/******/ (function() { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ 5202:
/***/ (function(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;
};


/***/ }),

/***/ 3827:
/***/ (function(module, exports) {

var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/
/* global define */

(function () {
	'use strict';

	var classNames = (function () {
		// don't inherit from Object so we can skip hasOwnProperty check later
		// http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232
		function StorageObject() {}
		StorageObject.prototype = Object.create(null);

		function _parseArray (resultSet, array) {
			var length = array.length;

			for (var i = 0; i < length; ++i) {
				_parse(resultSet, array[i]);
			}
		}

		var hasOwn = {}.hasOwnProperty;

		function _parseNumber (resultSet, num) {
			resultSet[num] = true;
		}

		function _parseObject (resultSet, object) {
			if (object.toString !== Object.prototype.toString && !object.toString.toString().includes('[native code]')) {
				resultSet[object.toString()] = true;
				return;
			}

			for (var k in object) {
				if (hasOwn.call(object, k)) {
					// set value to false instead of deleting it to avoid changing object structure
					// https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions
					resultSet[k] = !!object[k];
				}
			}
		}

		var SPACE = /\s+/;
		function _parseString (resultSet, str) {
			var array = str.split(SPACE);
			var length = array.length;

			for (var i = 0; i < length; ++i) {
				resultSet[array[i]] = true;
			}
		}

		function _parse (resultSet, arg) {
			if (!arg) return;
			var argType = typeof arg;

			// 'foo bar'
			if (argType === 'string') {
				_parseString(resultSet, arg);

			// ['foo', 'bar', ...]
			} else if (Array.isArray(arg)) {
				_parseArray(resultSet, arg);

			// { 'foo': true, ... }
			} else if (argType === 'object') {
				_parseObject(resultSet, arg);

			// '130'
			} else if (argType === 'number') {
				_parseNumber(resultSet, arg);
			}
		}

		function _classNames () {
			// don't leak arguments
			// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
			var len = arguments.length;
			var args = Array(len);
			for (var i = 0; i < len; i++) {
				args[i] = arguments[i];
			}

			var classSet = new StorageObject();
			_parseArray(classSet, args);

			var list = [];

			for (var k in classSet) {
				if (classSet[k]) {
					list.push(k)
				}
			}

			return list.join(' ');
		}

		return _classNames;
	})();

	if ( true && module.exports) {
		classNames.default = classNames;
		module.exports = classNames;
	} else if (true) {
		// register as 'classnames', consistent with npm package name
		!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
			return classNames;
		}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	} else {}
}());


/***/ }),

/***/ 4403:
/***/ (function(module, exports) {

var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/
/* global define */

(function () {
	'use strict';

	var hasOwn = {}.hasOwnProperty;
	var nativeCodeString = '[native code]';

	function classNames() {
		var classes = [];

		for (var i = 0; i < arguments.length; i++) {
			var arg = arguments[i];
			if (!arg) continue;

			var argType = typeof arg;

			if (argType === 'string' || argType === 'number') {
				classes.push(arg);
			} else if (Array.isArray(arg)) {
				if (arg.length) {
					var inner = classNames.apply(null, arg);
					if (inner) {
						classes.push(inner);
					}
				}
			} else if (argType === 'object') {
				if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
					classes.push(arg.toString());
					continue;
				}

				for (var key in arg) {
					if (hasOwn.call(arg, key) && arg[key]) {
						classes.push(key);
					}
				}
			}
		}

		return classes.join(' ');
	}

	if ( true && module.exports) {
		classNames.default = classNames;
		module.exports = classNames;
	} else if (true) {
		// register as 'classnames', consistent with npm package name
		!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
			return classNames;
		}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
		__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
	} else {}
}());


/***/ }),

/***/ 5619:
/***/ (function(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;
};


/***/ }),

/***/ 4793:
/***/ (function(module) {

var characterMap = {
	"À": "A",
	"Á": "A",
	"Â": "A",
	"Ã": "A",
	"Ä": "A",
	"Å": "A",
	"Ấ": "A",
	"Ắ": "A",
	"Ẳ": "A",
	"Ẵ": "A",
	"Ặ": "A",
	"Æ": "AE",
	"Ầ": "A",
	"Ằ": "A",
	"Ȃ": "A",
	"Ç": "C",
	"Ḉ": "C",
	"È": "E",
	"É": "E",
	"Ê": "E",
	"Ë": "E",
	"Ế": "E",
	"Ḗ": "E",
	"Ề": "E",
	"Ḕ": "E",
	"Ḝ": "E",
	"Ȇ": "E",
	"Ì": "I",
	"Í": "I",
	"Î": "I",
	"Ï": "I",
	"Ḯ": "I",
	"Ȋ": "I",
	"Ð": "D",
	"Ñ": "N",
	"Ò": "O",
	"Ó": "O",
	"Ô": "O",
	"Õ": "O",
	"Ö": "O",
	"Ø": "O",
	"Ố": "O",
	"Ṍ": "O",
	"Ṓ": "O",
	"Ȏ": "O",
	"Ù": "U",
	"Ú": "U",
	"Û": "U",
	"Ü": "U",
	"Ý": "Y",
	"à": "a",
	"á": "a",
	"â": "a",
	"ã": "a",
	"ä": "a",
	"å": "a",
	"ấ": "a",
	"ắ": "a",
	"ẳ": "a",
	"ẵ": "a",
	"ặ": "a",
	"æ": "ae",
	"ầ": "a",
	"ằ": "a",
	"ȃ": "a",
	"ç": "c",
	"ḉ": "c",
	"è": "e",
	"é": "e",
	"ê": "e",
	"ë": "e",
	"ế": "e",
	"ḗ": "e",
	"ề": "e",
	"ḕ": "e",
	"ḝ": "e",
	"ȇ": "e",
	"ì": "i",
	"í": "i",
	"î": "i",
	"ï": "i",
	"ḯ": "i",
	"ȋ": "i",
	"ð": "d",
	"ñ": "n",
	"ò": "o",
	"ó": "o",
	"ô": "o",
	"õ": "o",
	"ö": "o",
	"ø": "o",
	"ố": "o",
	"ṍ": "o",
	"ṓ": "o",
	"ȏ": "o",
	"ù": "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",
	"Ĵ": "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",
	"Ō": "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",
	"ß": "ss",
	"Ţ": "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 */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(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 */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// 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 });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
!function() {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "__experimentalGetCoreBlocks": function() { return /* binding */ __experimentalGetCoreBlocks; },
  "__experimentalRegisterExperimentalCoreBlocks": function() { return /* binding */ __experimentalRegisterExperimentalCoreBlocks; },
  "registerCoreBlocks": function() { return /* binding */ registerCoreBlocks; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/archives/index.js
var archives_namespaceObject = {};
__webpack_require__.r(archives_namespaceObject);
__webpack_require__.d(archives_namespaceObject, {
  "init": function() { return init; },
  "metadata": function() { return metadata; },
  "name": function() { return archives_name; },
  "settings": function() { return settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/avatar/index.js
var avatar_namespaceObject = {};
__webpack_require__.r(avatar_namespaceObject);
__webpack_require__.d(avatar_namespaceObject, {
  "init": function() { return avatar_init; },
  "metadata": function() { return avatar_metadata; },
  "name": function() { return avatar_name; },
  "settings": function() { return avatar_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return audio_init; },
  "metadata": function() { return audio_metadata; },
  "name": function() { return audio_name; },
  "settings": function() { return audio_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return button_init; },
  "metadata": function() { return button_metadata; },
  "name": function() { return button_name; },
  "settings": function() { return button_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return buttons_init; },
  "metadata": function() { return buttons_metadata; },
  "name": function() { return buttons_name; },
  "settings": function() { return buttons_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return calendar_init; },
  "metadata": function() { return calendar_metadata; },
  "name": function() { return calendar_name; },
  "settings": function() { return calendar_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/categories/index.js
var categories_namespaceObject = {};
__webpack_require__.r(categories_namespaceObject);
__webpack_require__.d(categories_namespaceObject, {
  "init": function() { return categories_init; },
  "metadata": function() { return categories_metadata; },
  "name": function() { return categories_name; },
  "settings": function() { return categories_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/freeform/index.js
var freeform_namespaceObject = {};
__webpack_require__.r(freeform_namespaceObject);
__webpack_require__.d(freeform_namespaceObject, {
  "init": function() { return freeform_init; },
  "metadata": function() { return freeform_metadata; },
  "name": function() { return freeform_name; },
  "settings": function() { return freeform_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return code_init; },
  "metadata": function() { return code_metadata; },
  "name": function() { return code_name; },
  "settings": function() { return code_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return column_init; },
  "metadata": function() { return column_metadata; },
  "name": function() { return column_name; },
  "settings": function() { return column_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return columns_init; },
  "metadata": function() { return columns_metadata; },
  "name": function() { return columns_name; },
  "settings": function() { return columns_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/comments/index.js
var comments_namespaceObject = {};
__webpack_require__.r(comments_namespaceObject);
__webpack_require__.d(comments_namespaceObject, {
  "init": function() { return comments_init; },
  "metadata": function() { return comments_metadata; },
  "name": function() { return comments_name; },
  "settings": function() { return comments_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return comment_author_avatar_init; },
  "metadata": function() { return comment_author_avatar_metadata; },
  "name": function() { return comment_author_avatar_name; },
  "settings": function() { return comment_author_avatar_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return comment_author_name_init; },
  "metadata": function() { return comment_author_name_metadata; },
  "name": function() { return comment_author_name_name; },
  "settings": function() { return comment_author_name_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return comment_content_init; },
  "metadata": function() { return comment_content_metadata; },
  "name": function() { return comment_content_name; },
  "settings": function() { return comment_content_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return comment_date_init; },
  "metadata": function() { return comment_date_metadata; },
  "name": function() { return comment_date_name; },
  "settings": function() { return comment_date_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return comment_edit_link_init; },
  "metadata": function() { return comment_edit_link_metadata; },
  "name": function() { return comment_edit_link_name; },
  "settings": function() { return comment_edit_link_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return comment_reply_link_init; },
  "metadata": function() { return comment_reply_link_metadata; },
  "name": function() { return comment_reply_link_name; },
  "settings": function() { return comment_reply_link_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return comment_template_init; },
  "metadata": function() { return comment_template_metadata; },
  "name": function() { return comment_template_name; },
  "settings": function() { return comment_template_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return comments_pagination_previous_init; },
  "metadata": function() { return comments_pagination_previous_metadata; },
  "name": function() { return comments_pagination_previous_name; },
  "settings": function() { return comments_pagination_previous_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return comments_pagination_init; },
  "metadata": function() { return comments_pagination_metadata; },
  "name": function() { return comments_pagination_name; },
  "settings": function() { return comments_pagination_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return comments_pagination_next_init; },
  "metadata": function() { return comments_pagination_next_metadata; },
  "name": function() { return comments_pagination_next_name; },
  "settings": function() { return comments_pagination_next_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return comments_pagination_numbers_init; },
  "metadata": function() { return comments_pagination_numbers_metadata; },
  "name": function() { return comments_pagination_numbers_name; },
  "settings": function() { return comments_pagination_numbers_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return comments_title_init; },
  "metadata": function() { return comments_title_metadata; },
  "name": function() { return comments_title_name; },
  "settings": function() { return comments_title_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return cover_init; },
  "metadata": function() { return cover_metadata; },
  "name": function() { return cover_name; },
  "settings": function() { return cover_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return details_init; },
  "metadata": function() { return details_metadata; },
  "name": function() { return details_name; },
  "settings": function() { return details_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/embed/index.js
var embed_namespaceObject = {};
__webpack_require__.r(embed_namespaceObject);
__webpack_require__.d(embed_namespaceObject, {
  "init": function() { return embed_init; },
  "metadata": function() { return embed_metadata; },
  "name": function() { return embed_name; },
  "settings": function() { return embed_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return file_init; },
  "metadata": function() { return file_metadata; },
  "name": function() { return file_name; },
  "settings": function() { return file_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return gallery_init; },
  "metadata": function() { return gallery_metadata; },
  "name": function() { return gallery_name; },
  "settings": function() { return gallery_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return group_init; },
  "metadata": function() { return group_metadata; },
  "name": function() { return group_name; },
  "settings": function() { return group_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return heading_init; },
  "metadata": function() { return heading_metadata; },
  "name": function() { return heading_name; },
  "settings": function() { return heading_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return home_link_init; },
  "metadata": function() { return home_link_metadata; },
  "name": function() { return home_link_name; },
  "settings": function() { return home_link_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return html_init; },
  "metadata": function() { return html_metadata; },
  "name": function() { return html_name; },
  "settings": function() { return html_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return image_init; },
  "metadata": function() { return image_metadata; },
  "name": function() { return image_name; },
  "settings": function() { return image_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return latest_comments_init; },
  "metadata": function() { return latest_comments_metadata; },
  "name": function() { return latest_comments_name; },
  "settings": function() { return latest_comments_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return latest_posts_init; },
  "metadata": function() { return latest_posts_metadata; },
  "name": function() { return latest_posts_name; },
  "settings": function() { return latest_posts_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return list_init; },
  "metadata": function() { return list_metadata; },
  "name": function() { return list_name; },
  "settings": function() { return list_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return list_item_init; },
  "metadata": function() { return list_item_metadata; },
  "name": function() { return list_item_name; },
  "settings": function() { return list_item_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/loginout/index.js
var loginout_namespaceObject = {};
__webpack_require__.r(loginout_namespaceObject);
__webpack_require__.d(loginout_namespaceObject, {
  "init": function() { return loginout_init; },
  "metadata": function() { return loginout_metadata; },
  "name": function() { return loginout_name; },
  "settings": function() { return loginout_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return media_text_init; },
  "metadata": function() { return media_text_metadata; },
  "name": function() { return media_text_name; },
  "settings": function() { return media_text_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/missing/index.js
var missing_namespaceObject = {};
__webpack_require__.r(missing_namespaceObject);
__webpack_require__.d(missing_namespaceObject, {
  "init": function() { return missing_init; },
  "metadata": function() { return missing_metadata; },
  "name": function() { return missing_name; },
  "settings": function() { return missing_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return more_init; },
  "metadata": function() { return more_metadata; },
  "name": function() { return more_name; },
  "settings": function() { return more_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return navigation_init; },
  "metadata": function() { return navigation_metadata; },
  "name": function() { return navigation_name; },
  "settings": function() { return navigation_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return navigation_link_init; },
  "metadata": function() { return navigation_link_metadata; },
  "name": function() { return navigation_link_name; },
  "settings": function() { return navigation_link_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return navigation_submenu_init; },
  "metadata": function() { return navigation_submenu_metadata; },
  "name": function() { return navigation_submenu_name; },
  "settings": function() { return navigation_submenu_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/nextpage/index.js
var nextpage_namespaceObject = {};
__webpack_require__.r(nextpage_namespaceObject);
__webpack_require__.d(nextpage_namespaceObject, {
  "init": function() { return nextpage_init; },
  "metadata": function() { return nextpage_metadata; },
  "name": function() { return nextpage_name; },
  "settings": function() { return nextpage_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/pattern/index.js
var pattern_namespaceObject = {};
__webpack_require__.r(pattern_namespaceObject);
__webpack_require__.d(pattern_namespaceObject, {
  "init": function() { return pattern_init; },
  "metadata": function() { return pattern_metadata; },
  "name": function() { return pattern_name; },
  "settings": function() { return pattern_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return page_list_init; },
  "metadata": function() { return page_list_metadata; },
  "name": function() { return page_list_name; },
  "settings": function() { return page_list_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return page_list_item_init; },
  "metadata": function() { return page_list_item_metadata; },
  "name": function() { return page_list_item_name; },
  "settings": function() { return page_list_item_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return paragraph_init; },
  "metadata": function() { return paragraph_metadata; },
  "name": function() { return paragraph_name; },
  "settings": function() { return paragraph_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_author_init; },
  "metadata": function() { return post_author_metadata; },
  "name": function() { return post_author_name; },
  "settings": function() { return post_author_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_author_name_init; },
  "metadata": function() { return post_author_name_metadata; },
  "name": function() { return post_author_name_name; },
  "settings": function() { return post_author_name_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_author_biography_init; },
  "metadata": function() { return post_author_biography_metadata; },
  "name": function() { return post_author_biography_name; },
  "settings": function() { return post_author_biography_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_comment_init; },
  "metadata": function() { return post_comment_metadata; },
  "name": function() { return post_comment_name; },
  "settings": function() { return post_comment_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_comments_count_init; },
  "metadata": function() { return post_comments_count_metadata; },
  "name": function() { return post_comments_count_name; },
  "settings": function() { return post_comments_count_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_comments_form_init; },
  "metadata": function() { return post_comments_form_metadata; },
  "name": function() { return post_comments_form_name; },
  "settings": function() { return post_comments_form_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_comments_link_init; },
  "metadata": function() { return post_comments_link_metadata; },
  "name": function() { return post_comments_link_name; },
  "settings": function() { return post_comments_link_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_content_init; },
  "metadata": function() { return post_content_metadata; },
  "name": function() { return post_content_name; },
  "settings": function() { return post_content_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_date_init; },
  "metadata": function() { return post_date_metadata; },
  "name": function() { return post_date_name; },
  "settings": function() { return post_date_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_excerpt_init; },
  "metadata": function() { return post_excerpt_metadata; },
  "name": function() { return post_excerpt_name; },
  "settings": function() { return post_excerpt_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_featured_image_init; },
  "metadata": function() { return post_featured_image_metadata; },
  "name": function() { return post_featured_image_name; },
  "settings": function() { return post_featured_image_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_navigation_link_init; },
  "metadata": function() { return post_navigation_link_metadata; },
  "name": function() { return post_navigation_link_name; },
  "settings": function() { return post_navigation_link_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_template_init; },
  "metadata": function() { return post_template_metadata; },
  "name": function() { return post_template_name; },
  "settings": function() { return post_template_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_terms_init; },
  "metadata": function() { return post_terms_metadata; },
  "name": function() { return post_terms_name; },
  "settings": function() { return post_terms_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_time_to_read_init; },
  "metadata": function() { return post_time_to_read_metadata; },
  "name": function() { return post_time_to_read_name; },
  "settings": function() { return post_time_to_read_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return post_title_init; },
  "metadata": function() { return post_title_metadata; },
  "name": function() { return post_title_name; },
  "settings": function() { return post_title_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return preformatted_init; },
  "metadata": function() { return preformatted_metadata; },
  "name": function() { return preformatted_name; },
  "settings": function() { return preformatted_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return pullquote_init; },
  "metadata": function() { return pullquote_metadata; },
  "name": function() { return pullquote_name; },
  "settings": function() { return pullquote_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/query/index.js
var query_namespaceObject = {};
__webpack_require__.r(query_namespaceObject);
__webpack_require__.d(query_namespaceObject, {
  "init": function() { return query_init; },
  "metadata": function() { return query_metadata; },
  "name": function() { return query_name; },
  "settings": function() { return query_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return query_no_results_init; },
  "metadata": function() { return query_no_results_metadata; },
  "name": function() { return query_no_results_name; },
  "settings": function() { return query_no_results_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return query_pagination_init; },
  "metadata": function() { return query_pagination_metadata; },
  "name": function() { return query_pagination_name; },
  "settings": function() { return query_pagination_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return query_pagination_next_init; },
  "metadata": function() { return query_pagination_next_metadata; },
  "name": function() { return query_pagination_next_name; },
  "settings": function() { return query_pagination_next_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return query_pagination_numbers_init; },
  "metadata": function() { return query_pagination_numbers_metadata; },
  "name": function() { return query_pagination_numbers_name; },
  "settings": function() { return query_pagination_numbers_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return query_pagination_previous_init; },
  "metadata": function() { return query_pagination_previous_metadata; },
  "name": function() { return query_pagination_previous_name; },
  "settings": function() { return query_pagination_previous_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return query_title_init; },
  "metadata": function() { return query_title_metadata; },
  "name": function() { return query_title_name; },
  "settings": function() { return query_title_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return quote_init; },
  "metadata": function() { return quote_metadata; },
  "name": function() { return quote_name; },
  "settings": function() { return quote_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/block/index.js
var block_namespaceObject = {};
__webpack_require__.r(block_namespaceObject);
__webpack_require__.d(block_namespaceObject, {
  "init": function() { return block_init; },
  "metadata": function() { return block_metadata; },
  "name": function() { return block_name; },
  "settings": function() { return block_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return read_more_init; },
  "metadata": function() { return read_more_metadata; },
  "name": function() { return read_more_name; },
  "settings": function() { return read_more_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return rss_init; },
  "metadata": function() { return rss_metadata; },
  "name": function() { return rss_name; },
  "settings": function() { return rss_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return search_init; },
  "metadata": function() { return search_metadata; },
  "name": function() { return search_name; },
  "settings": function() { return search_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return separator_init; },
  "metadata": function() { return separator_metadata; },
  "name": function() { return separator_name; },
  "settings": function() { return separator_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return shortcode_init; },
  "metadata": function() { return shortcode_metadata; },
  "name": function() { return shortcode_name; },
  "settings": function() { return shortcode_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return site_logo_init; },
  "metadata": function() { return site_logo_metadata; },
  "name": function() { return site_logo_name; },
  "settings": function() { return site_logo_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return site_tagline_init; },
  "metadata": function() { return site_tagline_metadata; },
  "name": function() { return site_tagline_name; },
  "settings": function() { return site_tagline_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return site_title_init; },
  "metadata": function() { return site_title_metadata; },
  "name": function() { return site_title_name; },
  "settings": function() { return site_title_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return social_link_init; },
  "metadata": function() { return social_link_metadata; },
  "name": function() { return social_link_name; },
  "settings": function() { return social_link_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return social_links_init; },
  "metadata": function() { return social_links_metadata; },
  "name": function() { return social_links_name; },
  "settings": function() { return social_links_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/spacer/index.js
var spacer_namespaceObject = {};
__webpack_require__.r(spacer_namespaceObject);
__webpack_require__.d(spacer_namespaceObject, {
  "init": function() { return spacer_init; },
  "metadata": function() { return spacer_metadata; },
  "name": function() { return spacer_name; },
  "settings": function() { return spacer_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return table_init; },
  "metadata": function() { return table_metadata; },
  "name": function() { return table_name; },
  "settings": function() { return table_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/table-of-contents/index.js
var table_of_contents_namespaceObject = {};
__webpack_require__.r(table_of_contents_namespaceObject);
__webpack_require__.d(table_of_contents_namespaceObject, {
  "init": function() { return table_of_contents_init; },
  "metadata": function() { return table_of_contents_metadata; },
  "name": function() { return table_of_contents_name; },
  "settings": function() { return table_of_contents_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return tag_cloud_init; },
  "metadata": function() { return tag_cloud_metadata; },
  "name": function() { return tag_cloud_name; },
  "settings": function() { return tag_cloud_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return template_part_init; },
  "metadata": function() { return template_part_metadata; },
  "name": function() { return template_part_name; },
  "settings": function() { return template_part_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return term_description_init; },
  "metadata": function() { return term_description_metadata; },
  "name": function() { return term_description_name; },
  "settings": function() { return term_description_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return text_columns_init; },
  "metadata": function() { return text_columns_metadata; },
  "name": function() { return text_columns_name; },
  "settings": function() { return text_columns_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return verse_init; },
  "metadata": function() { return verse_metadata; },
  "name": function() { return verse_name; },
  "settings": function() { return verse_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/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": function() { return video_init; },
  "metadata": function() { return video_metadata; },
  "name": function() { return video_name; },
  "settings": function() { return video_settings; }
});

// NAMESPACE OBJECT: ./node_modules/@gechiui/block-library/build-module/footnotes/index.js
var footnotes_namespaceObject = {};
__webpack_require__.r(footnotes_namespaceObject);
__webpack_require__.d(footnotes_namespaceObject, {
  "init": function() { return footnotes_init; },
  "metadata": function() { return footnotes_metadata; },
  "name": function() { return footnotes_name; },
  "settings": function() { return footnotes_settings; }
});

;// CONCATENATED MODULE: external ["gc","blocks"]
var external_gc_blocks_namespaceObject = window["gc"]["blocks"];
;// CONCATENATED MODULE: external ["gc","element"]
var external_gc_element_namespaceObject = window["gc"]["element"];
;// CONCATENATED MODULE: external ["gc","primitives"]
var external_gc_primitives_namespaceObject = window["gc"]["primitives"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/archive.js


/**
 * GeChiUI dependencies
 */

const archive = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"
}));
/* harmony default export */ var library_archive = (archive);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/utils/init-block.js
/**
 * GeChiUI dependencies
 */

/**
 * Function to register an individual block.
 *
 * @param {Object} block The block to be registered.
 *
 * @return {GCBlockType | 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_gc_blocks_namespaceObject.registerBlockType)({
    name,
    ...metadata
  }, settings);
}

;// CONCATENATED MODULE: external ["gc","components"]
var external_gc_components_namespaceObject = window["gc"]["components"];
;// CONCATENATED MODULE: external ["gc","i18n"]
var external_gc_i18n_namespaceObject = window["gc"]["i18n"];
;// CONCATENATED MODULE: external ["gc","blockEditor"]
var external_gc_blockEditor_namespaceObject = window["gc"]["blockEditor"];
;// CONCATENATED MODULE: external ["gc","serverSideRender"]
var external_gc_serverSideRender_namespaceObject = window["gc"]["serverSideRender"];
var external_gc_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_gc_serverSideRender_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/archives/edit.js


/**
 * GeChiUI dependencies
 */




function ArchivesEdit({
  attributes,
  setAttributes
}) {
  const {
    showLabel,
    showPostCounts,
    displayAsDropdown,
    type
  } = attributes;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('以下拉菜单显示'),
    checked: displayAsDropdown,
    onChange: () => setAttributes({
      displayAsDropdown: !displayAsDropdown
    })
  }), displayAsDropdown && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示标签'),
    checked: showLabel,
    onChange: () => setAttributes({
      showLabel: !showLabel
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示文章数目'),
    checked: showPostCounts,
    onChange: () => setAttributes({
      showPostCounts: !showPostCounts
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('分组依据：'),
    options: [{
      label: (0,external_gc_i18n_namespaceObject.__)('年'),
      value: 'yearly'
    }, {
      label: (0,external_gc_i18n_namespaceObject.__)('月'),
      value: 'monthly'
    }, {
      label: (0,external_gc_i18n_namespaceObject.__)('周'),
      value: 'weekly'
    }, {
      label: (0,external_gc_i18n_namespaceObject.__)('日'),
      value: 'daily'
    }],
    value: type,
    onChange: value => setAttributes({
      type: value
    })
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)()
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Disabled, null, (0,external_gc_element_namespaceObject.createElement)((external_gc_serverSideRender_default()), {
    block: "core/archives",
    skipBlockSupportAttributes: true,
    attributes: attributes
  }))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/archives/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/archives",
  title: "归档",
  category: "widgets",
  description: "显示文章的日期归档。",
  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,
    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
      }
    }
  },
  editorStyle: "gc-block-archives-editor"
};

const {
  name: archives_name
} = metadata;

const settings = {
  icon: library_archive,
  example: {},
  edit: ArchivesEdit
};
const init = () => initBlock({
  name: archives_name,
  metadata,
  settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/comment-author-avatar.js


/**
 * GeChiUI dependencies
 */

const commentAuthorAvatar = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var comment_author_avatar = (commentAuthorAvatar);

// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__(4403);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
;// CONCATENATED MODULE: external ["gc","url"]
var external_gc_url_namespaceObject = window["gc"]["url"];
;// CONCATENATED MODULE: external ["gc","coreData"]
var external_gc_coreData_namespaceObject = window["gc"]["coreData"];
;// CONCATENATED MODULE: external ["gc","data"]
var external_gc_data_namespaceObject = window["gc"]["data"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/avatar/hooks.js
/**
 * GeChiUI 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_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSettings
    } = select(external_gc_blockEditor_namespaceObject.store);
    const {
      __experimentalDiscussionSettings
    } = getSettings();
    return __experimentalDiscussionSettings;
  });
  return defaultAvatarUrl;
}

function useCommentAvatar({
  commentId
}) {
  const [avatars] = (0,external_gc_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId);
  const [authorName] = (0,external_gc_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,
    // translators: %s is the Author name.
    alt: authorName ? // translators: %s is the Author name.
    (0,external_gc_i18n_namespaceObject.sprintf)((0,external_gc_i18n_namespaceObject.__)('%s 的头像'), authorName) : (0,external_gc_i18n_namespaceObject.__)('默认头像')
  };
}
function useUserAvatar({
  userId,
  postId,
  postType
}) {
  const {
    authorDetails
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getEditedEntityRecord,
      getUser
    } = select(external_gc_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 is the Author name.
    (0,external_gc_i18n_namespaceObject.sprintf)((0,external_gc_i18n_namespaceObject.__)('%s 的头像'), authorDetails?.name) : (0,external_gc_i18n_namespaceObject.__)('默认头像')
  };
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/avatar/user-control.js


/**
 * GeChiUI dependencies
 */





const AUTHORS_QUERY = {
  who: 'authors',
  per_page: -1,
  _fields: 'id,name',
  context: 'view'
};

function UserControl({
  value,
  onChange
}) {
  const [filteredAuthorsList, setFilteredAuthorsList] = (0,external_gc_element_namespaceObject.useState)();
  const authorsList = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getUsers
    } = select(external_gc_coreData_namespaceObject.store);
    return getUsers(AUTHORS_QUERY);
  }, []);

  if (!authorsList) {
    return null;
  }

  const options = authorsList.map(author => {
    return {
      label: author.name,
      value: author.id
    };
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ComboboxControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('用户'),
    help: (0,external_gc_i18n_namespaceObject.__)('选择要显示的用户头像。如果为空，其将使用文章/页面作者的头像。'),
    value: value,
    onChange: onChange,
    options: filteredAuthorsList || options,
    onFilterValueChange: inputValue => setFilteredAuthorsList(options.filter(option => option.label.toLowerCase().startsWith(inputValue.toLowerCase())))
  });
}

/* harmony default export */ var user_control = (UserControl);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/avatar/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */




const AvatarInspectorControls = ({
  setAttributes,
  avatar,
  attributes,
  selectUser
}) => (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
  title: (0,external_gc_i18n_namespaceObject.__)('设置')
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
  __nextHasNoMarginBottom: true,
  label: (0,external_gc_i18n_namespaceObject.__)('图片尺寸'),
  onChange: newSize => setAttributes({
    size: newSize
  }),
  min: avatar.minSize,
  max: avatar.maxSize,
  initialPosition: attributes?.size,
  value: attributes?.size
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
  __nextHasNoMarginBottom: true,
  label: (0,external_gc_i18n_namespaceObject.__)('链接至用户个人资料'),
  onChange: () => setAttributes({
    isLink: !attributes.isLink
  }),
  checked: attributes.isLink
}), attributes.isLink && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
  label: (0,external_gc_i18n_namespaceObject.__)('在新窗口打开'),
  onChange: value => setAttributes({
    linkTarget: value ? '_blank' : '_self'
  }),
  checked: attributes.linkTarget === '_blank'
}), selectUser && (0,external_gc_element_namespaceObject.createElement)(user_control, {
  value: attributes?.userId,
  onChange: value => {
    setAttributes({
      userId: value
    });
  }
})));

const ResizableAvatar = ({
  setAttributes,
  attributes,
  avatar,
  blockProps,
  isSelected
}) => {
  const borderProps = (0,external_gc_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  const doubledSizedSrc = (0,external_gc_url_namespaceObject.addQueryArgs)((0,external_gc_url_namespaceObject.removeQueryArgs)(avatar?.src, ['s']), {
    s: attributes?.size * 2
  });
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_i18n_namespaceObject.isRTL)(),
      bottom: true,
      left: (0,external_gc_i18n_namespaceObject.isRTL)()
    },
    minWidth: avatar.minSize,
    maxWidth: avatar.maxSize
  }, (0,external_gc_element_namespaceObject.createElement)("img", {
    src: doubledSizedSrc,
    alt: avatar.alt,
    className: classnames_default()('avatar', 'avatar-' + attributes.size, 'photo', 'gc-block-avatar__image', borderProps.className),
    style: borderProps.style
  })));
};

const CommentEdit = ({
  attributes,
  context,
  setAttributes,
  isSelected
}) => {
  const {
    commentId
  } = context;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  const avatar = useCommentAvatar({
    commentId
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(AvatarInspectorControls, {
    avatar: avatar,
    setAttributes: setAttributes,
    attributes: attributes,
    selectUser: false
  }), attributes.isLink ? (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#avatar-pseudo-link",
    className: "gc-block-avatar__link",
    onClick: event => event.preventDefault()
  }, (0,external_gc_element_namespaceObject.createElement)(ResizableAvatar, {
    attributes: attributes,
    avatar: avatar,
    blockProps: blockProps,
    isSelected: isSelected,
    setAttributes: setAttributes
  })) : (0,external_gc_element_namespaceObject.createElement)(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_gc_blockEditor_namespaceObject.useBlockProps)();
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(AvatarInspectorControls, {
    selectUser: true,
    attributes: attributes,
    avatar: avatar,
    setAttributes: setAttributes
  }), (0,external_gc_element_namespaceObject.createElement)("div", null, attributes.isLink ? (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#avatar-pseudo-link",
    className: "gc-block-avatar__link",
    onClick: event => event.preventDefault()
  }, (0,external_gc_element_namespaceObject.createElement)(ResizableAvatar, {
    attributes: attributes,
    avatar: avatar,
    blockProps: blockProps,
    isSelected: isSelected,
    setAttributes: setAttributes
  })) : (0,external_gc_element_namespaceObject.createElement)(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 (0,external_gc_element_namespaceObject.createElement)(CommentEdit, { ...props
    });
  }

  return (0,external_gc_element_namespaceObject.createElement)(UserEdit, { ...props
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/avatar/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const avatar_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/avatar",
  title: "头像",
  category: "theme",
  description: "添加用户头像。",
  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
    },
    __experimentalBorder: {
      __experimentalSkipSerialization: true,
      radius: true,
      width: true,
      color: true,
      style: true,
      __experimentalDefaultControls: {
        radius: true
      }
    },
    color: {
      text: false,
      background: false,
      __experimentalDuotone: "img"
    }
  },
  editorStyle: "gc-block-avatar-editor",
  style: "gc-block-avatar"
};

const {
  name: avatar_name
} = avatar_metadata;

const avatar_settings = {
  icon: comment_author_avatar,
  edit: Edit
};
const avatar_init = () => initBlock({
  name: avatar_name,
  metadata: avatar_metadata,
  settings: avatar_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/audio.js


/**
 * GeChiUI dependencies
 */

const audio = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_audio = (audio);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/audio/deprecated.js


/**
 * GeChiUI dependencies
 */

/* harmony default export */ var 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 (0,external_gc_element_namespaceObject.createElement)("figure", null, (0,external_gc_element_namespaceObject.createElement)("audio", {
      controls: "controls",
      src: src,
      autoPlay: autoplay,
      loop: loop,
      preload: preload
    }), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "figcaption",
      value: caption
    }));
  }

}]);

;// CONCATENATED MODULE: external ["gc","blob"]
var external_gc_blob_namespaceObject = window["gc"]["blob"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/caption.js


/**
 * GeChiUI dependencies
 */

const caption = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_caption = (caption);

;// CONCATENATED MODULE: external ["gc","notices"]
var external_gc_notices_namespaceObject = window["gc"]["notices"];
;// CONCATENATED MODULE: external ["gc","compose"]
var external_gc_compose_namespaceObject = window["gc"]["compose"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/constants.js
const ASPECT_RATIOS = [// Common video resolutions.
{
  ratio: '2.33',
  className: 'gc-embed-aspect-21-9'
}, {
  ratio: '2.00',
  className: 'gc-embed-aspect-18-9'
}, {
  ratio: '1.78',
  className: 'gc-embed-aspect-16-9'
}, {
  ratio: '1.33',
  className: 'gc-embed-aspect-4-3'
}, // Vertical video and instagram square video support.
{
  ratio: '1.00',
  className: 'gc-embed-aspect-1-1'
}, {
  ratio: '0.56',
  className: 'gc-embed-aspect-9-16'
}, {
  ratio: '0.50',
  className: 'gc-embed-aspect-1-2'
}];
const GC_EMBED_TYPE = 'gc-embed';

;// CONCATENATED MODULE: external "lodash"
var external_lodash_namespaceObject = window["lodash"];
// EXTERNAL MODULE: ./node_modules/classnames/dedupe.js
var dedupe = __webpack_require__(3827);
var dedupe_default = /*#__PURE__*/__webpack_require__.n(dedupe);
;// CONCATENATED MODULE: ./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;
}



;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/util.js


/**
 * Internal dependencies
 */

/**
 * External dependencies
 */




/**
 * GeChiUI dependencies
 */



/**
 * Internal dependencies
 */

const util_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/embed",
  title: "嵌入",
  category: "embed",
  description: "添加可显示抖音、优酷等系统嵌入内容的区块。",
  textdomain: "default",
  attributes: {
    url: {
      type: "string",
      __experimentalRole: "content"
    },
    caption: {
      type: "string",
      source: "html",
      selector: "figcaption",
      __experimentalRole: "content"
    },
    type: {
      type: "string",
      __experimentalRole: "content"
    },
    providerNameSlug: {
      type: "string",
      __experimentalRole: "content"
    },
    allowResponsive: {
      type: "boolean",
      "default": true
    },
    responsive: {
      type: "boolean",
      "default": false,
      __experimentalRole: "content"
    },
    previewable: {
      type: "boolean",
      "default": true,
      __experimentalRole: "content"
    }
  },
  supports: {
    align: true,
    spacing: {
      margin: true
    }
  },
  editorStyle: "gc-block-embed-editor",
  style: "gc-block-embed"
};
const {
  name: DEFAULT_EMBED_BLOCK
} = util_metadata;
/** @typedef {import('@gechiui/blocks').GCBlockVariation} GCBlockVariation */

/**
 * Returns the embed block's information by matching the provided service provider
 *
 * @param {string} provider The embed block's provider
 * @return {GCBlockVariation} The embed block's information
 */

const getEmbedInfoByProvider = provider => (0,external_gc_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 agains.
 * @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 {GCBlockVariation} The block variation that should be used for this URL
 */

const findMoreSuitableBlock = url => (0,external_gc_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({
  patterns
}) => matchesPatterns(url, patterns));
const isFromGeChiUI = html => html && html.includes('class="gc-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 = (0,external_gc_element_namespaceObject.createElement)("p", null, (0,external_gc_element_namespaceObject.createElement)("img", {
    src: imageUrl,
    alt: photo.title,
    width: "100%"
  }));
  return (0,external_gc_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_gc_blocks_namespaceObject.getBlockType)(DEFAULT_EMBED_BLOCK)) return;
  const matchedBlock = findMoreSuitableBlock(url); // GeChiUI blocks can work on multiple sites, and so don't have patterns,
  // so if we're in a GeChiUI block, assume the user has chosen it for a GeChiUI URL.

  const isCurrentBlockGC = providerNameSlug === 'gechiui' || type === GC_EMBED_TYPE; // If current block is not GeChiUI and a more suitable block found
  // that is different from the current one, create the new matched block.

  const shouldCreateNewBlock = !isCurrentBlockGC && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug);

  if (shouldCreateNewBlock) {
    return (0,external_gc_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, {
      url,
      ...restAttributes,
      ...matchedBlock.attributes
    });
  }

  const gcVariation = (0,external_gc_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({
    name
  }) => name === 'gechiui'); // We can't match the URL for GeChiUI embeds, we have to check the HTML instead.

  if (!gcVariation || !preview || !isFromGeChiUI(preview.html) || isCurrentBlockGC) {
    return;
  } // This is not the GeChiUI embed block so transform it into one.


  return (0,external_gc_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, {
    url,
    ...gcVariation.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 GeChiUI
    // block. This only affects the GeChiUI 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 emtpy string.
    return existingClassNames;
  }

  const aspectRatioClassNames = ASPECT_RATIOS.reduce((accumulator, {
    className
  }) => {
    accumulator[className] = false;
    return accumulator;
  }, {
    'gc-has-aspect-ratio': false
  });
  return dedupe_default()(existingClassNames, aspectRatioClassNames);
};
/**
 * 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 dedupe_default()(removeAspectRatioClasses(existingClassNames), potentialRatio.className, 'gc-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 = (0,external_gc_element_namespaceObject.createElement)("a", {
    href: url
  }, url);
  onReplace((0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
    content: (0,external_gc_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 = (0,external_lodash_namespaceObject.kebabCase)((providerName || title).toLowerCase());

  if (isFromGeChiUI(html)) {
    type = GC_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)
  };
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/audio/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */











/**
 * Internal dependencies
 */


const ALLOWED_MEDIA_TYPES = ['audio'];

function AudioEdit({
  attributes,
  className,
  setAttributes,
  onReplace,
  isSelected,
  insertBlocksAfter
}) {
  const {
    id,
    autoplay,
    caption,
    loop,
    preload,
    src
  } = attributes;
  const prevCaption = (0,external_gc_compose_namespaceObject.usePrevious)(caption);
  const [showCaption, setShowCaption] = (0,external_gc_element_namespaceObject.useState)(!!caption);
  const isTemporaryAudio = !id && (0,external_gc_blob_namespaceObject.isBlobURL)(src);
  const mediaUpload = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSettings
    } = select(external_gc_blockEditor_namespaceObject.store);
    return getSettings().mediaUpload;
  }, []);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!id && (0,external_gc_blob_namespaceObject.isBlobURL)(src)) {
      const file = (0,external_gc_blob_namespaceObject.getBlobByURL)(src);

      if (file) {
        mediaUpload({
          filesList: [file],
          onFileChange: ([media]) => onSelectAudio(media),
          onError: e => onUploadError(e),
          allowedTypes: ALLOWED_MEDIA_TYPES
        });
      }
    }
  }, []); // We need to show the caption when changes come from
  // history navigation(undo/redo).

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (caption && !prevCaption) {
      setShowCaption(true);
    }
  }, [caption, prevCaption]); // Focus the caption when we click to add one.

  const captionRef = (0,external_gc_element_namespaceObject.useCallback)(node => {
    if (node && !caption) {
      node.focus();
    }
  }, [caption]);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!isSelected && !caption) {
      setShowCaption(false);
    }
  }, [isSelected, caption]);

  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
      });
    }
  }

  const {
    createErrorNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);

  function onUploadError(message) {
    createErrorNotice(message, {
      type: 'snackbar'
    });
  }

  function getAutoplayHelp(checked) {
    return checked ? (0,external_gc_i18n_namespaceObject.__)('自动播放可能对一些用户造成可用性问题。') : 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
      });
      return;
    } // Sets the block's attribute and updates the edit component from the
    // selected media, then switches off the editing UI.


    setAttributes({
      src: media.url,
      id: media.id,
      caption: media.caption
    });
  }

  const classes = classnames_default()(className, {
    'is-transient': isTemporaryAudio
  });
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classes
  });

  if (!src) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaPlaceholder, {
      icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
        icon: library_audio
      }),
      onSelect: onSelectAudio,
      onSelectURL: onSelectURL,
      accept: "audio/*",
      allowedTypes: ALLOWED_MEDIA_TYPES,
      value: attributes,
      onError: onUploadError
    }));
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    onClick: () => {
      setShowCaption(!showCaption);

      if (showCaption && caption) {
        setAttributes({
          caption: undefined
        });
      }
    },
    icon: library_caption,
    isPressed: showCaption,
    label: showCaption ? (0,external_gc_i18n_namespaceObject.__)('移除说明文字') : (0,external_gc_i18n_namespaceObject.__)('添加说明文字')
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "other"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaReplaceFlow, {
    mediaId: id,
    mediaURL: src,
    allowedTypes: ALLOWED_MEDIA_TYPES,
    accept: "audio/*",
    onSelect: onSelectAudio,
    onSelectURL: onSelectURL,
    onError: onUploadError
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('自动播放'),
    onChange: toggleAttribute('autoplay'),
    checked: autoplay,
    help: getAutoplayHelp
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('循环'),
    onChange: toggleAttribute('loop'),
    checked: loop
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject._x)('预加载', '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_gc_i18n_namespaceObject.__)('浏览器默认')
    }, {
      value: 'auto',
      label: (0,external_gc_i18n_namespaceObject.__)('自动')
    }, {
      value: 'metadata',
      label: (0,external_gc_i18n_namespaceObject.__)('元数据')
    }, {
      value: 'none',
      label: (0,external_gc_i18n_namespaceObject._x)('无', 'Preload value')
    }]
  }))), (0,external_gc_element_namespaceObject.createElement)("figure", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Disabled, {
    isDisabled: !isSelected
  }, (0,external_gc_element_namespaceObject.createElement)("audio", {
    controls: "controls",
    src: src
  })), isTemporaryAudio && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null), showCaption && (!external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    identifier: "caption",
    tagName: "figcaption",
    className: (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
    ref: captionRef,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('音频说明文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('添加说明文字'),
    value: caption,
    onChange: value => setAttributes({
      caption: value
    }),
    inlineToolbar: true,
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)()))
  })));
}

/* harmony default export */ var edit = (AudioEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/audio/save.js


/**
 * GeChiUI dependencies
 */

function save({
  attributes
}) {
  const {
    autoplay,
    caption,
    loop,
    preload,
    src
  } = attributes;
  return src && (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
  }, (0,external_gc_element_namespaceObject.createElement)("audio", {
    controls: "controls",
    src: src,
    autoPlay: autoplay,
    loop: loop,
    preload: preload
  }), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    tagName: "figcaption",
    value: caption,
    className: (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/audio/transforms.js
/**
 * GeChiUI 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_gc_blocks_namespaceObject.createBlock)('core/audio', {
        src: (0,external_gc_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 */ var audio_transforms = (transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/audio/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */




const audio_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/audio",
  title: "音频",
  category: "media",
  description: "嵌入简单音频播放器。",
  keywords: ["music", "sound", "podcast", "recording"],
  textdomain: "default",
  attributes: {
    src: {
      type: "string",
      source: "attribute",
      selector: "audio",
      attribute: "src",
      __experimentalRole: "content"
    },
    caption: {
      type: "string",
      source: "html",
      selector: "figcaption",
      __experimentalRole: "content"
    },
    id: {
      type: "number",
      __experimentalRole: "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
      }
    }
  },
  editorStyle: "gc-block-audio-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/button.js


/**
 * GeChiUI dependencies
 */

const button_button = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_button = (button_button);

;// CONCATENATED MODULE: external ["gc","privateApis"]
var external_gc_privateApis_namespaceObject = window["gc"]["privateApis"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/lock-unlock.js
/**
 * GeChiUI dependencies
 */

const {
  lock,
  unlock
} = (0,external_gc_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my plugin or theme will inevitably break on the next GeChiUI release.', '@gechiui/block-library');

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/utils/migrate-font-family.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const {
  cleanEmptyObject
} = unlock(external_gc_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()
  };
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/button/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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: classnames_default()(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 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: '.gc-block-button__link'
  },

  save({
    attributes,
    className
  }) {
    const {
      fontSize,
      linkTarget,
      rel,
      style,
      text,
      title,
      url,
      width
    } = attributes;

    if (!text) {
      return null;
    }

    const borderProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
    const colorProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
    const spacingProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
    const buttonClasses = classnames_default()('gc-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 = classnames_default()(className, {
      [`has-custom-width gc-block-button__width-${width}`]: width,
      [`has-custom-font-size`]: fontSize || style?.typography?.fontSize
    });
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: wrapperClasses
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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: '.gc-block-button__link'
  },

  save({
    attributes,
    className
  }) {
    const {
      fontSize,
      linkTarget,
      rel,
      style,
      text,
      title,
      url,
      width
    } = attributes;

    if (!text) {
      return null;
    }

    const borderProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
    const colorProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
    const spacingProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
    const buttonClasses = classnames_default()('gc-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 = classnames_default()(className, {
      [`has-custom-width gc-block-button__width-${width}`]: width,
      [`has-custom-font-size`]: fontSize || style?.typography?.fontSize
    });
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: wrapperClasses
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 = [v11, v10, {
  supports: {
    anchor: true,
    align: true,
    alignWide: false,
    color: {
      __experimentalSkipSerialization: true,
      gradients: true
    },
    typography: {
      fontSize: true,
      __experimentalFontFamily: true
    },
    reusable: false,
    __experimentalSelector: '.gc-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_gc_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
    const buttonClasses = classnames_default()('gc-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 = classnames_default()(className, {
      [`has-custom-width gc-block-button__width-${width}`]: width,
      [`has-custom-font-size`]: fontSize || style?.typography?.fontSize
    });
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: wrapperClasses
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "a",
      className: buttonClasses,
      href: url,
      title: title,
      style: buttonStyle,
      value: text,
      target: linkTarget,
      rel: rel
    }));
  },

  migrate: (0,external_gc_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
}, {
  supports: {
    anchor: true,
    align: true,
    alignWide: false,
    color: {
      __experimentalSkipSerialization: true
    },
    reusable: false,
    __experimentalSelector: '.gc-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_gc_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
    const buttonClasses = classnames_default()('gc-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 = classnames_default()(className, {
      [`has-custom-width gc-block-button__width-${width}`]: width
    });
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: wrapperClasses
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "a",
      className: buttonClasses,
      href: url,
      title: title,
      style: buttonStyle,
      value: text,
      target: linkTarget,
      rel: rel
    }));
  },

  migrate: (0,external_gc_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius)
}, {
  supports: {
    anchor: true,
    align: true,
    alignWide: false,
    color: {
      __experimentalSkipSerialization: true
    },
    reusable: false,
    __experimentalSelector: '.gc-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_gc_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
    const buttonClasses = classnames_default()('gc-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 = classnames_default()(className, {
      [`has-custom-width gc-block-button__width-${width}`]: width
    });
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: wrapperClasses
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "a",
      className: buttonClasses,
      href: url,
      title: title,
      style: buttonStyle,
      value: text,
      target: linkTarget,
      rel: rel
    }));
  },

  migrate: (0,external_gc_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 = classnames_default()('gc-block-button__link', {
      'no-border-radius': borderRadius === 0
    });
    const buttonStyle = {
      borderRadius: borderRadius ? borderRadius + 'px' : undefined
    };
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const backgroundClass = !customGradient && (0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);

    const gradientClass = (0,external_gc_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient);

    const buttonClasses = classnames_default()('gc-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 (0,external_gc_element_namespaceObject.createElement)("div", null, (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const backgroundClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const buttonClasses = classnames_default()('gc-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 (0,external_gc_element_namespaceObject.createElement)("div", null, (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const backgroundClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const buttonClasses = classnames_default()('gc-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 (0,external_gc_element_namespaceObject.createElement)("div", null, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 = 'gc-block-button__link';
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: `align${align}`
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 (0,external_gc_element_namespaceObject.createElement)("div", {
      className: `align${align}`,
      style: {
        backgroundColor: color
      }
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "a",
      href: url,
      title: title,
      style: {
        color: textColor
      },
      value: text
    }));
  },

  migrate: oldColorsMigration
}];
/* harmony default export */ var button_deprecated = (deprecated_deprecated);

;// CONCATENATED MODULE: external ["gc","keycodes"]
var external_gc_keycodes_namespaceObject = window["gc"]["keycodes"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/link.js


/**
 * GeChiUI dependencies
 */

const link_link = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_link = (link_link);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/link-off.js


/**
 * GeChiUI dependencies
 */

const linkOff = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var link_off = (linkOff);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/button/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */










const NEW_TAB_REL = 'noreferrer noopener';

function WidthPanel({
  selectedWidth,
  setAttributes
}) {
  function handleChange(newWidth) {
    // Check if we are toggling the width off
    const width = selectedWidth === newWidth ? undefined : newWidth; // Update attributes.

    setAttributes({
      width
    });
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('宽度设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ButtonGroup, {
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('按钮宽度')
  }, [25, 50, 75, 100].map(widthValue => {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
      key: widthValue,
      isSmall: true,
      variant: widthValue === selectedWidth ? 'primary' : undefined,
      onClick: () => handleChange(widthValue)
    }, widthValue, "%");
  })));
}

function ButtonEdit(props) {
  const {
    attributes,
    setAttributes,
    className,
    isSelected,
    onReplace,
    mergeBlocks
  } = props;
  const {
    textAlign,
    linkTarget,
    placeholder,
    rel,
    style,
    text,
    url,
    width
  } = attributes;

  function onToggleOpenInNewTab(value) {
    const newLinkTarget = value ? '_blank' : undefined;
    let updatedRel = rel;

    if (newLinkTarget && !rel) {
      updatedRel = NEW_TAB_REL;
    } else if (!newLinkTarget && rel === NEW_TAB_REL) {
      updatedRel = undefined;
    }

    setAttributes({
      linkTarget: newLinkTarget,
      rel: updatedRel
    });
  }

  function setButtonText(newText) {
    // Remove anchor tags from button text content.
    setAttributes({
      text: newText.replace(/<\/?a[^>]*>/g, '')
    });
  }

  function onKeyDown(event) {
    if (external_gc_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) {
      startEditing(event);
    } else if (external_gc_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_gc_element_namespaceObject.useState)(null);
  const borderProps = (0,external_gc_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  const colorProps = (0,external_gc_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  const spacingProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  const ref = (0,external_gc_element_namespaceObject.useRef)();
  const richTextRef = (0,external_gc_element_namespaceObject.useRef)();
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    ref: (0,external_gc_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, ref]),
    onKeyDown
  });
  const [isEditingURL, setIsEditingURL] = (0,external_gc_element_namespaceObject.useState)(false);
  const isURLSet = !!url;
  const opensInNewTab = linkTarget === '_blank';

  function startEditing(event) {
    event.preventDefault();
    setIsEditingURL(true);
  }

  function unlink() {
    setAttributes({
      url: undefined,
      linkTarget: undefined,
      rel: undefined
    });
    setIsEditingURL(false);
  }

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!isSelected) {
      setIsEditingURL(false);
    }
  }, [isSelected]);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps,
    className: classnames_default()(blockProps.className, {
      [`has-custom-width gc-block-button__width-${width}`]: width,
      [`has-custom-font-size`]: blockProps.style.fontSize
    })
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    ref: richTextRef,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('按钮文字'),
    placeholder: placeholder || (0,external_gc_i18n_namespaceObject.__)('添加文字...' ),
    value: text,
    onChange: value => setButtonText(value),
    withoutInteractiveFormatting: true,
    className: classnames_default()(className, 'gc-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_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')),
    style: { ...borderProps.style,
      ...colorProps.style,
      ...spacingProps.style
    },
    onSplit: value => (0,external_gc_blocks_namespaceObject.createBlock)('core/button', { ...attributes,
      text: value
    }),
    onReplace: onReplace,
    onMerge: mergeBlocks,
    identifier: "text"
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  }), !isURLSet && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    name: "link",
    icon: library_link,
    title: (0,external_gc_i18n_namespaceObject.__)('链接'),
    shortcut: external_gc_keycodes_namespaceObject.displayShortcut.primary('k'),
    onClick: startEditing
  }), isURLSet && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    name: "link",
    icon: link_off,
    title: (0,external_gc_i18n_namespaceObject.__)('移除链接'),
    shortcut: external_gc_keycodes_namespaceObject.displayShortcut.primaryShift('k'),
    onClick: unlink,
    isActive: true
  })), isSelected && (isEditingURL || isURLSet) && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Popover, {
    placement: "bottom",
    onClose: () => {
      setIsEditingURL(false);
      richTextRef.current?.focus();
    },
    anchor: popoverAnchor,
    focusOnMount: isEditingURL ? 'firstElement' : false,
    __unstableSlotName: '__unstable-block-tools-after',
    shift: true
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalLinkControl, {
    className: "gc-block-navigation-link__inline-link-input",
    value: {
      url,
      opensInNewTab
    },
    onChange: ({
      url: newURL = '',
      opensInNewTab: newOpensInNewTab
    }) => {
      setAttributes({
        url: (0,external_gc_url_namespaceObject.prependHTTP)(newURL)
      });

      if (opensInNewTab !== newOpensInNewTab) {
        onToggleOpenInNewTab(newOpensInNewTab);
      }
    },
    onRemove: () => {
      unlink();
      richTextRef.current?.focus();
    },
    forceIsEditingLink: isEditingURL
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(WidthPanel, {
    selectedWidth: width,
    setAttributes: setAttributes
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "advanced"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('链接rel'),
    value: rel || '',
    onChange: newRel => setAttributes({
      rel: newRel
    })
  })));
}

/* harmony default export */ var button_edit = (ButtonEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/button/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


function save_save({
  attributes,
  className
}) {
  const {
    textAlign,
    fontSize,
    linkTarget,
    rel,
    style,
    text,
    title,
    url,
    width
  } = attributes;

  if (!text) {
    return null;
  }

  const borderProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  const colorProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  const spacingProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  const buttonClasses = classnames_default()('gc-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_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('button'));
  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 = classnames_default()(className, {
    [`has-custom-width gc-block-button__width-${width}`]: width,
    [`has-custom-font-size`]: fontSize || style?.typography?.fontSize
  });
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className: wrapperClasses
    })
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    tagName: "a",
    className: buttonClasses,
    href: url,
    title: title,
    style: buttonStyle,
    value: text,
    target: linkTarget,
    rel: rel
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/button/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const button_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/button",
  title: "按钮",
  category: "design",
  parent: ["core/buttons"],
  description: "通过按钮式的链接来提示访客进行操作。",
  keywords: ["link"],
  textdomain: "default",
  attributes: {
    textAlign: {
      type: "string"
    },
    url: {
      type: "string",
      source: "attribute",
      selector: "a",
      attribute: "href",
      __experimentalRole: "content"
    },
    title: {
      type: "string",
      source: "attribute",
      selector: "a",
      attribute: "title",
      __experimentalRole: "content"
    },
    text: {
      type: "string",
      source: "html",
      selector: "a",
      __experimentalRole: "content"
    },
    linkTarget: {
      type: "string",
      source: "attribute",
      selector: "a",
      attribute: "target",
      __experimentalRole: "content"
    },
    rel: {
      type: "string",
      source: "attribute",
      selector: "a",
      attribute: "rel",
      __experimentalRole: "content"
    },
    placeholder: {
      type: "string"
    },
    backgroundColor: {
      type: "string"
    },
    textColor: {
      type: "string"
    },
    gradient: {
      type: "string"
    },
    width: {
      type: "number"
    }
  },
  supports: {
    anchor: true,
    align: false,
    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,
      __experimentalDefaultControls: {
        fontSize: true
      }
    },
    reusable: false,
    shadow: 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: ".gc-block-button .gc-block-button__link"
  },
  styles: [{
    name: "fill",
    label: "Fill",
    isDefault: true
  }, {
    name: "outline",
    label: "Outline"
  }],
  editorStyle: "gc-block-button-editor",
  style: "gc-block-button"
};

const {
  name: button_name
} = button_metadata;

const button_settings = {
  icon: library_button,
  example: {
    attributes: {
      className: 'is-style-fill',
      text: (0,external_gc_i18n_namespaceObject.__)('行动号召')
    }
  },
  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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/buttons.js


/**
 * GeChiUI dependencies
 */

const buttons = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_buttons = (buttons);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/buttons/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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 (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: classnames_default()({
          [`is-content-justification-${contentJustification}`]: contentJustification,
          'is-vertical': orientation === 'vertical'
        })
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
  }

}, {
  supports: {
    align: ['center', 'left', 'right'],
    anchor: true
  },

  save() {
    return (0,external_gc_element_namespaceObject.createElement)("div", null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
  },

  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 */ var buttons_deprecated = (buttons_deprecated_deprecated);

;// CONCATENATED MODULE: external ["gc","richText"]
var external_gc_richText_namespaceObject = window["gc"]["richText"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/buttons/transforms.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */

const {
  name: transforms_name
} = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/buttons",
  title: "多个按钮",
  category: "design",
  description: "使用一组按钮式的链接来提示访客进行操作。",
  keywords: ["link"],
  textdomain: "default",
  supports: {
    anchor: true,
    align: ["wide", "full"],
    html: false,
    __experimentalExposeControlsToChildren: true,
    spacing: {
      blockGap: 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
      }
    },
    layout: {
      allowSwitching: false,
      allowInheriting: false,
      "default": {
        type: "flex"
      }
    }
  },
  editorStyle: "gc-block-buttons-editor",
  style: "gc-block-buttons"
};
const transforms_transforms = {
  from: [{
    type: 'block',
    isMultiBlock: true,
    blocks: ['core/button'],
    transform: buttons => // Creates the buttons block.
    (0,external_gc_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons.
    buttons.map(attributes => // Create singular button in the buttons block.
    (0,external_gc_blocks_namespaceObject.createBlock)('core/button', attributes)))
  }, {
    type: 'block',
    isMultiBlock: true,
    blocks: ['core/paragraph'],
    transform: buttons => // Creates the buttons block.
    (0,external_gc_blocks_namespaceObject.createBlock)(transforms_name, {}, // Loop the selected buttons.
    buttons.map(attributes => {
      const element = (0,external_gc_richText_namespaceObject.__unstableCreateElement)(document, attributes.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_gc_blocks_namespaceObject.createBlock)('core/button', {
        text,
        url
      });
    })),
    isMatch: paragraphs => {
      return paragraphs.every(attributes => {
        const element = (0,external_gc_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 */ var buttons_transforms = (transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/buttons/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */



/**
 * Internal dependencies
 */


const ALLOWED_BLOCKS = [button_name];
const DEFAULT_BLOCK = {
  name: button_name,
  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_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()(className, {
      'has-custom-font-size': fontSize || style?.typography?.fontSize
    })
  });
  const preferredStyle = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const preferredStyleVariations = select(external_gc_blockEditor_namespaceObject.store).getSettings().__experimentalPreferredStyleVariations;

    return preferredStyleVariations?.value?.[button_name];
  }, []);
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    allowedBlocks: ALLOWED_BLOCKS,
    __experimentalDefaultBlock: DEFAULT_BLOCK,
    __experimentalDirectInsert: true,
    template: [[button_name, {
      className: preferredStyle && `is-style-${preferredStyle}`
    }]],
    templateInsertUpdatesSelection: true,
    orientation: (_layout$orientation = layout?.orientation) !== null && _layout$orientation !== void 0 ? _layout$orientation : 'horizontal'
  });
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  });
}

/* harmony default export */ var buttons_edit = (ButtonsEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/buttons/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


function buttons_save_save({
  attributes,
  className
}) {
  const {
    fontSize,
    style
  } = attributes;
  const blockProps = external_gc_blockEditor_namespaceObject.useBlockProps.save({
    className: classnames_default()(className, {
      'has-custom-font-size': fontSize || style?.typography?.fontSize
    })
  });
  const innerBlocksProps = external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/buttons/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */





const buttons_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/buttons",
  title: "多个按钮",
  category: "design",
  description: "使用一组按钮式的链接来提示访客进行操作。",
  keywords: ["link"],
  textdomain: "default",
  supports: {
    anchor: true,
    align: ["wide", "full"],
    html: false,
    __experimentalExposeControlsToChildren: true,
    spacing: {
      blockGap: 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
      }
    },
    layout: {
      allowSwitching: false,
      allowInheriting: false,
      "default": {
        type: "flex"
      }
    }
  },
  editorStyle: "gc-block-buttons-editor",
  style: "gc-block-buttons"
};

const {
  name: buttons_name
} = buttons_metadata;

const buttons_settings = {
  icon: library_buttons,
  example: {
    innerBlocks: [{
      name: 'core/button',
      attributes: {
        text: (0,external_gc_i18n_namespaceObject.__)('了解更多')
      }
    }, {
      name: 'core/button',
      attributes: {
        text: (0,external_gc_i18n_namespaceObject.__)('联系我们')
      }
    }]
  },
  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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/calendar.js


/**
 * GeChiUI dependencies
 */

const calendar = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_calendar = (calendar);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/calendar/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */








/**
 * Returns the year and month of a specified date.
 *
 * @see `GC_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_gc_blockEditor_namespaceObject.useBlockProps)();
  const {
    date,
    hasPosts,
    hasPostsResolved
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getEntityRecords,
      hasFinishedResolution
    } = select(external_gc_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: @gechiui/block-library should not depend on @gechiui/editor.
    // Blocks can be loaded into a *non-post* block editor.
    // eslint-disable-next-line @gechiui/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 (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
      icon: library_calendar,
      label: (0,external_gc_i18n_namespaceObject.__)('日历')
    }, !hasPostsResolved ? (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null) : (0,external_gc_i18n_namespaceObject.__)('未找到已发布的文章。')));
  }

  return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Disabled, null, (0,external_gc_element_namespaceObject.createElement)((external_gc_serverSideRender_default()), {
    block: "core/calendar",
    attributes: { ...attributes,
      ...getYearMonth(date)
    }
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/calendar/transforms.js
/**
 * GeChiUI dependencies
 */

const calendar_transforms_transforms = {
  from: [{
    type: 'block',
    blocks: ['core/archives'],
    transform: () => (0,external_gc_blocks_namespaceObject.createBlock)('core/calendar')
  }],
  to: [{
    type: 'block',
    blocks: ['core/archives'],
    transform: () => (0,external_gc_blocks_namespaceObject.createBlock)('core/archives')
  }]
};
/* harmony default export */ var calendar_transforms = (calendar_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/calendar/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const calendar_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/calendar",
  title: "日历",
  category: "widgets",
  description: "文章的日历。",
  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
      }
    }
  },
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/category.js


/**
 * GeChiUI dependencies
 */

const category = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_category = (category);

;// CONCATENATED MODULE: external ["gc","htmlEntities"]
var external_gc_htmlEntities_namespaceObject = window["gc"]["htmlEntities"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/pin.js


/**
 * GeChiUI dependencies
 */

const pin = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_pin = (pin);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/categories/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */








function CategoriesEdit({
  attributes: {
    displayAsDropdown,
    showHierarchy,
    showPostCounts,
    showOnlyTopLevel,
    showEmpty
  },
  setAttributes,
  className
}) {
  const selectId = (0,external_gc_compose_namespaceObject.useInstanceId)(CategoriesEdit, 'blocks-category-select');
  const query = {
    per_page: -1,
    hide_empty: !showEmpty,
    context: 'view'
  };

  if (showOnlyTopLevel) {
    query.parent = 0;
  }

  const {
    records: categories,
    isResolving
  } = (0,external_gc_coreData_namespaceObject.useEntityRecords)('taxonomy', 'category', 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_gc_i18n_namespaceObject.__)('(未命名)') : (0,external_gc_htmlEntities_namespaceObject.decodeEntities)(name).trim();

  const renderCategoryList = () => {
    const parentId = 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 (0,external_gc_element_namespaceObject.createElement)("li", {
      key: id,
      className: `cat-item cat-item-${id}`
    }, (0,external_gc_element_namespaceObject.createElement)("a", {
      href: link,
      target: "_blank",
      rel: "noreferrer noopener"
    }, renderCategoryName(name)), showPostCounts && ` (${count})`, showHierarchy && !!childCategories.length && (0,external_gc_element_namespaceObject.createElement)("ul", {
      className: "children"
    }, childCategories.map(childCategory => renderCategoryListItem(childCategory))));
  };

  const renderCategoryDropdown = () => {
    const parentId = showHierarchy ? 0 : null;
    const categoriesList = getCategoriesList(parentId);
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.VisuallyHidden, {
      as: "label",
      htmlFor: selectId
    }, (0,external_gc_i18n_namespaceObject.__)('分类目录')), (0,external_gc_element_namespaceObject.createElement)("select", {
      id: selectId
    }, (0,external_gc_element_namespaceObject.createElement)("option", null, (0,external_gc_i18n_namespaceObject.__)('选择分类')), categoriesList.map(category => renderCategoryDropdownItem(category, 0))));
  };

  const renderCategoryDropdownItem = (category, level) => {
    const {
      id,
      count,
      name
    } = category;
    const childCategories = getCategoriesList(id);
    return [(0,external_gc_element_namespaceObject.createElement)("option", {
      key: id,
      className: `level-${level}`
    }, Array.from({
      length: level * 3
    }).map(() => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`), showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))];
  };

  const TagName = !!categories?.length && !displayAsDropdown && !isResolving ? 'ul' : 'div';
  const classes = classnames_default()(className, {
    'gc-block-categories-list': !!categories?.length && !displayAsDropdown && !isResolving,
    'gc-block-categories-dropdown': !!categories?.length && displayAsDropdown && !isResolving
  });
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classes
  });
  return (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('以下拉菜单显示'),
    checked: displayAsDropdown,
    onChange: toggleAttribute('displayAsDropdown')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示文章数目'),
    checked: showPostCounts,
    onChange: toggleAttribute('showPostCounts')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('仅显示顶级分类'),
    checked: showOnlyTopLevel,
    onChange: toggleAttribute('showOnlyTopLevel')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示空的分类'),
    checked: showEmpty,
    onChange: toggleAttribute('showEmpty')
  }), !showOnlyTopLevel && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('体现层级关系'),
    checked: showHierarchy,
    onChange: toggleAttribute('showHierarchy')
  }))), isResolving && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
    icon: library_pin,
    label: (0,external_gc_i18n_namespaceObject.__)('分类目录')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null)), !isResolving && categories?.length === 0 && (0,external_gc_element_namespaceObject.createElement)("p", null, (0,external_gc_i18n_namespaceObject.__)('您的系统没有任何文章，因此目前没有任何内容可供显示。')), !isResolving && categories?.length > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList()));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/categories/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const categories_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/categories",
  title: "分类列表",
  category: "widgets",
  description: "显示所有分类的列表。",
  textdomain: "default",
  attributes: {
    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
    }
  },
  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
      }
    }
  },
  editorStyle: "gc-block-categories-editor",
  style: "gc-block-categories"
};

const {
  name: categories_name
} = categories_metadata;

const categories_settings = {
  icon: library_category,
  example: {},
  edit: CategoriesEdit
};
const categories_init = () => initBlock({
  name: categories_name,
  metadata: categories_metadata,
  settings: categories_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/classic.js


/**
 * GeChiUI dependencies
 */

const classic = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_classic = (classic);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/freeform/convert-to-blocks-button.js


/**
 * GeChiUI dependencies
 */






const ConvertToBlocksButton = ({
  clientId
}) => {
  const {
    replaceBlocks
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const block = (0,external_gc_data_namespaceObject.useSelect)(select => {
    return select(external_gc_blockEditor_namespaceObject.store).getBlock(clientId);
  }, [clientId]);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    onClick: () => replaceBlocks(block.clientId, (0,external_gc_blocks_namespaceObject.rawHandler)({
      HTML: (0,external_gc_blocks_namespaceObject.serialize)(block)
    }))
  }, (0,external_gc_i18n_namespaceObject.__)('转换为区块'));
};

/* harmony default export */ var convert_to_blocks_button = (ConvertToBlocksButton);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/freeform/modal.js


/**
 * GeChiUI dependencies
 */






function ClassicEdit(props) {
  const styles = (0,external_gc_data_namespaceObject.useSelect)(select => select(external_gc_blockEditor_namespaceObject.store).getSettings().styles);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    const {
      baseURL,
      suffix,
      settings
    } = window.gcEditorL10n.tinymce;
    window.tinymce.EditorManager.overrideDefaults({
      base_url: baseURL,
      suffix
    });
    window.gc.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.gc.oldEditor.remove(props.id);
    };
  }, []);
  return (0,external_gc_element_namespaceObject.createElement)("textarea", { ...props
  });
}

function ModalEdit(props) {
  const {
    clientId,
    attributes: {
      content
    },
    setAttributes,
    onReplace
  } = props;
  const [isOpen, setOpen] = (0,external_gc_element_namespaceObject.useState)(false);
  const id = `editor-${clientId}`;

  const onClose = () => content ? setOpen(false) : onReplace([]);

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    onClick: () => setOpen(true)
  }, (0,external_gc_i18n_namespaceObject.__)('编辑')))), content && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.RawHTML, null, content), (isOpen || !content) && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Modal, {
    title: (0,external_gc_i18n_namespaceObject.__)('经典编辑器'),
    onRequestClose: onClose,
    shouldCloseOnClickOutside: false,
    overlayClassName: "block-editor-freeform-modal"
  }, (0,external_gc_element_namespaceObject.createElement)(ClassicEdit, {
    id: id,
    defaultValue: content
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Flex, {
    className: "block-editor-freeform-modal__actions",
    justify: "flex-end",
    expanded: false
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FlexItem, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "tertiary",
    onClick: onClose
  }, (0,external_gc_i18n_namespaceObject.__)('取消'))), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FlexItem, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "primary",
    onClick: () => {
      setAttributes({
        content: window.gc.oldEditor.getContent(id)
      });
      setOpen(false);
    }
  }, (0,external_gc_i18n_namespaceObject.__)('保存'))))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/freeform/edit.js


/**
 * GeChiUI dependencies
 */







/**
 * Internal dependencies
 */



const {
  gc
} = 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_gc_data_namespaceObject.useSelect)(select => select(external_gc_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]);
  const [isIframed, setIsIframed] = (0,external_gc_element_namespaceObject.useState)(false);
  const ref = (0,external_gc_compose_namespaceObject.useRefEffect)(element => {
    setIsIframed(element.ownerDocument !== document);
  }, []);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, canRemove && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, (0,external_gc_element_namespaceObject.createElement)(convert_to_blocks_button, {
    clientId: clientId
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)({
      ref
    })
  }, isIframed ? (0,external_gc_element_namespaceObject.createElement)(ModalEdit, { ...props
  }) : (0,external_gc_element_namespaceObject.createElement)(edit_ClassicEdit, { ...props
  })));
}

function edit_ClassicEdit({
  clientId,
  attributes: {
    content
  },
  setAttributes,
  onReplace
}) {
  const {
    getMultiSelectedBlockClientIds
  } = (0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store);
  const didMount = (0,external_gc_element_namespaceObject.useRef)(false);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!didMount.current) {
      return;
    }

    const editor = window.tinymce.get(`editor-${clientId}`);
    const currentContent = editor?.getContent();

    if (currentContent !== content) {
      editor.setContent(content || '');
    }
  }, [content]);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    const {
      baseURL,
      suffix
    } = window.gcEditorL10n.tinymce;
    didMount.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.gechiui.com/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_gc_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_gc_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_gc_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_gc_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_gc_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.gcEditorL10n.tinymce;
      gc.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);
      gc.oldEditor.remove(`editor-${clientId}`);
    };
  }, []);

  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 (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("div", {
    key: "toolbar",
    id: `toolbar-${clientId}`,
    className: "block-library-classic__toolbar",
    onClick: focus,
    "data-placeholder": (0,external_gc_i18n_namespaceObject.__)('经典'),
    onKeyDown: onToolbarKeyDown
  }), (0,external_gc_element_namespaceObject.createElement)("div", {
    key: "editor",
    id: `editor-${clientId}`,
    className: "gc-block-freeform block-library-rich-text__tinymce"
  }));
  /* eslint-enable jsx-a11y/no-static-element-interactions */
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/freeform/save.js


/**
 * GeChiUI dependencies
 */

function freeform_save_save({
  attributes
}) {
  const {
    content
  } = attributes;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.RawHTML, null, content);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/freeform/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */



const freeform_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/freeform",
  title: "经典",
  category: "text",
  description: "使用经典GeChiUI编辑器。",
  textdomain: "default",
  attributes: {
    content: {
      type: "string",
      source: "raw"
    }
  },
  supports: {
    className: false,
    customClassName: false,
    reusable: false
  },
  editorStyle: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/code.js


/**
 * GeChiUI dependencies
 */

const code = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_code = (code);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/code/edit.js


/**
 * GeChiUI dependencies
 */


function CodeEdit({
  attributes,
  setAttributes,
  onRemove
}) {
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  return (0,external_gc_element_namespaceObject.createElement)("pre", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    tagName: "code",
    value: attributes.content,
    onChange: content => setAttributes({
      content
    }),
    onRemove: onRemove,
    placeholder: (0,external_gc_i18n_namespaceObject.__)('编写代码...' ),
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('代码'),
    preserveWhiteSpace: true,
    __unstablePastePlainText: true
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/code/utils.js
/**
 * GeChiUI 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_gc_compose_namespaceObject.pipe)(escapeOpeningSquareBrackets, escapeProtocolInIsolatedUrls)(content || '');
}
/**
 * Returns the given content with all opening shortcode characters converted
 * into their HTML entity counterpart (i.e. [ => &#91;). For instance, a
 * shortcode like [embed] becomes &#91;embed]
 *
 * This function replicates the escaping of HTML tags, where a tag like
 * <strong> becomes &lt;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. [ => &#91;)
 */

function escapeOpeningSquareBrackets(content) {
  return content.replace(/\[/g, '&#91;');
}
/**
 * Converts the first two forward slashes of any isolated URL into their HTML
 * counterparts (i.e. // => &#47;&#47;). For instance, https://youku.com/watch?x
 * becomes https:&#47;&#47;youku.com/watch?x.
 *
 * An isolated URL is a URL that sits in its own line, surrounded only by spacing
 * characters.
 *
 * See https://github.com/GeChiUI/gechiui-develop/blob/5.1.1/src/gc-includes/class-gc-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. & => &amp;)
 */


function escapeProtocolInIsolatedUrls(content) {
  return content.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, '$1&#47;&#47;$2');
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/code/save.js


/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


function code_save_save({
  attributes
}) {
  return (0,external_gc_element_namespaceObject.createElement)("pre", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    tagName: "code",
    value: utils_escape(attributes.content)
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/code/transforms.js
/**
 * GeChiUI dependencies
 */

const code_transforms_transforms = {
  from: [{
    type: 'enter',
    regExp: /^```$/,
    transform: () => (0,external_gc_blocks_namespaceObject.createBlock)('core/code')
  }, {
    type: 'block',
    blocks: ['core/html', 'core/paragraph'],
    transform: ({
      content
    }) => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/code', {
        content
      });
    }
  }, {
    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
    }) => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
        content: content.replace(/\n/g, '<br>')
      });
    }
  }]
};
/* harmony default export */ var code_transforms = (code_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/code/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */



const code_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/code",
  title: "代码",
  category: "text",
  description: "显示符合间距和制表符的代码片段。",
  textdomain: "default",
  attributes: {
    content: {
      type: "string",
      source: "html",
      selector: "code"
    }
  },
  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
      }
    }
  },
  style: "gc-block-code"
};


const {
  name: code_name
} = code_metadata;

const code_settings = {
  icon: library_code,
  example: {
    attributes: {
      /* eslint-disable @gechiui/i18n-no-collapsible-whitespace */
      // translators: Preserve \n markers for line breaks
      content: (0,external_gc_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 @gechiui/i18n-no-collapsible-whitespace */

    }
  },
  transforms: code_transforms,
  edit: CodeEdit,
  save: code_save_save
};
const code_init = () => initBlock({
  name: code_name,
  metadata: code_metadata,
  settings: code_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/column.js


/**
 * GeChiUI dependencies
 */

const column = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_column = (column);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/column/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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 = classnames_default()({
      [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
    });
    const style = {
      flexBasis: width + '%'
    };
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: wrapperClasses,
      style: style
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
  }

}];
/* harmony default export */ var column_deprecated = (column_deprecated_deprecated);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/column/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */






function ColumnEdit({
  attributes: {
    verticalAlignment,
    width,
    templateLock,
    allowedBlocks
  },
  setAttributes,
  clientId
}) {
  const classes = classnames_default()('block-core-columns', {
    [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment
  });
  const units = (0,external_gc_components_namespaceObject.__experimentalUseCustomUnits)({
    availableUnits: (0,external_gc_blockEditor_namespaceObject.useSetting)('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
  });
  const {
    columnsIds,
    hasChildBlocks,
    rootClientId
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlockOrder,
      getBlockRootClientId
    } = select(external_gc_blockEditor_namespaceObject.store);
    const rootId = getBlockRootClientId(clientId);
    return {
      hasChildBlocks: getBlockOrder(clientId).length > 0,
      rootClientId: rootId,
      columnsIds: getBlockOrder(rootId)
    };
  }, [clientId]);
  const {
    updateBlockAttributes
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_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_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classes,
    style: widthWithUnit ? {
      flexBasis: widthWithUnit
    } : undefined
  });
  const columnsCount = columnsIds.length;
  const currentColumnPosition = columnsIds.indexOf(clientId) + 1;
  const label = (0,external_gc_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_gc_i18n_namespaceObject.__)('%1$s（%2$d，共%3$d）'), blockProps['aria-label'], currentColumnPosition, columnsCount);
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)({ ...blockProps,
    'aria-label': label
  }, {
    templateLock,
    allowedBlocks,
    renderAppender: hasChildBlocks ? undefined : external_gc_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, {
    onChange: updateAlignment,
    value: verticalAlignment
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('栏目设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalUnitControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('宽度'),
    labelPosition: "edge",
    __unstableInputWidth: "80px",
    value: width || '',
    onChange: nextWidth => {
      nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth;
      setAttributes({
        width: nextWidth
      });
    },
    units: units
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  }));
}

/* harmony default export */ var column_edit = (ColumnEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/column/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


function column_save_save({
  attributes
}) {
  const {
    verticalAlignment,
    width
  } = attributes;
  const wrapperClasses = classnames_default()({
    [`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_gc_blockEditor_namespaceObject.useBlockProps.save({
    className: wrapperClasses,
    style
  });
  const innerBlocksProps = external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/column/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */




const column_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/column",
  title: "栏目",
  category: "design",
  parent: ["core/columns"],
  description: "多栏区块中的一栏。",
  textdomain: "default",
  attributes: {
    verticalAlignment: {
      type: "string"
    },
    width: {
      type: "string"
    },
    allowedBlocks: {
      type: "array"
    },
    templateLock: {
      type: ["string", "boolean"],
      "enum": ["all", "insert", "contentOnly", false]
    }
  },
  supports: {
    anchor: true,
    reusable: false,
    html: false,
    color: {
      gradients: true,
      link: true,
      __experimentalDefaultControls: {
        background: true,
        text: true
      }
    },
    spacing: {
      blockGap: true,
      padding: true,
      __experimentalDefaultControls: {
        padding: true,
        blockGap: true
      }
    },
    __experimentalBorder: {
      color: true,
      style: true,
      width: true,
      __experimentalDefaultControls: {
        color: 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
  }
};

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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/columns.js


/**
 * GeChiUI dependencies
 */

const columns = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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-2zm-4.1 1.5v10H10v-10h4.9zM5.5 17V8c0-.3.2-.5.5-.5h2.5v10H6c-.3 0-.5-.2-.5-.5zm14 0c0 .3-.2.5-.5.5h-2.6v-10H19c.3 0 .5.2.5.5v9z"
}));
/* harmony default export */ var library_columns = (columns);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/columns/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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 */ var 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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const textClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const className = classnames_default()({
      '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 (0,external_gc_element_namespaceObject.createElement)("div", {
      className: className ? className : undefined,
      style: style
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
  }

}, {
  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_gc_blocks_namespaceObject.createBlock)('core/column', {}, columnBlocks));
    const {
      columns: ignoredColumns,
      ...restAttributes
    } = attributes;
    return [{ ...restAttributes,
      isStackedOnMobile: true
    }, migratedInnerBlocks];
  },

  save({
    attributes
  }) {
    const {
      columns
    } = attributes;
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: `has-${columns}-columns`
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
  }

}, {
  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 = classnames_default()(`has-${columns}-columns`, {
      [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment
    });
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: wrapperClasses
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
  }

}]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/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 {GCBlock} 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 {GCBlock[]} 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 {GCBlock[]} 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 {GCBlock[]} 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 {GCBlock[]} 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 {GCBlock[]}             blocks Block objects.
 * @param {Object<string,number>} widths Redistributed column widths.
 *
 * @return {GCBlock[]} 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 {GCBlock[]} 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 === '%';
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/columns/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */


/**
 * Allowed blocks constant is passed to InnerBlocks precisely as specified here.
 * The contents of the array should never change.
 * The array should contain the name of each block that is allowed.
 * In columns block, the only block we allow is 'core/column'.
 *
 * @constant
 * @type {string[]}
 */

const edit_ALLOWED_BLOCKS = ['core/column'];

function ColumnsEditContainer({
  attributes,
  setAttributes,
  updateAlignment,
  updateColumns,
  clientId
}) {
  const {
    isStackedOnMobile,
    verticalAlignment,
    templateLock
  } = attributes;
  const {
    count,
    canInsertColumnBlock,
    minCount
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      canInsertBlockType,
      canRemoveBlock,
      getBlocks,
      getBlockCount
    } = select(external_gc_blockEditor_namespaceObject.store);
    const innerBlocks = getBlocks(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 = innerBlocks.reduce((acc, block, index) => {
      if (!canRemoveBlock(block.clientId)) {
        acc.push(index);
      }

      return acc;
    }, []);
    return {
      count: getBlockCount(clientId),
      canInsertColumnBlock: canInsertBlockType('core/column', clientId),
      minCount: Math.max(...preventRemovalBlockIndexes) + 1
    };
  }, [clientId]);
  const classes = classnames_default()({
    [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
    [`is-not-stacked-on-mobile`]: !isStackedOnMobile
  });
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classes
  });
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    allowedBlocks: edit_ALLOWED_BLOCKS,
    orientation: 'horizontal',
    renderAppender: false,
    templateLock
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, {
    onChange: updateAlignment,
    value: verticalAlignment
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, null, canInsertColumnBlock && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('栏目'),
    value: count,
    onChange: value => updateColumns(count, Math.max(minCount, value)),
    min: Math.max(1, minCount),
    max: Math.max(6, count)
  }), count > 6 && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Notice, {
    status: "warning",
    isDismissible: false
  }, (0,external_gc_i18n_namespaceObject.__)('该栏数超过建议的数量，可能会导致页面无法完整呈现。'))), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在移动设备上堆叠显示'),
    checked: isStackedOnMobile,
    onChange: () => setAttributes({
      isStackedOnMobile: !isStackedOnMobile
    })
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  }));
}

const ColumnsEditContainerWrapper = (0,external_gc_data_namespaceObject.withDispatch)((dispatch, ownProps, registry) => ({
  /**
   * Update all child Column blocks with a new vertical alignment setting
   * based on whatever alignment is passed in. This allows change to parent
   * to overide anything set on a individual column basis.
   *
   * @param {string} verticalAlignment the vertical alignment setting
   */
  updateAlignment(verticalAlignment) {
    const {
      clientId,
      setAttributes
    } = ownProps;
    const {
      updateBlockAttributes
    } = dispatch(external_gc_blockEditor_namespaceObject.store);
    const {
      getBlockOrder
    } = registry.select(external_gc_blockEditor_namespaceObject.store); // Update own alignment.

    setAttributes({
      verticalAlignment
    }); // Update all child Column Blocks to match.

    const innerBlockClientIds = getBlockOrder(clientId);
    innerBlockClientIds.forEach(innerBlockClientId => {
      updateBlockAttributes(innerBlockClientId, {
        verticalAlignment
      });
    });
  },

  /**
   * 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.
   */
  updateColumns(previousColumns, newColumns) {
    const {
      clientId
    } = ownProps;
    const {
      replaceInnerBlocks
    } = dispatch(external_gc_blockEditor_namespaceObject.store);
    const {
      getBlocks
    } = registry.select(external_gc_blockEditor_namespaceObject.store);
    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); // Redistribute in consideration of pending block insertion as
      // constraining the available working width.

      const widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth);
      innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...Array.from({
        length: newColumns - previousColumns
      }).map(() => {
        return (0,external_gc_blocks_namespaceObject.createBlock)('core/column', {
          width: `${newColumnWidth}%`
        });
      })];
    } else if (isAddingColumn) {
      innerBlocks = [...innerBlocks, ...Array.from({
        length: newColumns - previousColumns
      }).map(() => {
        return (0,external_gc_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);
  }

}))(ColumnsEditContainer);

function Placeholder({
  clientId,
  name,
  setAttributes
}) {
  const {
    blockType,
    defaultVariation,
    variations
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlockVariations,
      getBlockType,
      getDefaultBlockVariation
    } = select(external_gc_blocks_namespaceObject.store);
    return {
      blockType: getBlockType(name),
      defaultVariation: getDefaultBlockVariation(name, 'block'),
      variations: getBlockVariations(name, 'block')
    };
  }, [name]);
  const {
    replaceInnerBlocks
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalBlockVariationPicker, {
    icon: blockType?.icon?.src,
    label: blockType?.title,
    variations: variations,
    onSelect: (nextVariation = defaultVariation) => {
      if (nextVariation.attributes) {
        setAttributes(nextVariation.attributes);
      }

      if (nextVariation.innerBlocks) {
        replaceInnerBlocks(clientId, (0,external_gc_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), true);
      }
    },
    allowSkip: true
  }));
}

const ColumnsEdit = props => {
  const {
    clientId
  } = props;
  const hasInnerBlocks = (0,external_gc_data_namespaceObject.useSelect)(select => select(external_gc_blockEditor_namespaceObject.store).getBlocks(clientId).length > 0, [clientId]);
  const Component = hasInnerBlocks ? ColumnsEditContainerWrapper : Placeholder;
  return (0,external_gc_element_namespaceObject.createElement)(Component, { ...props
  });
};

/* harmony default export */ var columns_edit = (ColumnsEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/columns/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


function columns_save_save({
  attributes
}) {
  const {
    isStackedOnMobile,
    verticalAlignment
  } = attributes;
  const className = classnames_default()({
    [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
    [`is-not-stacked-on-mobile`]: !isStackedOnMobile
  });
  const blockProps = external_gc_blockEditor_namespaceObject.useBlockProps.save({
    className
  });
  const innerBlocksProps = external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/columns/variations.js


/**
 * GeChiUI dependencies
 */


/** @typedef {import('@gechiui/blocks').GCBlockVariation} GCBlockVariation */

/**
 * Template option choices for predefined columns layouts.
 *
 * @type {GCBlockVariation[]}
 */

const variations = [{
  name: 'one-column-full',
  title: (0,external_gc_i18n_namespaceObject.__)('100'),
  description: (0,external_gc_i18n_namespaceObject.__)('单栏'),
  icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
    width: "48",
    height: "48",
    viewBox: "0 0 48 48",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z"
  })),
  innerBlocks: [['core/column']],
  scope: ['block']
}, {
  name: 'two-columns-equal',
  title: (0,external_gc_i18n_namespaceObject.__)('50 / 50'),
  description: (0,external_gc_i18n_namespaceObject.__)('两栏：栏宽相等'),
  icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
    width: "48",
    height: "48",
    viewBox: "0 0 48 48",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z"
  })),
  isDefault: true,
  innerBlocks: [['core/column'], ['core/column']],
  scope: ['block']
}, {
  name: 'two-columns-one-third-two-thirds',
  title: (0,external_gc_i18n_namespaceObject.__)('33 / 66'),
  description: (0,external_gc_i18n_namespaceObject.__)('两栏：分别占三分之一及三分之二宽度'),
  icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
    width: "48",
    height: "48",
    viewBox: "0 0 48 48",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z"
  })),
  innerBlocks: [['core/column', {
    width: '33.33%'
  }], ['core/column', {
    width: '66.66%'
  }]],
  scope: ['block']
}, {
  name: 'two-columns-two-thirds-one-third',
  title: (0,external_gc_i18n_namespaceObject.__)('66 / 33'),
  description: (0,external_gc_i18n_namespaceObject.__)('两栏：分别占三分之二及三分之一宽度'),
  icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
    width: "48",
    height: "48",
    viewBox: "0 0 48 48",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z"
  })),
  innerBlocks: [['core/column', {
    width: '66.66%'
  }], ['core/column', {
    width: '33.33%'
  }]],
  scope: ['block']
}, {
  name: 'three-columns-equal',
  title: (0,external_gc_i18n_namespaceObject.__)('33 / 33 / 33'),
  description: (0,external_gc_i18n_namespaceObject.__)('三栏：栏宽相等'),
  icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
    width: "48",
    height: "48",
    viewBox: "0 0 48 48",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
    fillRule: "evenodd",
    d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z"
  })),
  innerBlocks: [['core/column'], ['core/column'], ['core/column']],
  scope: ['block']
}, {
  name: 'three-columns-wider-center',
  title: (0,external_gc_i18n_namespaceObject.__)('25 / 50 / 25'),
  description: (0,external_gc_i18n_namespaceObject.__)('三栏：中间栏位较宽'),
  icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
    width: "48",
    height: "48",
    viewBox: "0 0 48 48",
    xmlns: "http://www.w3.org/2000/svg"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
    fillRule: "evenodd",
    d: "M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z"
  })),
  innerBlocks: [['core/column', {
    width: '25%'
  }], ['core/column', {
    width: '50%'
  }], ['core/column', {
    width: '25%'
  }]],
  scope: ['block']
}];
/* harmony default export */ var columns_variations = (variations);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/columns/transforms.js
/**
 * GeChiUI 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_gc_blocks_namespaceObject.createBlock)('core/columns', {}, (0,external_gc_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_gc_blocks_namespaceObject.createBlock)('core/columns', {
        align,
        backgroundColor,
        textColor,
        style,
        verticalAlignment
      }, (0,external_gc_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate));
    }
  }],
  ungroup: (attributes, innerBlocks) => innerBlocks.flatMap(innerBlock => innerBlock.innerBlocks)
};
/* harmony default export */ var columns_transforms = (columns_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/columns/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const columns_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/columns",
  title: "栏目",
  category: "design",
  description: "在多列中显示内容，并在每列中添加区块。",
  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,
      __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
      }
    }
  },
  editorStyle: "gc-block-columns-editor",
  style: "gc-block-columns"
};



const {
  name: columns_name
} = columns_metadata;

const columns_settings = {
  icon: library_columns,
  variations: columns_variations,
  example: {
    viewportWidth: 600,
    // Columns collapse "@media (max-width: 599px)".
    innerBlocks: [{
      name: 'core/column',
      innerBlocks: [{
        name: 'core/paragraph',
        attributes: {
          /* translators: example text. */
          content: (0,external_gc_i18n_namespaceObject.__)('一些句子结束了，另一些句子就开始了。等到把沉默都唠叨烦了，懦弱暴躁地翻个身，贪婪入眠。')
        }
      }, {
        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_gc_i18n_namespaceObject.__)('生活解析得太透彻，把日子却过得了一塌糊涂。我们懂得太多，做到的太少，默默的自食其果，然后任岁月蹉跎。')
        }
      }]
    }, {
      name: 'core/column',
      innerBlocks: [{
        name: 'core/paragraph',
        attributes: {
          /* translators: example text. */
          content: (0,external_gc_i18n_namespaceObject.__)('致我们终将逝去的青春在这个喧闹的城市，我们背负了太多的包袱，走过了很多路，吃过了很多苦。寂静夜空，对天仰望，尘世间寻找心灵的安慰，我希望这些文字感动了你。')
        }
      }, {
        name: 'core/paragraph',
        attributes: {
          /* translators: example text. */
          content: (0,external_gc_i18n_namespaceObject.__)('有时候，真的不知道什么叫做结束，仿佛世上不存在绝对的存在与逝去。---题记人生是一辆驶向坟墓的列车，途中会经过很多站，每一站都会有人上车，同时也会有人下车。')
        }
      }]
    }]
  },
  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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/post-comments.js


/**
 * GeChiUI dependencies
 */

const postComments = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var post_comments = (postComments);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments/deprecated.js


/**
 * GeChiUI 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_gc_blockEditor_namespaceObject.useBlockProps.save();
    const {
      className
    } = blockProps;
    const classes = className?.split(' ') || []; // The ID of the previous version of the block
    // didn't have the `gc-block-comments` class,
    // so we need to remove it here in order to mimic it.

    const newClasses = classes?.filter(cls => cls !== 'gc-block-comments');
    const newBlockProps = { ...blockProps,
      className: newClasses.join(' ')
    };
    return (0,external_gc_element_namespaceObject.createElement)(Tag, { ...newBlockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
  }

};
/* harmony default export */ var comments_deprecated = ([v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments/edit/comments-inspector-controls.js


/**
 * GeChiUI dependencies
 */



function CommentsInspectorControls({
  attributes: {
    tagName
  },
  setAttributes
}) {
  const htmlElementMessages = {
    section: (0,external_gc_i18n_namespaceObject.__)("<section>元素应该代表文档的一个独立部分，不能用另一个元素更好地表示。"),
    aside: (0,external_gc_i18n_namespaceObject.__)("<aside>元素应代表文档的一部分，其内容仅与文档的主要内容间接相关。")
  };
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "advanced"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('HTML 元素'),
    options: [{
      label: (0,external_gc_i18n_namespaceObject.__)('默认（<div>）'),
      value: 'div'
    }, {
      label: '<section>',
      value: 'section'
    }, {
      label: '<aside>',
      value: 'aside'
    }],
    value: tagName,
    onChange: value => setAttributes({
      tagName: value
    }),
    help: htmlElementMessages[tagName]
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-comments-form/form.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */








const CommentsFormPlaceholder = () => {
  const instanceId = (0,external_gc_compose_namespaceObject.useInstanceId)(CommentsFormPlaceholder);
  return (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "comment-respond"
  }, (0,external_gc_element_namespaceObject.createElement)("h3", {
    className: "comment-reply-title"
  }, (0,external_gc_i18n_namespaceObject.__)('发表回复')), (0,external_gc_element_namespaceObject.createElement)("form", {
    noValidate: true,
    className: "comment-form",
    inert: "true"
  }, (0,external_gc_element_namespaceObject.createElement)("p", null, (0,external_gc_element_namespaceObject.createElement)("label", {
    htmlFor: `comment-${instanceId}`
  }, (0,external_gc_i18n_namespaceObject.__)('评论')), (0,external_gc_element_namespaceObject.createElement)("textarea", {
    id: `comment-${instanceId}`,
    name: "comment",
    cols: "45",
    rows: "8"
  })), (0,external_gc_element_namespaceObject.createElement)("p", {
    className: "form-submit gc-block-button"
  }, (0,external_gc_element_namespaceObject.createElement)("input", {
    name: "submit",
    type: "submit",
    className: classnames_default()('gc-block-button__link', (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')),
    label: (0,external_gc_i18n_namespaceObject.__)('发表评论'),
    value: (0,external_gc_i18n_namespaceObject.__)('发表评论')
  }))));
};

const CommentsForm = ({
  postId,
  postType
}) => {
  const [commentStatus, setCommentStatus] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', postType, 'comment_status', postId);
  const isSiteEditor = postType === undefined || postId === undefined;
  const {
    defaultCommentStatus
  } = (0,external_gc_data_namespaceObject.useSelect)(select => select(external_gc_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings);
  const postTypeSupportsComments = (0,external_gc_data_namespaceObject.useSelect)(select => postType ? !!select(external_gc_coreData_namespaceObject.store).getPostType(postType)?.supports.comments : false);

  if (!isSiteEditor && 'open' !== commentStatus) {
    if ('closed' === commentStatus) {
      const actions = [(0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
        key: "enableComments",
        onClick: () => setCommentStatus('open'),
        variant: "primary"
      }, (0,external_gc_i18n_namespaceObject._x)('Enable comments', 'action that affects the current post'))];
      return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, {
        actions: actions
      }, (0,external_gc_i18n_namespaceObject.__)('评论表单区块：尚未对此项目启用评论。'));
    } else if (!postTypeSupportsComments) {
      return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.sprintf)(
      /* translators: 1: Post type (i.e. "post", "page") */
      (0,external_gc_i18n_namespaceObject.__)('评论表单区块：尚未对此文章类型（%s）启用评论。'), postType));
    } else if ('open' !== defaultCommentStatus) {
      return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('评论表单区块：评论未启用。'));
    }
  }

  return (0,external_gc_element_namespaceObject.createElement)(CommentsFormPlaceholder, null);
};

/* harmony default export */ var post_comments_form_form = (CommentsForm);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments/edit/placeholder.js


/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */


function PostCommentsPlaceholder({
  postType,
  postId
}) {
  let [postTitle] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
  postTitle = postTitle || (0,external_gc_i18n_namespaceObject.__)('文章标题');
  const {
    avatarURL
  } = (0,external_gc_data_namespaceObject.useSelect)(select => select(external_gc_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings);
  return (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-comments__legacy-placeholder",
    inert: "true"
  }, (0,external_gc_element_namespaceObject.createElement)("h3", null,
  /* translators: %s: Post title. */
  (0,external_gc_i18n_namespaceObject.sprintf)((0,external_gc_i18n_namespaceObject.__)('《%s》 有 1 条评论'), postTitle)), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "navigation"
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "alignleft"
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#top"
  }, "\xAB ", (0,external_gc_i18n_namespaceObject.__)('上一页'))), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "alignright"
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#top"
  }, (0,external_gc_i18n_namespaceObject.__)('下一页'), " \xBB"))), (0,external_gc_element_namespaceObject.createElement)("ol", {
    className: "commentlist"
  }, (0,external_gc_element_namespaceObject.createElement)("li", {
    className: "comment even thread-even depth-1"
  }, (0,external_gc_element_namespaceObject.createElement)("article", {
    className: "comment-body"
  }, (0,external_gc_element_namespaceObject.createElement)("footer", {
    className: "comment-meta"
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "comment-author vcard"
  }, (0,external_gc_element_namespaceObject.createElement)("img", {
    alt: (0,external_gc_i18n_namespaceObject.__)('评论头像'),
    src: avatarURL,
    className: "avatar avatar-32 photo",
    height: "32",
    width: "32",
    loading: "lazy"
  }), (0,external_gc_element_namespaceObject.createElement)("b", {
    className: "fn"
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#top",
    className: "url"
  }, (0,external_gc_i18n_namespaceObject.__)('一位GeChiUI评论者'))), ' ', (0,external_gc_element_namespaceObject.createElement)("span", {
    className: "says"
  }, (0,external_gc_i18n_namespaceObject.__)('说'), ":")), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "comment-metadata"
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#top"
  }, (0,external_gc_element_namespaceObject.createElement)("time", {
    dateTime: "2000-01-01T00:00:00+00:00"
  }, (0,external_gc_i18n_namespaceObject.__)('2000年1月1日上午12:00'))), ' ', (0,external_gc_element_namespaceObject.createElement)("span", {
    className: "edit-link"
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    className: "comment-edit-link",
    href: "#top"
  }, (0,external_gc_i18n_namespaceObject.__)('编辑'))))), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "comment-content"
  }, (0,external_gc_element_namespaceObject.createElement)("p", null, (0,external_gc_i18n_namespaceObject.__)('您好，这是一则评论。'), (0,external_gc_element_namespaceObject.createElement)("br", null), (0,external_gc_i18n_namespaceObject.__)('要开始管理、编辑和删除评论，请前往仪表盘的评论页面。'), (0,external_gc_element_namespaceObject.createElement)("br", null), (0,external_gc_element_namespaceObject.createInterpolateElement)((0,external_gc_i18n_namespaceObject.__)('评论者头像来自 <a>Gravatar</a>'), {
    a: // eslint-disable-next-line jsx-a11y/anchor-has-content
    (0,external_gc_element_namespaceObject.createElement)("a", {
      href: "https://gravatar.com/"
    })
  }))), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "reply"
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    className: "comment-reply-link",
    href: "#top",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('回复GeChiUI评论')
  }, (0,external_gc_i18n_namespaceObject.__)('回复')))))), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "navigation"
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "alignleft"
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#top"
  }, "\xAB ", (0,external_gc_i18n_namespaceObject.__)('上一页'))), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "alignright"
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#top"
  }, (0,external_gc_i18n_namespaceObject.__)('下一页'), " \xBB"))), (0,external_gc_element_namespaceObject.createElement)(post_comments_form_form, {
    postId: postId,
    postType: postType
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments/edit/comments-legacy.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */




/**
 * Internal dependencies
 */


function CommentsLegacy({
  attributes,
  setAttributes,
  context: {
    postType,
    postId
  }
}) {
  const {
    textAlign
  } = attributes;
  const actions = [(0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    key: "convert",
    onClick: () => void setAttributes({
      legacy: false
    }),
    variant: "primary"
  }, (0,external_gc_i18n_namespaceObject.__)('切换到编辑模式'))];
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, {
    actions: actions
  }, (0,external_gc_i18n_namespaceObject.__)('注释块：您当前正在使用该块的旧版本。以下只是一个占位符-最终样式可能会有所不同。为了获得更好的表示和更多的自定义选项，将块切换到其可编辑模式。')), (0,external_gc_element_namespaceObject.createElement)(PostCommentsPlaceholder, {
    postId: postId,
    postType: postType
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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 */ var template = (TEMPLATE);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments/edit/index.js


/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */




function CommentsEdit(props) {
  const {
    attributes,
    setAttributes
  } = props;
  const {
    tagName: TagName,
    legacy
  } = attributes;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    template: template
  });

  if (legacy) {
    return (0,external_gc_element_namespaceObject.createElement)(CommentsLegacy, { ...props
    });
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(CommentsInspectorControls, {
    attributes: attributes,
    setAttributes: setAttributes
  }), (0,external_gc_element_namespaceObject.createElement)(TagName, { ...innerBlocksProps
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments/save.js


/**
 * GeChiUI dependencies
 */

function comments_save_save({
  attributes: {
    tagName: Tag,
    legacy
  }
}) {
  const blockProps = external_gc_blockEditor_namespaceObject.useBlockProps.save();
  const innerBlocksProps = external_gc_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 : (0,external_gc_element_namespaceObject.createElement)(Tag, { ...innerBlocksProps
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comments_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comments",
  title: "评论",
  category: "theme",
  description: "一个允许使用不同视觉配置显示评论的高级区块。",
  textdomain: "default",
  attributes: {
    tagName: {
      type: "string",
      "default": "div"
    },
    legacy: {
      type: "boolean",
      "default": false
    }
  },
  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
      }
    }
  },
  editorStyle: "gc-block-comments-editor",
  usesContext: ["postId", "postType"]
};



const {
  name: comments_name
} = comments_metadata;

const comments_settings = {
  icon: post_comments,
  edit: CommentsEdit,
  save: comments_save_save,
  deprecated: comments_deprecated
};
const comments_init = () => initBlock({
  name: comments_name,
  metadata: comments_metadata,
  settings: comments_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-author-avatar/edit.js


/**
 * GeChiUI dependencies
 */





function edit_Edit({
  attributes,
  context: {
    commentId
  },
  setAttributes,
  isSelected
}) {
  const {
    height,
    width
  } = attributes;
  const [avatars] = (0,external_gc_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId);
  const [authorName] = (0,external_gc_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_gc_blockEditor_namespaceObject.useBlockProps)();
  const spacingProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes);
  const maxSizeBuffer = Math.floor(maxSize * 2.5);
  const {
    avatarURL
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSettings
    } = select(external_gc_blockEditor_namespaceObject.store);
    const {
      __experimentalDiscussionSettings
    } = getSettings();
    return __experimentalDiscussionSettings;
  });
  const inspectorControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('头像设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('图片尺寸'),
    onChange: newWidth => setAttributes({
      width: newWidth,
      height: newWidth
    }),
    min: minSize,
    max: maxSizeBuffer,
    initialPosition: width,
    value: width
  })));
  const resizableAvatar = (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_i18n_namespaceObject.isRTL)(),
      bottom: true,
      left: (0,external_gc_i18n_namespaceObject.isRTL)()
    },
    minWidth: minSize,
    maxWidth: maxSizeBuffer
  }, (0,external_gc_element_namespaceObject.createElement)("img", {
    src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : avatarURL,
    alt: `${authorName} ${(0,external_gc_i18n_namespaceObject.__)('头像')}`,
    ...blockProps
  }));
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, inspectorControls, (0,external_gc_element_namespaceObject.createElement)("div", { ...spacingProps
  }, resizableAvatar));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-author-avatar/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comment_author_avatar_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  __experimental: "fse",
  name: "core/comment-author-avatar",
  title: "评论作者头像（已弃用）",
  category: "theme",
  ancestor: ["core/comment-template"],
  description: "此块已弃用。请使用头像块。",
  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
    }
  }
};

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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/comment-author-name.js


/**
 * GeChiUI dependencies
 */

const commentAuthorName = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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"
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_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"
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Circle, {
  cx: "12",
  cy: "9",
  r: "2",
  fillRule: "evenodd",
  clipRule: "evenodd"
}));
/* harmony default export */ var comment_author_name = (commentAuthorName);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-author-name/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  let displayName = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getEntityRecord
    } = select(external_gc_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_gc_i18n_namespaceObject.__)('匿名');
    }

    return authorName !== null && authorName !== void 0 ? authorName : '';
  }, [commentId]);
  const blockControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: newAlign => setAttributes({
      textAlign: newAlign
    })
  }));
  const inspectorControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('链接至作者网址'),
    onChange: () => setAttributes({
      isLink: !isLink
    }),
    checked: isLink
  }), isLink && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新窗口打开'),
    onChange: value => setAttributes({
      linkTarget: value ? '_blank' : '_self'
    }),
    checked: linkTarget === '_blank'
  })));

  if (!commentId || !displayName) {
    displayName = (0,external_gc_i18n_namespaceObject._x)('评论者', 'block title');
  }

  const displayAuthor = isLink ? (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#comment-author-pseudo-link",
    onClick: event => event.preventDefault()
  }, displayName) : displayName;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, inspectorControls, blockControls, (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, displayAuthor));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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 */ var comment_author_name_deprecated = ([deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-author-name/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comment_author_name_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comment-author-name",
  title: "评论者名称",
  category: "theme",
  ancestor: ["core/comment-template"],
  description: "显示评论者的名称。",
  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
      }
    }
  }
};


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
};
const comment_author_name_init = () => initBlock({
  name: comment_author_name_name,
  metadata: comment_author_name_metadata,
  settings: comment_author_name_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/comment-content.js


/**
 * GeChiUI dependencies
 */

const commentContent = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var comment_content = (commentContent);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-content/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  const [content] = (0,external_gc_coreData_namespaceObject.useEntityProp)('root', 'comment', 'content', commentId);
  const blockControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: newAlign => setAttributes({
      textAlign: newAlign
    })
  }));

  if (!commentId || !content) {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, blockControls, (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)("p", null, (0,external_gc_i18n_namespaceObject._x)('评论内容', 'block title'))));
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, blockControls, (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Disabled, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.RawHTML, {
    key: "html"
  }, content.rendered))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-content/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comment_content_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comment-content",
  title: "评论内容",
  category: "theme",
  ancestor: ["core/comment-template"],
  description: "显示评论的内容。",
  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
      }
    },
    spacing: {
      padding: ["horizontal", "vertical"],
      __experimentalDefaultControls: {
        padding: true
      }
    },
    html: false
  }
};

const {
  name: comment_content_name
} = comment_content_metadata;

const comment_content_settings = {
  icon: comment_content,
  edit: comment_content_edit_Edit
};
const comment_content_init = () => initBlock({
  name: comment_content_name,
  metadata: comment_content_metadata,
  settings: comment_content_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/post-date.js


/**
 * GeChiUI dependencies
 */

const postDate = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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"
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var post_date = (postDate);

;// CONCATENATED MODULE: external ["gc","date"]
var external_gc_date_namespaceObject = window["gc"]["date"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-date/edit.js


/**
 * GeChiUI 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_gc_blockEditor_namespaceObject.useBlockProps)();
  let [date] = (0,external_gc_coreData_namespaceObject.useEntityProp)('root', 'comment', 'date', commentId);
  const [siteFormat = (0,external_gc_date_namespaceObject.getSettings)().formats.date] = (0,external_gc_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
  const inspectorControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalDateFormatPicker, {
    format: format,
    defaultFormat: siteFormat,
    onChange: nextFormat => setAttributes({
      format: nextFormat
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('链接至评论'),
    onChange: () => setAttributes({
      isLink: !isLink
    }),
    checked: isLink
  })));

  if (!commentId || !date) {
    date = (0,external_gc_i18n_namespaceObject._x)('评论日期', 'block title');
  }

  let commentDate = date instanceof Date ? (0,external_gc_element_namespaceObject.createElement)("time", {
    dateTime: (0,external_gc_date_namespaceObject.dateI18n)('c', date)
  }, (0,external_gc_date_namespaceObject.dateI18n)(format || siteFormat, date)) : (0,external_gc_element_namespaceObject.createElement)("time", null, date);

  if (isLink) {
    commentDate = (0,external_gc_element_namespaceObject.createElement)("a", {
      href: "#comment-date-pseudo-link",
      onClick: event => event.preventDefault()
    }, commentDate);
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, inspectorControls, (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, commentDate));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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 */ var comment_date_deprecated = ([comment_date_deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-date/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comment_date_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comment-date",
  title: "评论日期",
  category: "theme",
  ancestor: ["core/comment-template"],
  description: "显示评论发表的日期。",
  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
      }
    }
  }
};


const {
  name: comment_date_name
} = comment_date_metadata;

const comment_date_settings = {
  icon: post_date,
  edit: comment_date_edit_Edit,
  deprecated: comment_date_deprecated
};
const comment_date_init = () => initBlock({
  name: comment_date_name,
  metadata: comment_date_metadata,
  settings: comment_date_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/comment-edit-link.js


/**
 * GeChiUI dependencies
 */

const commentEditLink = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  width: "24",
  height: "24",
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var comment_edit_link = (commentEditLink);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-edit-link/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */




function comment_edit_link_edit_Edit({
  attributes: {
    linkTarget,
    textAlign
  },
  setAttributes
}) {
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  const blockControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: newAlign => setAttributes({
      textAlign: newAlign
    })
  }));
  const inspectorControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新窗口打开'),
    onChange: value => setAttributes({
      linkTarget: value ? '_blank' : '_self'
    }),
    checked: linkTarget === '_blank'
  })));
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#edit-comment-pseudo-link",
    onClick: event => event.preventDefault()
  }, (0,external_gc_i18n_namespaceObject.__)('编辑'))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-edit-link/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comment_edit_link_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comment-edit-link",
  title: "评论编辑链接",
  category: "theme",
  ancestor: ["core/comment-template"],
  description: "显示一个通向 GeChiUI 仪表盘中编辑评论的链接。此链接仅对于具有编辑权限的用户可见。",
  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
    },
    typography: {
      fontSize: true,
      lineHeight: true,
      __experimentalFontFamily: true,
      __experimentalFontWeight: true,
      __experimentalFontStyle: true,
      __experimentalTextTransform: true,
      __experimentalTextDecoration: true,
      __experimentalLetterSpacing: true,
      __experimentalDefaultControls: {
        fontSize: true
      }
    }
  }
};

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
};
const comment_edit_link_init = () => initBlock({
  name: comment_edit_link_name,
  metadata: comment_edit_link_metadata,
  settings: comment_edit_link_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/comment-reply-link.js


/**
 * GeChiUI dependencies
 */

const commentReplyLink = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  width: "24",
  height: "24",
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var comment_reply_link = (commentReplyLink);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-reply-link/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  const blockControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: newAlign => setAttributes({
      textAlign: newAlign
    })
  }));
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, blockControls, (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#comment-reply-pseudo-link",
    onClick: event => event.preventDefault()
  }, (0,external_gc_i18n_namespaceObject.__)('回复'))));
}

/* harmony default export */ var comment_reply_link_edit = (comment_reply_link_edit_Edit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-reply-link/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comment_reply_link_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comment-reply-link",
  title: "评论回复链接",
  category: "theme",
  ancestor: ["core/comment-template"],
  description: "显示用于回复评论的链接。",
  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
    },
    typography: {
      fontSize: true,
      lineHeight: true,
      __experimentalFontFamily: true,
      __experimentalFontWeight: true,
      __experimentalFontStyle: true,
      __experimentalTextTransform: true,
      __experimentalTextDecoration: true,
      __experimentalLetterSpacing: true,
      __experimentalDefaultControls: {
        fontSize: true
      }
    },
    html: false
  }
};

const {
  name: comment_reply_link_name
} = comment_reply_link_metadata;

const comment_reply_link_settings = {
  edit: comment_reply_link_edit,
  icon: comment_reply_link
};
const comment_reply_link_init = () => initBlock({
  name: comment_reply_link_name,
  metadata: comment_reply_link_metadata,
  settings: comment_reply_link_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/layout.js


/**
 * GeChiUI dependencies
 */

const layout = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_layout = (layout);

;// CONCATENATED MODULE: external ["gc","apiFetch"]
var external_gc_apiFetch_namespaceObject = window["gc"]["apiFetch"];
var external_gc_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_gc_apiFetch_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-template/hooks.js
/**
 * GeChiUI dependencies
 */




 // This is limited by GC 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_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSettings
    } = select(external_gc_blockEditor_namespaceObject.store);
    const {
      __experimentalDiscussionSettings
    } = getSettings();
    return __experimentalDiscussionSettings;
  }); // GC 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_gc_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-GC-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_gc_element_namespaceObject.useState)({});
  const key = `${postId}_${perPage}`;
  const page = defaultPages[key] || 0;
  (0,external_gc_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_gc_apiFetch_default()({
      path: (0,external_gc_url_namespaceObject.addQueryArgs)('/gc/v2/comments', { ...queryArgs,
        post: postId,
        per_page: perPage,
        _fields: 'id'
      }),
      method: 'HEAD',
      parse: false
    }).then(res => {
      const pages = parseInt(res.headers.get('X-GC-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_gc_element_namespaceObject.useMemo)(() => topLevelComments?.map(({
    id,
    _embedded
  }) => {
    const [children] = _embedded?.children || [[]];
    return {
      commentId: id,
      children: children.map(child => ({
        commentId: child.id
      }))
    };
  }), [topLevelComments]);
  return commentTree;
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-template/edit.js


/**
 * GeChiUI 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 {GCElement}                 		Inner blocks of the Comment Template
 */


function CommentTemplateInnerBlocks({
  comment,
  activeCommentId,
  setActiveCommentId,
  firstCommentId,
  blocks
}) {
  const {
    children,
    ...innerBlocksProps
  } = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)({}, {
    template: edit_TEMPLATE
  });
  return (0,external_gc_element_namespaceObject.createElement)("li", { ...innerBlocksProps
  }, comment.commentId === (activeCommentId || firstCommentId) ? children : null, (0,external_gc_element_namespaceObject.createElement)(MemoizedCommentTemplatePreview, {
    blocks: blocks,
    commentId: comment.commentId,
    setActiveCommentId: setActiveCommentId,
    isHidden: comment.commentId === (activeCommentId || firstCommentId)
  }), comment?.children?.length > 0 ? (0,external_gc_element_namespaceObject.createElement)(CommentsList, {
    comments: comment.children,
    activeCommentId: activeCommentId,
    setActiveCommentId: setActiveCommentId,
    blocks: blocks,
    firstCommentId: firstCommentId
  }) : null);
}

const CommentTemplatePreview = ({
  blocks,
  commentId,
  setActiveCommentId,
  isHidden
}) => {
  const blockPreviewProps = (0,external_gc_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
    blocks
  });

  const handleOnClick = () => {
    setActiveCommentId(commentId);
  }; // We have to hide the preview block if the `comment` props points to
  // the curently 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 (0,external_gc_element_namespaceObject.createElement)("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_gc_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 {GCElement}                 		List of comments.
 */

const CommentsList = ({
  comments,
  blockProps,
  activeCommentId,
  setActiveCommentId,
  blocks,
  firstCommentId
}) => (0,external_gc_element_namespaceObject.createElement)("ol", { ...blockProps
}, comments && comments.map(({
  commentId,
  ...comment
}, index) => (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockContextProvider, {
  key: comment.commentId || index,
  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 reqested from the REST API.
    commentId: commentId < 0 ? null : commentId
  }
}, (0,external_gc_element_namespaceObject.createElement)(CommentTemplateInnerBlocks, {
  comment: {
    commentId,
    ...comment
  },
  activeCommentId: activeCommentId,
  setActiveCommentId: setActiveCommentId,
  blocks: blocks,
  firstCommentId: firstCommentId
}))));

function CommentTemplateEdit({
  clientId,
  context: {
    postId
  }
}) {
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  const [activeCommentId, setActiveCommentId] = (0,external_gc_element_namespaceObject.useState)();
  const {
    commentOrder,
    threadCommentsDepth,
    threadComments,
    commentsPerPage,
    pageComments
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSettings
    } = select(external_gc_blockEditor_namespaceObject.store);
    return getSettings().__experimentalDiscussionSettings;
  });
  const commentQuery = useCommentQueryArgs({
    postId
  });
  const {
    topLevelComments,
    blocks
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getEntityRecords
    } = select(external_gc_coreData_namespaceObject.store);
    const {
      getBlocks
    } = select(external_gc_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 (0,external_gc_element_namespaceObject.createElement)("p", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null));
  }

  if (!postId) {
    commentTree = getCommentsPlaceholder({
      perPage: commentsPerPage,
      pageComments,
      threadComments,
      threadCommentsDepth
    });
  }

  if (!commentTree.length) {
    return (0,external_gc_element_namespaceObject.createElement)("p", { ...blockProps
    }, (0,external_gc_i18n_namespaceObject.__)('未找到结果。'));
  }

  return (0,external_gc_element_namespaceObject.createElement)(CommentsList, {
    comments: commentTree,
    blockProps: blockProps,
    blocks: blocks,
    activeCommentId: activeCommentId,
    setActiveCommentId: setActiveCommentId,
    firstCommentId: commentTree[0]?.commentId
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-template/save.js


/**
 * GeChiUI dependencies
 */

function CommentTemplateSave() {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comment-template/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comment_template_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comment-template",
  title: "评论模板",
  category: "design",
  parent: ["core/comments"],
  description: "包含用于显示评论的区块元素，例如标题、日期、作者、头像等。",
  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
      }
    }
  },
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/query-pagination-previous.js


/**
 * GeChiUI dependencies
 */

const queryPaginationPrevious = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var query_pagination_previous = (queryPaginationPrevious);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-pagination-previous/edit.js


/**
 * GeChiUI dependencies
 */


const arrowMap = {
  none: '',
  arrow: '←',
  chevron: '«'
};
function CommentsPaginationPreviousEdit({
  attributes: {
    label
  },
  setAttributes,
  context: {
    'comments/paginationArrow': paginationArrow
  }
}) {
  const displayArrow = arrowMap[paginationArrow];
  return (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#comments-pagination-previous-pseudo-link",
    onClick: event => event.preventDefault(),
    ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)()
  }, displayArrow && (0,external_gc_element_namespaceObject.createElement)("span", {
    className: `gc-block-comments-pagination-previous-arrow is-arrow-${paginationArrow}`
  }, displayArrow), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.PlainText, {
    __experimentalVersion: 2,
    tagName: "span",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('上一页页面的链接'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('上一页'),
    value: label,
    onChange: newLabel => setAttributes({
      label: newLabel
    })
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-pagination-previous/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comments_pagination_previous_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comments-pagination-previous",
  title: "评论上一页",
  category: "theme",
  parent: ["core/comments-pagination"],
  description: "显示上一页评论的页面链接。",
  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
      }
    }
  }
};

const {
  name: comments_pagination_previous_name
} = comments_pagination_previous_metadata;

const comments_pagination_previous_settings = {
  icon: query_pagination_previous,
  edit: CommentsPaginationPreviousEdit
};
const comments_pagination_previous_init = () => initBlock({
  name: comments_pagination_previous_name,
  metadata: comments_pagination_previous_metadata,
  settings: comments_pagination_previous_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/query-pagination.js


/**
 * GeChiUI dependencies
 */

const queryPagination = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z"
}));
/* harmony default export */ var query_pagination = (queryPagination);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.js


/**
 * GeChiUI dependencies
 */


function CommentsPaginationArrowControls({
  value,
  onChange
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('箭'),
    value: value,
    onChange: onChange,
    help: (0,external_gc_i18n_namespaceObject.__)('附加到下一页和上一页评论链接的装饰箭头。'),
    isBlock: true
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "none",
    label: (0,external_gc_i18n_namespaceObject._x)('无', 'Arrow option for Comments Pagination Next/Previous blocks')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "arrow",
    label: (0,external_gc_i18n_namespaceObject._x)('Arrow', 'Arrow option for Comments Pagination Next/Previous blocks')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "chevron",
    label: (0,external_gc_i18n_namespaceObject._x)('Chevron', 'Arrow option for Comments Pagination Next/Previous blocks')
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-pagination/edit.js


/**
 * GeChiUI dependencies
 */




/**
 * Internal dependencies
 */


const comments_pagination_edit_TEMPLATE = [['core/comments-pagination-previous'], ['core/comments-pagination-numbers'], ['core/comments-pagination-next']];
const comments_pagination_edit_ALLOWED_BLOCKS = ['core/comments-pagination-previous', 'core/comments-pagination-numbers', 'core/comments-pagination-next'];
function QueryPaginationEdit({
  attributes: {
    paginationArrow
  },
  setAttributes,
  clientId
}) {
  const hasNextPreviousBlocks = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlocks
    } = select(external_gc_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_gc_blockEditor_namespaceObject.useBlockProps)();
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    template: comments_pagination_edit_TEMPLATE,
    allowedBlocks: comments_pagination_edit_ALLOWED_BLOCKS
  }); // Get the Discussion settings

  const pageComments = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSettings
    } = select(external_gc_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 (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('评论分页区块：评论分页功能已在讨论设置中停用'));
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, hasNextPreviousBlocks && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(CommentsPaginationArrowControls, {
    value: paginationArrow,
    onChange: value => {
      setAttributes({
        paginationArrow: value
      });
    }
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-pagination/save.js


/**
 * GeChiUI dependencies
 */

function comments_pagination_save_save() {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-pagination/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comments_pagination_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comments-pagination",
  title: "评论分页",
  category: "theme",
  parent: ["core/comments"],
  description: "如果适用，显示下一组/上一组评论的分页导航。",
  textdomain: "default",
  attributes: {
    paginationArrow: {
      type: "string",
      "default": "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
      }
    }
  },
  editorStyle: "gc-block-comments-pagination-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/query-pagination-next.js


/**
 * GeChiUI dependencies
 */

const queryPaginationNext = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var query_pagination_next = (queryPaginationNext);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-pagination-next/edit.js


/**
 * GeChiUI dependencies
 */


const edit_arrowMap = {
  none: '',
  arrow: '→',
  chevron: '»'
};
function CommentsPaginationNextEdit({
  attributes: {
    label
  },
  setAttributes,
  context: {
    'comments/paginationArrow': paginationArrow
  }
}) {
  const displayArrow = edit_arrowMap[paginationArrow];
  return (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#comments-pagination-next-pseudo-link",
    onClick: event => event.preventDefault(),
    ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)()
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.PlainText, {
    __experimentalVersion: 2,
    tagName: "span",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('下一页页面的链接'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('下一页'),
    value: label,
    onChange: newLabel => setAttributes({
      label: newLabel
    })
  }), displayArrow && (0,external_gc_element_namespaceObject.createElement)("span", {
    className: `gc-block-comments-pagination-next-arrow is-arrow-${paginationArrow}`
  }, displayArrow));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-pagination-next/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comments_pagination_next_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comments-pagination-next",
  title: "评论下一页",
  category: "theme",
  parent: ["core/comments-pagination"],
  description: "显示下一页评论的页面链接。",
  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
      }
    }
  }
};

const {
  name: comments_pagination_next_name
} = comments_pagination_next_metadata;

const comments_pagination_next_settings = {
  icon: query_pagination_next,
  edit: CommentsPaginationNextEdit
};
const comments_pagination_next_init = () => initBlock({
  name: comments_pagination_next_name,
  metadata: comments_pagination_next_metadata,
  settings: comments_pagination_next_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/query-pagination-numbers.js


/**
 * GeChiUI dependencies
 */

const queryPaginationNumbers = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var query_pagination_numbers = (queryPaginationNumbers);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-pagination-numbers/edit.js


/**
 * GeChiUI dependencies
 */


const PaginationItem = ({
  content,
  tag: Tag = 'a',
  extraClass = ''
}) => Tag === 'a' ? (0,external_gc_element_namespaceObject.createElement)(Tag, {
  className: `page-numbers ${extraClass}`,
  href: "#comments-pagination-numbers-pseudo-link",
  onClick: event => event.preventDefault()
}, content) : (0,external_gc_element_namespaceObject.createElement)(Tag, {
  className: `page-numbers ${extraClass}`
}, content);

function CommentsPaginationNumbersEdit() {
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)()
  }, (0,external_gc_element_namespaceObject.createElement)(PaginationItem, {
    content: "1"
  }), (0,external_gc_element_namespaceObject.createElement)(PaginationItem, {
    content: "2"
  }), (0,external_gc_element_namespaceObject.createElement)(PaginationItem, {
    content: "3",
    tag: "span",
    extraClass: "current"
  }), (0,external_gc_element_namespaceObject.createElement)(PaginationItem, {
    content: "4"
  }), (0,external_gc_element_namespaceObject.createElement)(PaginationItem, {
    content: "5"
  }), (0,external_gc_element_namespaceObject.createElement)(PaginationItem, {
    content: "...",
    tag: "span",
    extraClass: "dots"
  }), (0,external_gc_element_namespaceObject.createElement)(PaginationItem, {
    content: "8"
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-pagination-numbers/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comments_pagination_numbers_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comments-pagination-numbers",
  title: "评论分页页码",
  category: "theme",
  parent: ["core/comments-pagination"],
  description: "显示评论分页的页码列表。",
  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
      }
    }
  }
};

const {
  name: comments_pagination_numbers_name
} = comments_pagination_numbers_metadata;

const comments_pagination_numbers_settings = {
  icon: query_pagination_numbers,
  edit: CommentsPaginationNumbersEdit
};
const comments_pagination_numbers_init = () => initBlock({
  name: comments_pagination_numbers_name,
  metadata: comments_pagination_numbers_metadata,
  settings: comments_pagination_numbers_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/title.js


/**
 * GeChiUI dependencies
 */

const title = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "https://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_title = (title);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-title/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */









function comments_title_edit_Edit({
  attributes: {
    textAlign,
    showPostTitle,
    showCommentsCount,
    level
  },
  setAttributes,
  context: {
    postType,
    postId
  }
}) {
  const TagName = 'h' + level;
  const [commentsCount, setCommentsCount] = (0,external_gc_element_namespaceObject.useState)();
  const [rawTitle] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
  const isSiteEditor = typeof postId === 'undefined';
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  const {
    threadCommentsDepth,
    threadComments,
    commentsPerPage,
    pageComments
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSettings
    } = select(external_gc_blockEditor_namespaceObject.store);
    return getSettings().__experimentalDiscussionSettings;
  });
  (0,external_gc_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_gc_apiFetch_default()({
      path: (0,external_gc_url_namespaceObject.addQueryArgs)('/gc/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-GC-Total')));
      }
    }).catch(() => {
      setCommentsCount(0);
    });
  }, [postId]);
  const blockControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: newAlign => setAttributes({
      textAlign: newAlign
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.HeadingLevelDropdown, {
    value: level,
    onChange: newLevel => setAttributes({
      level: newLevel
    })
  }));
  const inspectorControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示文章标题'),
    checked: showPostTitle,
    onChange: value => setAttributes({
      showPostTitle: value
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示评论计数'),
    checked: showCommentsCount,
    onChange: value => setAttributes({
      showCommentsCount: value
    })
  })));
  const postTitle = isSiteEditor ? (0,external_gc_i18n_namespaceObject.__)('“文章标题”') : `"${rawTitle}"`;
  let placeholder;

  if (showCommentsCount && commentsCount !== undefined) {
    if (showPostTitle) {
      if (commentsCount === 1) {
        /* translators: %s: Post title. */
        placeholder = (0,external_gc_i18n_namespaceObject.sprintf)((0,external_gc_i18n_namespaceObject.__)('《%s》 有 1 条评论'), postTitle);
      } else {
        placeholder = (0,external_gc_i18n_namespaceObject.sprintf)(
        /* translators: 1: Number of comments, 2: Post title. */
        (0,external_gc_i18n_namespaceObject._n)('《%2$s》 有 %1$s 条评论', '%1$s responses to %2$s', commentsCount), commentsCount, postTitle);
      }
    } else if (commentsCount === 1) {
      placeholder = (0,external_gc_i18n_namespaceObject.__)('1 条回复');
    } else {
      placeholder = (0,external_gc_i18n_namespaceObject.sprintf)(
      /* translators: %s: Number of comments. */
      (0,external_gc_i18n_namespaceObject._n)('%s 条回复', '%s responses', commentsCount), commentsCount);
    }
  } else if (showPostTitle) {
    if (commentsCount === 1) {
      /* translators: %s: Post title. */
      placeholder = (0,external_gc_i18n_namespaceObject.sprintf)((0,external_gc_i18n_namespaceObject.__)('%s 的回复'), postTitle);
    } else {
      /* translators: %s: Post title. */
      placeholder = (0,external_gc_i18n_namespaceObject.sprintf)((0,external_gc_i18n_namespaceObject.__)('%s 的回复'), postTitle);
    }
  } else if (commentsCount === 1) {
    placeholder = (0,external_gc_i18n_namespaceObject.__)('回复');
  } else {
    placeholder = (0,external_gc_i18n_namespaceObject.__)('回复');
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
  }, placeholder));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-title/deprecated.js
/**
 * Internal dependencies
 */
const deprecated_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comments-title",
  title: "评论标题",
  category: "theme",
  ancestor: ["core/comments"],
  description: "显示包含评论数量的标题",
  textdomain: "default",
  usesContext: ["postId", "postType"],
  attributes: {
    textAlign: {
      type: "string"
    },
    showPostTitle: {
      type: "boolean",
      "default": true
    },
    showCommentsCount: {
      type: "boolean",
      "default": true
    },
    level: {
      type: "number",
      "default": 2
    }
  },
  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
      }
    }
  }
};
const {
  attributes,
  supports
} = deprecated_metadata;
/* harmony default export */ var 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
}]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/comments-title/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const comments_title_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/comments-title",
  title: "评论标题",
  category: "theme",
  ancestor: ["core/comments"],
  description: "显示包含评论数量的标题",
  textdomain: "default",
  usesContext: ["postId", "postType"],
  attributes: {
    textAlign: {
      type: "string"
    },
    showPostTitle: {
      type: "boolean",
      "default": true
    },
    showCommentsCount: {
      type: "boolean",
      "default": true
    },
    level: {
      type: "number",
      "default": 2
    }
  },
  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
      }
    }
  }
};


const {
  name: comments_title_name
} = comments_title_metadata;

const comments_title_settings = {
  icon: library_title,
  edit: comments_title_edit_Edit,
  deprecated: comments_title_deprecated
};
const comments_title_init = () => initBlock({
  name: comments_title_name,
  metadata: comments_title_metadata,
  settings: comments_title_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/cover.js


/**
 * GeChiUI dependencies
 */

const cover = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_cover = (cover);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/cover/shared.js
/**
 * GeChiUI 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(setAttributes, dimRatio) {
  return media => {
    if (!media || !media.url) {
      setAttributes({
        url: undefined,
        id: undefined
      });
      return;
    }

    if ((0,external_gc_blob_namespaceObject.isBlobURL)(media.url)) {
      media.type = (0,external_gc_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;
      }
    } else {
      // For media selections originated from existing files in the media library.
      if (media.type !== IMAGE_BACKGROUND_TYPE && media.type !== VIDEO_BACKGROUND_TYPE) {
        return;
      }

      mediaType = media.type;
    }

    setAttributes({
      dimRatio: dimRatio === 100 ? 50 : dimRatio,
      url: media.url,
      id: media.id,
      alt: media?.alt,
      backgroundType: mediaType,
      focalPoint: undefined,
      ...(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];
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/cover/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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 v8ToV10BlockAttributes = {
  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 v7toV10BlockSupports = {
  anchor: true,
  align: true,
  html: false,
  spacing: {
    padding: true,
    __experimentalDefaultControls: {
      padding: true
    }
  },
  color: {
    __experimentalDuotone: '> .gc-block-cover__image-background, > .gc-block-cover__video-background',
    text: false,
    background: false
  }
}; // Deprecation for blocks that does not have a HTML tag option.

const deprecated_v11 = {
  attributes: v8ToV10BlockAttributes,
  supports: v7toV10BlockSupports,

  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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);

    const gradientClass = (0,external_gc_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 = classnames_default()({
      'is-light': !isDark,
      'has-parallax': hasParallax,
      'is-repeated': isRepeated,
      'has-custom-content-position': !isContentPositionCenter(contentPosition)
    }, getPositionClassName(contentPosition));
    const imgClasses = classnames_default()('gc-block-cover__image-background', id ? `gc-image-${id}` : null, {
      'has-parallax': hasParallax,
      'is-repeated': isRepeated
    });
    const gradientValue = gradient || customGradient;
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: classes,
        style
      })
    }, (0,external_gc_element_namespaceObject.createElement)("span", {
      "aria-hidden": "true",
      className: classnames_default()('gc-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
        'has-background-dim': dimRatio !== undefined,
        // For backwards compatibility. Former versions of the Cover Block applied
        // `.gc-block-cover__gradient-background` in the presence of
        // media, a gradient and a dim.
        'gc-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
        'has-background-gradient': gradientValue,
        [gradientClass]: gradientClass
      }),
      style: bgStyle
    }), !useFeaturedImage && isImageBackground && url && (isImgElement ? (0,external_gc_element_namespaceObject.createElement)("img", {
      className: imgClasses,
      alt: alt,
      src: url,
      style: {
        objectPosition
      },
      "data-object-fit": "cover",
      "data-object-position": objectPosition
    }) : (0,external_gc_element_namespaceObject.createElement)("div", {
      role: "img",
      className: imgClasses,
      style: {
        backgroundPosition,
        backgroundImage
      }
    })), isVideoBackground && url && (0,external_gc_element_namespaceObject.createElement)("video", {
      className: classnames_default()('gc-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
    }), (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save({
        className: 'gc-block-cover__inner-container'
      })
    }));
  },

  migrate: migrateTag
}; // Deprecation for blocks that renders fixed background as backgroud from the main block container.

const deprecated_v10 = {
  attributes: v8ToV10BlockAttributes,
  supports: v7toV10BlockSupports,

  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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);

    const gradientClass = (0,external_gc_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 = classnames_default()({
      'is-light': !isDark,
      'has-parallax': hasParallax,
      'is-repeated': isRepeated,
      'has-custom-content-position': !isContentPositionCenter(contentPosition)
    }, getPositionClassName(contentPosition));
    const gradientValue = gradient || customGradient;
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: classes,
        style
      })
    }, (0,external_gc_element_namespaceObject.createElement)("span", {
      "aria-hidden": "true",
      className: classnames_default()('gc-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
        'has-background-dim': dimRatio !== undefined,
        // For backwards compatibility. Former versions of the Cover Block applied
        // `.gc-block-cover__gradient-background` in the presence of
        // media, a gradient and a dim.
        'gc-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
        'has-background-gradient': gradientValue,
        [gradientClass]: gradientClass
      }),
      style: bgStyle
    }), !useFeaturedImage && isImageBackground && isImgElement && url && (0,external_gc_element_namespaceObject.createElement)("img", {
      className: classnames_default()('gc-block-cover__image-background', id ? `gc-image-${id}` : null),
      alt: alt,
      src: url,
      style: {
        objectPosition
      },
      "data-object-fit": "cover",
      "data-object-position": objectPosition
    }), isVideoBackground && url && (0,external_gc_element_namespaceObject.createElement)("video", {
      className: classnames_default()('gc-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
    }), (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save({
        className: 'gc-block-cover__inner-container'
      })
    }));
  },

  migrate: migrateTag
}; // Deprecation for blocks with `minHeightUnit` set but no `minHeight`.

const v9 = {
  attributes: v8ToV10BlockAttributes,
  supports: v7toV10BlockSupports,

  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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);

    const gradientClass = (0,external_gc_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 = classnames_default()({
      'is-light': !isDark,
      'has-parallax': hasParallax,
      'is-repeated': isRepeated,
      'has-custom-content-position': !isContentPositionCenter(contentPosition)
    }, getPositionClassName(contentPosition));
    const gradientValue = gradient || customGradient;
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: classes,
        style
      })
    }, (0,external_gc_element_namespaceObject.createElement)("span", {
      "aria-hidden": "true",
      className: classnames_default()('gc-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
        'has-background-dim': dimRatio !== undefined,
        // For backwards compatibility. Former versions of the Cover Block applied
        // `.gc-block-cover__gradient-background` in the presence of
        // media, a gradient and a dim.
        'gc-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
        'has-background-gradient': gradientValue,
        [gradientClass]: gradientClass
      }),
      style: bgStyle
    }), isImageBackground && isImgElement && url && (0,external_gc_element_namespaceObject.createElement)("img", {
      className: classnames_default()('gc-block-cover__image-background', id ? `gc-image-${id}` : null),
      alt: alt,
      src: url,
      style: {
        objectPosition
      },
      "data-object-fit": "cover",
      "data-object-position": objectPosition
    }), isVideoBackground && url && (0,external_gc_element_namespaceObject.createElement)("video", {
      className: classnames_default()('gc-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
    }), (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save({
        className: 'gc-block-cover__inner-container'
      })
    }));
  },

  migrate: migrateTag
}; // v8: deprecated to remove duplicated gradient classes and swap `gc-block-cover__gradient-background` for `gc-block-cover__background`.

const v8 = {
  attributes: v8ToV10BlockAttributes,
  supports: v7toV10BlockSupports,

  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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);

    const gradientClass = (0,external_gc_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 = classnames_default()({
      'is-light': !isDark,
      'has-parallax': hasParallax,
      'is-repeated': isRepeated,
      'has-custom-content-position': !isContentPositionCenter(contentPosition)
    }, getPositionClassName(contentPosition));
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: classes,
        style
      })
    }, (0,external_gc_element_namespaceObject.createElement)("span", {
      "aria-hidden": "true",
      className: classnames_default()(overlayColorClass, dimRatioToClass(dimRatio), 'gc-block-cover__gradient-background', gradientClass, {
        'has-background-dim': dimRatio !== undefined,
        'has-background-gradient': gradient || customGradient,
        [gradientClass]: !url && gradientClass
      }),
      style: bgStyle
    }), isImageBackground && isImgElement && url && (0,external_gc_element_namespaceObject.createElement)("img", {
      className: classnames_default()('gc-block-cover__image-background', id ? `gc-image-${id}` : null),
      alt: alt,
      src: url,
      style: {
        objectPosition
      },
      "data-object-fit": "cover",
      "data-object-position": objectPosition
    }), isVideoBackground && url && (0,external_gc_element_namespaceObject.createElement)("video", {
      className: classnames_default()('gc-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
    }), (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save({
        className: 'gc-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: v7toV10BlockSupports,

  save({
    attributes
  }) {
    const {
      backgroundType,
      gradient,
      contentPosition,
      customGradient,
      customOverlayColor,
      dimRatio,
      focalPoint,
      hasParallax,
      isRepeated,
      overlayColor,
      url,
      alt,
      id,
      minHeight: minHeightProp,
      minHeightUnit
    } = attributes;
    const overlayColorClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);

    const gradientClass = (0,external_gc_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 = classnames_default()(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 (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: classes,
        style
      })
    }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_gc_element_namespaceObject.createElement)("span", {
      "aria-hidden": "true",
      className: classnames_default()('gc-block-cover__gradient-background', gradientClass),
      style: customGradient ? {
        background: customGradient
      } : undefined
    }), isImageBackground && isImgElement && url && (0,external_gc_element_namespaceObject.createElement)("img", {
      className: classnames_default()('gc-block-cover__image-background', id ? `gc-image-${id}` : null),
      alt: alt,
      src: url,
      style: {
        objectPosition
      },
      "data-object-fit": "cover",
      "data-object-position": objectPosition
    }), isVideoBackground && url && (0,external_gc_element_namespaceObject.createElement)("video", {
      className: classnames_default()('gc-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
    }), (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-cover__inner-container"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  },

  migrate: (0,external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);

    const gradientClass = (0,external_gc_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 = classnames_default()(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 (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: classes,
        style
      })
    }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_gc_element_namespaceObject.createElement)("span", {
      "aria-hidden": "true",
      className: classnames_default()('gc-block-cover__gradient-background', gradientClass),
      style: customGradient ? {
        background: customGradient
      } : undefined
    }), isVideoBackground && url && (0,external_gc_element_namespaceObject.createElement)("video", {
      className: "gc-block-cover__video-background",
      autoPlay: true,
      muted: true,
      loop: true,
      playsInline: true,
      src: url,
      style: videoStyle
    }), (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-cover__inner-container"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  },

  migrate: (0,external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);

    const gradientClass = (0,external_gc_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 = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
      'has-background-dim': dimRatio !== 0,
      'has-parallax': hasParallax,
      'has-background-gradient': customGradient,
      [gradientClass]: !url && gradientClass
    });
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: classes,
      style: style
    }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_gc_element_namespaceObject.createElement)("span", {
      "aria-hidden": "true",
      className: classnames_default()('gc-block-cover__gradient-background', gradientClass),
      style: customGradient ? {
        background: customGradient
      } : undefined
    }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_gc_element_namespaceObject.createElement)("video", {
      className: "gc-block-cover__video-background",
      autoPlay: true,
      muted: true,
      loop: true,
      src: url
    }), (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-cover__inner-container"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  },

  migrate: (0,external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);

    const gradientClass = (0,external_gc_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 = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
      'has-background-dim': dimRatio !== 0,
      'has-parallax': hasParallax,
      'has-background-gradient': customGradient,
      [gradientClass]: !url && gradientClass
    });
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: classes,
      style: style
    }, url && (gradient || customGradient) && dimRatio !== 0 && (0,external_gc_element_namespaceObject.createElement)("span", {
      "aria-hidden": "true",
      className: classnames_default()('gc-block-cover__gradient-background', gradientClass),
      style: customGradient ? {
        background: customGradient
      } : undefined
    }), VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_gc_element_namespaceObject.createElement)("video", {
      className: "gc-block-cover__video-background",
      autoPlay: true,
      muted: true,
      loop: true,
      src: url
    }), (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-cover__inner-container"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  },

  migrate: (0,external_gc_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_gc_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 = classnames_default()(dimRatioToClassV1(dimRatio), overlayColorClass, {
      'has-background-dim': dimRatio !== 0,
      'has-parallax': hasParallax,
      [`has-${contentAlign}-content`]: contentAlign !== 'center'
    });
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: classes,
      style: style
    }, VIDEO_BACKGROUND_TYPE === backgroundType && url && (0,external_gc_element_namespaceObject.createElement)("video", {
      className: "gc-block-cover__video-background",
      autoPlay: true,
      muted: true,
      loop: true,
      src: url
    }), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "p",
      className: "gc-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_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
      content: attributes.title,
      align: attributes.contentAlign,
      fontSize: 'large',
      placeholder: (0,external_gc_i18n_namespaceObject.__)('编写标题...' )
    })]];
  }

};
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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);
    const style = backgroundImageStyles(url);

    if (!overlayColorClass) {
      style.backgroundColor = customOverlayColor;
    }

    const classes = classnames_default()('gc-block-cover-image', dimRatioToClassV1(dimRatio), overlayColorClass, {
      'has-background-dim': dimRatio !== 0,
      'has-parallax': hasParallax,
      [`has-${contentAlign}-content`]: contentAlign !== 'center'
    }, align ? `align${align}` : null);
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: classes,
      style: style
    }, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(title) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "p",
      className: "gc-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_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
      content: attributes.title,
      align: attributes.contentAlign,
      fontSize: 'large',
      placeholder: (0,external_gc_i18n_namespaceObject.__)('编写标题...' )
    })]];
  }

};
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 = classnames_default()('gc-block-cover-image', dimRatioToClassV1(dimRatio), {
      'has-background-dim': dimRatio !== 0,
      'has-parallax': hasParallax
    }, align ? `align${align}` : null);
    return (0,external_gc_element_namespaceObject.createElement)("section", {
      className: classes,
      style: style
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
      content: attributes.title,
      align: attributes.contentAlign,
      fontSize: 'large',
      placeholder: (0,external_gc_i18n_namespaceObject.__)('编写标题...' )
    })]];
  }

};
/* harmony default export */ var cover_deprecated = ([deprecated_v11, deprecated_v10, v9, v8, v7, v6, v5, v4, v3, v2, cover_deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/colord/index.mjs
var 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)*(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()})};

;// CONCATENATED MODULE: ./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"])}

;// CONCATENATED MODULE: ./node_modules/fast-average-color/dist/index.esm.js
/*! Fast Average Color | © 2023 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;
}

var DEFAULT_DOMINANT_DIVIDER = 24;
function dominantAlgorithm(arr, len, options) {
    var colorHash = {};
    var divider = options.dominantDivider || DEFAULT_DOMINANT_DIVIDER;
    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;
    }
    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() 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,
            dominantDivider: options.dominantDivider,
        });
    };
    /**
     * 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;
}());



;// CONCATENATED MODULE: external ["gc","hooks"]
var external_gc_hooks_namespaceObject = window["gc"]["hooks"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/cover/edit/use-cover-is-dark.js
/**
 * External dependencies
 */


/**
 * GeChiUI dependencies
 */




function retrieveFastAverageColor() {
  if (!retrieveFastAverageColor.fastAverageColor) {
    retrieveFastAverageColor.fastAverageColor = new FastAverageColor();
  }

  return retrieveFastAverageColor.fastAverageColor;
}
/**
 * useCoverIsDark is a hook that returns a boolean variable specifying if the cover
 * background is dark or not.
 *
 * @param {?string} url          Url of the media background.
 * @param {?number} dimRatio     Transparency of the overlay color. If an image and
 *                               color are set, dimRatio is used to decide what is used
 *                               for background darkness checking purposes.
 * @param {?string} overlayColor String containing the overlay color value if one exists.
 *
 * @return {boolean} True if the cover background is considered "dark" and false otherwise.
 */


function useCoverIsDark(url, dimRatio = 50, overlayColor) {
  const [isDark, setIsDark] = (0,external_gc_element_namespaceObject.useState)(false);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    // If opacity is lower than 50 the dominant color is the image or video color,
    // so use that color for the dark mode computation.
    if (url && dimRatio <= 50) {
      const imgCrossOrigin = (0,external_gc_hooks_namespaceObject.applyFilters)('media.crossOrigin', undefined, url);
      retrieveFastAverageColor().getColorAsync(url, {
        // Previously the default color was white, but that changed
        // in v6.0.0 so it has to be manually set now.
        defaultColor: [255, 255, 255, 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
      }).then(color => setIsDark(color.isDark));
    }
  }, [url, url && dimRatio <= 50, setIsDark]);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    // If opacity is greater than 50 the dominant color is the overlay color,
    // so use that color for the dark mode computation.
    if (dimRatio > 50 || !url) {
      if (!overlayColor) {
        // If no overlay color exists the overlay color is black (isDark )
        setIsDark(true);
        return;
      }

      setIsDark(w(overlayColor).isDark());
    }
  }, [overlayColor, dimRatio > 50 || !url, setIsDark]);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!url && !overlayColor) {
      // Reset isDark.
      setIsDark(false);
    }
  }, [!url && !overlayColor, setIsDark]);
  return isDark;
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/cover/edit/inspector-controls.js


/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */



function CoverHeightInput({
  onChange,
  onUnitChange,
  unit = 'px',
  value = ''
}) {
  const instanceId = (0,external_gc_compose_namespaceObject.useInstanceId)(external_gc_components_namespaceObject.__experimentalUnitControl);
  const inputId = `block-cover-height-input-${instanceId}`;
  const isPx = unit === 'px';
  const units = (0,external_gc_components_namespaceObject.__experimentalUseCustomUnits)({
    availableUnits: (0,external_gc_blockEditor_namespaceObject.useSetting)('spacing.units') || ['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_gc_element_namespaceObject.useMemo)(() => {
    const [parsedQuantity] = (0,external_gc_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
    return [parsedQuantity, unit].join('');
  }, [unit, value]);
  const min = isPx ? COVER_MIN_HEIGHT : 0;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalUnitControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('覆盖最小高度'),
    id: inputId,
    isResetValueOnUnitChange: true,
    min: min,
    onChange: handleOnChange,
    onUnitChange: onUnitChange,
    __unstableInputWidth: '80px',
    units: units,
    value: computedValue
  });
}

function CoverInspectorControls({
  attributes,
  setAttributes,
  clientId,
  setOverlayColor,
  coverRef,
  currentSettings
}) {
  const {
    useFeaturedImage,
    dimRatio,
    focalPoint,
    hasParallax,
    isRepeated,
    minHeight,
    minHeightUnit,
    alt,
    tagName
  } = attributes;
  const {
    isVideoBackground,
    isImageBackground,
    mediaElement,
    url,
    isImgElement,
    overlayColor
  } = currentSettings;

  const {
    gradientValue,
    setGradient
  } = (0,external_gc_blockEditor_namespaceObject.__experimentalUseGradient)();

  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_gc_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
  const htmlElementMessages = {
    header: (0,external_gc_i18n_namespaceObject.__)('<header>元素应表示介绍性内容，通常是一组介绍性或导航辅助工具。'),
    main: (0,external_gc_i18n_namespaceObject.__)('<main>元素应仅用于文档的主要内容。'),
    section: (0,external_gc_i18n_namespaceObject.__)("<section>元素应该代表文档的一个独立部分，不能用另一个元素更好地表示。"),
    article: (0,external_gc_i18n_namespaceObject.__)('<article>元素应该代表文档的一个自包含的、可联合的部分。'),
    aside: (0,external_gc_i18n_namespaceObject.__)("<aside>元素应代表文档的一部分，其内容仅与文档的主要内容间接相关。"),
    footer: (0,external_gc_i18n_namespaceObject.__)('<footer>元素应表示其最近的分段元素的页脚（例如：<section>、<article>、<main>等）。')
  };
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, !!url && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('媒体设置')
  }, isImageBackground && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('固定背景'),
    checked: hasParallax,
    onChange: toggleParallax
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('重复背景'),
    checked: isRepeated,
    onChange: toggleIsRepeated
  })), showFocalPointPicker && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FocalPointPicker, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('焦点选择器'),
    url: url,
    value: focalPoint,
    onDragStart: imperativeFocalPointPreview,
    onDrag: imperativeFocalPointPreview,
    onChange: newFocalPoint => setAttributes({
      focalPoint: newFocalPoint
    })
  }), !useFeaturedImage && url && isImageBackground && isImgElement && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextareaControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('替代文本'),
    value: alt,
    onChange: newAlt => setAttributes({
      alt: newAlt
    }),
    help: (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ExternalLink, {
      href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
    }, (0,external_gc_i18n_namespaceObject.__)('说明此图片的用途')), (0,external_gc_element_namespaceObject.createElement)("br", null), (0,external_gc_i18n_namespaceObject.__)('如果是装饰性的，请留空。'))
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelRow, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "secondary",
    isSmall: true,
    className: "block-library-cover__reset-button",
    onClick: () => setAttributes({
      url: undefined,
      id: undefined,
      backgroundType: undefined,
      focalPoint: undefined,
      hasParallax: undefined,
      isRepeated: undefined,
      useFeaturedImage: false
    })
  }, (0,external_gc_i18n_namespaceObject.__)('清除媒体'))))), colorGradientSettings.hasColorsOrGradients && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "color"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, {
    __experimentalIsRenderedInSidebar: true,
    settings: [{
      colorValue: overlayColor.color,
      gradientValue,
      label: (0,external_gc_i18n_namespaceObject.__)('覆盖'),
      onColorChange: setOverlayColor,
      onGradientChange: setGradient,
      isShownByDefault: true,
      resetAllFilter: () => ({
        overlayColor: undefined,
        customOverlayColor: undefined,
        gradient: undefined,
        customGradient: undefined
      })
    }],
    panelId: clientId,
    ...colorGradientSettings
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_i18n_namespaceObject.__)('覆盖不透明度'),
    onDeselect: () => setAttributes({
      dimRatio: url ? 50 : 100
    }),
    resetAllFilter: () => ({
      dimRatio: url ? 50 : 100
    }),
    isShownByDefault: true,
    panelId: clientId
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('覆盖不透明度'),
    value: dimRatio,
    onChange: newDimRation => setAttributes({
      dimRatio: newDimRation
    }),
    min: 0,
    max: 100,
    step: 10,
    required: true
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "dimensions"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    hasValue: () => !!minHeight,
    label: (0,external_gc_i18n_namespaceObject.__)('最小高度'),
    onDeselect: () => setAttributes({
      minHeight: undefined,
      minHeightUnit: undefined
    }),
    resetAllFilter: () => ({
      minHeight: undefined,
      minHeightUnit: undefined
    }),
    isShownByDefault: true,
    panelId: clientId
  }, (0,external_gc_element_namespaceObject.createElement)(CoverHeightInput, {
    value: minHeight,
    unit: minHeightUnit,
    onChange: newMinHeight => setAttributes({
      minHeight: newMinHeight
    }),
    onUnitChange: nextUnit => setAttributes({
      minHeightUnit: nextUnit
    })
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "advanced"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('HTML 元素'),
    options: [{
      label: (0,external_gc_i18n_namespaceObject.__)('默认（<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]
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/cover/edit/block-controls.js


/**
 * GeChiUI dependencies
 */



/**
 * Internal dependencies
 */


function CoverBlockControls({
  attributes,
  setAttributes,
  onSelectMedia,
  currentSettings,
  toggleUseFeaturedImage
}) {
  const {
    contentPosition,
    id,
    useFeaturedImage,
    minHeight,
    minHeightUnit
  } = attributes;
  const {
    hasInnerBlocks,
    url
  } = currentSettings;
  const [prevMinHeightValue, setPrevMinHeightValue] = (0,external_gc_element_namespaceObject.useState)(minHeight);
  const [prevMinHeightUnit, setPrevMinHeightUnit] = (0,external_gc_element_namespaceObject.useState)(minHeightUnit);
  const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100;

  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.

    return setAttributes({
      minHeight: 100,
      minHeightUnit: 'vh'
    });
  };

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalBlockAlignmentMatrixControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('更改内容位置'),
    value: contentPosition,
    onChange: nextPosition => setAttributes({
      contentPosition: nextPosition
    }),
    isDisabled: !hasInnerBlocks
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalBlockFullHeightAligmentControl, {
    isActive: isMinFullHeight,
    onToggle: toggleMinFullHeight,
    isDisabled: !hasInnerBlocks
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "other"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_i18n_namespaceObject.__)('添加媒体') : (0,external_gc_i18n_namespaceObject.__)('替换')
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/cover/edit/cover-placeholder.js


/**
 * GeChiUI dependencies
 */



/**
 * Internal dependencies
 */


function CoverPlaceholder({
  disableMediaButtons = false,
  children,
  onSelectMedia,
  onError,
  style,
  toggleUseFeaturedImage
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaPlaceholder, {
    icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
      icon: library_cover
    }),
    labels: {
      title: (0,external_gc_i18n_namespaceObject.__)('封面'),
      instructions: (0,external_gc_i18n_namespaceObject.__)('将媒体拖拽到此区块上，上传媒体或从媒体库中选择现有媒体。')
    },
    onSelect: onSelectMedia,
    accept: "image/*,video/*",
    allowedTypes: shared_ALLOWED_MEDIA_TYPES,
    disableMediaButtons: disableMediaButtons,
    onToggleFeaturedImage: toggleUseFeaturedImage,
    onError: onError,
    style: style
  }, children);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/cover/edit/resizable-cover-popover.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_blockEditor_namespaceObject.privateApis);
function ResizableCoverPopover({
  className,
  height,
  minHeight,
  onResize,
  onResizeStart,
  onResizeStop,
  showHandle,
  size,
  width,
  ...props
}) {
  const [isResizing, setIsResizing] = (0,external_gc_element_namespaceObject.useState)(false);
  const dimensions = (0,external_gc_element_namespaceObject.useMemo)(() => ({
    height,
    minHeight,
    width
  }), [minHeight, height, width]);
  const resizableBoxProps = {
    className: classnames_default()(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 (0,external_gc_element_namespaceObject.createElement)(ResizableBoxPopover, {
    className: "block-library-cover__resizable-box-popover",
    __unstableRefreshSize: dimensions,
    resizableBoxProps: resizableBoxProps,
    ...props
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/cover/edit/index.js


/**
 * External dependencies
 */



/**
 * GeChiUI dependencies
 */










/**
 * Internal dependencies
 */







k([names]);

function getInnerBlocksTemplate(attributes) {
  return [['core/paragraph', {
    align: 'center',
    placeholder: (0,external_gc_i18n_namespaceObject.__)('编写标题...' ),
    ...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_gc_blob_namespaceObject.isBlobURL)(url);

function CoverEdit({
  attributes,
  clientId,
  isSelected,
  overlayColor,
  setAttributes,
  setOverlayColor,
  toggleSelection,
  context: {
    postId,
    postType
  }
}) {
  const {
    contentPosition,
    id,
    useFeaturedImage,
    dimRatio,
    focalPoint,
    hasParallax,
    isDark,
    isRepeated,
    minHeight,
    minHeightUnit,
    alt,
    allowedBlocks,
    templateLock,
    tagName: TagName = 'div'
  } = attributes;
  const [featuredImage] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId);
  const media = (0,external_gc_data_namespaceObject.useSelect)(select => featuredImage && select(external_gc_coreData_namespaceObject.store).getMedia(featuredImage, {
    context: 'view'
  }), [featuredImage]);
  const mediaUrl = media?.source_url; // 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 `gc_kses`.
  attributes.url?.replaceAll('&amp;', '&');
  const backgroundType = useFeaturedImage ? IMAGE_BACKGROUND_TYPE : attributes.backgroundType;
  const {
    __unstableMarkNextChangeAsNotPersistent
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const {
    createErrorNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);

  const {
    gradientClass,
    gradientValue
  } = (0,external_gc_blockEditor_namespaceObject.__experimentalUseGradient)();

  const onSelectMedia = attributesFromMedia(setAttributes, dimRatio);
  const isUploadingMedia = isTemporaryMedia(id, url);

  const onUploadError = message => {
    createErrorNotice(message, {
      type: 'snackbar'
    });
  };

  const isCoverDark = useCoverIsDark(url, dimRatio, overlayColor.color);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    // This side-effect should not create an undo level.
    __unstableMarkNextChangeAsNotPersistent();

    setAttributes({
      isDark: isCoverDark
    });
  }, [isCoverDark]);
  const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType;
  const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType;
  const [resizeListener, {
    height,
    width
  }] = (0,external_gc_compose_namespaceObject.useResizeObserver)();
  const resizableBoxDimensions = (0,external_gc_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_gc_data_namespaceObject.useSelect)(select => select(external_gc_blockEditor_namespaceObject.store).getBlock(clientId).innerBlocks.length > 0, [clientId]);
  const ref = (0,external_gc_element_namespaceObject.useRef)();
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    ref
  }); // Check for fontSize support before we pass a fontSize attribute to the innerBlocks.

  const hasFontSizes = !!(0,external_gc_blockEditor_namespaceObject.useSetting)('typography.fontSizes')?.length;
  const innerBlocksTemplate = getInnerBlocksTemplate({
    fontSize: hasFontSizes ? 'large' : undefined
  });
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)({
    className: 'gc-block-cover__inner-container'
  }, {
    // Avoid template sync when the `templateLock` value is `all` or `contentOnly`.
    // See: https://github.com/GeChiUI/gutenberg/pull/45632
    template: !hasInnerBlocks ? innerBlocksTemplate : undefined,
    templateInsertUpdatesSelection: true,
    allowedBlocks,
    templateLock
  });
  const mediaElement = (0,external_gc_element_namespaceObject.useRef)();
  const currentSettings = {
    isVideoBackground,
    isImageBackground,
    mediaElement,
    hasInnerBlocks,
    url,
    isImgElement,
    overlayColor
  };

  const toggleUseFeaturedImage = () => {
    setAttributes({
      id: undefined,
      url: undefined,
      useFeaturedImage: !useFeaturedImage,
      dimRatio: dimRatio === 100 ? 50 : dimRatio,
      backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : undefined
    });
  };

  const blockControls = (0,external_gc_element_namespaceObject.createElement)(CoverBlockControls, {
    attributes: attributes,
    setAttributes: setAttributes,
    onSelectMedia: onSelectMedia,
    currentSettings: currentSettings,
    toggleUseFeaturedImage: toggleUseFeaturedImage
  });
  const inspectorControls = (0,external_gc_element_namespaceObject.createElement)(CoverInspectorControls, {
    attributes: attributes,
    setAttributes: setAttributes,
    clientId: clientId,
    setOverlayColor: setOverlayColor,
    coverRef: ref,
    currentSettings: currentSettings,
    toggleUseFeaturedImage: toggleUseFeaturedImage
  });
  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
      });
    },
    showHandle: true,
    size: resizableBoxDimensions,
    width
  };

  if (!useFeaturedImage && !hasInnerBlocks && !hasBackground) {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, blockControls, inspectorControls, isSelected && (0,external_gc_element_namespaceObject.createElement)(ResizableCoverPopover, { ...resizableCoverProps
    }), (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps,
      className: classnames_default()('is-placeholder', blockProps.className),
      style: { ...blockProps.style,
        minHeight: minHeightWithUnit || undefined
      }
    }, resizeListener, (0,external_gc_element_namespaceObject.createElement)(CoverPlaceholder, {
      onSelectMedia: onSelectMedia,
      onError: onUploadError,
      toggleUseFeaturedImage: toggleUseFeaturedImage
    }, (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-cover__placeholder-background-options"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.ColorPalette, {
      disableCustomColors: true,
      value: overlayColor.color,
      onChange: setOverlayColor,
      clearable: false
    })))));
  }

  const classes = classnames_default()({
    'is-dark-theme': isDark,
    'is-light': !isDark,
    'is-transient': isUploadingMedia,
    'has-parallax': hasParallax,
    'is-repeated': isRepeated,
    'has-custom-content-position': !isContentPositionCenter(contentPosition)
  }, getPositionClassName(contentPosition));
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, blockControls, inspectorControls, (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps,
    className: classnames_default()(classes, blockProps.className),
    style: { ...style,
      ...blockProps.style
    },
    "data-url": url
  }, resizeListener, (!useFeaturedImage || url) && (0,external_gc_element_namespaceObject.createElement)("span", {
    "aria-hidden": "true",
    className: classnames_default()('gc-block-cover__background', dimRatioToClass(dimRatio), {
      [overlayColor.class]: overlayColor.class,
      'has-background-dim': dimRatio !== undefined,
      // For backwards compatibility. Former versions of the Cover Block applied
      // `.gc-block-cover__gradient-background` in the presence of
      // media, a gradient and a dim.
      'gc-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
      'has-background-gradient': gradientValue,
      [gradientClass]: gradientClass
    }),
    style: {
      backgroundImage: gradientValue,
      ...bgStyle
    }
  }), !url && useFeaturedImage && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
    className: "gc-block-cover__image--placeholder-image",
    withIllustration: true
  }), url && isImageBackground && (isImgElement ? (0,external_gc_element_namespaceObject.createElement)("img", {
    ref: mediaElement,
    className: "gc-block-cover__image-background",
    alt: alt,
    src: url,
    style: mediaStyle
  }) : (0,external_gc_element_namespaceObject.createElement)("div", {
    ref: mediaElement,
    role: "img",
    className: classnames_default()(classes, 'gc-block-cover__image-background'),
    style: {
      backgroundImage,
      backgroundPosition
    }
  })), url && isVideoBackground && (0,external_gc_element_namespaceObject.createElement)("video", {
    ref: mediaElement,
    className: "gc-block-cover__video-background",
    autoPlay: true,
    muted: true,
    loop: true,
    src: url,
    style: mediaStyle
  }), isUploadingMedia && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null), (0,external_gc_element_namespaceObject.createElement)(CoverPlaceholder, {
    disableMediaButtons: true,
    onSelectMedia: onSelectMedia,
    onError: onUploadError,
    toggleUseFeaturedImage: toggleUseFeaturedImage
  }), (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  })), isSelected && (0,external_gc_element_namespaceObject.createElement)(ResizableCoverPopover, { ...resizableCoverProps
  }));
}

/* harmony default export */ var cover_edit = ((0,external_gc_compose_namespaceObject.compose)([(0,external_gc_blockEditor_namespaceObject.withColors)({
  overlayColor: 'background-color'
})])(CoverEdit));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/cover/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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
  } = attributes;
  const overlayColorClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor);

  const gradientClass = (0,external_gc_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 = classnames_default()({
    'is-light': !isDark,
    'has-parallax': hasParallax,
    'is-repeated': isRepeated,
    'has-custom-content-position': !isContentPositionCenter(contentPosition)
  }, getPositionClassName(contentPosition));
  const imgClasses = classnames_default()('gc-block-cover__image-background', id ? `gc-image-${id}` : null, {
    'has-parallax': hasParallax,
    'is-repeated': isRepeated
  });
  const gradientValue = gradient || customGradient;
  return (0,external_gc_element_namespaceObject.createElement)(Tag, { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className: classes,
      style
    })
  }, (0,external_gc_element_namespaceObject.createElement)("span", {
    "aria-hidden": "true",
    className: classnames_default()('gc-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), {
      'has-background-dim': dimRatio !== undefined,
      // For backwards compatibility. Former versions of the Cover Block applied
      // `.gc-block-cover__gradient-background` in the presence of
      // media, a gradient and a dim.
      'gc-block-cover__gradient-background': url && gradientValue && dimRatio !== 0,
      'has-background-gradient': gradientValue,
      [gradientClass]: gradientClass
    }),
    style: bgStyle
  }), !useFeaturedImage && isImageBackground && url && (isImgElement ? (0,external_gc_element_namespaceObject.createElement)("img", {
    className: imgClasses,
    alt: alt,
    src: url,
    style: {
      objectPosition
    },
    "data-object-fit": "cover",
    "data-object-position": objectPosition
  }) : (0,external_gc_element_namespaceObject.createElement)("div", {
    role: "img",
    className: imgClasses,
    style: {
      backgroundPosition,
      backgroundImage
    }
  })), isVideoBackground && url && (0,external_gc_element_namespaceObject.createElement)("video", {
    className: classnames_default()('gc-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
  }), (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save({
      className: 'gc-block-cover__inner-container'
    })
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/cover/transforms.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */



const {
  cleanEmptyObject: transforms_cleanEmptyObject
} = unlock(external_gc_blockEditor_namespaceObject.privateApis);
const cover_transforms_transforms = {
  from: [{
    type: 'block',
    blocks: ['core/image'],
    transform: ({
      caption,
      url,
      alt,
      align,
      id,
      anchor,
      style
    }) => (0,external_gc_blocks_namespaceObject.createBlock)('core/cover', {
      dimRatio: 50,
      url,
      alt,
      align,
      id,
      anchor,
      style: {
        color: {
          duotone: style?.color?.duotone
        }
      }
    }, [(0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
      content: caption,
      fontSize: 'large',
      align: 'center'
    })])
  }, {
    type: 'block',
    blocks: ['core/video'],
    transform: ({
      caption,
      src,
      align,
      id,
      anchor
    }) => (0,external_gc_blocks_namespaceObject.createBlock)('core/cover', {
      dimRatio: 50,
      url: src,
      align,
      id,
      backgroundType: VIDEO_BACKGROUND_TYPE,
      anchor
    }, [(0,external_gc_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_gc_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_gc_blocks_namespaceObject.createBlock)('core/cover', parentAttributes, [(0,external_gc_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_gc_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_gc_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_gc_blocks_namespaceObject.createBlock)('core/group', groupAttributes, innerBlocks[0]?.innerBlocks);
        }

        return (0,external_gc_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_gc_blocks_namespaceObject.createBlock)('core/group', { ...attributes,
        ...transformedColorAttributes
      }, innerBlocks);
    }
  }]
};
/* harmony default export */ var cover_transforms = (cover_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/cover/variations.js
/**
 * GeChiUI dependencies
 */


const variations_variations = [{
  name: 'cover',
  title: (0,external_gc_i18n_namespaceObject.__)('封面'),
  description: (0,external_gc_i18n_namespaceObject.__)('添加带有文本叠加层的图片或视频。'),
  attributes: {
    layout: {
      type: 'constrained'
    }
  },
  isDefault: true,
  icon: library_cover
}];
/* harmony default export */ var cover_variations = (variations_variations);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/cover/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const cover_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/cover",
  title: "封面",
  category: "media",
  description: "添加带有文本叠加层的图片或视频。",
  textdomain: "default",
  attributes: {
    url: {
      type: "string"
    },
    useFeaturedImage: {
      type: "boolean",
      "default": false
    },
    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", "contentOnly", false]
    },
    tagName: {
      type: "string",
      "default": "div"
    }
  },
  usesContext: ["postId", "postType"],
  supports: {
    anchor: true,
    align: true,
    html: false,
    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: "> .gc-block-cover__image-background, > .gc-block-cover__video-background",
      text: true,
      background: false,
      __experimentalSkipSerialization: ["gradients"]
    },
    typography: {
      fontSize: true,
      lineHeight: true,
      __experimentalFontFamily: true,
      __experimentalFontWeight: true,
      __experimentalFontStyle: true,
      __experimentalTextTransform: true,
      __experimentalTextDecoration: true,
      __experimentalLetterSpacing: true,
      __experimentalDefaultControls: {
        fontSize: true
      }
    },
    layout: {
      allowJustification: false
    }
  },
  editorStyle: "gc-block-cover-editor",
  style: "gc-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'
    },
    innerBlocks: [{
      name: 'core/paragraph',
      attributes: {
        content: (0,external_gc_i18n_namespaceObject.__)('<strong>雪地巡逻队</strong>'),
        align: 'center',
        style: {
          typography: {
            fontSize: 48
          },
          color: {
            text: 'white'
          }
        }
      }
    }]
  },
  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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/details.js


/**
 * GeChiUI dependencies
 */

const details = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M4 16h10v1.5H4V16Zm0-4.5h16V13H4v-1.5ZM10 7h10v1.5H10V7Z",
  fillRule: "evenodd",
  clipRule: "evenodd"
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "m4 5.25 4 2.5-4 2.5v-5Z"
}));
/* harmony default export */ var library_details = (details);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/details/edit.js


/**
 * GeChiUI dependencies
 */




const details_edit_TEMPLATE = [['core/paragraph', {
  placeholder: (0,external_gc_i18n_namespaceObject.__)('键入/添加隐藏块')
}]];

function DetailsEdit({
  attributes,
  setAttributes,
  clientId
}) {
  const {
    showContent,
    summary
  } = attributes;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    template: details_edit_TEMPLATE,
    __experimentalCaptureToolbars: true
  }); // Check if either the block or the inner blocks are selected.

  const hasSelection = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      isBlockSelected,
      hasSelectedInnerBlock
    } = select(external_gc_blockEditor_namespaceObject.store);
    /* Sets deep to true to also find blocks inside the details content block. */

    return hasSelectedInnerBlock(clientId, true) || isBlockSelected(clientId);
  }, [clientId]);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('默认打开'),
    checked: showContent,
    onChange: () => setAttributes({
      showContent: !showContent
    })
  }))), (0,external_gc_element_namespaceObject.createElement)("details", { ...innerBlocksProps,
    open: hasSelection || showContent
  }, (0,external_gc_element_namespaceObject.createElement)("summary", {
    onClick: event => event.preventDefault()
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('编写摘要'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('编写摘要...' ),
    allowedFormats: [],
    withoutInteractiveFormatting: true,
    value: summary,
    onChange: newSummary => setAttributes({
      summary: newSummary
    }),
    multiline: false
  })), innerBlocksProps.children));
}

/* harmony default export */ var details_edit = (DetailsEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/details/save.js


/**
 * GeChiUI dependencies
 */

function details_save_save({
  attributes
}) {
  const {
    showContent
  } = attributes;
  const summary = attributes.summary ? attributes.summary : 'Details';
  const blockProps = external_gc_blockEditor_namespaceObject.useBlockProps.save();
  return (0,external_gc_element_namespaceObject.createElement)("details", { ...blockProps,
    open: showContent
  }, (0,external_gc_element_namespaceObject.createElement)("summary", null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    value: summary
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/details/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */


const details_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/details",
  title: "详细信息",
  category: "text",
  description: "隐藏与显示更多内容",
  keywords: ["disclosure", "summary", "hide"],
  textdomain: "default",
  attributes: {
    showContent: {
      type: "boolean",
      "default": false
    },
    summary: {
      type: "string"
    }
  },
  supports: {
    align: ["wide", "full"],
    color: {
      gradients: true,
      link: true,
      __experimentalDefaultControls: {
        background: true,
        text: true
      }
    },
    __experimentalBorder: {
      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
      }
    }
  },
  editorStyle: "gc-block-details-editor",
  style: "gc-block-details"
};


const {
  name: details_name
} = details_metadata;

const details_settings = {
  icon: library_details,
  example: {
    attributes: {
      summary: '塞万提斯《唐·吉诃德》',
      showContent: true
    },
    innerBlocks: [{
      name: 'core/paragraph',
      attributes: {
        content: (0,external_gc_i18n_namespaceObject.__)('曼查有个地方，地名就不用提了，不久前住着一位贵族。他那类贵族，矛架上有一支长矛，还有一面皮盾、一匹瘦马和一只猎兔狗。')
      }
    }]
  },
  save: details_save_save,
  edit: details_edit
};
const details_init = () => initBlock({
  name: details_name,
  metadata: details_metadata,
  settings: details_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/pencil.js


/**
 * GeChiUI dependencies
 */

const pencil = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_pencil = (pencil);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/edit.js
/**
 * Internal dependencies
 */

/* harmony default export */ var library_edit = (library_pencil);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/embed-controls.js


/**
 * GeChiUI dependencies
 */





function getResponsiveHelp(checked) {
  return checked ? (0,external_gc_i18n_namespaceObject.__)('在浏览器尺寸变化时，此嵌入会保持其高宽比。') : (0,external_gc_i18n_namespaceObject.__)('在浏览器尺寸变化时，此嵌入可能不会保持其高宽比。');
}

const EmbedControls = ({
  blockSupportsResponsive,
  showEditButton,
  themeSupportsResponsive,
  allowResponsive,
  toggleResponsive,
  switchBackToURLInput
}) => (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, showEditButton && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
  className: "components-toolbar__control",
  label: (0,external_gc_i18n_namespaceObject.__)('编辑URL'),
  icon: library_edit,
  onClick: switchBackToURLInput
}))), themeSupportsResponsive && blockSupportsResponsive && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
  title: (0,external_gc_i18n_namespaceObject.__)('媒体设置'),
  className: "blocks-responsive"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
  __nextHasNoMarginBottom: true,
  label: (0,external_gc_i18n_namespaceObject.__)('为小设备调整尺寸'),
  checked: allowResponsive,
  help: getResponsiveHelp,
  onChange: toggleResponsive
}))));

/* harmony default export */ var embed_controls = (EmbedControls);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/icons.js


/**
 * GeChiUI dependencies
 */

const embedContentIcon = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 embedGeChiUIIcon = {
  foreground: '#0073AA',
  src: (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
    viewBox: "0 0 24 24"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.G, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
    d: "M14.033 1.195a2.387 2.387 0 0 1-.87 3.235l-6.98 4.04a.602.602 0 0 0-.3.522v6.342a.6.6 0 0 0 .3.521l5.524 3.199a.585.585 0 0 0 .586 0l5.527-3.199a.603.603 0 0 0 .299-.52V11.39l-4.969 2.838a2.326 2.326 0 0 1-3.19-.9 2.388 2.388 0 0 1 .89-3.23l7.108-4.062C20.123 4.8 22.8 6.384 22.8 8.901v6.914a4.524 4.524 0 0 1-2.245 3.919l-6.345 3.672a4.407 4.407 0 0 1-4.422 0l-6.344-3.672A4.524 4.524 0 0 1 1.2 15.816V8.51a4.524 4.524 0 0 1 2.245-3.918l7.393-4.28a2.326 2.326 0 0 1 3.195.883z"
  })))
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/embed-loading.js


/**
 * GeChiUI dependencies
 */


const EmbedLoading = () => (0,external_gc_element_namespaceObject.createElement)("div", {
  className: "gc-block-embed is-loading"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null));

/* harmony default export */ var embed_loading = (EmbedLoading);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/embed-placeholder.js


/**
 * GeChiUI dependencies
 */




const EmbedPlaceholder = ({
  icon,
  label,
  value,
  onSubmit,
  onChange,
  cannotEmbed,
  fallback,
  tryAgain
}) => {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
    icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
      icon: icon,
      showColors: true
    }),
    label: label,
    className: "gc-block-embed",
    instructions: (0,external_gc_i18n_namespaceObject.__)('粘贴至您希望显示的系统内容的链接。')
  }, (0,external_gc_element_namespaceObject.createElement)("form", {
    onSubmit: onSubmit
  }, (0,external_gc_element_namespaceObject.createElement)("input", {
    type: "url",
    value: value || '',
    className: "components-placeholder__input",
    "aria-label": label,
    placeholder: (0,external_gc_i18n_namespaceObject.__)('键入要在此嵌入的URL...' ),
    onChange: onChange
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "primary",
    type: "submit"
  }, (0,external_gc_i18n_namespaceObject._x)('嵌入', 'button label'))), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "components-placeholder__learn-more"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ExternalLink, {
    href: (0,external_gc_i18n_namespaceObject.__)('https://www.gechiui.com/support/embeds/')
  }, (0,external_gc_i18n_namespaceObject.__)('了解关于嵌入的更多内容'))), cannotEmbed && (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "components-placeholder__error"
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "components-placeholder__instructions"
  }, (0,external_gc_i18n_namespaceObject.__)('抱歉，此内容不能被嵌入。')), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "secondary",
    onClick: tryAgain
  }, (0,external_gc_i18n_namespaceObject._x)('再试试', 'button label')), ' ', (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "secondary",
    onClick: fallback
  }, (0,external_gc_i18n_namespaceObject._x)('转换为链接', 'button label'))));
};

/* harmony default export */ var embed_placeholder = (EmbedPlaceholder);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/gc-embed-preview.js


/**
 * GeChiUI dependencies
 */


/** @typedef {import('@gechiui/element').GCSyntheticEvent} GCSyntheticEvent */

const attributeMap = {
  class: 'className',
  frameborder: 'frameBorder',
  marginheight: 'marginHeight',
  marginwidth: 'marginWidth'
};
function GcEmbedPreview({
  html
}) {
  const ref = (0,external_gc_element_namespaceObject.useRef)();
  const props = (0,external_gc_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_gc_element_namespaceObject.useEffect)(() => {
    const {
      ownerDocument
    } = ref.current;
    const {
      defaultView
    } = ownerDocument;
    /**
     * Checks for GeChiUI embed events signaling the height change when
     * iframe content loads or iframe's window is resized.  The event is
     * sent from GeChiUI core via the window.postMessage API.
     *
     * References:
     * window.postMessage:
     * https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
     * GeChiUI core embed-template on load:
     * https://github.com/GeChiUI/GeChiUI/blob/HEAD/gc-includes/js/gc-embed-template.js#L143
     * GeChiUI core embed-template on resize:
     * https://github.com/GeChiUI/GeChiUI/blob/HEAD/gc-includes/js/gc-embed-template.js#L187
     *
     * @param {MessageEvent} event Message event.
     */

    function resizeGCembeds({
      data: {
        secret,
        message,
        value
      } = {}
    }) {
      if (message !== 'height' || secret !== props['data-secret']) {
        return;
      }

      ref.current.height = value;
    }

    defaultView.addEventListener('message', resizeGCembeds);
    return () => {
      defaultView.removeEventListener('message', resizeGCembeds);
    };
  }, []);
  return (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-embed__wrapper"
  }, (0,external_gc_element_namespaceObject.createElement)("iframe", {
    ref: (0,external_gc_compose_namespaceObject.useMergeRefs)([ref, (0,external_gc_compose_namespaceObject.useFocusableIframe)()]),
    title: props.title,
    ...props
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/embed-preview.js


/**
 * Internal dependencies
 */

/**
 * External dependencies
 */


/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */



class EmbedPreview extends external_gc_element_namespaceObject.Component {
  constructor() {
    super(...arguments);
    this.hideOverlay = this.hideOverlay.bind(this);
    this.state = {
      interactive: false
    };
  }

  static getDerivedStateFromProps(nextProps, state) {
    if (!nextProps.isSelected && state.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.
      return {
        interactive: false
      };
    }

    return null;
  }

  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.
    this.setState({
      interactive: true
    });
  }

  render() {
    const {
      preview,
      previewable,
      url,
      type,
      caption,
      onCaptionChange,
      isSelected,
      className,
      icon,
      label,
      insertBlocksAfter
    } = this.props;
    const {
      scripts
    } = preview;
    const {
      interactive
    } = this.state;
    const html = 'photo' === type ? getPhotoHtml(preview) : preview.html;
    const parsedHost = new URL(url).host.split('.');
    const parsedHostBaseUrl = parsedHost.splice(parsedHost.length - 2, parsedHost.length - 1).join('.');
    const iframeTitle = (0,external_gc_i18n_namespaceObject.sprintf)( // translators: %s: host providing embed content e.g: www.youku.com
    (0,external_gc_i18n_namespaceObject.__)('嵌入来自%s的内容'), parsedHostBaseUrl);
    const sandboxClassnames = dedupe_default()(type, className, 'gc-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 = 'gc-embed' === type ? (0,external_gc_element_namespaceObject.createElement)(GcEmbedPreview, {
      html: html
    }) : (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-embed__wrapper"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SandBox, {
      html: html,
      scripts: scripts,
      title: iframeTitle,
      type: sandboxClassnames,
      onFocus: this.hideOverlay
    }), !interactive && (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "block-library-embed__interactive-overlay",
      onMouseUp: this.hideOverlay
    }));
    /* eslint-enable jsx-a11y/no-static-element-interactions */

    return (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: dedupe_default()(className, 'gc-block-embed', {
        'is-type-video': 'video' === type
      })
    }, previewable ? embedWrapper : (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
      icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
        icon: icon,
        showColors: true
      }),
      label: label
    }, (0,external_gc_element_namespaceObject.createElement)("p", {
      className: "components-placeholder__error"
    }, (0,external_gc_element_namespaceObject.createElement)("a", {
      href: url
    }, url)), (0,external_gc_element_namespaceObject.createElement)("p", {
      className: "components-placeholder__error"
    }, (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: host providing embed content e.g: www.youku.com */
    (0,external_gc_i18n_namespaceObject.__)("来自%s的嵌入内容不能在编辑器中预览。"), parsedHostBaseUrl))), (!external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
      identifier: "caption",
      tagName: "figcaption",
      className: (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
      placeholder: (0,external_gc_i18n_namespaceObject.__)('添加说明文字'),
      value: caption,
      onChange: onCaptionChange,
      inlineToolbar: true,
      __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)()))
    }));
  }

}

/* harmony default export */ var embed_preview = (EmbedPreview);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/edit.js


/**
 * Internal dependencies
 */






/**
 * External dependencies
 */


/**
 * GeChiUI dependencies
 */








const EmbedEdit = props => {
  const {
    attributes: {
      providerNameSlug,
      previewable,
      responsive,
      url: attributesUrl
    },
    attributes,
    isSelected,
    onReplace,
    setAttributes,
    insertBlocksAfter,
    onFocus
  } = props;
  const defaultEmbedInfo = {
    title: (0,external_gc_i18n_namespaceObject._x)('嵌入', 'block title'),
    icon: embedContentIcon
  };
  const {
    icon,
    title
  } = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo;
  const [url, setURL] = (0,external_gc_element_namespaceObject.useState)(attributesUrl);
  const [isEditingURL, setIsEditingURL] = (0,external_gc_element_namespaceObject.useState)(false);
  const {
    invalidateResolution
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_coreData_namespaceObject.store);
  const {
    preview,
    fetching,
    themeSupportsResponsive,
    cannotEmbed
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getEmbedPreview,
      isPreviewEmbedFallback,
      isRequestingEmbedPreview,
      getThemeSupports
    } = select(external_gc_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 GeChiUI 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 gechiuiCantEmbed = embedPreview?.data?.status === 404;
    const validPreview = !!embedPreview && !badEmbedProvider && !gechiuiCantEmbed;
    return {
      preview: validPreview ? embedPreview : undefined,
      fetching: isRequestingEmbedPreview(attributesUrl),
      themeSupportsResponsive: getThemeSupports()['responsive-embeds'],
      cannotEmbed: !validPreview || previewIsFallback
    };
  }, [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_gc_element_namespaceObject.useEffect)(() => {
    if (!preview?.html || !cannotEmbed || fetching) {
      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, fetching]); // Handle incoming preview.

  (0,external_gc_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_gc_blockEditor_namespaceObject.useBlockProps)();

  if (fetching) {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.View, { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(embed_loading, null));
  } // translators: %s: type of embed e.g: "YouKu", "Twitter", etc. "Embed" is used when no specific type exists


  const label = (0,external_gc_i18n_namespaceObject.sprintf)((0,external_gc_i18n_namespaceObject.__)('%sURL'), 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 (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.View, { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(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: event => setURL(event.target.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 = classnames_default()(classFromPreview, props.className);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(embed_controls, {
    showEditButton: preview && !cannotEmbed,
    themeSupportsResponsive: themeSupportsResponsive,
    blockSupportsResponsive: responsive,
    allowResponsive: allowResponsive,
    toggleResponsive: toggleResponsive,
    switchBackToURLInput: () => setIsEditingURL(true)
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.View, { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(embed_preview, {
    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
  })));
};

/* harmony default export */ var embed_edit = (EmbedEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


function embed_save_save({
  attributes
}) {
  const {
    url,
    caption,
    type,
    providerNameSlug
  } = attributes;

  if (!url) {
    return null;
  }

  const className = dedupe_default()('gc-block-embed', {
    [`is-type-${type}`]: type,
    [`is-provider-${providerNameSlug}`]: providerNameSlug,
    [`gc-block-embed-${providerNameSlug}`]: providerNameSlug
  });
  return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className
    })
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-embed__wrapper"
  }, `\n${url}\n`
  /* URL needs to be on its own line. */
  ), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    className: (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
    tagName: "figcaption",
    value: caption
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/transforms.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */

const transforms_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/embed",
  title: "嵌入",
  category: "embed",
  description: "添加可显示抖音、优酷等系统嵌入内容的区块。",
  textdomain: "default",
  attributes: {
    url: {
      type: "string",
      __experimentalRole: "content"
    },
    caption: {
      type: "string",
      source: "html",
      selector: "figcaption",
      __experimentalRole: "content"
    },
    type: {
      type: "string",
      __experimentalRole: "content"
    },
    providerNameSlug: {
      type: "string",
      __experimentalRole: "content"
    },
    allowResponsive: {
      type: "boolean",
      "default": true
    },
    responsive: {
      type: "boolean",
      "default": false,
      __experimentalRole: "content"
    },
    previewable: {
      type: "boolean",
      "default": true,
      __experimentalRole: "content"
    }
  },
  supports: {
    align: true,
    spacing: {
      margin: true
    }
  },
  editorStyle: "gc-block-embed-editor",
  style: "gc-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_gc_blocks_namespaceObject.createBlock)(EMBED_BLOCK, {
        url: node.textContent.trim()
      });
    }
  }],
  to: [{
    type: 'block',
    blocks: ['core/paragraph'],
    isMatch: ({
      url
    }) => !!url,
    transform: ({
      url,
      caption
    }) => {
      let value = `<a href="${url}">${url}</a>`;

      if (caption?.trim()) {
        value += `<br />${caption}`;
      }

      return (0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
        content: value
      });
    }
  }]
};
/* harmony default export */ var embed_transforms = (embed_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/variations.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


/** @typedef {import('@gechiui/blocks').GCBlockVariation} GCBlockVariation */

/**
 * The embed provider services.
 *
 * @type {GCBlockVariation[]}
 */

const embed_variations_variations = [{
  name: 'gechiui',
  title: 'GeChiUI',
  icon: embedGeChiUIIcon,
  keywords: [(0,external_gc_i18n_namespaceObject.__)('文章'), (0,external_gc_i18n_namespaceObject.__)('博客')],
  description: (0,external_gc_i18n_namespaceObject.__)('嵌入GeChiUI文章。'),
  attributes: {
    providerNameSlug: 'gechiui'
  }
}];
/**
 * 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 */ var embed_variations = (embed_variations_variations);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/deprecated.js


/**
 * External dependencies
 */

/**
 * Internal dependencies
 */

const embed_deprecated_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/embed",
  title: "嵌入",
  category: "embed",
  description: "添加可显示抖音、优酷等系统嵌入内容的区块。",
  textdomain: "default",
  attributes: {
    url: {
      type: "string",
      __experimentalRole: "content"
    },
    caption: {
      type: "string",
      source: "html",
      selector: "figcaption",
      __experimentalRole: "content"
    },
    type: {
      type: "string",
      __experimentalRole: "content"
    },
    providerNameSlug: {
      type: "string",
      __experimentalRole: "content"
    },
    allowResponsive: {
      type: "boolean",
      "default": true
    },
    responsive: {
      type: "boolean",
      "default": false,
      __experimentalRole: "content"
    },
    previewable: {
      type: "boolean",
      "default": true,
      __experimentalRole: "content"
    }
  },
  supports: {
    align: true,
    spacing: {
      margin: true
    }
  },
  editorStyle: "gc-block-embed-editor",
  style: "gc-block-embed"
};
/**
 * GeChiUI dependencies
 */


const {
  attributes: embed_deprecated_blockAttributes
} = embed_deprecated_metadata; // In #41140 support was added to global styles for caption elements which added a `gc-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 = classnames_default()('gc-block-embed', {
      [`is-type-${type}`]: type,
      [`is-provider-${providerNameSlug}`]: providerNameSlug,
      [`gc-block-embed-${providerNameSlug}`]: providerNameSlug
    });
    return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className
      })
    }, (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-embed__wrapper"
    }, `\n${url}\n`
    /* URL needs to be on its own line. */
    ), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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 = classnames_default()('gc-block-embed', {
      [`is-type-${type}`]: type,
      [`is-provider-${providerNameSlug}`]: providerNameSlug
    });
    return (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: embedClassName
    }, `\n${url}\n`
    /* URL needs to be on its own line. */
    , !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "figcaption",
      value: caption
    }));
  }

};
const embed_deprecated_deprecated = [deprecated_v2, embed_deprecated_v1];
/* harmony default export */ var embed_deprecated = (embed_deprecated_deprecated);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/embed/index.js
/**
 * Internal dependencies
 */



const embed_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/embed",
  title: "嵌入",
  category: "embed",
  description: "添加可显示抖音、优酷等系统嵌入内容的区块。",
  textdomain: "default",
  attributes: {
    url: {
      type: "string",
      __experimentalRole: "content"
    },
    caption: {
      type: "string",
      source: "html",
      selector: "figcaption",
      __experimentalRole: "content"
    },
    type: {
      type: "string",
      __experimentalRole: "content"
    },
    providerNameSlug: {
      type: "string",
      __experimentalRole: "content"
    },
    allowResponsive: {
      type: "boolean",
      "default": true
    },
    responsive: {
      type: "boolean",
      "default": false,
      __experimentalRole: "content"
    },
    previewable: {
      type: "boolean",
      "default": true,
      __experimentalRole: "content"
    }
  },
  supports: {
    align: true,
    spacing: {
      margin: true
    }
  },
  editorStyle: "gc-block-embed-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/file.js


/**
 * GeChiUI dependencies
 */

const file = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"
}));
/* harmony default export */ var library_file = (file);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/file/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_gc_i18n_namespaceObject.__)('PDF 已嵌入') : (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: filename. */
    (0,external_gc_i18n_namespaceObject.__)('嵌入 %s'), fileName);
    const hasFilename = !external_gc_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 && (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
    }, displayPreview && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("object", {
      className: "gc-block-file__embed",
      data: href,
      type: "application/pdf",
      style: {
        width: '100%',
        height: `${previewHeight}px`
      },
      "aria-label": pdfEmbedLabel
    })), hasFilename && (0,external_gc_element_namespaceObject.createElement)("a", {
      id: describedById,
      href: textLinkHref,
      target: textLinkTarget,
      rel: textLinkTarget ? 'noreferrer noopener' : undefined
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: fileName
    })), showDownloadButton && (0,external_gc_element_namespaceObject.createElement)("a", {
      href: href,
      className: classnames_default()('gc-block-file__button', (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')),
      download: true,
      "aria-describedby": describedById
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: downloadButtonText
    })));
  }

}; // In #41239 the button was made an element button which added a `gc-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_gc_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_gc_i18n_namespaceObject.__)('PDF 已嵌入') : (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: filename. */
    (0,external_gc_i18n_namespaceObject.__)('嵌入 %s'), fileName);
    const hasFilename = !external_gc_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 && (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
    }, displayPreview && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("object", {
      className: "gc-block-file__embed",
      data: href,
      type: "application/pdf",
      style: {
        width: '100%',
        height: `${previewHeight}px`
      },
      "aria-label": pdfEmbedLabel
    })), hasFilename && (0,external_gc_element_namespaceObject.createElement)("a", {
      id: describedById,
      href: textLinkHref,
      target: textLinkTarget,
      rel: textLinkTarget ? 'noreferrer noopener' : undefined
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: fileName
    })), showDownloadButton && (0,external_gc_element_namespaceObject.createElement)("a", {
      href: href,
      className: "gc-block-file__button",
      download: true,
      "aria-describedby": describedById
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_gc_i18n_namespaceObject.__)('PDF 已嵌入') : (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: filename. */
    (0,external_gc_i18n_namespaceObject.__)('嵌入 %s'), fileName);
    return href && (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
    }, displayPreview && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("object", {
      className: "gc-block-file__embed",
      data: href,
      type: "application/pdf",
      style: {
        width: '100%',
        height: `${previewHeight}px`
      },
      "aria-label": pdfEmbedLabel
    })), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(fileName) && (0,external_gc_element_namespaceObject.createElement)("a", {
      href: textLinkHref,
      target: textLinkTarget,
      rel: textLinkTarget ? 'noreferrer noopener' : undefined
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: fileName
    })), showDownloadButton && (0,external_gc_element_namespaceObject.createElement)("a", {
      href: href,
      className: "gc-block-file__button",
      download: true
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: downloadButtonText
    })));
  }

};
const file_deprecated_deprecated = [deprecated_v3, file_deprecated_v2, file_deprecated_v1];
/* harmony default export */ var file_deprecated = (file_deprecated_deprecated);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/file/inspector.js


/**
 * GeChiUI 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_gc_i18n_namespaceObject.__)('URL')
  }];

  if (attachmentPage) {
    linkDestinationOptions = [{
      value: href,
      label: (0,external_gc_i18n_namespaceObject.__)('媒体文件')
    }, {
      value: attachmentPage,
      label: (0,external_gc_i18n_namespaceObject.__)('附件页面')
    }];
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, href.endsWith('.pdf') && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('PDF 设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示内联嵌入'),
    help: displayPreview ? (0,external_gc_i18n_namespaceObject.__)("注意：大多数手机和平板电脑浏览器不会显示嵌入式 PDF。") : null,
    checked: !!displayPreview,
    onChange: changeDisplayPreview
  }), displayPreview && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('高度（像素）'),
    min: MIN_PREVIEW_HEIGHT,
    max: Math.max(MAX_PREVIEW_HEIGHT, previewHeight),
    value: previewHeight,
    onChange: changePreviewHeight
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('链接至'),
    value: textLinkHref,
    options: linkDestinationOptions,
    onChange: changeLinkDestinationOption
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新窗口打开'),
    checked: openInNewWindow,
    onChange: changeOpenInNewWindow
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示下载按钮'),
    checked: showDownloadButton,
    onChange: changeShowDownloadButton
  }))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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 noteable 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;
};
/**
 * Hides all .gc-block-file__embed elements on the document. This function is only intended
 * to be run on the front-end, it may have weird side effects running in the block editor.
 */


const hidePdfEmbedsOnUnsupportedBrowsers = () => {
  if (!browserSupportsPdfs()) {
    const embeds = document.getElementsByClassName('gc-block-file__embed');
    Array.from(embeds).forEach(embed => {
      embed.style.display = 'none';
    });
  }
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/file/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */











/**
 * Internal dependencies
 */



const MIN_PREVIEW_HEIGHT = 200;
const MAX_PREVIEW_HEIGHT = 2000;

function ClipboardToolbarButton({
  text,
  disabled
}) {
  const {
    createNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);
  const ref = (0,external_gc_compose_namespaceObject.useCopyToClipboard)(text, () => {
    createNotice('info', (0,external_gc_i18n_namespaceObject.__)('已将 URL 复制到剪贴板。'), {
      isDismissible: true,
      type: 'snackbar'
    });
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    className: "components-clipboard-toolbar-button",
    ref: ref,
    disabled: disabled
  }, (0,external_gc_i18n_namespaceObject.__)('复制URL'));
}

function FileEdit({
  attributes,
  isSelected,
  setAttributes,
  clientId
}) {
  const {
    id,
    fileId,
    fileName,
    href,
    textLinkHref,
    textLinkTarget,
    showDownloadButton,
    downloadButtonText,
    displayPreview,
    previewHeight
  } = attributes;
  const {
    media,
    mediaUpload
  } = (0,external_gc_data_namespaceObject.useSelect)(select => ({
    media: id === undefined ? undefined : select(external_gc_coreData_namespaceObject.store).getMedia(id),
    mediaUpload: select(external_gc_blockEditor_namespaceObject.store).getSettings().mediaUpload
  }), [id]);
  const {
    createErrorNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);
  const {
    toggleSelection,
    __unstableMarkNextChangeAsNotPersistent
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    // Upload a file drag-and-dropped into the editor.
    if ((0,external_gc_blob_namespaceObject.isBlobURL)(href)) {
      const file = (0,external_gc_blob_namespaceObject.getBlobByURL)(href);
      mediaUpload({
        filesList: [file],
        onFileChange: ([newMedia]) => onSelectFile(newMedia),
        onError: onUploadError
      });
      (0,external_gc_blob_namespaceObject.revokeBlobURL)(href);
    }

    if (downloadButtonText === undefined) {
      changeDownloadButtonText((0,external_gc_i18n_namespaceObject._x)('下载', 'button label'));
    }
  }, []);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!fileId && href) {
      // Add a unique fileId to each file block.
      __unstableMarkNextChangeAsNotPersistent();

      setAttributes({
        fileId: `gc-block-file--media-${clientId}`
      });
    }
  }, [href, fileId, clientId]);

  function onSelectFile(newMedia) {
    if (newMedia && newMedia.url) {
      const isPdf = newMedia.url.endsWith('.pdf');
      setAttributes({
        href: newMedia.url,
        fileName: newMedia.title,
        textLinkHref: newMedia.url,
        id: newMedia.id,
        displayPreview: isPdf ? true : undefined,
        previewHeight: isPdf ? 600 : undefined
      });
    }
  }

  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 changeDownloadButtonText(newValue) {
    // Remove anchor tags from button text content.
    setAttributes({
      downloadButtonText: newValue.replace(/<\/?a[^>]*>/g, '')
    });
  }

  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_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()((0,external_gc_blob_namespaceObject.isBlobURL)(href) && (0,external_gc_components_namespaceObject.__unstableGetAnimateClassName)({
      type: 'loading'
    }), {
      'is-transient': (0,external_gc_blob_namespaceObject.isBlobURL)(href)
    })
  });
  const displayPreviewInEditor = browserSupportsPdfs() && displayPreview;

  if (!href) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaPlaceholder, {
      icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
        icon: library_file
      }),
      labels: {
        title: (0,external_gc_i18n_namespaceObject.__)('文件'),
        instructions: (0,external_gc_i18n_namespaceObject.__)('上传文件，或从您的媒体库中选择。')
      },
      onSelect: onSelectFile,
      onError: onUploadError,
      accept: "*"
    }));
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(FileBlockInspector, {
    hrefs: {
      href,
      textLinkHref,
      attachmentPage
    },
    openInNewWindow: !!textLinkTarget,
    showDownloadButton,
    changeLinkDestinationOption,
    changeOpenInNewWindow,
    changeShowDownloadButton,
    displayPreview,
    changeDisplayPreview,
    previewHeight,
    changePreviewHeight
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "other"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaReplaceFlow, {
    mediaId: id,
    mediaURL: href,
    accept: "*",
    onSelect: onSelectFile,
    onError: onUploadError
  }), (0,external_gc_element_namespaceObject.createElement)(ClipboardToolbarButton, {
    text: href,
    disabled: (0,external_gc_blob_namespaceObject.isBlobURL)(href)
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, displayPreviewInEditor && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ResizableBox, {
    size: {
      height: previewHeight
    },
    minHeight: MIN_PREVIEW_HEIGHT,
    maxHeight: MAX_PREVIEW_HEIGHT,
    minWidth: "100%",
    grid: [10, 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
  }, (0,external_gc_element_namespaceObject.createElement)("object", {
    className: "gc-block-file__preview",
    data: href,
    type: "application/pdf",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('嵌入所选的 PDF 文件。')
  }), !isSelected && (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-file__preview-overlay"
  })), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: 'gc-block-file__content-wrapper'
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    tagName: "a",
    value: fileName,
    placeholder: (0,external_gc_i18n_namespaceObject.__)('编写文件名...' ),
    withoutInteractiveFormatting: true,
    onChange: text => setAttributes({
      fileName: text
    }),
    href: textLinkHref
  }), showDownloadButton && (0,external_gc_element_namespaceObject.createElement)("div", {
    className: 'gc-block-file__button-richtext-wrapper'
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    tagName: "div" // Must be block-level or else cursor disappears.
    ,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('下载按钮文字'),
    className: classnames_default()('gc-block-file__button', (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')),
    value: downloadButtonText,
    withoutInteractiveFormatting: true,
    placeholder: (0,external_gc_i18n_namespaceObject.__)('添加文字...' ),
    onChange: text => changeDownloadButtonText(text)
  })))));
}

/* harmony default export */ var file_edit = (FileEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/file/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


function file_save_save({
  attributes
}) {
  const {
    href,
    fileId,
    fileName,
    textLinkHref,
    textLinkTarget,
    showDownloadButton,
    downloadButtonText,
    displayPreview,
    previewHeight
  } = attributes;
  const pdfEmbedLabel = external_gc_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? 'PDF 已嵌入' : fileName;
  const hasFilename = !external_gc_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 && (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
  }, displayPreview && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("object", {
    className: "gc-block-file__embed",
    data: href,
    type: "application/pdf",
    style: {
      width: '100%',
      height: `${previewHeight}px`
    },
    "aria-label": pdfEmbedLabel
  })), hasFilename && (0,external_gc_element_namespaceObject.createElement)("a", {
    id: describedById,
    href: textLinkHref,
    target: textLinkTarget,
    rel: textLinkTarget ? 'noreferrer noopener' : undefined
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    value: fileName
  })), showDownloadButton && (0,external_gc_element_namespaceObject.createElement)("a", {
    href: href,
    className: classnames_default()('gc-block-file__button', (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')),
    download: true,
    "aria-describedby": describedById
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    value: downloadButtonText
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/file/transforms.js
/**
 * GeChiUI dependencies
 */





const file_transforms_transforms = {
  from: [{
    type: 'files',

    isMatch(files) {
      return files.length > 0;
    },

    // We define a lower priorty (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_gc_blob_namespaceObject.createBlobURL)(file); // File will be uploaded in componentDidMount()

        blocks.push((0,external_gc_blocks_namespaceObject.createBlock)('core/file', {
          href: blobURL,
          fileName: file.name,
          textLinkHref: blobURL
        }));
      });
      return blocks;
    }
  }, {
    type: 'block',
    blocks: ['core/audio'],
    transform: attributes => {
      return (0,external_gc_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_gc_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_gc_blocks_namespaceObject.createBlock)('core/file', {
        href: attributes.url,
        fileName: attributes.caption || (0,external_gc_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_gc_data_namespaceObject.select)(external_gc_coreData_namespaceObject.store);
      const media = getMedia(id);
      return !!media && media.mime_type.includes('audio');
    },
    transform: attributes => {
      return (0,external_gc_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_gc_data_namespaceObject.select)(external_gc_coreData_namespaceObject.store);
      const media = getMedia(id);
      return !!media && media.mime_type.includes('video');
    },
    transform: attributes => {
      return (0,external_gc_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_gc_data_namespaceObject.select)(external_gc_coreData_namespaceObject.store);
      const media = getMedia(id);
      return !!media && media.mime_type.includes('image');
    },
    transform: attributes => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/image', {
        url: attributes.href,
        caption: attributes.fileName,
        id: attributes.id,
        anchor: attributes.anchor
      });
    }
  }]
};
/* harmony default export */ var file_transforms = (file_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/file/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const file_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/file",
  title: "文件",
  category: "media",
  description: "添加指向可下载文件的链接。",
  keywords: ["document", "pdf", "download"],
  textdomain: "default",
  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,
    color: {
      gradients: true,
      link: true,
      text: false,
      __experimentalDefaultControls: {
        background: true,
        link: true
      }
    }
  },
  viewScript: "file:./view.min.js",
  editorStyle: "gc-block-file-editor",
  style: "gc-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_gc_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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/gallery.js


/**
 * GeChiUI dependencies
 */

const gallery = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_gallery = (gallery);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/constants.js
const LINK_DESTINATION_NONE = 'none';
const LINK_DESTINATION_MEDIA = 'media';
const LINK_DESTINATION_ATTACHMENT = 'attachment';
const LINK_DESTINATION_MEDIA_GC_CORE = 'file';
const LINK_DESTINATION_ATTACHMENT_GC_CORE = 'post';

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/shared.js
/**
 * GeChiUI dependencies
 */

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;
};

function getGalleryBlockV2Enabled() {
  // We want to fail early here, at least during beta testing phase, to ensure
  // there aren't instances where undefined values cause false negatives.
  if (!window.gc || typeof window.gc.galleryBlockV2Enabled !== 'boolean') {
    throw 'window.gc.galleryBlockV2Enabled is not defined';
  }

  return window.gc.galleryBlockV2Enabled;
}
/**
 * The new gallery block format is not compatible with the use_BalanceTags option
 * in GC versions <= 5.8 https://core.trac.gechiui.com/ticket/54130. The
 * window.gc.galleryBlockV2Enabled flag is set in lib/compat.php. This method
 * can be removed when minimum supported GC version >=5.9.
 */


function isGalleryV2Enabled() {
  if (external_gc_element_namespaceObject.Platform.isNative) {
    return getGalleryBlockV2Enabled();
  }

  return true;
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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 GeChiUI 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_gc_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 `gc-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 = classnames_default()('has-nested-images', {
      [`columns-${columns}`]: columns !== undefined,
      [`columns-default`]: columns === undefined,
      'is-cropped': imageCrop
    });
    const blockProps = external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className
    });
    const innerBlocksProps = external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
    return (0,external_gc_element_namespaceObject.createElement)("figure", { ...innerBlocksProps
    }, innerBlocksProps.children, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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 (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className
      })
    }, (0,external_gc_element_namespaceObject.createElement)("ul", {
      className: "blocks-gallery-grid"
    }, 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 = (0,external_gc_element_namespaceObject.createElement)("img", {
        src: image.url,
        alt: image.alt,
        "data-id": image.id,
        "data-full-url": image.fullUrl,
        "data-link": image.link,
        className: image.id ? `gc-image-${image.id}` : null
      });
      return (0,external_gc_element_namespaceObject.createElement)("li", {
        key: image.id || image.url,
        className: "blocks-gallery-item"
      }, (0,external_gc_element_namespaceObject.createElement)("figure", null, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
        href: href
      }, img) : img, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
        tagName: "figcaption",
        className: "blocks-gallery-item__caption",
        value: image.caption
      })));
    })), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "figcaption",
      className: "blocks-gallery-caption",
      value: caption
    }));
  },

  migrate(attributes) {
    if (isGalleryV2Enabled()) {
      return runV2Migration(attributes);
    }

    return 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) {
    if (isGalleryV2Enabled()) {
      return runV2Migration(attributes);
    }

    let linkTo = attributes.linkTo;

    if (!attributes.linkTo) {
      linkTo = 'none';
    } else if (attributes.linkTo === 'attachment') {
      linkTo = 'post';
    } else if (attributes.linkTo === 'media') {
      linkTo = 'file';
    }

    return { ...attributes,
      linkTo
    };
  },

  save({
    attributes
  }) {
    const {
      images,
      columns = defaultColumnsNumberV1(attributes),
      imageCrop,
      caption,
      linkTo
    } = attributes;
    return (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
    }, (0,external_gc_element_namespaceObject.createElement)("ul", {
      className: "blocks-gallery-grid"
    }, images.map(image => {
      let href;

      switch (linkTo) {
        case 'media':
          href = image.fullUrl || image.url;
          break;

        case 'attachment':
          href = image.link;
          break;
      }

      const img = (0,external_gc_element_namespaceObject.createElement)("img", {
        src: image.url,
        alt: image.alt,
        "data-id": image.id,
        "data-full-url": image.fullUrl,
        "data-link": image.link,
        className: image.id ? `gc-image-${image.id}` : null
      });
      return (0,external_gc_element_namespaceObject.createElement)("li", {
        key: image.id || image.url,
        className: "blocks-gallery-item"
      }, (0,external_gc_element_namespaceObject.createElement)("figure", null, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
        href: href
      }, img) : img, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
        tagName: "figcaption",
        className: "blocks-gallery-item__caption",
        value: image.caption
      })));
    })), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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) {
    var _attributes$ids;

    if (isGalleryV2Enabled()) {
      return runV2Migration(attributes);
    }

    return { ...attributes,
      ids: ((_attributes$ids = attributes.ids) !== null && _attributes$ids !== void 0 ? _attributes$ids : []).map(id => {
        const parsedId = parseInt(id, 10);
        return Number.isInteger(parsedId) ? parsedId : null;
      })
    };
  },

  save({
    attributes
  }) {
    const {
      images,
      columns = defaultColumnsNumberV1(attributes),
      imageCrop,
      caption,
      linkTo
    } = attributes;
    return (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
    }, (0,external_gc_element_namespaceObject.createElement)("ul", {
      className: "blocks-gallery-grid"
    }, images.map(image => {
      let href;

      switch (linkTo) {
        case 'media':
          href = image.fullUrl || image.url;
          break;

        case 'attachment':
          href = image.link;
          break;
      }

      const img = (0,external_gc_element_namespaceObject.createElement)("img", {
        src: image.url,
        alt: image.alt,
        "data-id": image.id,
        "data-full-url": image.fullUrl,
        "data-link": image.link,
        className: image.id ? `gc-image-${image.id}` : null
      });
      return (0,external_gc_element_namespaceObject.createElement)("li", {
        key: image.id || image.url,
        className: "blocks-gallery-item"
      }, (0,external_gc_element_namespaceObject.createElement)("figure", null, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
        href: href
      }, img) : img, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
        tagName: "figcaption",
        className: "blocks-gallery-item__caption",
        value: image.caption
      })));
    })), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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.gc-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 (0,external_gc_element_namespaceObject.createElement)("ul", {
      className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
    }, images.map(image => {
      let href;

      switch (linkTo) {
        case 'media':
          href = image.fullUrl || image.url;
          break;

        case 'attachment':
          href = image.link;
          break;
      }

      const img = (0,external_gc_element_namespaceObject.createElement)("img", {
        src: image.url,
        alt: image.alt,
        "data-id": image.id,
        "data-full-url": image.fullUrl,
        "data-link": image.link,
        className: image.id ? `gc-image-${image.id}` : null
      });
      return (0,external_gc_element_namespaceObject.createElement)("li", {
        key: image.id || image.url,
        className: "blocks-gallery-item"
      }, (0,external_gc_element_namespaceObject.createElement)("figure", null, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
        href: href
      }, img) : img, image.caption && image.caption.length > 0 && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
        tagName: "figcaption",
        value: image.caption
      })));
    }));
  },

  migrate(attributes) {
    if (isGalleryV2Enabled()) {
      return runV2Migration(attributes);
    }

    return attributes;
  }

};
const gallery_deprecated_v2 = {
  attributes: {
    images: {
      type: 'array',
      default: [],
      source: 'query',
      selector: 'ul.gc-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) {
    var _attributes$images;

    if (isGalleryV2Enabled()) {
      return runV2Migration(attributes);
    }

    return { ...attributes,
      ids: ((_attributes$images = attributes.images) !== null && _attributes$images !== void 0 ? _attributes$images : []).map(({
        id
      }) => {
        if (!id) {
          return null;
        }

        return parseInt(id, 10);
      })
    };
  },

  supports: {
    align: true
  },

  save({
    attributes
  }) {
    const {
      images,
      columns = defaultColumnsNumberV1(attributes),
      imageCrop,
      linkTo
    } = attributes;
    return (0,external_gc_element_namespaceObject.createElement)("ul", {
      className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`
    }, images.map(image => {
      let href;

      switch (linkTo) {
        case 'media':
          href = image.url;
          break;

        case 'attachment':
          href = image.link;
          break;
      }

      const img = (0,external_gc_element_namespaceObject.createElement)("img", {
        src: image.url,
        alt: image.alt,
        "data-id": image.id,
        "data-link": image.link,
        className: image.id ? `gc-image-${image.id}` : null
      });
      return (0,external_gc_element_namespaceObject.createElement)("li", {
        key: image.id || image.url,
        className: "blocks-gallery-item"
      }, (0,external_gc_element_namespaceObject.createElement)("figure", null, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
        href: href
      }, img) : img, image.caption && image.caption.length > 0 && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
        tagName: "figcaption",
        value: image.caption
      })));
    }));
  }

};
const gallery_deprecated_v1 = {
  attributes: {
    images: {
      type: 'array',
      default: [],
      source: 'query',
      selector: 'div.gc-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 = classnames_default()(`columns-${columns}`, {
      alignnone: align === 'none',
      'is-cropped': imageCrop
    });
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: className
    }, images.map(image => {
      let href;

      switch (linkTo) {
        case 'media':
          href = image.url;
          break;

        case 'attachment':
          href = image.link;
          break;
      }

      const img = (0,external_gc_element_namespaceObject.createElement)("img", {
        src: image.url,
        alt: image.alt,
        "data-id": image.id
      });
      return (0,external_gc_element_namespaceObject.createElement)("figure", {
        key: image.id || image.url,
        className: "blocks-gallery-image"
      }, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
        href: href
      }, img) : img);
    }));
  },

  migrate(attributes) {
    if (isGalleryV2Enabled()) {
      return runV2Migration(attributes);
    }

    return attributes;
  }

};
/* harmony default export */ var gallery_deprecated = ([deprecated_v7, deprecated_v6, deprecated_v5, deprecated_v4, gallery_deprecated_v3, gallery_deprecated_v2, gallery_deprecated_v1]);

;// CONCATENATED MODULE: external ["gc","viewport"]
var external_gc_viewport_namespaceObject = window["gc"]["viewport"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/shared-icon.js


/**
 * GeChiUI dependencies
 */


const sharedIcon = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
  icon: library_gallery
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/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;

;// CONCATENATED MODULE: ./node_modules/@gechiui/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 blocks attributes.
 * @return {Object}            New attributes to assign to image block.
 */

function utils_getHrefAndDestination(image, galleryDestination, imageDestination) {
  // Gutenberg and GeChiUI use different constants so if image_default_link_type
  // option is set we need to map from the GC Core values.
  switch (imageDestination ? imageDestination : galleryDestination) {
    case LINK_DESTINATION_MEDIA_GC_CORE:
    case LINK_DESTINATION_MEDIA:
      return {
        href: image?.source_url || image?.url,
        // eslint-disable-line camelcase
        linkDestination: constants_LINK_DESTINATION_MEDIA
      };

    case LINK_DESTINATION_ATTACHMENT_GC_CORE:
    case LINK_DESTINATION_ATTACHMENT:
      return {
        href: image?.link,
        linkDestination: constants_LINK_DESTINATION_ATTACHMENT
      };

    case LINK_DESTINATION_NONE:
      return {
        href: undefined,
        linkDestination: constants_LINK_DESTINATION_NONE
      };
  }

  return {};
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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 {};
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/gallery.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */






const Gallery = (props, captionRef) => {
  const {
    attributes,
    isSelected,
    setAttributes,
    mediaPlaceholder,
    insertBlocksAfter,
    blockProps,
    __unstableLayoutClassNames: layoutClassNames,
    showCaption
  } = props;
  const {
    align,
    columns,
    caption,
    imageCrop
  } = attributes;
  return (0,external_gc_element_namespaceObject.createElement)("figure", { ...blockProps,
    className: classnames_default()(blockProps.className, layoutClassNames, 'blocks-gallery-grid', {
      [`align${align}`]: align,
      [`columns-${columns}`]: columns !== undefined,
      [`columns-default`]: columns === undefined,
      'is-cropped': imageCrop
    })
  }, blockProps.children, isSelected && !blockProps.children && (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.View, {
    className: "blocks-gallery-media-placeholder-wrapper"
  }, mediaPlaceholder), showCaption && (!external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    identifier: "caption",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('图库说明文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('编写图库字幕...' ),
    value: caption,
    className: classnames_default()('blocks-gallery-caption', (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')),
    ref: captionRef,
    tagName: "figcaption",
    onChange: value => setAttributes({
      caption: value
    }),
    inlineToolbar: true,
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)()))
  }));
};
/* harmony default export */ var gallery_gallery = ((0,external_gc_element_namespaceObject.forwardRef)(Gallery));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/use-image-sizes.js
/**
 * GeChiUI dependencies
 */

/**
 * Calculates the image sizes that are avaible 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_gc_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
    }));
  }
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/use-get-new-images.js
/**
 * GeChiUI 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_gc_element_namespaceObject.useState)([]);
  return (0,external_gc_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.fromSavedConent);

    if (imagesUpdated || newImages?.length > 0) {
      setCurrentImages([...newCurrentImages, ...newImages]);
    }

    return newImages.length > 0 ? newImages : null;
  }
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/use-get-media.js
/**
 * GeChiUI 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_gc_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_gc_coreData_namespaceObject.store).getMediaItems({
      include: imageIds.join(','),
      per_page: -1,
      orderby: 'include'
    })) !== null && _select$getMediaItems !== void 0 ? _select$getMediaItems : EMPTY_IMAGE_MEDIA;
  }, [innerBlockImages]);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/gap-styles.js


/**
 * GeChiUI dependencies
 */


function GapStyles({
  blockGap,
  clientId
}) {
  const styleElement = (0,external_gc_element_namespaceObject.useContext)(external_gc_blockEditor_namespaceObject.BlockList.__unstableElementContext); // --gallery-block--gutter-size is deprecated. --gc--style--gallery-gap-default should be used by themes that want to set a default
  // gap on the gallery.

  const fallbackValue = `var( --gc--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --gc--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/GeChiUI/gutenberg/pull/37736

  if (!!blockGap) {
    row = typeof blockGap === 'string' ? (0,external_gc_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap) : (0,external_gc_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap?.top) || fallbackValue;
    column = typeof blockGap === 'string' ? (0,external_gc_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap) : (0,external_gc_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} {
		--gc--style--unstable-gallery-gap: ${column === '0' ? '0px' : column};
		gap: ${gapValue}
	}`;

  const GapStyle = () => {
    return (0,external_gc_element_namespaceObject.createElement)("style", null, gap);
  };

  return gap && styleElement ? (0,external_gc_element_namespaceObject.createPortal)((0,external_gc_element_namespaceObject.createElement)(GapStyle, null), styleElement) : null;
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */













/**
 * Internal dependencies
 */











const MAX_COLUMNS = 8;
const linkOptions = [{
  value: LINK_DESTINATION_ATTACHMENT,
  label: (0,external_gc_i18n_namespaceObject.__)('附件页面')
}, {
  value: LINK_DESTINATION_MEDIA,
  label: (0,external_gc_i18n_namespaceObject.__)('媒体文件')
}, {
  value: LINK_DESTINATION_NONE,
  label: (0,external_gc_i18n_namespaceObject._x)('无', 'Media item link option')
}];
const edit_ALLOWED_MEDIA_TYPES = ['image'];
const allowedBlocks = ['core/image'];
const PLACEHOLDER_TEXT = external_gc_element_namespaceObject.Platform.isNative ? (0,external_gc_i18n_namespaceObject.__)('添加媒体') : (0,external_gc_i18n_namespaceObject.__)('拖动图片，上传新图片或从您的媒体库中选择文件。');
const MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_gc_element_namespaceObject.Platform.isNative ? {
  type: 'stepper'
} : {};

function GalleryEdit(props) {
  const {
    setAttributes,
    attributes,
    className,
    clientId,
    isSelected,
    insertBlocksAfter,
    isContentLocked
  } = props;
  const {
    columns,
    imageCrop,
    linkTarget,
    linkTo,
    sizeSlug,
    caption
  } = attributes;
  const [showCaption, setShowCaption] = (0,external_gc_element_namespaceObject.useState)(!!caption);
  const prevCaption = (0,external_gc_compose_namespaceObject.usePrevious)(caption); // We need to show the caption when changes come from
  // history navigation(undo/redo).

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (caption && !prevCaption) {
      setShowCaption(true);
    }
  }, [caption, prevCaption]);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!isSelected && !caption) {
      setShowCaption(false);
    }
  }, [isSelected, caption]); // Focus the caption when we click to add one.

  const captionRef = (0,external_gc_element_namespaceObject.useCallback)(node => {
    if (node && !caption) {
      node.focus();
    }
  }, [caption]);
  const {
    __unstableMarkNextChangeAsNotPersistent,
    replaceInnerBlocks,
    updateBlockAttributes,
    selectBlock
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const {
    createSuccessNotice,
    createErrorNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);
  const {
    getBlock,
    getSettings,
    preferredStyle
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const settings = select(external_gc_blockEditor_namespaceObject.store).getSettings();
    const preferredStyleVariations = settings.__experimentalPreferredStyleVariations;
    return {
      getBlock: select(external_gc_blockEditor_namespaceObject.store).getBlock,
      getSettings: select(external_gc_blockEditor_namespaceObject.store).getSettings,
      preferredStyle: preferredStyleVariations?.value?.['core/image']
    };
  }, []);
  const innerBlockImages = (0,external_gc_data_namespaceObject.useSelect)(select => {
    var _select$getBlock$inne;

    const innerBlocks = (_select$getBlock$inne = select(external_gc_blockEditor_namespaceObject.store).getBlock(clientId)?.innerBlocks) !== null && _select$getBlock$inne !== void 0 ? _select$getBlock$inne : [];
    return innerBlocks;
  }, [clientId]);
  const wasBlockJustInserted = (0,external_gc_data_namespaceObject.useSelect)(select => {
    return select(external_gc_blockEditor_namespaceObject.store).wasBlockJustInserted(clientId, 'inserter_menu');
  }, [clientId]);
  const images = (0,external_gc_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_gc_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;
    } else {
      newClassName = preferredStyle ? `is-style-${preferredStyle}` : undefined;
    }

    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_gc_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.url?.indexOf('blob:') === 0;
  }

  function updateImages(selectedImages) {
    const newFileUploads = Object.prototype.toString.call(selectedImages) === '[object FileList]';
    const imageArray = newFileUploads ? Array.from(selectedImages).map(file => {
      if (!file.url) {
        return pickRelevantMediaFiles({
          url: (0,external_gc_blob_namespaceObject.createBlobURL)(file)
        });
      }

      return file;
    }) : selectedImages;

    if (!imageArray.every(isValidFileType)) {
      createErrorNotice((0,external_gc_i18n_namespaceObject.__)('如果上传到图库，所有文件都需要是图片格式'), {
        id: 'gallery-upload-invalid-file',
        type: 'snackbar'
      });
    }

    const processedImages = imageArray.filter(file => file.url || isValidFileType(file)).map(file => {
      if (!file.url) {
        return pickRelevantMediaFiles({
          url: (0,external_gc_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_gc_blocks_namespaceObject.createBlock)('core/image', {
        id: image.id,
        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);
    });
    updateBlockAttributes(blocks, changedAttributes, true);
    const linkToText = [...linkOptions].find(linkType => linkType.value === value);
    createSuccessNotice((0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: image size settings */
    (0,external_gc_i18n_namespaceObject.__)('所有图库图片链接更新为：%s'), linkToText.label), {
      id: 'gallery-attributes-linkTo',
      type: 'snackbar'
    });
  }

  function setColumnsNumber(value) {
    setAttributes({
      columns: value
    });
  }

  function toggleImageCrop() {
    setAttributes({
      imageCrop: !imageCrop
    });
  }

  function getImageCropHelp(checked) {
    return checked ? (0,external_gc_i18n_namespaceObject.__)('缩略图已被裁切以便对齐。') : (0,external_gc_i18n_namespaceObject.__)('缩略图未被裁切。');
  }

  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_gc_i18n_namespaceObject.__)('所有图库图片都更新为在新标签页中打开') : (0,external_gc_i18n_namespaceObject.__)('所有图库图片都更新为不在新标签页中打开');
    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_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: image size settings */
    (0,external_gc_i18n_namespaceObject.__)('所有图库图片大小更新为：%s'), imageSize.label), {
      id: 'gallery-attributes-sizeSlug',
      type: 'snackbar'
    });
  }

  (0,external_gc_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?.gc?.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_gc_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_gc_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 && wasBlockJustInserted
    }
  });
  const mediaPlaceholder = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaPlaceholder, {
    handleUpload: false,
    icon: sharedIcon,
    labels: {
      title: (0,external_gc_i18n_namespaceObject.__)('图库'),
      instructions: PLACEHOLDER_TEXT
    },
    onSelect: updateImages,
    accept: "image/*",
    allowedTypes: edit_ALLOWED_MEDIA_TYPES,
    multiple: true,
    onError: onUploadError,
    ...mediaPlaceholderProps
  });
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()(className, 'has-nested-images')
  });
  const nativeInnerBlockProps = external_gc_element_namespaceObject.Platform.isNative && {
    marginHorizontal: 0,
    marginVertical: 0
  };
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    allowedBlocks,
    orientation: 'horizontal',
    renderAppender: false,
    ...nativeInnerBlockProps
  });

  if (!hasImages) {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.View, { ...innerBlocksProps
    }, innerBlocksProps.children, mediaPlaceholder);
  }

  const hasLinkTo = linkTo && linkTo !== 'none';
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, images.length > 1 && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('栏目'),
    value: columns ? columns : defaultColumnsNumber(images.length),
    onChange: setColumnsNumber,
    min: 1,
    max: Math.min(MAX_COLUMNS, images.length),
    ...MOBILE_CONTROL_PROPS_RANGE_CONTROL,
    required: true,
    size: "__unstable-large"
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('裁剪图片'),
    checked: !!imageCrop,
    onChange: toggleImageCrop,
    help: getImageCropHelp
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('链接至'),
    value: linkTo,
    onChange: setLinkTo,
    options: linkOptions,
    hideCancelButton: true,
    size: "__unstable-large"
  }), hasLinkTo && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新窗口打开'),
    checked: linkTarget === '_blank',
    onChange: toggleOpenInNewTab
  }), imageSizeOptions?.length > 0 && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('分辨率'),
    help: (0,external_gc_i18n_namespaceObject.__)('选择源图像的尺寸'),
    value: sizeSlug,
    options: imageSizeOptions,
    onChange: updateImagesSize,
    hideCancelButton: true,
    size: "__unstable-large"
  }), external_gc_element_namespaceObject.Platform.isWeb && !imageSizeOptions && hasImageIds && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.BaseControl, {
    className: 'gallery-image-sizes'
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_gc_i18n_namespaceObject.__)('分辨率')), (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.View, {
    className: 'gallery-image-sizes__loading'
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null), (0,external_gc_i18n_namespaceObject.__)('正在加载选项...'))))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, !isContentLocked && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    onClick: () => {
      setShowCaption(!showCaption);

      if (showCaption && caption) {
        setAttributes({
          caption: undefined
        });
      }
    },
    icon: library_caption,
    isPressed: showCaption,
    label: showCaption ? (0,external_gc_i18n_namespaceObject.__)('移除说明文字') : (0,external_gc_i18n_namespaceObject.__)('添加说明文字')
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "other"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaReplaceFlow, {
    allowedTypes: edit_ALLOWED_MEDIA_TYPES,
    accept: "image/*",
    handleUpload: false,
    onSelect: updateImages,
    name: (0,external_gc_i18n_namespaceObject.__)('添加'),
    multiple: true,
    mediaIds: images.filter(image => image.id).map(image => image.id),
    addToGallery: hasImageIds
  })), external_gc_element_namespaceObject.Platform.isWeb && (0,external_gc_element_namespaceObject.createElement)(GapStyles, {
    blockGap: attributes.style?.spacing?.blockGap,
    clientId: clientId
  }), (0,external_gc_element_namespaceObject.createElement)(gallery_gallery, { ...props,
    showCaption: showCaption,
    ref: external_gc_element_namespaceObject.Platform.isWeb ? captionRef : undefined,
    images: images,
    mediaPlaceholder: !hasImages || external_gc_element_namespaceObject.Platform.isNative ? mediaPlaceholder : undefined,
    blockProps: innerBlocksProps,
    insertBlocksAfter: insertBlocksAfter
  }));
}

/* harmony default export */ var gallery_edit = ((0,external_gc_compose_namespaceObject.compose)([(0,external_gc_viewport_namespaceObject.withViewportMatch)({
  isNarrow: '< small'
})])(GalleryEdit));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/v1/shared.js
const shared_pickRelevantMediaFiles = (image, sizeSlug = 'large') => {
  const imageProps = Object.fromEntries(Object.entries(image !== null && image !== void 0 ? image : {}).filter(([key]) => ['alt', 'id', 'link', 'caption'].includes(key)));
  imageProps.url = image?.sizes?.[sizeSlug]?.url || image?.media_details?.sizes?.[sizeSlug]?.source_url || image?.url;
  const fullUrl = image?.sizes?.full?.url || image?.media_details?.sizes?.full?.source_url;

  if (fullUrl) {
    imageProps.fullUrl = fullUrl;
  }

  return imageProps;
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/image.js


/**
 * GeChiUI dependencies
 */

const image_image = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_image = (image_image);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/chevron-left.js


/**
 * GeChiUI dependencies
 */

const chevronLeft = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"
}));
/* harmony default export */ var chevron_left = (chevronLeft);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/chevron-right.js


/**
 * GeChiUI dependencies
 */

const chevronRight = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
}));
/* harmony default export */ var chevron_right = (chevronRight);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/close-small.js


/**
 * GeChiUI dependencies
 */

const closeSmall = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var close_small = (closeSmall);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/v1/constants.js
const v1_constants_LINK_DESTINATION_NONE = 'none';
const v1_constants_LINK_DESTINATION_MEDIA = 'file';
const v1_constants_LINK_DESTINATION_ATTACHMENT = 'post';

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/v1/gallery-image.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */











/**
 * Internal dependencies
 */




const isTemporaryImage = (id, url) => !id && (0,external_gc_blob_namespaceObject.isBlobURL)(url);

class GalleryImage extends external_gc_element_namespaceObject.Component {
  constructor() {
    super(...arguments);
    this.onSelectImage = this.onSelectImage.bind(this);
    this.onRemoveImage = this.onRemoveImage.bind(this);
    this.bindContainer = this.bindContainer.bind(this);
    this.onEdit = this.onEdit.bind(this);
    this.onSelectImageFromLibrary = this.onSelectImageFromLibrary.bind(this);
    this.onSelectCustomURL = this.onSelectCustomURL.bind(this);
    this.state = {
      isEditing: false
    };
  }

  bindContainer(ref) {
    this.container = ref;
  }

  onSelectImage() {
    if (!this.props.isSelected) {
      this.props.onSelect();
    }
  }

  onRemoveImage(event) {
    if (this.container === this.container.ownerDocument.activeElement && this.props.isSelected && [external_gc_keycodes_namespaceObject.BACKSPACE, external_gc_keycodes_namespaceObject.DELETE].indexOf(event.keyCode) !== -1) {
      event.preventDefault();
      this.props.onRemove();
    }
  }

  onEdit() {
    this.setState({
      isEditing: true
    });
  }

  componentDidUpdate() {
    const {
      image,
      url,
      __unstableMarkNextChangeAsNotPersistent
    } = this.props;

    if (image && !url) {
      __unstableMarkNextChangeAsNotPersistent();

      this.props.setAttributes({
        url: image.source_url,
        alt: image.alt_text
      });
    }
  }

  deselectOnBlur() {
    this.props.onDeselect();
  }

  onSelectImageFromLibrary(media) {
    const {
      setAttributes,
      id,
      url,
      alt,
      caption,
      sizeSlug
    } = this.props;

    if (!media || !media.url) {
      return;
    }

    let mediaAttributes = shared_pickRelevantMediaFiles(media, sizeSlug); // If the current image is temporary but an alt text was meanwhile
    // written by the user, make sure the text is not overwritten.

    if (isTemporaryImage(id, url)) {
      if (alt) {
        const {
          alt: omittedAlt,
          ...restMediaAttributes
        } = mediaAttributes;
        mediaAttributes = restMediaAttributes;
      }
    } // If a caption text was meanwhile written by the user,
    // make sure the text is not overwritten by empty captions.


    if (caption && !mediaAttributes.caption) {
      const {
        caption: omittedCaption,
        ...restMediaAttributes
      } = mediaAttributes;
      mediaAttributes = restMediaAttributes;
    }

    setAttributes(mediaAttributes);
    this.setState({
      isEditing: false
    });
  }

  onSelectCustomURL(newURL) {
    const {
      setAttributes,
      url
    } = this.props;

    if (newURL !== url) {
      setAttributes({
        url: newURL,
        id: undefined
      });
      this.setState({
        isEditing: false
      });
    }
  }

  render() {
    const {
      url,
      alt,
      id,
      linkTo,
      link,
      isFirstItem,
      isLastItem,
      isSelected,
      caption,
      onRemove,
      onMoveForward,
      onMoveBackward,
      setAttributes,
      'aria-label': ariaLabel
    } = this.props;
    const {
      isEditing
    } = this.state;
    let href;

    switch (linkTo) {
      case v1_constants_LINK_DESTINATION_MEDIA:
        href = url;
        break;

      case v1_constants_LINK_DESTINATION_ATTACHMENT:
        href = link;
        break;
    }

    const img = // Disable reason: Image itself is not meant to be interactive, but should
    // direct image selection and unfocus caption fields.

    /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
    (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("img", {
      src: url,
      alt: alt,
      "data-id": id,
      onKeyDown: this.onRemoveImage,
      tabIndex: "0",
      "aria-label": ariaLabel,
      ref: this.bindContainer
    }), (0,external_gc_blob_namespaceObject.isBlobURL)(url) && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null))
    /* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
    ;
    const className = classnames_default()({
      'is-selected': isSelected,
      'is-transient': (0,external_gc_blob_namespaceObject.isBlobURL)(url)
    });
    return (// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
      (0,external_gc_element_namespaceObject.createElement)("figure", {
        className: className,
        onClick: this.onSelectImage,
        onFocus: this.onSelectImage
      }, !isEditing && (href ? (0,external_gc_element_namespaceObject.createElement)("a", {
        href: href
      }, img) : img), isEditing && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaPlaceholder, {
        labels: {
          title: (0,external_gc_i18n_namespaceObject.__)('编辑库图片')
        },
        icon: library_image,
        onSelect: this.onSelectImageFromLibrary,
        onSelectURL: this.onSelectCustomURL,
        accept: "image/*",
        allowedTypes: ['image'],
        value: {
          id,
          src: url
        }
      }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ButtonGroup, {
        className: "block-library-gallery-item__inline-menu is-left"
      }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
        icon: chevron_left,
        onClick: isFirstItem ? undefined : onMoveBackward,
        label: (0,external_gc_i18n_namespaceObject.__)('后移图片'),
        "aria-disabled": isFirstItem,
        disabled: !isSelected
      }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
        icon: chevron_right,
        onClick: isLastItem ? undefined : onMoveForward,
        label: (0,external_gc_i18n_namespaceObject.__)('前移图片'),
        "aria-disabled": isLastItem,
        disabled: !isSelected
      })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ButtonGroup, {
        className: "block-library-gallery-item__inline-menu is-right"
      }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
        icon: library_edit,
        onClick: this.onEdit,
        label: (0,external_gc_i18n_namespaceObject.__)('更换图片'),
        disabled: !isSelected
      }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
        icon: close_small,
        onClick: onRemove,
        label: (0,external_gc_i18n_namespaceObject.__)('移除图片'),
        disabled: !isSelected
      })), !isEditing && (isSelected || caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
        tagName: "figcaption",
        className: (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
        "aria-label": (0,external_gc_i18n_namespaceObject.__)('图片描述文字'),
        placeholder: isSelected ? (0,external_gc_i18n_namespaceObject.__)('添加说明文字') : null,
        value: caption,
        onChange: newCaption => setAttributes({
          caption: newCaption
        }),
        inlineToolbar: true
      }))
    );
  }

}

/* harmony default export */ var gallery_image = ((0,external_gc_compose_namespaceObject.compose)([(0,external_gc_data_namespaceObject.withSelect)((select, ownProps) => {
  const {
    getMedia
  } = select(external_gc_coreData_namespaceObject.store);
  const {
    id
  } = ownProps;
  return {
    image: id ? getMedia(parseInt(id, 10)) : null
  };
}), (0,external_gc_data_namespaceObject.withDispatch)(dispatch => {
  const {
    __unstableMarkNextChangeAsNotPersistent
  } = dispatch(external_gc_blockEditor_namespaceObject.store);
  return {
    __unstableMarkNextChangeAsNotPersistent
  };
})])(GalleryImage));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/v1/gallery.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */



const gallery_Gallery = props => {
  const {
    attributes,
    isSelected,
    setAttributes,
    selectedImage,
    mediaPlaceholder,
    onMoveBackward,
    onMoveForward,
    onRemoveImage,
    onSelectImage,
    onDeselectImage,
    onSetImageAttributes,
    insertBlocksAfter,
    blockProps
  } = props;
  const {
    align,
    columns = defaultColumnsNumberV1(attributes),
    caption,
    imageCrop,
    images
  } = attributes;
  return (0,external_gc_element_namespaceObject.createElement)("figure", { ...blockProps,
    className: classnames_default()(blockProps.className, {
      [`align${align}`]: align,
      [`columns-${columns}`]: columns,
      'is-cropped': imageCrop
    })
  }, (0,external_gc_element_namespaceObject.createElement)("ul", {
    className: "blocks-gallery-grid"
  }, images.map((img, index) => {
    const ariaLabel = (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: 1: the order number of the image. 2: the total number of images. */
    (0,external_gc_i18n_namespaceObject.__)('相册中的%1$d/%2$d个图片'), index + 1, images.length);
    return (0,external_gc_element_namespaceObject.createElement)("li", {
      className: "blocks-gallery-item",
      key: img.id ? `${img.id}-${index}` : img.url
    }, (0,external_gc_element_namespaceObject.createElement)(gallery_image, {
      url: img.url,
      alt: img.alt,
      id: img.id,
      isFirstItem: index === 0,
      isLastItem: index + 1 === images.length,
      isSelected: isSelected && selectedImage === index,
      onMoveBackward: onMoveBackward(index),
      onMoveForward: onMoveForward(index),
      onRemove: onRemoveImage(index),
      onSelect: onSelectImage(index),
      onDeselect: onDeselectImage(index),
      setAttributes: attrs => onSetImageAttributes(index, attrs),
      caption: img.caption,
      "aria-label": ariaLabel,
      sizeSlug: attributes.sizeSlug
    }));
  })), mediaPlaceholder, (0,external_gc_element_namespaceObject.createElement)(RichTextVisibilityHelper, {
    isHidden: !isSelected && external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption),
    tagName: "figcaption",
    className: classnames_default()('blocks-gallery-caption', (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')),
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('图库说明文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('编写图库字幕...' ),
    value: caption,
    onChange: value => setAttributes({
      caption: value
    }),
    inlineToolbar: true,
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)()))
  }));
};

function RichTextVisibilityHelper({
  isHidden,
  ...richTextProps
}) {
  return isHidden ? (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.VisuallyHidden, {
    as: external_gc_blockEditor_namespaceObject.RichText,
    ...richTextProps
  }) : (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, { ...richTextProps
  });
}

/* harmony default export */ var v1_gallery = (gallery_Gallery);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/v1/edit.js


/**
 * GeChiUI dependencies
 */










/**
 * Internal dependencies
 */






const edit_MAX_COLUMNS = 8;
const edit_linkOptions = [{
  value: v1_constants_LINK_DESTINATION_ATTACHMENT,
  label: (0,external_gc_i18n_namespaceObject.__)('附件页面')
}, {
  value: v1_constants_LINK_DESTINATION_MEDIA,
  label: (0,external_gc_i18n_namespaceObject.__)('媒体文件')
}, {
  value: v1_constants_LINK_DESTINATION_NONE,
  label: (0,external_gc_i18n_namespaceObject.__)('无')
}];
const v1_edit_ALLOWED_MEDIA_TYPES = ['image'];
const edit_PLACEHOLDER_TEXT = external_gc_element_namespaceObject.Platform.select({
  web: (0,external_gc_i18n_namespaceObject.__)('拖动图片，上传新图片或从您的媒体库中选择文件。'),
  native: (0,external_gc_i18n_namespaceObject.__)('添加媒体')
});
const edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_gc_element_namespaceObject.Platform.select({
  web: {},
  native: {
    type: 'stepper'
  }
});

function edit_GalleryEdit(props) {
  const {
    attributes,
    clientId,
    isSelected,
    noticeUI,
    noticeOperations,
    onFocus
  } = props;
  const {
    columns = defaultColumnsNumberV1(attributes),
    imageCrop,
    images,
    linkTo,
    sizeSlug
  } = attributes;
  const [selectedImage, setSelectedImage] = (0,external_gc_element_namespaceObject.useState)();
  const [attachmentCaptions, setAttachmentCaptions] = (0,external_gc_element_namespaceObject.useState)();
  const {
    __unstableMarkNextChangeAsNotPersistent
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const {
    imageSizes,
    mediaUpload,
    getMedia,
    wasBlockJustInserted
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const settings = select(external_gc_blockEditor_namespaceObject.store).getSettings();
    return {
      imageSizes: settings.imageSizes,
      mediaUpload: settings.mediaUpload,
      getMedia: select(external_gc_coreData_namespaceObject.store).getMedia,
      wasBlockJustInserted: select(external_gc_blockEditor_namespaceObject.store).wasBlockJustInserted(clientId, 'inserter_menu')
    };
  });
  const resizedImages = (0,external_gc_element_namespaceObject.useMemo)(() => {
    if (isSelected) {
      var _attributes$ids;

      return ((_attributes$ids = attributes.ids) !== null && _attributes$ids !== void 0 ? _attributes$ids : []).reduce((currentResizedImages, id) => {
        if (!id) {
          return currentResizedImages;
        }

        const image = getMedia(id);
        const sizes = imageSizes.reduce((currentSizes, size) => {
          const defaultUrl = image?.sizes?.[size.slug]?.url;
          const mediaDetailsUrl = image?.media_details?.sizes?.[size.slug]?.source_url;
          return { ...currentSizes,
            [size.slug]: defaultUrl || mediaDetailsUrl
          };
        }, {});
        return { ...currentResizedImages,
          [parseInt(id, 10)]: sizes
        };
      }, {});
    }

    return {};
  }, [isSelected, attributes.ids, imageSizes]);

  function onFocusGalleryCaption() {
    setSelectedImage();
  }

  function setAttributes(newAttrs) {
    if (newAttrs.ids) {
      throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');
    }

    if (newAttrs.images) {
      newAttrs = { ...newAttrs,
        // Unlike images[ n ].id which is a string, always ensure the
        // ids array contains numbers as per its attribute type.
        ids: newAttrs.images.map(({
          id
        }) => parseInt(id, 10))
      };
    }

    props.setAttributes(newAttrs);
  }

  function onSelectImage(index) {
    return () => {
      setSelectedImage(index);
    };
  }

  function onDeselectImage() {
    return () => {
      setSelectedImage();
    };
  }

  function onMove(oldIndex, newIndex) {
    const newImages = [...images];
    newImages.splice(newIndex, 1, images[oldIndex]);
    newImages.splice(oldIndex, 1, images[newIndex]);
    setSelectedImage(newIndex);
    setAttributes({
      images: newImages
    });
  }

  function onMoveForward(oldIndex) {
    return () => {
      if (oldIndex === images.length - 1) {
        return;
      }

      onMove(oldIndex, oldIndex + 1);
    };
  }

  function onMoveBackward(oldIndex) {
    return () => {
      if (oldIndex === 0) {
        return;
      }

      onMove(oldIndex, oldIndex - 1);
    };
  }

  function onRemoveImage(index) {
    return () => {
      const newImages = images.filter((img, i) => index !== i);
      setSelectedImage();
      setAttributes({
        images: newImages,
        columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns
      });
    };
  }

  function selectCaption(newImage) {
    // The image id in both the images and attachmentCaptions arrays is a
    // string, so ensure comparison works correctly by converting the
    // newImage.id to a string.
    const newImageId = newImage.id.toString();
    const currentImage = images.find(({
      id
    }) => id === newImageId);
    const currentImageCaption = currentImage ? currentImage.caption : newImage.caption;

    if (!attachmentCaptions) {
      return currentImageCaption;
    }

    const attachment = attachmentCaptions.find(({
      id
    }) => id === newImageId); // If the attachment caption is updated.

    if (attachment && attachment.caption !== newImage.caption) {
      return newImage.caption;
    }

    return currentImageCaption;
  }

  function onSelectImages(newImages) {
    setAttachmentCaptions(newImages.map(newImage => ({
      // Store the attachmentCaption id as a string for consistency
      // with the type of the id in the images attribute.
      id: newImage.id.toString(),
      caption: newImage.caption
    })));
    setAttributes({
      images: newImages.map(newImage => ({ ...shared_pickRelevantMediaFiles(newImage, sizeSlug),
        caption: selectCaption(newImage, images, attachmentCaptions),
        // The id value is stored in a data attribute, so when the
        // block is parsed it's converted to a string. Converting
        // to a string here ensures it's type is consistent.
        id: newImage.id.toString()
      })),
      columns: attributes.columns ? Math.min(newImages.length, attributes.columns) : attributes.columns
    });
  }

  function onUploadError(message) {
    noticeOperations.removeAllNotices();
    noticeOperations.createErrorNotice(message);
  }

  function setLinkTo(value) {
    setAttributes({
      linkTo: value
    });
  }

  function setColumnsNumber(value) {
    setAttributes({
      columns: value
    });
  }

  function toggleImageCrop() {
    setAttributes({
      imageCrop: !imageCrop
    });
  }

  function getImageCropHelp(checked) {
    return checked ? (0,external_gc_i18n_namespaceObject.__)('缩略图已被裁切以便对齐。') : (0,external_gc_i18n_namespaceObject.__)('缩略图未被裁切。');
  }

  function setImageAttributes(index, newAttributes) {
    if (!images[index]) {
      return;
    }

    setAttributes({
      images: [...images.slice(0, index), { ...images[index],
        ...newAttributes
      }, ...images.slice(index + 1)]
    });
  }

  function getImagesSizeOptions() {
    const resizedImageSizes = Object.values(resizedImages);
    return imageSizes.filter(({
      slug
    }) => resizedImageSizes.some(sizes => sizes[slug])).map(({
      name,
      slug
    }) => ({
      value: slug,
      label: name
    }));
  }

  function updateImagesSize(newSizeSlug) {
    const updatedImages = (images !== null && images !== void 0 ? images : []).map(image => {
      if (!image.id) {
        return image;
      }

      const url = resizedImages[parseInt(image.id, 10)]?.[newSizeSlug];
      return { ...image,
        ...(url && {
          url
        })
      };
    });
    setAttributes({
      images: updatedImages,
      sizeSlug: newSizeSlug
    });
  }

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (external_gc_element_namespaceObject.Platform.OS === 'web' && images && images.length > 0 && images.every(({
      url
    }) => (0,external_gc_blob_namespaceObject.isBlobURL)(url))) {
      const filesList = images.map(({
        url
      }) => (0,external_gc_blob_namespaceObject.getBlobByURL)(url));
      images.forEach(({
        url
      }) => (0,external_gc_blob_namespaceObject.revokeBlobURL)(url));
      mediaUpload({
        filesList,
        onFileChange: onSelectImages,
        allowedTypes: ['image']
      });
    }
  }, []);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    // Deselect images when deselecting the block.
    if (!isSelected) {
      setSelectedImage();
    }
  }, [isSelected]);
  (0,external_gc_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?.gc?.media?.view?.settings?.defaultProps?.link || v1_constants_LINK_DESTINATION_NONE
      });
    }
  }, [linkTo]);
  const hasImages = !!images.length;
  const hasImageIds = hasImages && images.some(image => !!image.id);
  const mediaPlaceholder = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaPlaceholder, {
    addToGallery: hasImageIds,
    isAppender: hasImages,
    disableMediaButtons: hasImages && !isSelected,
    icon: !hasImages && sharedIcon,
    labels: {
      title: !hasImages && (0,external_gc_i18n_namespaceObject.__)('图库'),
      instructions: !hasImages && edit_PLACEHOLDER_TEXT
    },
    onSelect: onSelectImages,
    accept: "image/*",
    allowedTypes: v1_edit_ALLOWED_MEDIA_TYPES,
    multiple: true,
    value: hasImageIds ? images : {},
    onError: onUploadError,
    notices: hasImages ? undefined : noticeUI,
    onFocus: onFocus,
    autoOpenMediaUpload: !hasImages && isSelected && wasBlockJustInserted
  });
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();

  if (!hasImages) {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.View, { ...blockProps
    }, mediaPlaceholder);
  }

  const imageSizeOptions = getImagesSizeOptions();
  const shouldShowSizeOptions = hasImages && imageSizeOptions.length > 0;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, images.length > 1 && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('栏目'),
    value: columns,
    onChange: setColumnsNumber,
    min: 1,
    max: Math.min(edit_MAX_COLUMNS, images.length),
    ...edit_MOBILE_CONTROL_PROPS_RANGE_CONTROL,
    required: true
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('裁剪图片'),
    checked: !!imageCrop,
    onChange: toggleImageCrop,
    help: getImageCropHelp
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('链接至'),
    value: linkTo,
    onChange: setLinkTo,
    options: edit_linkOptions,
    hideCancelButton: true
  }), shouldShowSizeOptions && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('图片尺寸'),
    value: sizeSlug,
    options: imageSizeOptions,
    onChange: updateImagesSize,
    hideCancelButton: true
  }))), noticeUI, (0,external_gc_element_namespaceObject.createElement)(v1_gallery, { ...props,
    selectedImage: selectedImage,
    mediaPlaceholder: mediaPlaceholder,
    onMoveBackward: onMoveBackward,
    onMoveForward: onMoveForward,
    onRemoveImage: onRemoveImage,
    onSelectImage: onSelectImage,
    onDeselectImage: onDeselectImage,
    onSetImageAttributes: setImageAttributes,
    blockProps: blockProps // This prop is used by gallery.native.js.
    ,
    onFocusGalleryCaption: onFocusGalleryCaption
  }));
}

/* harmony default export */ var v1_edit = ((0,external_gc_compose_namespaceObject.compose)([external_gc_components_namespaceObject.withNotices, (0,external_gc_viewport_namespaceObject.withViewportMatch)({
  isNarrow: '< small'
})])(edit_GalleryEdit));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/edit-wrapper.js


/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




/*
 * Using a wrapper around the logic to load the edit for v1 of Gallery block
 * or the refactored version with InnerBlocks. This is to prevent conditional
 * use of hooks lint errors if adding this logic to the top of the edit component.
 */

function GalleryEditWrapper(props) {
  if (!isGalleryV2Enabled()) {
    return (0,external_gc_element_namespaceObject.createElement)(v1_edit, { ...props
    });
  }

  return (0,external_gc_element_namespaceObject.createElement)(gallery_edit, { ...props
  });
}

/* harmony default export */ var edit_wrapper = ((0,external_gc_compose_namespaceObject.compose)([external_gc_components_namespaceObject.withNotices])(GalleryEditWrapper));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/v1/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */



function saveV1({
  attributes
}) {
  const {
    images,
    columns = defaultColumnsNumberV1(attributes),
    imageCrop,
    caption,
    linkTo
  } = attributes;
  const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`;
  return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className
    })
  }, (0,external_gc_element_namespaceObject.createElement)("ul", {
    className: "blocks-gallery-grid"
  }, images.map(image => {
    let href;

    switch (linkTo) {
      case v1_constants_LINK_DESTINATION_MEDIA:
        href = image.fullUrl || image.url;
        break;

      case v1_constants_LINK_DESTINATION_ATTACHMENT:
        href = image.link;
        break;
    }

    const img = (0,external_gc_element_namespaceObject.createElement)("img", {
      src: image.url,
      alt: image.alt,
      "data-id": image.id,
      "data-full-url": image.fullUrl,
      "data-link": image.link,
      className: image.id ? `gc-image-${image.id}` : null
    });
    return (0,external_gc_element_namespaceObject.createElement)("li", {
      key: image.id || image.url,
      className: "blocks-gallery-item"
    }, (0,external_gc_element_namespaceObject.createElement)("figure", null, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
      href: href
    }, img) : img, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "figcaption",
      className: classnames_default()('blocks-gallery-item__caption', (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')),
      value: image.caption
    })));
  })), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    tagName: "figcaption",
    className: classnames_default()('blocks-gallery-caption', (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')),
    value: caption
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */



function saveWithInnerBlocks({
  attributes
}) {
  if (!isGalleryV2Enabled()) {
    return saveV1({
      attributes
    });
  }

  const {
    caption,
    columns,
    imageCrop
  } = attributes;
  const className = classnames_default()('has-nested-images', {
    [`columns-${columns}`]: columns !== undefined,
    [`columns-default`]: columns === undefined,
    'is-cropped': imageCrop
  });
  const blockProps = external_gc_blockEditor_namespaceObject.useBlockProps.save({
    className
  });
  const innerBlocksProps = external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  return (0,external_gc_element_namespaceObject.createElement)("figure", { ...innerBlocksProps
  }, innerBlocksProps.children, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    tagName: "figcaption",
    className: classnames_default()('blocks-gallery-caption', (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')),
    value: caption
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/transforms.js
/**
 * GeChiUI 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 tranform 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 (isGalleryV2Enabled() && block.name === 'core/gallery' && block.attributes?.images.length > 0) {
    const innerBlocks = block.attributes.images.map(({
      url,
      id,
      alt
    }) => {
      return (0,external_gc_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_gc_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_gc_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);

      if (isGalleryV2Enabled()) {
        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_gc_blocks_namespaceObject.createBlock)('core/image', image);
        });
        return (0,external_gc_blocks_namespaceObject.createBlock)('core/gallery', {
          align,
          sizeSlug
        }, innerBlocks);
      }

      return (0,external_gc_blocks_namespaceObject.createBlock)('core/gallery', {
        images: validImages.map(({
          id,
          url,
          alt,
          caption
        }) => ({
          id: id.toString(),
          url,
          alt,
          caption
        })),
        ids: validImages.map(({
          id
        }) => parseInt(id, 10)),
        align,
        sizeSlug
      });
    }
  }, {
    type: 'shortcode',
    tag: 'gallery',
    attributes: {
      images: {
        type: 'array',
        shortcode: ({
          named: {
            ids
          }
        }) => {
          if (!isGalleryV2Enabled()) {
            return parseShortcodeIds(ids).map(id => ({
              id: id.toString()
            }));
          }
        }
      },
      ids: {
        type: 'array',
        shortcode: ({
          named: {
            ids
          }
        }) => {
          if (!isGalleryV2Enabled()) {
            return parseShortcodeIds(ids);
          }
        }
      },
      columns: {
        type: 'number',
        shortcode: ({
          named: {
            columns = '3'
          }
        }) => {
          return parseInt(columns, 10);
        }
      },
      linkTo: {
        type: 'string',
        shortcode: ({
          named: {
            link
          }
        }) => {
          if (!isGalleryV2Enabled()) {
            switch (link) {
              case 'post':
                return v1_constants_LINK_DESTINATION_ATTACHMENT;

              case 'file':
                return v1_constants_LINK_DESTINATION_MEDIA;

              default:
                return v1_constants_LINK_DESTINATION_ATTACHMENT;
            }
          }

          switch (link) {
            case 'post':
              return LINK_DESTINATION_ATTACHMENT;

            case 'file':
              return LINK_DESTINATION_MEDIA;

            default:
              return LINK_DESTINATION_NONE;
          }
        }
      }
    },

    transform({
      named: {
        ids,
        columns = 3,
        link
      }
    }) {
      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_gc_blocks_namespaceObject.createBlock)('core/gallery', {
        columns: parseInt(columns, 10),
        linkTo
      }, imageIds.map(imageId => (0,external_gc_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 overrrides the image block transformation when mulitple 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) {
      if (isGalleryV2Enabled()) {
        const innerBlocks = files.map(file => (0,external_gc_blocks_namespaceObject.createBlock)('core/image', {
          url: (0,external_gc_blob_namespaceObject.createBlobURL)(file)
        }));
        return (0,external_gc_blocks_namespaceObject.createBlock)('core/gallery', {}, innerBlocks);
      }

      const block = (0,external_gc_blocks_namespaceObject.createBlock)('core/gallery', {
        images: files.map(file => pickRelevantMediaFiles({
          url: (0,external_gc_blob_namespaceObject.createBlobURL)(file)
        }))
      });
      return block;
    }

  }],
  to: [{
    type: 'block',
    blocks: ['core/image'],
    transform: ({
      align,
      images,
      ids,
      sizeSlug
    }, innerBlocks) => {
      if (isGalleryV2Enabled()) {
        if (innerBlocks.length > 0) {
          return innerBlocks.map(({
            attributes: {
              url,
              alt,
              caption,
              title,
              href,
              rel,
              linkClass,
              id,
              sizeSlug: imageSizeSlug,
              linkDestination,
              linkTarget,
              anchor,
              className
            }
          }) => (0,external_gc_blocks_namespaceObject.createBlock)('core/image', {
            align,
            url,
            alt,
            caption,
            title,
            href,
            rel,
            linkClass,
            id,
            sizeSlug: imageSizeSlug,
            linkDestination,
            linkTarget,
            anchor,
            className
          }));
        }

        return (0,external_gc_blocks_namespaceObject.createBlock)('core/image', {
          align
        });
      }

      if (images.length > 0) {
        return images.map(({
          url,
          alt,
          caption
        }, index) => (0,external_gc_blocks_namespaceObject.createBlock)('core/image', {
          id: ids[index],
          url,
          alt,
          caption,
          align,
          sizeSlug
        }));
      }

      return (0,external_gc_blocks_namespaceObject.createBlock)('core/image', {
        align
      });
    }
  }]
};
/* harmony default export */ var gallery_transforms = (gallery_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/gallery/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */




const gallery_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/gallery",
  title: "图库",
  category: "media",
  description: "在相册中展示多张图片。",
  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: "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
    }
  },
  providesContext: {
    allowResize: "allowResize",
    imageCrop: "imageCrop",
    fixedHeight: "fixedHeight"
  },
  supports: {
    anchor: true,
    align: 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"
      }
    }
  },
  editorStyle: "gc-block-gallery-editor",
  style: "gc-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: edit_wrapper,
  save: saveWithInnerBlocks,
  deprecated: gallery_deprecated
};
const gallery_init = () => initBlock({
  name: gallery_name,
  metadata: gallery_metadata,
  settings: gallery_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/group.js


/**
 * GeChiUI dependencies
 */

const group = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_group = (group);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/group/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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 (0,external_gc_element_namespaceObject.createElement)(Tag, { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(external_gc_blockEditor_namespaceObject.useBlockProps.save())
    });
  },

  isEligible: ({
    layout
  }) => !layout || layout.inherit || layout.contentSize && layout.type !== 'constrained',
  migrate: attributes => {
    const {
      layout = null
    } = attributes;

    if (!layout) {
      return 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 (0,external_gc_element_namespaceObject.createElement)(Tag, { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
    }, (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-group__inner-container"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  }

}, // 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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const textClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const className = classnames_default()(backgroundClass, textClass, {
      'has-text-color': textColor || customTextColor,
      'has-background': backgroundColor || customBackgroundColor
    });
    const styles = {
      backgroundColor: backgroundClass ? undefined : customBackgroundColor,
      color: textClass ? undefined : customTextColor
    };
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: className,
      style: styles
    }, (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-group__inner-container"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  }

}, // 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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const textClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const className = classnames_default()(backgroundClass, {
      'has-text-color': textColor || customTextColor,
      'has-background': backgroundColor || customBackgroundColor
    });
    const styles = {
      backgroundColor: backgroundClass ? undefined : customBackgroundColor,
      color: textClass ? undefined : customTextColor
    };
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: className,
      style: styles
    }, (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-group__inner-container"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  }

}, // 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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const className = classnames_default()(backgroundClass, {
      'has-background': backgroundColor || customBackgroundColor
    });
    const styles = {
      backgroundColor: backgroundClass ? undefined : customBackgroundColor
    };
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: className,
      style: styles
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
  }

}];
/* harmony default export */ var group_deprecated = (group_deprecated_deprecated);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/group/placeholder.js


/**
 * GeChiUI 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: (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
      xmlns: "http://www.w3.org/2000/svg",
      width: "44",
      height: "32",
      viewBox: "0 0 44 32"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
      d: "M42 0H2C.9 0 0 .9 0 2v28c0 1.1.9 2 2 2h40c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2z"
    })),
    'group-row': (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
      xmlns: "http://www.w3.org/2000/svg",
      width: "44",
      height: "32",
      viewBox: "0 0 44 32"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
      d: "M42 0H23.5c-.6 0-1 .4-1 1v30c0 .6.4 1 1 1H42c1.1 0 2-.9 2-2V2c0-1.1-.9-2-2-2zM20.5 0H2C.9 0 0 .9 0 2v28c0 1.1.9 2 2 2h18.5c.6 0 1-.4 1-1V1c0-.6-.4-1-1-1z"
    })),
    'group-stack': (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
      xmlns: "http://www.w3.org/2000/svg",
      width: "44",
      height: "32",
      viewBox: "0 0 44 32"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
      d: "M42 0H2C.9 0 0 .9 0 2v12.5c0 .6.4 1 1 1h42c.6 0 1-.4 1-1V2c0-1.1-.9-2-2-2zm1 16.5H1c-.6 0-1 .4-1 1V30c0 1.1.9 2 2 2h40c1.1 0 2-.9 2-2V17.5c0-.6-.4-1-1-1z"
    })),
    'group-grid': (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
      xmlns: "http://www.w3.org/2000/svg",
      width: "44",
      height: "32",
      viewBox: "0 0 44 32"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
      d: "m20.30137,-0.00025l-18.9728,0c-0.86524,0.07234 -1.41711,0.79149 -1.41711,1.89149l0,12.64468c0,0.6 0.73401,0.96383 1.0304,0.96383l19.67469,0.03617c0.29639,0 1.0304,-0.4 1.0304,-1l-0.03576,-12.7532c0,-1.1 -0.76644,-1.78297 -1.30983,-1.78297zm0.52975,16.60851l-19.99654,-0.03617c-0.29639,0 -0.92312,0.36383 -0.92312,0.96383l-0.03576,12.68085c0,1.1 0.8022,1.81915 1.34559,1.81915l19.00857,0c0.54339,0 1.45287,-0.71915 1.45287,-1.81915l0,-12.53617c0,-0.6 -0.5552,-1.07234 -0.8516,-1.07234z"
    }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
      d: "m42.73056,-0.03617l-18.59217,0c-0.84788,0.07234 -1.38868,0.79149 -1.38868,1.89149l0,12.64468c0,0.6 0.71928,0.96383 1.00973,0.96383l19.27997,0.03617c0.29045,0 1.00973,-0.4 1.00973,-1l-0.03504,-12.7532c0,-1.1 -0.75106,-1.78297 -1.28355,-1.78297zm0.51912,16.60851l-19.59537,-0.03617c-0.29045,0 -0.9046,0.36383 -0.9046,0.96383l-0.03504,12.68085c0,1.1 0.78611,1.81915 1.31859,1.81915l18.62721,0c0.53249,0 1.42372,-0.71915 1.42372,-1.81915l0,-12.53617c0,-0.6 -0.54407,-1.07234 -0.83451,-1.07234z"
    }))
  };
  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_gc_element_namespaceObject.useState)(!hasInnerBlocks && !backgroundColor && !fontSize && !textColor && !style && usedLayoutType !== 'flex' && usedLayoutType !== 'grid');
  (0,external_gc_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_gc_data_namespaceObject.useSelect)(select => select(external_gc_blocks_namespaceObject.store).getBlockVariations(name, 'block'), [name]);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: 'gc-block-group__placeholder'
  });
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
    instructions: (0,external_gc_i18n_namespaceObject.__)('将块组合在一起，请选择布局：')
  }, (0,external_gc_element_namespaceObject.createElement)("ul", {
    role: "list",
    className: "gc-block-group-placeholder__variations",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('区块变体')
  }, variations.map(variation => (0,external_gc_element_namespaceObject.createElement)("li", {
    key: variation.name
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "tertiary",
    icon: getGroupPlaceholderIcons(variation.name),
    iconSize: 44,
    onClick: () => onSelect(variation),
    className: "gc-block-group-placeholder__variation-button",
    label: `${variation.title}: ${variation.description}`
  }))))));
}

/* harmony default export */ var placeholder = (GroupPlaceHolder);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/group/edit.js


/**
 * GeChiUI 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
}) {
  const htmlElementMessages = {
    header: (0,external_gc_i18n_namespaceObject.__)('<header>元素应表示介绍性内容，通常是一组介绍性或导航辅助工具。'),
    main: (0,external_gc_i18n_namespaceObject.__)('<main>元素应仅用于文档的主要内容。'),
    section: (0,external_gc_i18n_namespaceObject.__)("<section>元素应该代表文档的一个独立部分，不能用另一个元素更好地表示。"),
    article: (0,external_gc_i18n_namespaceObject.__)('<article>元素应该代表文档的一个自包含的、可联合的部分。'),
    aside: (0,external_gc_i18n_namespaceObject.__)("<aside>元素应代表文档的一部分，其内容仅与文档的主要内容间接相关。"),
    footer: (0,external_gc_i18n_namespaceObject.__)('<footer>元素应表示其最近的分段元素的页脚（例如：<section>、<article>、<main>等）。')
  };
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "advanced"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('HTML 元素'),
    options: [{
      label: (0,external_gc_i18n_namespaceObject.__)('默认（<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,
  __unstableLayoutClassNames: layoutClassNames
}) {
  const {
    hasInnerBlocks,
    themeSupportsLayout
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlock,
      getSettings
    } = select(external_gc_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 defaultLayout = (0,external_gc_blockEditor_namespaceObject.useSetting)('layout') || {};
  const usedLayout = !layout?.type ? { ...defaultLayout,
    ...layout,
    type: 'default'
  } : { ...defaultLayout,
    ...layout
  };
  const {
    type = 'default'
  } = usedLayout;
  const layoutSupportEnabled = themeSupportsLayout || type === 'flex' || type === 'grid'; // Hooks.

  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: !layoutSupportEnabled ? layoutClassNames : null
  });
  const [showPlaceholder, setShowPlaceholder] = useShouldShowPlaceHolder({
    attributes,
    usedLayoutType: usedLayout?.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_gc_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender;
  }

  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : {
    className: 'gc-block-group__inner-container'
  }, {
    templateLock,
    allowedBlocks,
    renderAppender,
    __unstableDisableLayoutClassNames: !layoutSupportEnabled
  });
  const {
    selectBlock
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);

  const selectVariation = nextVariation => {
    setAttributes(nextVariation.attributes);
    selectBlock(clientId, -1);
    setShowPlaceholder(false);
  };

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(GroupEditControls, {
    tagName: TagName,
    onSelectTagName: value => setAttributes({
      tagName: value
    })
  }), showPlaceholder && (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.View, null, innerBlocksProps.children, (0,external_gc_element_namespaceObject.createElement)(placeholder, {
    clientId: clientId,
    name: name,
    onSelect: selectVariation
  })), layoutSupportEnabled && !showPlaceholder && (0,external_gc_element_namespaceObject.createElement)(TagName, { ...innerBlocksProps
  }), !layoutSupportEnabled && !showPlaceholder && (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  })));
}

/* harmony default export */ var group_edit = (GroupEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/group/save.js


/**
 * GeChiUI dependencies
 */

function group_save_save({
  attributes: {
    tagName: Tag
  }
}) {
  return (0,external_gc_element_namespaceObject.createElement)(Tag, { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(external_gc_blockEditor_namespaceObject.useBlockProps.save())
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/group/transforms.js
/**
 * GeChiUI 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_gc_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks);
      });
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/group', {
        align: widestAlignment,
        layout: {
          type: 'constrained'
        }
      }, groupInnerBlocks);
    }

  }]
};
/* harmony default export */ var group_transforms = (group_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/row.js


/**
 * GeChiUI dependencies
 */

const row = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_row = (row);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/stack.js


/**
 * GeChiUI dependencies
 */

const stack = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_stack = (stack);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/grid.js


/**
 * GeChiUI dependencies
 */

const grid = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_grid = (grid);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/group/variations.js
/**
 * GeChiUI dependencies
 */


const group_variations_variations = [{
  name: 'group',
  title: (0,external_gc_i18n_namespaceObject.__)('组合'),
  description: (0,external_gc_i18n_namespaceObject.__)('聚集区块到一个容器里。'),
  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_gc_i18n_namespaceObject._x)('行', 'single horizontal line'),
  description: (0,external_gc_i18n_namespaceObject.__)('水平排列区块。'),
  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
}, {
  name: 'group-stack',
  title: (0,external_gc_i18n_namespaceObject.__)('堆叠'),
  description: (0,external_gc_i18n_namespaceObject.__)('垂直排列区块。'),
  attributes: {
    layout: {
      type: 'flex',
      orientation: 'vertical'
    }
  },
  scope: ['block', 'inserter', 'transform'],
  isActive: blockAttributes => blockAttributes.layout?.type === 'flex' && blockAttributes.layout?.orientation === 'vertical',
  icon: library_stack
}];

if (window?.__experimentalEnableGroupGridVariation) {
  group_variations_variations.push({
    name: 'group-grid',
    title: (0,external_gc_i18n_namespaceObject.__)('网格'),
    description: (0,external_gc_i18n_namespaceObject.__)('在网格布局(grid)中排列块。'),
    attributes: {
      layout: {
        type: 'grid'
      }
    },
    scope: ['block', 'inserter', 'transform'],
    isActive: blockAttributes => blockAttributes.layout?.type === 'grid',
    icon: library_grid
  });
}

/* harmony default export */ var group_variations = (group_variations_variations);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/group/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const group_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/group",
  title: "组",
  category: "design",
  description: "在布局容器里收集区块。",
  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,
    __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
      }
    },
    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
    }
  },
  editorStyle: "gc-block-group-editor",
  style: "gc-block-group"
};



const {
  name: group_name
} = group_metadata;

const group_settings = {
  icon: library_group,
  example: {
    attributes: {
      style: {
        color: {
          text: '#000000',
          background: '#ffffff'
        }
      }
    },
    innerBlocks: [{
      name: 'core/paragraph',
      attributes: {
        customTextColor: '#cf2e2e',
        fontSize: 'large',
        content: (0,external_gc_i18n_namespaceObject.__)('一、')
      }
    }, {
      name: 'core/paragraph',
      attributes: {
        customTextColor: '#ff6900',
        fontSize: 'large',
        content: (0,external_gc_i18n_namespaceObject.__)('二、')
      }
    }, {
      name: 'core/paragraph',
      attributes: {
        customTextColor: '#fcb900',
        fontSize: 'large',
        content: (0,external_gc_i18n_namespaceObject.__)('三、')
      }
    }, {
      name: 'core/paragraph',
      attributes: {
        customTextColor: '#00d084',
        fontSize: 'large',
        content: (0,external_gc_i18n_namespaceObject.__)('四、')
      }
    }, {
      name: 'core/paragraph',
      attributes: {
        customTextColor: '#0693e3',
        fontSize: 'large',
        content: (0,external_gc_i18n_namespaceObject.__)('五、')
      }
    }, {
      name: 'core/paragraph',
      attributes: {
        customTextColor: '#9b51e0',
        fontSize: 'large',
        content: (0,external_gc_i18n_namespaceObject.__)('六、')
      }
    }]
  },
  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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/heading.js


/**
 * GeChiUI dependencies
 */

const heading = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M6 5V18.5911L12 13.8473L18 18.5911V5H6Z"
}));
/* harmony default export */ var library_heading = (heading);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/heading/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const className = classnames_default()({
      [textClass]: textClass
    });
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const className = classnames_default()({
      [textClass]: textClass,
      [`has-text-align-${align}`]: align
    });
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const className = classnames_default()({
      [textClass]: textClass,
      'has-text-color': textColor || customTextColor,
      [`has-text-align-${align}`]: align
    });
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_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 = classnames_default()({
      [`has-text-align-${align}`]: align
    });
    return (0,external_gc_element_namespaceObject.createElement)(TagName, { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: content
    }));
  }

}; // This deprecation covers the serialization of the `gc-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: '',
      __experimentalRole: 'content'
    },
    level: {
      type: 'number',
      default: 2
    },
    placeholder: {
      type: 'string'
    }
  },

  save({
    attributes
  }) {
    const {
      textAlign,
      content,
      level
    } = attributes;
    const TagName = 'h' + level;
    const className = classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    });
    return (0,external_gc_element_namespaceObject.createElement)(TagName, { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var heading_deprecated = (heading_deprecated_deprecated);

// EXTERNAL MODULE: ./node_modules/remove-accents/index.js
var remove_accents = __webpack_require__(4793);
var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
;// CONCATENATED MODULE: ./node_modules/@gechiui/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;
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/heading/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */



function HeadingEdit({
  attributes,
  setAttributes,
  mergeBlocks,
  onReplace,
  style,
  clientId
}) {
  const {
    textAlign,
    content,
    level,
    placeholder,
    anchor
  } = attributes;
  const tagName = 'h' + level;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    }),
    style
  });
  const {
    canGenerateAnchors
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getGlobalBlockCount,
      getSettings
    } = select(external_gc_blockEditor_namespaceObject.store);
    const settings = getSettings();
    return {
      canGenerateAnchors: !!settings.generateAnchors || getGlobalBlockCount('core/table-of-contents') > 0
    };
  }, []);
  const {
    __unstableMarkNextChangeAsNotPersistent
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_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_gc_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 (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.HeadingLevelDropdown, {
    value: level,
    onChange: newLevel => setAttributes({
      level: newLevel
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    identifier: "content",
    tagName: tagName,
    value: content,
    onChange: onContentChange,
    onMerge: mergeBlocks,
    onSplit: (value, isOriginal) => {
      let block;

      if (isOriginal || value) {
        block = (0,external_gc_blocks_namespaceObject.createBlock)('core/heading', { ...attributes,
          content: value
        });
      } else {
        var _getDefaultBlockName;

        block = (0,external_gc_blocks_namespaceObject.createBlock)((_getDefaultBlockName = (0,external_gc_blocks_namespaceObject.getDefaultBlockName)()) !== null && _getDefaultBlockName !== void 0 ? _getDefaultBlockName : 'core/heading');
      }

      if (isOriginal) {
        block.clientId = clientId;
      }

      return block;
    },
    onReplace: onReplace,
    onRemove: () => onReplace([]),
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('标题文字'),
    placeholder: placeholder || (0,external_gc_i18n_namespaceObject.__)('标题'),
    textAlign: textAlign,
    ...(external_gc_element_namespaceObject.Platform.isNative && {
      deleteEnter: true
    }),
    ...blockProps
  }));
}

/* harmony default export */ var heading_edit = (HeadingEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/heading/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


function heading_save_save({
  attributes
}) {
  const {
    textAlign,
    content,
    level
  } = attributes;
  const TagName = 'h' + level;
  const className = classnames_default()({
    [`has-text-align-${textAlign}`]: textAlign
  });
  return (0,external_gc_element_namespaceObject.createElement)(TagName, { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className
    })
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    value: content
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/heading/transforms.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const {
  name: heading_transforms_name
} = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/heading",
  title: "标题",
  category: "text",
  description: "介绍新章节并组织内容，以帮助访问者和搜索引擎了解您的内容结构。",
  keywords: ["title", "subtitle"],
  textdomain: "default",
  attributes: {
    textAlign: {
      type: "string"
    },
    content: {
      type: "string",
      source: "html",
      selector: "h1,h2,h3,h4,h5,h6",
      "default": "",
      __experimentalRole: "content"
    },
    level: {
      type: "number",
      "default": 2
    },
    placeholder: {
      type: "string"
    }
  },
  supports: {
    align: ["wide", "full"],
    anchor: true,
    className: 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,
      __experimentalDefaultControls: {
        fontSize: true,
        fontAppearance: true,
        textTransform: true
      }
    },
    __unstablePasteTextInline: true,
    __experimentalSlashInserter: true
  },
  editorStyle: "gc-block-heading-editor",
  style: "gc-block-heading"
};
const heading_transforms_transforms = {
  from: [{
    type: 'block',
    isMultiBlock: true,
    blocks: ['core/paragraph'],
    transform: attributes => attributes.map(({
      content,
      anchor,
      align: textAlign
    }) => (0,external_gc_blocks_namespaceObject.createBlock)(heading_transforms_name, {
      content,
      anchor,
      textAlign
    }))
  }, {
    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_gc_blocks_namespaceObject.getBlockAttributes)(heading_transforms_name, node.outerHTML);
      const {
        textAlign
      } = node.style || {};
      attributes.level = getLevelFromHeadingNodeName(node.nodeName);

      if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') {
        attributes.align = textAlign;
      }

      return (0,external_gc_blocks_namespaceObject.createBlock)(heading_transforms_name, attributes);
    }

  }, ...[1, 2, 3, 4, 5, 6].map(level => ({
    type: 'prefix',
    prefix: Array(level + 1).join('#'),

    transform(content) {
      return (0,external_gc_blocks_namespaceObject.createBlock)(heading_transforms_name, {
        level,
        content
      });
    }

  })), ...[1, 2, 3, 4, 5, 6].map(level => ({
    type: 'enter',
    regExp: new RegExp(`^/(h|H)${level}$`),

    transform(content) {
      return (0,external_gc_blocks_namespaceObject.createBlock)(heading_transforms_name, {
        level,
        content
      });
    }

  }))],
  to: [{
    type: 'block',
    isMultiBlock: true,
    blocks: ['core/paragraph'],
    transform: attributes => attributes.map(({
      content,
      textAlign: align
    }) => (0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
      content,
      align
    }))
  }]
};
/* harmony default export */ var heading_transforms = (heading_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/heading/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const heading_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/heading",
  title: "标题",
  category: "text",
  description: "介绍新章节并组织内容，以帮助访问者和搜索引擎了解您的内容结构。",
  keywords: ["title", "subtitle"],
  textdomain: "default",
  attributes: {
    textAlign: {
      type: "string"
    },
    content: {
      type: "string",
      source: "html",
      selector: "h1,h2,h3,h4,h5,h6",
      "default": "",
      __experimentalRole: "content"
    },
    level: {
      type: "number",
      "default": 2
    },
    placeholder: {
      type: "string"
    }
  },
  supports: {
    align: ["wide", "full"],
    anchor: true,
    className: 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,
      __experimentalDefaultControls: {
        fontSize: true,
        fontAppearance: true,
        textTransform: true
      }
    },
    __unstablePasteTextInline: true,
    __experimentalSlashInserter: true
  },
  editorStyle: "gc-block-heading-editor",
  style: "gc-block-heading"
};


const {
  name: heading_name
} = heading_metadata;

const heading_settings = {
  icon: library_heading,
  example: {
    attributes: {
      content: (0,external_gc_i18n_namespaceObject.__)('代码如诗'),
      level: 2
    }
  },

  __experimentalLabel(attributes, {
    context
  }) {
    const {
      content,
      level
    } = attributes; // 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' && content) {
      return content;
    }

    if (context === 'accessibility') {
      return !content || content.length === 0 ? (0,external_gc_i18n_namespaceObject.sprintf)(
      /* translators: accessibility text. %s: heading level. */
      (0,external_gc_i18n_namespaceObject.__)('%s级。空白。'), level) : (0,external_gc_i18n_namespaceObject.sprintf)(
      /* translators: accessibility text. 1: heading level. 2: heading content. */
      (0,external_gc_i18n_namespaceObject.__)('第%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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/home.js


/**
 * GeChiUI dependencies
 */

const home = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_home = (home);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/home-link/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */







const preventDefault = event => event.preventDefault();

function HomeEdit({
  attributes,
  setAttributes,
  context
}) {
  const {
    homeUrl
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getUnstableBase // Site index.

    } = select(external_gc_coreData_namespaceObject.store);
    return {
      homeUrl: getUnstableBase()?.home
    };
  }, []);
  const {
    __unstableMarkNextChangeAsNotPersistent
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const {
    textColor,
    backgroundColor,
    style
  } = context;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()('gc-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
    }
  });
  const {
    label
  } = attributes;
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (label === undefined) {
      __unstableMarkNextChangeAsNotPersistent();

      setAttributes({
        label: (0,external_gc_i18n_namespaceObject.__)('首页')
      });
    }
  }, [label]);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    className: "gc-block-home-link__content gc-block-navigation-item__content",
    href: homeUrl,
    onClick: preventDefault
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    identifier: "label",
    className: "gc-block-home-link__label",
    value: label,
    onChange: labelValue => {
      setAttributes({
        label: labelValue
      });
    },
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('主页链接文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('添加主页链接'),
    withoutInteractiveFormatting: true,
    allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough']
  }))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/home-link/save.js


/**
 * GeChiUI dependencies
 */

function home_link_save_save() {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/home-link/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */


const home_link_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/home-link",
  category: "design",
  parent: ["core/navigation"],
  title: "首页链接",
  description: "创建一个始终指向系统主页的链接。如果在标题中已经存在系统标题链接，通常没有必要。",
  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
      }
    }
  },
  editorStyle: "gc-block-home-link-editor",
  style: "gc-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_gc_i18n_namespaceObject._x)('首页链接', 'block example')
    }
  }
};
const home_link_init = () => initBlock({
  name: home_link_name,
  metadata: home_link_metadata,
  settings: home_link_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/html.js


/**
 * GeChiUI dependencies
 */

const html = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_html = (html);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/html/preview.js


/**
 * GeChiUI 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_gc_data_namespaceObject.useSelect)(select => {
    return select(external_gc_blockEditor_namespaceObject.store).getSettings()?.styles;
  }, []);
  const styles = (0,external_gc_element_namespaceObject.useMemo)(() => [DEFAULT_STYLES, ...(0,external_gc_blockEditor_namespaceObject.transformStyles)(settingStyles)], [settingStyles]);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SandBox, {
    html: content,
    styles: styles
  }), !isSelected && (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "block-library-html__preview-overlay"
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/html/edit.js


/**
 * GeChiUI dependencies
 */




/**
 * Internal dependencies
 */


function HTMLEdit({
  attributes,
  setAttributes,
  isSelected
}) {
  const [isPreview, setIsPreview] = (0,external_gc_element_namespaceObject.useState)();
  const isDisabled = (0,external_gc_element_namespaceObject.useContext)(external_gc_components_namespaceObject.Disabled.Context);

  function switchToPreview() {
    setIsPreview(true);
  }

  function switchToHTML() {
    setIsPreview(false);
  }

  return (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)({
      className: 'block-library-html__edit'
    })
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    className: "components-tab-button",
    isPressed: !isPreview,
    onClick: switchToHTML
  }, "HTML"), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    className: "components-tab-button",
    isPressed: isPreview,
    onClick: switchToPreview
  }, (0,external_gc_i18n_namespaceObject.__)('预览')))), isPreview || isDisabled ? (0,external_gc_element_namespaceObject.createElement)(HTMLEditPreview, {
    content: attributes.content,
    isSelected: isSelected
  }) : (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.PlainText, {
    value: attributes.content,
    onChange: content => setAttributes({
      content
    }),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('编写HTML...' ),
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('HTML')
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/html/save.js


/**
 * GeChiUI dependencies
 */

function html_save_save({
  attributes
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.RawHTML, null, attributes.content);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/html/transforms.js
/**
 * GeChiUI dependencies
 */

const html_transforms_transforms = {
  from: [{
    type: 'block',
    blocks: ['core/code'],
    transform: ({
      content
    }) => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/html', {
        content
      });
    }
  }]
};
/* harmony default export */ var html_transforms = (html_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/html/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */



const html_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/html",
  title: "自定义HTML",
  category: "widgets",
  description: "添加自定义 HTML 代码并在编辑时进行预览。",
  keywords: ["embed"],
  textdomain: "default",
  attributes: {
    content: {
      type: "string",
      source: "raw"
    }
  },
  supports: {
    customClassName: false,
    className: false,
    html: false
  },
  editorStyle: "gc-block-html-editor"
};


const {
  name: html_name
} = html_metadata;

const html_settings = {
  icon: library_html,
  example: {
    attributes: {
      content: '<marquee>' + (0,external_gc_i18n_namespaceObject.__)('欢迎来到区块的多彩世界…...' ) + '</marquee>'
    }
  },
  edit: HTMLEdit,
  save: html_save_save,
  transforms: html_transforms
};
const html_init = () => initBlock({
  name: html_name,
  metadata: html_metadata,
  settings: html_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/image/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


/**
 * Deprecation for adding the `gc-image-${id}` class to the image block for
 * responsive images.
 *
 * @see https://github.com/GeChiUI/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 = (0,external_gc_element_namespaceObject.createElement)("img", {
      src: url,
      alt: alt,
      ...extraImageProps
    });
    let figureStyle = {};

    if (width) {
      figureStyle = {
        width
      };
    } else if (align === 'left' || align === 'right') {
      figureStyle = {
        maxWidth: '50%'
      };
    }

    return (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: align ? `align${align}` : null,
      style: figureStyle
    }, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
      href: href
    }, image) : image, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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/GeChiUI/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 = (0,external_gc_element_namespaceObject.createElement)("img", {
      src: url,
      alt: alt,
      className: id ? `gc-image-${id}` : null,
      width: width,
      height: height
    });
    return (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: align ? `align${align}` : null
    }, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
      href: href
    }, image) : image, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "figcaption",
      value: caption
    }));
  }

};
/**
 * Deprecation for image floats including a wrapping div.
 *
 * @see https://github.com/GeChiUI/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 = classnames_default()({
      [`align${align}`]: align,
      'is-resized': width || height
    });
    const image = (0,external_gc_element_namespaceObject.createElement)("img", {
      src: url,
      alt: alt,
      className: id ? `gc-image-${id}` : null,
      width: width,
      height: height
    });
    return (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: classes
    }, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
      href: href
    }, image) : image, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "figcaption",
      value: caption
    }));
  }

};
/**
 * Deprecation for removing the outer div wrapper around aligned images.
 *
 * @see https://github.com/GeChiUI/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 = classnames_default()({
      [`align${align}`]: align,
      [`size-${sizeSlug}`]: sizeSlug,
      'is-resized': width || height
    });
    const image = (0,external_gc_element_namespaceObject.createElement)("img", {
      src: url,
      alt: alt,
      className: id ? `gc-image-${id}` : null,
      width: width,
      height: height,
      title: title
    });
    const figure = (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
      className: linkClass,
      href: href,
      target: linkTarget,
      rel: newRel
    }, image) : image, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "figcaption",
      value: caption
    }));

    if ('left' === align || 'right' === align || 'center' === align) {
      return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
      }, (0,external_gc_element_namespaceObject.createElement)("figure", {
        className: classes
      }, figure));
    }

    return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: classes
      })
    }, 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/GeChiUI/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 = classnames_default()({
      [`align${align}`]: align,
      [`size-${sizeSlug}`]: sizeSlug,
      'is-resized': width || height
    });
    const image = (0,external_gc_element_namespaceObject.createElement)("img", {
      src: url,
      alt: alt,
      className: id ? `gc-image-${id}` : null,
      width: width,
      height: height,
      title: title
    });
    const figure = (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
      className: linkClass,
      href: href,
      target: linkTarget,
      rel: newRel
    }, image) : image, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "figcaption",
      value: caption
    }));
    return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: classes
      })
    }, figure);
  }

};
/**
 * Deprecation for adding width and height as style rules on the inner img.
 *
 * @see https://github.com/GeChiUI/gutenberg/pull/31366
 */

const image_deprecated_v6 = {
  attributes: {
    align: {
      type: 'string'
    },
    url: {
      type: 'string',
      source: 'attribute',
      selector: 'img',
      attribute: 'src',
      __experimentalRole: 'content'
    },
    alt: {
      type: 'string',
      source: 'attribute',
      selector: 'img',
      attribute: 'alt',
      default: '',
      __experimentalRole: 'content'
    },
    caption: {
      type: 'string',
      source: 'html',
      selector: 'figcaption',
      __experimentalRole: 'content'
    },
    title: {
      type: 'string',
      source: 'attribute',
      selector: 'img',
      attribute: 'title',
      __experimentalRole: 'content'
    },
    href: {
      type: 'string',
      source: 'attribute',
      selector: 'figure > a',
      attribute: 'href',
      __experimentalRole: 'content'
    },
    rel: {
      type: 'string',
      source: 'attribute',
      selector: 'figure > a',
      attribute: 'rel'
    },
    linkClass: {
      type: 'string',
      source: 'attribute',
      selector: 'figure > a',
      attribute: 'class'
    },
    id: {
      type: 'number',
      __experimentalRole: '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,
    behaviors: {
      lightbox: 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
      }
    }
  },

  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_gc_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
    const classes = classnames_default()({
      [`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 = classnames_default()(borderProps.className, {
      [`gc-image-${id}`]: !!id
    });
    const image = (0,external_gc_element_namespaceObject.createElement)("img", {
      src: url,
      alt: alt,
      className: imageClasses || undefined,
      style: { ...borderProps.style,
        aspectRatio,
        objectFit: scale
      },
      width: width,
      height: height,
      title: title
    });
    const figure = (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
      className: linkClass,
      href: href,
      target: linkTarget,
      rel: newRel
    }, image) : image, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      className: (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
      tagName: "figcaption",
      value: caption
    }));
    return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: classes
      })
    }, figure);
  }

};
/* harmony default export */ var image_deprecated = ([image_deprecated_v6, image_deprecated_v5, image_deprecated_v4, image_deprecated_v3, image_deprecated_v2, image_deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/crop.js


/**
 * GeChiUI dependencies
 */

const crop = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M16.5 7.8v7H18v-7c0-1-.8-1.8-1.8-1.8h-7v1.5h7c.2 0 .3.1.3.3zm-8.7 8.7c-.1 0-.2-.1-.2-.2V2H6v4H2v1.5h4v8.8c0 1 .8 1.8 1.8 1.8h8.8v4H18v-4h4v-1.5H7.8z"
}));
/* harmony default export */ var library_crop = (crop);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/overlay-text.js


/**
 * GeChiUI dependencies
 */

const overlayText = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var overlay_text = (overlayText);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/upload.js


/**
 * GeChiUI dependencies
 */

const upload = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_upload = (upload);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/image/use-client-width.js
/**
 * GeChiUI dependencies
 */

function useClientWidth(ref, dependencies) {
  const [clientWidth, setClientWidth] = (0,external_gc_element_namespaceObject.useState)();

  function calculateClientWidth() {
    setClientWidth(ref.current?.clientWidth);
  }

  (0,external_gc_element_namespaceObject.useEffect)(calculateClientWidth, dependencies);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    const {
      defaultView
    } = ref.current.ownerDocument;
    defaultView.addEventListener('resize', calculateClientWidth);
    return () => {
      defaultView.removeEventListener('resize', calculateClientWidth);
    };
  }, []);
  return clientWidth;
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/image/image.js


/**
 * GeChiUI dependencies
 */












/**
 * Internal dependencies
 */





/**
 * Module constants
 */



const {
  DimensionsTool,
  ResolutionTool
} = unlock(external_gc_blockEditor_namespaceObject.privateApis);
const scaleOptions = [{
  value: 'cover',
  label: (0,external_gc_i18n_namespaceObject._x)('Cover', 'Scale option for dimensions control'),
  help: (0,external_gc_i18n_namespaceObject.__)('图像均匀地覆盖了整个空间。')
}, {
  value: 'contain',
  label: (0,external_gc_i18n_namespaceObject._x)('Contain', 'Scale option for dimensions control'),
  help: (0,external_gc_i18n_namespaceObject.__)('图像不失真。')
}];
function image_Image({
  temporaryURL,
  attributes,
  setAttributes,
  isSelected,
  insertBlocksAfter,
  onReplace,
  onSelectImage,
  onSelectURL,
  onUploadError,
  containerRef,
  context,
  clientId,
  blockEditingMode
}) {
  const {
    url = '',
    alt,
    caption,
    align,
    id,
    href,
    rel,
    linkClass,
    linkDestination,
    title,
    width,
    height,
    aspectRatio,
    scale,
    linkTarget,
    sizeSlug
  } = attributes;
  const imageRef = (0,external_gc_element_namespaceObject.useRef)();
  const prevCaption = (0,external_gc_compose_namespaceObject.usePrevious)(caption);
  const [showCaption, setShowCaption] = (0,external_gc_element_namespaceObject.useState)(!!caption);
  const {
    allowResize = true
  } = context;
  const {
    getBlock
  } = (0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store);
  const {
    image,
    multiImageSelection
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getMedia
    } = select(external_gc_coreData_namespaceObject.store);
    const {
      getMultiSelectedBlockClientIds,
      getBlockName
    } = select(external_gc_blockEditor_namespaceObject.store);
    const multiSelectedClientIds = getMultiSelectedBlockClientIds();
    return {
      image: id && isSelected ? getMedia(id, {
        context: 'view'
      }) : null,
      multiImageSelection: multiSelectedClientIds.length && multiSelectedClientIds.every(_clientId => getBlockName(_clientId) === 'core/image')
    };
  }, [id, isSelected]);
  const {
    canInsertCover,
    imageEditing,
    imageSizes,
    maxWidth,
    mediaUpload
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlockRootClientId,
      getSettings,
      canInsertBlockType
    } = select(external_gc_blockEditor_namespaceObject.store);
    const rootClientId = getBlockRootClientId(clientId);
    const settings = getSettings();
    return {
      imageEditing: settings.imageEditing,
      imageSizes: settings.imageSizes,
      maxWidth: settings.maxWidth,
      mediaUpload: settings.mediaUpload,
      canInsertCover: canInsertBlockType('core/cover', rootClientId)
    };
  }, [clientId]);
  const {
    replaceBlocks,
    toggleSelection
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const {
    createErrorNotice,
    createSuccessNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);
  const isLargeViewport = (0,external_gc_compose_namespaceObject.useViewportMatch)('medium');
  const isWideAligned = ['wide', 'full'].includes(align);
  const [{
    loadedNaturalWidth,
    loadedNaturalHeight
  }, setLoadedNaturalSize] = (0,external_gc_element_namespaceObject.useState)({});
  const [isEditingImage, setIsEditingImage] = (0,external_gc_element_namespaceObject.useState)(false);
  const [externalBlob, setExternalBlob] = (0,external_gc_element_namespaceObject.useState)();
  const clientWidth = useClientWidth(containerRef, [align]);
  const hasNonContentControls = blockEditingMode === 'default';
  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
  }));
  const canUploadMedia = !!mediaUpload; // 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_gc_element_namespaceObject.useEffect)(() => {
    if (!isExternalImage(id, url) || !isSelected || !canUploadMedia) {
      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, isSelected, externalBlob, canUploadMedia]); // We need to show the caption when changes come from
  // history navigation(undo/redo).

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (caption && !prevCaption) {
      setShowCaption(true);
    }
  }, [caption, prevCaption]); // Focus the caption when we click to add one.

  const captionRef = (0,external_gc_element_namespaceObject.useCallback)(node => {
    if (node && !caption) {
      node.focus();
    }
  }, [caption]); // 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/GeChiUI/gutenberg/pull/37210.

  const {
    naturalWidth,
    naturalHeight
  } = (0,external_gc_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() {
    // Check if there's an embed block that handles this URL, e.g., instagram URL.
    // See: https://github.com/GeChiUI/gutenberg/pull/11472
    const embedBlock = createUpgradedEmbedBlock({
      attributes: {
        url
      }
    });

    if (undefined !== embedBlock) {
      onReplace(embedBlock);
    }
  }

  function onSetHref(props) {
    setAttributes(props);
  }

  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() {
    mediaUpload({
      filesList: [externalBlob],

      onFileChange([img]) {
        onSelectImage(img);

        if ((0,external_gc_blob_namespaceObject.isBlobURL)(img.url)) {
          return;
        }

        setExternalBlob();
        createSuccessNotice((0,external_gc_i18n_namespaceObject.__)('图片已上传。'), {
          type: 'snackbar'
        });
      },

      allowedTypes: constants_ALLOWED_MEDIA_TYPES,

      onError(message) {
        createErrorNotice(message, {
          type: 'snackbar'
        });
      }

    });
  }

  function updateAlignment(nextAlign) {
    const extraUpdatedAttributes = ['wide', 'full'].includes(nextAlign) ? {
      width: undefined,
      height: undefined
    } : {};
    setAttributes({ ...extraUpdatedAttributes,
      align: nextAlign
    });
  }

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!isSelected) {
      setIsEditingImage(false);

      if (!caption) {
        setShowCaption(false);
      }
    }
  }, [isSelected, caption]);
  const canEditImage = id && naturalWidth && naturalHeight && imageEditing;
  const allowCrop = !multiImageSelection && canEditImage && !isEditingImage;

  function switchToCover() {
    replaceBlocks(clientId, (0,external_gc_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_gc_components_namespaceObject.__experimentalUseCustomUnits)({
    availableUnits: ['px']
  });
  const controls = (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, hasNonContentControls && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockAlignmentControl, {
    value: align,
    onChange: updateAlignment
  }), hasNonContentControls && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    onClick: () => {
      setShowCaption(!showCaption);

      if (showCaption && caption) {
        setAttributes({
          caption: undefined
        });
      }
    },
    icon: library_caption,
    isPressed: showCaption,
    label: showCaption ? (0,external_gc_i18n_namespaceObject.__)('移除说明文字') : (0,external_gc_i18n_namespaceObject.__)('添加说明文字')
  }), !multiImageSelection && !isEditingImage && (0,external_gc_element_namespaceObject.createElement)(external_gc_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
  }), allowCrop && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    onClick: () => setIsEditingImage(true),
    icon: library_crop,
    label: (0,external_gc_i18n_namespaceObject.__)('裁剪')
  }), !multiImageSelection && canInsertCover && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    icon: overlay_text,
    label: (0,external_gc_i18n_namespaceObject.__)('在图片上添加文字'),
    onClick: switchToCover
  })), !multiImageSelection && !isEditingImage && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "other"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaReplaceFlow, {
    mediaId: id,
    mediaURL: url,
    allowedTypes: constants_ALLOWED_MEDIA_TYPES,
    accept: "image/*",
    onSelect: onSelectImage,
    onSelectURL: onSelectURL,
    onError: onUploadError
  })), !multiImageSelection && externalBlob && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    onClick: uploadExternal,
    icon: library_upload,
    label: (0,external_gc_i18n_namespaceObject.__)('上传外部图片')
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanel, {
    label: (0,external_gc_i18n_namespaceObject.__)('设置'),
    resetAll: () => setAttributes({
      width: undefined,
      height: undefined,
      scale: undefined,
      aspectRatio: undefined
    })
  }, !multiImageSelection && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    label: (0,external_gc_i18n_namespaceObject.__)('替代文本'),
    isShownByDefault: true,
    hasValue: () => alt !== '',
    onDeselect: () => setAttributes({
      alt: undefined
    })
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextareaControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('替代文本'),
    value: alt,
    onChange: updateAlt,
    help: (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ExternalLink, {
      href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
    }, (0,external_gc_i18n_namespaceObject.__)('说明此图片的用途')), (0,external_gc_element_namespaceObject.createElement)("br", null), (0,external_gc_i18n_namespaceObject.__)('如果是装饰性的，请留空。')),
    __nextHasNoMarginBottom: true
  })), (0,external_gc_element_namespaceObject.createElement)(DimensionsTool, {
    value: {
      width: width && `${width}px`,
      height: height && `${height}px`,
      scale,
      aspectRatio
    },
    onChange: newValue => {
      // Rebuilding the object forces setting `undefined`
      // for values that are removed since setAttributes
      // doesn't do anything with keys that aren't set.
      setAttributes({
        width: newValue.width && parseInt(newValue.width, 10),
        height: newValue.height && parseInt(newValue.height, 10),
        scale: newValue.scale,
        aspectRatio: newValue.aspectRatio
      });
    },
    defaultScale: "cover",
    defaultAspectRatio: "auto",
    scaleOptions: scaleOptions,
    unitsOptions: dimensionsUnitsOptions
  }), (0,external_gc_element_namespaceObject.createElement)(ResolutionTool, {
    value: sizeSlug,
    onChange: updateImage,
    options: imageSizeOptions
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "advanced"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('title属性'),
    value: title || '',
    onChange: onSetTitle,
    help: (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_i18n_namespaceObject.__)('描述此图片在本页的用途。'), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ExternalLink, {
      href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute"
    }, (0,external_gc_i18n_namespaceObject.__)('（注：很多设备及浏览器都不显示此文本。）')))
  })));
  const filename = (0,external_gc_url_namespaceObject.getFilename)(url);
  let defaultedAlt;

  if (alt) {
    defaultedAlt = alt;
  } else if (filename) {
    defaultedAlt = (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: file name */
    (0,external_gc_i18n_namespaceObject.__)('此图片的alt属性为空；文件名为%s'), filename);
  } else {
    defaultedAlt = (0,external_gc_i18n_namespaceObject.__)('此图片的alt属性为空');
  }

  const borderProps = (0,external_gc_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  const isRounded = attributes.className?.includes('is-style-rounded');
  let img = // 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_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("img", {
    src: temporaryURL || url,
    alt: defaultedAlt,
    onError: () => onImageError(),
    onLoad: event => {
      setLoadedNaturalSize({
        loadedNaturalWidth: event.target?.naturalWidth,
        loadedNaturalHeight: event.target?.naturalHeight
      });
    },
    ref: imageRef,
    className: borderProps.className,
    style: {
      width: width && height || aspectRatio ? '100%' : undefined,
      height: width && height || aspectRatio ? '100%' : undefined,
      objectFit: scale,
      ...borderProps.style
    }
  }), temporaryURL && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null))
  /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
  ; // clientWidth needs to be a number for the image Cropper to work, but sometimes it's 0
  // So we try using the imageRef width first and fallback to clientWidth.

  const fallbackClientWidth = imageRef.current?.width || clientWidth;

  if (canEditImage && isEditingImage) {
    img = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalImageEditor, {
      id: id,
      url: url,
      width: width,
      height: height,
      clientWidth: fallbackClientWidth,
      naturalHeight: naturalHeight,
      naturalWidth: naturalWidth,
      onSaveImage: imageAttributes => setAttributes(imageAttributes),
      onFinishEditing: () => {
        setIsEditingImage(false);
      },
      borderProps: isRounded ? undefined : borderProps
    });
  } else if (!isResizable) {
    img = (0,external_gc_element_namespaceObject.createElement)("div", {
      style: {
        width,
        height,
        aspectRatio
      }
    }, img);
  } else {
    const ratio = aspectRatio && evalAspectRatio(aspectRatio) || width && height && width / height || naturalWidth / naturalHeight || 1;
    const currentWidth = !width && height ? height * ratio : width;
    const currentHeight = !height && width ? width / ratio : height;
    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;
    let showRightHandle = false;
    let showLeftHandle = false;
    /* eslint-disable no-lonely-if */
    // See https://github.com/GeChiUI/gutenberg/issues/7584.

    if (align === 'center') {
      // When the image is centered, show both handles.
      showRightHandle = true;
      showLeftHandle = true;
    } else if ((0,external_gc_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 = (0,external_gc_element_namespaceObject.createElement)(external_gc_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: isSelected,
      minWidth: minWidth,
      maxWidth: maxWidthBuffer,
      minHeight: minHeight,
      maxHeight: maxWidthBuffer / ratio,
      lockAspectRatio: ratio,
      enable: {
        top: false,
        right: showRightHandle,
        bottom: true,
        left: showLeftHandle
      },
      onResizeStart: onResizeStart,
      onResizeStop: (event, direction, elt) => {
        onResizeStop();
        setAttributes({
          width: elt.offsetWidth,
          height: elt.offsetHeight,
          aspectRatio: undefined
        });
      },
      resizeRatio: align === 'center' ? 2 : 1
    }, img);
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, !temporaryURL && controls, img, showCaption && (!external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    identifier: "caption",
    className: (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
    ref: captionRef,
    tagName: "figcaption",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('图片描述文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('添加说明文字'),
    value: caption,
    onChange: value => setAttributes({
      caption: value
    }),
    inlineToolbar: true,
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)()))
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/image/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */









/**
 * Internal dependencies
 */



/**
 * Module constants
 */


const {
  useBlockEditingMode
} = unlock(external_gc_blockEditor_namespaceObject.privateApis);
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 a temporary blob URL? A blob URL is one that is used temporarily
 * while the image is being uploaded and will not have an id yet allocated.
 *
 * @param {number=} id  The id of the image.
 * @param {string=} url The url of the image.
 *
 * @return {boolean} Is the URL a Blob URL
 */

const edit_isTemporaryImage = (id, url) => !id && (0,external_gc_blob_namespaceObject.isBlobURL)(url);
/**
 * 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_gc_blob_namespaceObject.isBlobURL)(url);
/**
 * Checks if GC generated default image size. Size generation is skipped
 * when the image is smaller than the said size.
 *
 * @param {Object} image
 * @param {string} defaultSize
 *
 * @return {boolean} Whether or not it has default image size.
 */

function hasDefaultSize(image, defaultSize) {
  var _image$sizes$defaultS, _image$media_details$;

  return 'url' in ((_image$sizes$defaultS = image?.sizes?.[defaultSize]) !== null && _image$sizes$defaultS !== void 0 ? _image$sizes$defaultS : {}) || 'source_url' in ((_image$media_details$ = image?.media_details?.sizes?.[defaultSize]) !== null && _image$media_details$ !== void 0 ? _image$media_details$ : {});
}

function ImageEdit({
  attributes,
  setAttributes,
  isSelected,
  className,
  insertBlocksAfter,
  onReplace,
  context,
  clientId
}) {
  const {
    url = '',
    alt,
    caption,
    align,
    id,
    width,
    height,
    sizeSlug
  } = attributes;
  const [temporaryURL, setTemporaryURL] = (0,external_gc_element_namespaceObject.useState)();
  const altRef = (0,external_gc_element_namespaceObject.useRef)();
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    altRef.current = alt;
  }, [alt]);
  const captionRef = (0,external_gc_element_namespaceObject.useRef)();
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    captionRef.current = caption;
  }, [caption]);
  const ref = (0,external_gc_element_namespaceObject.useRef)();
  const {
    imageDefaultSize,
    mediaUpload
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSettings
    } = select(external_gc_blockEditor_namespaceObject.store);
    const settings = getSettings();
    return {
      imageDefaultSize: settings.imageDefaultSize,
      mediaUpload: settings.mediaUpload
    };
  }, []);
  const blockEditingMode = useBlockEditingMode();
  const {
    createErrorNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);

  function onUploadError(message) {
    createErrorNotice(message, {
      type: 'snackbar'
    });
    setAttributes({
      src: undefined,
      id: undefined,
      url: undefined
    });
    setTemporaryURL(undefined);
  }

  function onSelectImage(media) {
    if (!media || !media.url) {
      setAttributes({
        url: undefined,
        alt: undefined,
        id: undefined,
        title: undefined,
        caption: undefined
      });
      return;
    }

    if ((0,external_gc_blob_namespaceObject.isBlobURL)(media.url)) {
      setTemporaryURL(media.url);
      return;
    }

    setTemporaryURL();
    let mediaAttributes = edit_pickRelevantMediaFiles(media, imageDefaultSize); // 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 = {
        // Fallback to size "full" if there's no default image size.
        // It means the image is smaller, and the block will use a full-size URL.
        sizeSlug: hasDefaultSize(media, imageDefaultSize) ? imageDefaultSize : 'full'
      };
    } 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 GeChiUI option to determine the proper default.
      // The constants used in Gutenberg do not match GC 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?.gc?.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({ ...mediaAttributes,
      ...additionalAttributes,
      linkDestination
    });
  }

  function onSelectURL(newURL) {
    if (newURL !== url) {
      setAttributes({
        url: newURL,
        id: undefined,
        sizeSlug: imageDefaultSize
      });
    }
  }

  function updateAlignment(nextAlign) {
    const extraUpdatedAttributes = ['wide', 'full'].includes(nextAlign) ? {
      width: undefined,
      height: undefined
    } : {};
    setAttributes({ ...extraUpdatedAttributes,
      align: nextAlign
    });
  }

  let isTemp = edit_isTemporaryImage(id, url); // Upload a temporary image on mount.

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!isTemp) {
      return;
    }

    const file = (0,external_gc_blob_namespaceObject.getBlobByURL)(url);

    if (file) {
      mediaUpload({
        filesList: [file],
        onFileChange: ([img]) => {
          onSelectImage(img);
        },
        allowedTypes: constants_ALLOWED_MEDIA_TYPES,
        onError: message => {
          isTemp = false;
          onUploadError(message);
        }
      });
    }
  }, []); // If an image is temporary, revoke the Blob url when it is uploaded (and is
  // no longer temporary).

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (isTemp) {
      setTemporaryURL(url);
      return;
    }

    (0,external_gc_blob_namespaceObject.revokeBlobURL)(temporaryURL);
  }, [isTemp, url]);
  const isExternal = isExternalImage(id, url);
  const src = isExternal ? url : undefined;
  const mediaPreview = !!url && (0,external_gc_element_namespaceObject.createElement)("img", {
    alt: (0,external_gc_i18n_namespaceObject.__)('编辑图片'),
    title: (0,external_gc_i18n_namespaceObject.__)('编辑图片'),
    className: 'edit-image-preview',
    src: url
  });
  const borderProps = (0,external_gc_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  const classes = classnames_default()(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_gc_blockEditor_namespaceObject.useBlockProps)({
    ref,
    className: classes
  }); // Much of this description is duplicated from MediaPlaceholder.

  const placeholder = content => {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
      className: classnames_default()('block-editor-media-placeholder', {
        [borderProps.className]: !!borderProps.className && !isSelected
      }),
      withIllustration: true,
      icon: library_image,
      label: (0,external_gc_i18n_namespaceObject.__)('图片'),
      instructions: (0,external_gc_i18n_namespaceObject.__)('上传图片，或从您的媒体库中选择，或通过URL添加。'),
      style: isSelected ? undefined : borderProps.style
    }, content);
  };

  return (0,external_gc_element_namespaceObject.createElement)("figure", { ...blockProps
  }, (temporaryURL || url) && (0,external_gc_element_namespaceObject.createElement)(image_Image, {
    temporaryURL: temporaryURL,
    attributes: attributes,
    setAttributes: setAttributes,
    isSelected: isSelected,
    insertBlocksAfter: insertBlocksAfter,
    onReplace: onReplace,
    onSelectImage: onSelectImage,
    onSelectURL: onSelectURL,
    onUploadError: onUploadError,
    containerRef: ref,
    context: context,
    clientId: clientId,
    blockEditingMode: blockEditingMode
  }), !url && blockEditingMode === 'default' && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockAlignmentControl, {
    value: align,
    onChange: updateAlignment
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaPlaceholder, {
    icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
      icon: library_image
    }),
    onSelect: onSelectImage,
    onSelectURL: onSelectURL,
    onError: onUploadError,
    placeholder: placeholder,
    accept: "image/*",
    allowedTypes: constants_ALLOWED_MEDIA_TYPES,
    value: {
      id,
      src
    },
    mediaPreview: mediaPreview,
    disableMediaButtons: temporaryURL || url
  }));
}
/* harmony default export */ var image_edit = (ImageEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/image/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  const classes = classnames_default()({
    [`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 = classnames_default()(borderProps.className, {
    [`gc-image-${id}`]: !!id
  });
  const image = (0,external_gc_element_namespaceObject.createElement)("img", {
    src: url,
    alt: alt,
    className: imageClasses || undefined,
    style: { ...borderProps.style,
      aspectRatio,
      objectFit: scale,
      width,
      height
    },
    width: width,
    height: height,
    title: title
  });
  const figure = (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, href ? (0,external_gc_element_namespaceObject.createElement)("a", {
    className: linkClass,
    href: href,
    target: linkTarget,
    rel: newRel
  }, image) : image, !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    className: (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
    tagName: "figcaption",
    value: caption
  }));
  return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className: classes
    })
  }, figure);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/image/transforms.js
/**
 * GeChiUI 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', /^gc-image-\d+$/]
  }
};

const schema = ({
  phrasingContentSchema
}) => ({
  figure: {
    require: ['img'],
    children: { ...imageSchema,
      a: {
        attributes: ['href', 'rel', 'target'],
        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)gc-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_gc_blocks_namespaceObject.getBlockAttributes)('core/image', node.outerHTML, {
        align,
        id,
        linkDestination,
        href,
        rel,
        linkClass,
        anchor
      });
      return (0,external_gc_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) {
      // The following check is intended to catch non-image files when dropped together with images.
      if (files.some(file => file.type.indexOf('image/') === 0) && files.some(file => file.type.indexOf('image/') !== 0)) {
        const {
          createErrorNotice
        } = (0,external_gc_data_namespaceObject.dispatch)(external_gc_notices_namespaceObject.store);
        createErrorNotice((0,external_gc_i18n_namespaceObject.__)('如果上传到图库，所有文件都需要是图片格式'), {
          id: 'gallery-transform-invalid-file',
          type: 'snackbar'
        });
      }

      return files.every(file => file.type.indexOf('image/') === 0);
    },

    transform(files) {
      const blocks = files.map(file => {
        return (0,external_gc_blocks_namespaceObject.createBlock)('core/image', {
          url: (0,external_gc_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 */ var image_transforms = (image_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/image/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const image_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/image",
  title: "图片",
  category: "media",
  usesContext: ["allowResize", "imageCrop", "fixedHeight"],
  description: "插入图片用于视觉说明。",
  keywords: ["img", "photo", "picture"],
  textdomain: "default",
  attributes: {
    align: {
      type: "string"
    },
    url: {
      type: "string",
      source: "attribute",
      selector: "img",
      attribute: "src",
      __experimentalRole: "content"
    },
    alt: {
      type: "string",
      source: "attribute",
      selector: "img",
      attribute: "alt",
      "default": "",
      __experimentalRole: "content"
    },
    caption: {
      type: "string",
      source: "html",
      selector: "figcaption",
      __experimentalRole: "content"
    },
    title: {
      type: "string",
      source: "attribute",
      selector: "img",
      attribute: "title",
      __experimentalRole: "content"
    },
    href: {
      type: "string",
      source: "attribute",
      selector: "figure > a",
      attribute: "href",
      __experimentalRole: "content"
    },
    rel: {
      type: "string",
      source: "attribute",
      selector: "figure > a",
      attribute: "rel"
    },
    linkClass: {
      type: "string",
      source: "attribute",
      selector: "figure > a",
      attribute: "class"
    },
    id: {
      type: "number",
      __experimentalRole: "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,
    behaviors: {
      lightbox: 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
      }
    }
  },
  selectors: {
    border: ".gc-block-image img, .gc-block-image .gc-block-image__crop-area, .gc-block-image .components-placeholder",
    filter: {
      duotone: ".gc-block-image img, .gc-block-image .components-placeholder"
    }
  },
  styles: [{
    name: "default",
    label: "Default",
    isDefault: true
  }, {
    name: "rounded",
    label: "Rounded"
  }],
  editorStyle: "gc-block-image-editor",
  style: "gc-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_gc_i18n_namespaceObject.__)('勃朗峰高耸：积雪、宁静、安恬。')
    }
  },

  __experimentalLabel(attributes, {
    context
  }) {
    if (context === 'accessibility') {
      const {
        caption,
        alt,
        url
      } = attributes;

      if (!url) {
        return (0,external_gc_i18n_namespaceObject.__)('空');
      }

      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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/comment.js


/**
 * GeChiUI dependencies
 */

const comment = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_comment = (comment);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/latest-comments/edit.js


/**
 * GeChiUI 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
    }
  };
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)()
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示头像'),
    checked: displayAvatar,
    onChange: () => setAttributes({
      displayAvatar: !displayAvatar
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示日期'),
    checked: displayDate,
    onChange: () => setAttributes({
      displayDate: !displayDate
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示摘要'),
    checked: displayExcerpt,
    onChange: () => setAttributes({
      displayExcerpt: !displayExcerpt
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('评论数量'),
    value: commentsToShow,
    onChange: value => setAttributes({
      commentsToShow: value
    }),
    min: MIN_COMMENTS,
    max: MAX_COMMENTS,
    required: true
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Disabled, null, (0,external_gc_element_namespaceObject.createElement)((external_gc_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'
    }
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/latest-comments/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const latest_comments_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/latest-comments",
  title: "最新评论",
  category: "widgets",
  description: "显示您的最近评论的列表。",
  keywords: ["近期评论"],
  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,
    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
      }
    }
  },
  editorStyle: "gc-block-latest-comments-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/post-list.js


/**
 * GeChiUI dependencies
 */

const postList = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"
}));
/* harmony default export */ var post_list = (postList);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/latest-posts/deprecated.js
/**
 * Internal dependencies
 */
const latest_posts_deprecated_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/latest-posts",
  title: "最新文章",
  category: "widgets",
  description: "显示您的近期文章的列表。",
  keywords: ["近期文章"],
  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
      }
    }
  },
  editorStyle: "gc-block-latest-posts-editor",
  style: "gc-block-latest-posts"
};
const {
  attributes: deprecated_attributes
} = latest_posts_deprecated_metadata;
/* harmony default export */ var 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
}]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/list.js


/**
 * GeChiUI dependencies
 */

const list = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_list = (list);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/latest-posts/constants.js
const MIN_EXCERPT_LENGTH = 10;
const MAX_EXCERPT_LENGTH = 100;
const MAX_POSTS_COLUMNS = 6;

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/latest-posts/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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?.['gc: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_gc_compose_namespaceObject.useInstanceId)(LatestPostsEdit);
  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_gc_data_namespaceObject.useSelect)(select => {
    var _settings$imageDimens, _settings$imageDimens2;

    const {
      getEntityRecords,
      getUsers
    } = select(external_gc_coreData_namespaceObject.store);
    const settings = select(external_gc_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: 'gc:featuredmedia'
    }).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,
    removeNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);
  let noticeId;

  const showRedirectionPreventedNotice = event => {
    event.preventDefault(); // Remove previous warning if any, to show one at a time per block.

    removeNotice(noticeId);
    noticeId = `block-library/core/latest-posts/redirection-prevented/${instanceId}`;
    createWarningNotice((0,external_gc_i18n_namespaceObject.__)('已禁止在编辑器中使用超链接。'), {
      id: noticeId,
      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 hasPosts = !!latestPosts?.length;
  const inspectorControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('文章内容')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('文章内容'),
    checked: displayPostContent,
    onChange: value => setAttributes({
      displayPostContent: value
    })
  }), displayPostContent && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RadioControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('显示：'),
    selected: displayPostContentRadio,
    options: [{
      label: (0,external_gc_i18n_namespaceObject.__)('摘要'),
      value: 'excerpt'
    }, {
      label: (0,external_gc_i18n_namespaceObject.__)('整个文章'),
      value: 'full_post'
    }],
    onChange: value => setAttributes({
      displayPostContentRadio: value
    })
  }), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('最大字数'),
    value: excerptLength,
    onChange: value => setAttributes({
      excerptLength: value
    }),
    min: MIN_EXCERPT_LENGTH,
    max: MAX_EXCERPT_LENGTH
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('Post元数据')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示作者名'),
    checked: displayAuthor,
    onChange: value => setAttributes({
      displayAuthor: value
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示文章日期'),
    checked: displayPostDate,
    onChange: value => setAttributes({
      displayPostDate: value
    })
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('特色图片')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示特色图片'),
    checked: displayFeaturedImage,
    onChange: value => setAttributes({
      displayFeaturedImage: value
    })
  }), displayFeaturedImage && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_i18n_namespaceObject.__)('选择来源图片的尺寸。'),
    onChangeImage: value => setAttributes({
      featuredImageSizeSlug: value,
      featuredImageSizeWidth: undefined,
      featuredImageSizeHeight: undefined
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.BaseControl, {
    className: "editor-latest-posts-image-alignment-control"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_gc_i18n_namespaceObject.__)('图片对齐方式')), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockAlignmentToolbar, {
    value: featuredImageAlign,
    onChange: value => setAttributes({
      featuredImageAlign: value
    }),
    controls: ['left', 'center', 'right'],
    isCollapsed: false
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('加入指向特色图片的链接'),
    checked: addLinkToFeaturedImage,
    onChange: value => setAttributes({
      addLinkToFeaturedImage: value
    })
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('排序和筛选')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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' && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('栏目'),
    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_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      'gc-block-latest-posts__list': true,
      'is-grid': postLayout === 'grid',
      'has-dates': displayPostDate,
      'has-author': displayAuthor,
      [`columns-${columns}`]: postLayout === 'grid'
    })
  });

  if (!hasPosts) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, inspectorControls, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
      icon: library_pin,
      label: (0,external_gc_i18n_namespaceObject.__)('最新文章')
    }, !Array.isArray(latestPosts) ? (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null) : (0,external_gc_i18n_namespaceObject.__)('未找到文章。')));
  } // 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_gc_i18n_namespaceObject.__)('列表视图'),
    onClick: () => setAttributes({
      postLayout: 'list'
    }),
    isActive: postLayout === 'list'
  }, {
    icon: library_grid,
    title: (0,external_gc_i18n_namespaceObject.__)('网格视图'),
    onClick: () => setAttributes({
      postLayout: 'grid'
    }),
    isActive: postLayout === 'grid'
  }];
  const dateFormat = (0,external_gc_date_namespaceObject.getSettings)().formats.date;
  return (0,external_gc_element_namespaceObject.createElement)("div", null, inspectorControls, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, {
    controls: layoutControls
  })), (0,external_gc_element_namespaceObject.createElement)("ul", { ...blockProps
  }, 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 = classnames_default()({
      'gc-block-latest-posts__featured-image': true,
      [`align${featuredImageAlign}`]: !!featuredImageAlign
    });
    const renderFeaturedImage = displayFeaturedImage && imageSourceUrl;
    const featuredImage = renderFeaturedImage && (0,external_gc_element_namespaceObject.createElement)("img", {
      src: imageSourceUrl,
      alt: featuredImageAlt,
      style: {
        maxWidth: featuredImageSizeWidth,
        maxHeight: featuredImageSizeHeight
      }
    });
    const needsReadMore = excerptLength < excerpt.trim().split(' ').length && post.excerpt.raw === '';
    const postExcerpt = needsReadMore ? (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, excerpt.trim().split(' ', excerptLength).join(' '), (0,external_gc_element_namespaceObject.createInterpolateElement)(
    /* translators: excerpt truncation character, default …  */
    (0,external_gc_i18n_namespaceObject.__)(' … <a>Read more</a>'), {
      a: // eslint-disable-next-line jsx-a11y/anchor-has-content
      (0,external_gc_element_namespaceObject.createElement)("a", {
        href: post.link,
        rel: "noopener noreferrer",
        onClick: showRedirectionPreventedNotice
      })
    })) : excerpt;
    return (0,external_gc_element_namespaceObject.createElement)("li", {
      key: post.id
    }, renderFeaturedImage && (0,external_gc_element_namespaceObject.createElement)("div", {
      className: imageClasses
    }, addLinkToFeaturedImage ? (0,external_gc_element_namespaceObject.createElement)("a", {
      className: "gc-block-latest-posts__post-title",
      href: post.link,
      rel: "noreferrer noopener",
      onClick: showRedirectionPreventedNotice
    }, featuredImage) : featuredImage), (0,external_gc_element_namespaceObject.createElement)("a", {
      href: post.link,
      rel: "noreferrer noopener",
      dangerouslySetInnerHTML: !!titleTrimmed ? {
        __html: titleTrimmed
      } : undefined,
      onClick: showRedirectionPreventedNotice
    }, !titleTrimmed ? (0,external_gc_i18n_namespaceObject.__)('（无标题）') : null), displayAuthor && currentAuthor && (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-latest-posts__post-author"
    }, (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: byline. %s: current author. */
    (0,external_gc_i18n_namespaceObject.__)('作者：%s'), currentAuthor.name)), displayPostDate && post.date_gmt && (0,external_gc_element_namespaceObject.createElement)("time", {
      dateTime: (0,external_gc_date_namespaceObject.format)('c', post.date_gmt),
      className: "gc-block-latest-posts__post-date"
    }, (0,external_gc_date_namespaceObject.dateI18n)(dateFormat, post.date_gmt)), displayPostContent && displayPostContentRadio === 'excerpt' && (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-latest-posts__post-excerpt"
    }, postExcerpt), displayPostContent && displayPostContentRadio === 'full_post' && (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-latest-posts__post-full-content",
      dangerouslySetInnerHTML: {
        __html: post.content.raw.trim()
      }
    }));
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/latest-posts/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */




const latest_posts_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/latest-posts",
  title: "最新文章",
  category: "widgets",
  description: "显示您的近期文章的列表。",
  keywords: ["近期文章"],
  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
      }
    }
  },
  editorStyle: "gc-block-latest-posts-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list/utils.js
/**
 * GeChiUI dependencies
 */

function createListBlockFromDOMElement(listElement) {
  var _listElement$getAttri;

  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: (_listElement$getAttri = listElement.getAttribute('type')) !== null && _listElement$getAttri !== void 0 ? _listElement$getAttri : 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_gc_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_gc_blocks_namespaceObject.createBlock)('core/list-item', childAttributes, childInnerBlocks);
  });
  return (0,external_gc_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_gc_blocks_namespaceObject.rawHandler)({
    HTML: list.outerHTML
  });
  return [{ ...otherAttributes,
    ...listBlock.attributes
  }, listBlock.innerBlocks];
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list/deprecated.js


/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */



const v0 = {
  attributes: {
    ordered: {
      type: 'boolean',
      default: false,
      __experimentalRole: 'content'
    },
    values: {
      type: 'string',
      source: 'html',
      selector: 'ol,ul',
      multiline: 'li',
      __unstableMultilineWrapperTags: ['ol', 'ul'],
      default: '',
      __experimentalRole: '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 (0,external_gc_element_namespaceObject.createElement)(TagName, { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        type,
        reversed,
        start
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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,
      __experimentalRole: 'content'
    },
    values: {
      type: 'string',
      source: 'html',
      selector: 'ol,ul',
      multiline: 'li',
      __unstableMultilineWrapperTags: ['ol', 'ul'],
      default: '',
      __experimentalRole: '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 (0,external_gc_element_namespaceObject.createElement)(TagName, { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        type,
        reversed,
        start
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: values,
      multiline: "li"
    }));
  },

  migrate: migrateToListV2
};
/**
 * 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 */ var list_deprecated = ([list_deprecated_v1, v0]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/format-outdent-rtl.js


/**
 * GeChiUI dependencies
 */

const formatOutdentRTL = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var format_outdent_rtl = (formatOutdentRTL);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/format-outdent.js


/**
 * GeChiUI dependencies
 */

const formatOutdent = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var format_outdent = (formatOutdent);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/format-list-bullets-rtl.js


/**
 * GeChiUI dependencies
 */

const formatListBulletsRTL = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var format_list_bullets_rtl = (formatListBulletsRTL);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/format-list-bullets.js


/**
 * GeChiUI dependencies
 */

const formatListBullets = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var format_list_bullets = (formatListBullets);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/format-list-numbered-rtl.js


/**
 * GeChiUI dependencies
 */

const formatListNumberedRTL = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var format_list_numbered_rtl = (formatListNumberedRTL);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/format-list-numbered.js


/**
 * GeChiUI dependencies
 */

const formatListNumbered = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var format_list_numbered = (formatListNumbered);

;// CONCATENATED MODULE: external ["gc","deprecated"]
var external_gc_deprecated_namespaceObject = window["gc"]["deprecated"];
var external_gc_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_gc_deprecated_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list/ordered-list-settings.js


/**
 * GeChiUI dependencies
 */




const OrderedListSettings = ({
  setAttributes,
  reversed,
  start,
  type
}) => (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
  title: (0,external_gc_i18n_namespaceObject.__)('有序列表设置')
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
  __nextHasNoMarginBottom: true,
  label: (0,external_gc_i18n_namespaceObject.__)('起始值'),
  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"
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
  __nextHasNoMarginBottom: true,
  label: (0,external_gc_i18n_namespaceObject.__)('编号样式'),
  options: [{
    value: '1',
    label: (0,external_gc_i18n_namespaceObject.__)('Numbers')
  }, {
    value: 'A',
    label: (0,external_gc_i18n_namespaceObject.__)('大写字母')
  }, {
    value: 'a',
    label: (0,external_gc_i18n_namespaceObject.__)('小写字母')
  }, {
    value: 'I',
    label: (0,external_gc_i18n_namespaceObject.__)('大写罗马数字')
  }, {
    value: 'i',
    label: (0,external_gc_i18n_namespaceObject.__)('小写罗马数字')
  }],
  value: type,
  onChange: newValue => setAttributes({
    type: newValue
  })
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
  __nextHasNoMarginBottom: true,
  label: (0,external_gc_i18n_namespaceObject.__)('倒序列表编号'),
  checked: reversed || false,
  onChange: value => {
    setAttributes({
      // Unset the attribute if not reversed.
      reversed: value || undefined
    });
  }
})));

/* harmony default export */ var ordered_list_settings = (OrderedListSettings);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list/tag-name.js


/**
 * GeChiUI dependencies
 */


function TagName(props, ref) {
  const {
    ordered,
    ...extraProps
  } = props;
  const Tag = ordered ? 'ol' : 'ul';
  return (0,external_gc_element_namespaceObject.createElement)(Tag, {
    ref: ref,
    ...extraProps
  });
}

/* harmony default export */ var tag_name = ((0,external_gc_element_namespaceObject.forwardRef)(TagName));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list/edit.js


/**
 * GeChiUI dependencies
 */








/**
 * Internal dependencies
 */




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_gc_data_namespaceObject.useRegistry)();
  const {
    updateBlockAttributes,
    replaceInnerBlocks
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  (0,external_gc_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_gc_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 {
    canOutdent
  } = (0,external_gc_data_namespaceObject.useSelect)(innerSelect => {
    const {
      getBlockRootClientId,
      getBlock
    } = innerSelect(external_gc_blockEditor_namespaceObject.store);
    const parentId = getBlockRootClientId(clientId);
    return {
      canOutdent: !!parentId && getBlock(parentId).name === 'core/list-item'
    };
  }, [clientId]);
  const {
    replaceBlocks,
    selectionChange
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const {
    getBlockRootClientId,
    getBlockAttributes,
    getBlock
  } = (0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store);
  return [canOutdent, (0,external_gc_element_namespaceObject.useCallback)(() => {
    const parentBlockId = getBlockRootClientId(clientId);
    const parentBlockAttributes = getBlockAttributes(parentBlockId); // Create a new parent block without the inner blocks.

    const newParentBlock = (0,external_gc_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 [canOutdent, outdentList] = useOutdentList(clientId);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    icon: (0,external_gc_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent,
    title: (0,external_gc_i18n_namespaceObject.__)('减少缩进量'),
    describedBy: (0,external_gc_i18n_namespaceObject.__)('减少列表项目缩进量'),
    disabled: !canOutdent,
    onClick: outdentList
  }));
}

function list_edit_Edit({
  attributes,
  setAttributes,
  clientId,
  style
}) {
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({ ...(external_gc_element_namespaceObject.Platform.isNative && {
      style
    })
  });
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    allowedBlocks: ['core/list-item'],
    template: list_edit_TEMPLATE,
    templateLock: false,
    templateInsertUpdatesSelection: true,
    ...(external_gc_element_namespaceObject.Platform.isNative && {
      marginVertical: NATIVE_MARGIN_SPACING,
      marginHorizontal: NATIVE_MARGIN_SPACING,
      renderAppender: false
    })
  });
  useMigrateOnLoad(attributes, clientId);
  const {
    ordered,
    type,
    reversed,
    start
  } = attributes;
  const controls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    icon: (0,external_gc_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl : format_list_bullets,
    title: (0,external_gc_i18n_namespaceObject.__)('无序'),
    describedBy: (0,external_gc_i18n_namespaceObject.__)('转换为无序列表'),
    isActive: ordered === false,
    onClick: () => {
      setAttributes({
        ordered: false
      });
    }
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    icon: (0,external_gc_i18n_namespaceObject.isRTL)() ? format_list_numbered_rtl : format_list_numbered,
    title: (0,external_gc_i18n_namespaceObject.__)('顺序'),
    describedBy: (0,external_gc_i18n_namespaceObject.__)('转换为有序列表'),
    isActive: ordered === true,
    onClick: () => {
      setAttributes({
        ordered: true
      });
    }
  }), (0,external_gc_element_namespaceObject.createElement)(IndentUI, {
    clientId: clientId
  }));
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(tag_name, {
    ordered: ordered,
    reversed: reversed,
    start: start,
    type: type,
    ...innerBlocksProps
  }), controls, ordered && (0,external_gc_element_namespaceObject.createElement)(ordered_list_settings, {
    setAttributes,
    reversed,
    start,
    type
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list/save.js


/**
 * GeChiUI dependencies
 */

function list_save_save({
  attributes
}) {
  const {
    ordered,
    type,
    reversed,
    start
  } = attributes;
  const TagName = ordered ? 'ol' : 'ul';
  return (0,external_gc_element_namespaceObject.createElement)(TagName, { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      type,
      reversed,
      start
    })
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list/transforms.js
/**
 * GeChiUI 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_gc_blocks_namespaceObject.createBlock)('core/list-item', {
            content
          });
        });
      } else if (blockAttributes.length === 1) {
        const value = (0,external_gc_richText_namespaceObject.create)({
          html: blockAttributes[0].content
        });
        childBlocks = (0,external_gc_richText_namespaceObject.split)(value, '\n').map(result => {
          return (0,external_gc_blocks_namespaceObject.createBlock)('core/list-item', {
            content: (0,external_gc_richText_namespaceObject.toHTMLString)({
              value: result
            })
          });
        });
      }

      return (0,external_gc_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_gc_blocks_namespaceObject.createBlock)('core/list', {}, [(0,external_gc_blocks_namespaceObject.createBlock)('core/list-item', {
        content
      })]);
    }

  })), ...['1.', '1)'].map(prefix => ({
    type: 'prefix',
    prefix,

    transform(content) {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/list', {
        ordered: true
      }, [(0,external_gc_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_gc_blocks_namespaceObject.createBlock)(block, {
        content
      }));
    }
  }))]
};
/* harmony default export */ var list_transforms = (list_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const list_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/list",
  title: "列表",
  category: "text",
  description: "创建项目符号或编号列表。",
  keywords: ["项目符号列表", "有序列表", "编号列表"],
  textdomain: "default",
  attributes: {
    ordered: {
      type: "boolean",
      "default": false,
      __experimentalRole: "content"
    },
    values: {
      type: "string",
      source: "html",
      selector: "ol,ul",
      multiline: "li",
      __unstableMultilineWrapperTags: ["ol", "ul"],
      "default": "",
      __experimentalRole: "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
  },
  editorStyle: "gc-block-list-editor",
  style: "gc-block-list"
};


const {
  name: list_name
} = list_metadata;

const list_settings = {
  icon: library_list,
  example: {
    innerBlocks: [{
      name: 'core/list-item',
      attributes: {
        content: (0,external_gc_i18n_namespaceObject.__)('爱丽丝。')
      }
    }, {
      name: 'core/list-item',
      attributes: {
        content: (0,external_gc_i18n_namespaceObject.__)('白兔先生。')
      }
    }, {
      name: 'core/list-item',
      attributes: {
        content: (0,external_gc_i18n_namespaceObject.__)('柴郡猫。')
      }
    }, {
      name: 'core/list-item',
      attributes: {
        content: (0,external_gc_i18n_namespaceObject.__)('疯帽客。')
      }
    }, {
      name: 'core/list-item',
      attributes: {
        content: (0,external_gc_i18n_namespaceObject.__)('红心皇后。')
      }
    }]
  },
  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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/list-item.js


/**
 * GeChiUI dependencies
 */

const listItem = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var list_item = (listItem);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/format-indent-rtl.js


/**
 * GeChiUI dependencies
 */

const formatIndentRTL = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var format_indent_rtl = (formatIndentRTL);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/format-indent.js


/**
 * GeChiUI dependencies
 */

const formatIndent = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var format_indent = (formatIndent);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list-item/hooks/use-indent-list-item.js
/**
 * GeChiUI dependencies
 */




function useIndentListItem(clientId) {
  const canIndent = (0,external_gc_data_namespaceObject.useSelect)(select => select(external_gc_blockEditor_namespaceObject.store).getBlockIndex(clientId) > 0, [clientId]);
  const {
    replaceBlocks,
    selectionChange,
    multiSelect
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const {
    getBlock,
    getPreviousBlockClientId,
    getSelectionStart,
    getSelectionEnd,
    hasMultiSelection,
    getMultiSelectedBlockClientIds
  } = (0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store);
  return [canIndent, (0,external_gc_element_namespaceObject.useCallback)(() => {
    const _hasMultiSelection = hasMultiSelection();

    const clientIds = _hasMultiSelection ? getMultiSelectedBlockClientIds() : [clientId];
    const clonedBlocks = clientIds.map(_clientId => (0,external_gc_blocks_namespaceObject.cloneBlock)(getBlock(_clientId)));
    const previousSiblingId = getPreviousBlockClientId(clientId);
    const newListItem = (0,external_gc_blocks_namespaceObject.cloneBlock)(getBlock(previousSiblingId)); // If the sibling has no innerBlocks, create a new `list` block.

    if (!newListItem.innerBlocks?.length) {
      newListItem.innerBlocks = [(0,external_gc_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);
    }
  }, [clientId])];
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list-item/hooks/use-outdent-list-item.js
/**
 * GeChiUI dependencies
 */




/**
 * Internal dependencies
 */

const {
  name: listItemName
} = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/list-item",
  title: "列表项目",
  category: "text",
  parent: ["core/list"],
  description: "建立列表项目。",
  textdomain: "default",
  attributes: {
    placeholder: {
      type: "string"
    },
    content: {
      type: "string",
      source: "html",
      selector: "li",
      "default": "",
      __experimentalRole: "content"
    }
  },
  supports: {
    className: false,
    __experimentalSelector: "li",
    typography: {
      fontSize: true,
      lineHeight: true,
      __experimentalFontFamily: true,
      __experimentalFontWeight: true,
      __experimentalFontStyle: true,
      __experimentalTextTransform: true,
      __experimentalTextDecoration: true,
      __experimentalLetterSpacing: true,
      __experimentalDefaultControls: {
        fontSize: true
      }
    }
  }
};
function useOutdentListItem(clientId) {
  const registry = (0,external_gc_data_namespaceObject.useRegistry)();
  const {
    canOutdent
  } = (0,external_gc_data_namespaceObject.useSelect)(innerSelect => {
    const {
      getBlockRootClientId,
      getBlockName
    } = innerSelect(external_gc_blockEditor_namespaceObject.store);
    const grandParentId = getBlockRootClientId(getBlockRootClientId(clientId));
    const grandParentName = getBlockName(grandParentId);
    const isListItem = grandParentName === listItemName;
    return {
      canOutdent: isListItem
    };
  }, [clientId]);
  const {
    moveBlocksToPosition,
    removeBlock,
    insertBlock,
    updateBlockListSettings
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const {
    getBlockRootClientId,
    getBlockName,
    getBlockOrder,
    getBlockIndex,
    getSelectedBlockClientIds,
    getBlock,
    getBlockListSettings
  } = (0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store);

  function getParentListItemId(id) {
    const listId = getBlockRootClientId(id);
    const parentListItemId = getBlockRootClientId(listId);
    if (!parentListItemId) return;
    if (getBlockName(parentListItemId) !== listItemName) return;
    return parentListItemId;
  }

  return [canOutdent, (0,external_gc_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) !== listItemName) 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_gc_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);
      }
    });
  }, [])];
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list-item/hooks/use-copy.js
/**
 * GeChiUI dependencies
 */



function useCopy(clientId) {
  const {
    getBlockRootClientId,
    getBlockName,
    getBlockAttributes
  } = (0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store);
  return (0,external_gc_compose_namespaceObject.useRefEffect)(node => {
    function onCopy(event) {
      // The event propagates through all nested lists, so don't override
      // when copying nested list items.
      if (event.clipboardData.getData('__unstableWrapperBlockName')) {
        return;
      }

      const rootClientId = getBlockRootClientId(clientId);
      event.clipboardData.setData('__unstableWrapperBlockName', getBlockName(rootClientId));
      event.clipboardData.setData('__unstableWrapperBlockAttributes', JSON.stringify(getBlockAttributes(rootClientId)));
    }

    node.addEventListener('copy', onCopy);
    node.addEventListener('cut', onCopy);
    return () => {
      node.removeEventListener('copy', onCopy);
      node.removeEventListener('cut', onCopy);
    };
  }, []);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list-item/hooks/use-enter.js
/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */


function useEnter(props) {
  const {
    replaceBlocks,
    selectionChange
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const {
    getBlock,
    getBlockRootClientId,
    getBlockIndex
  } = (0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store);
  const propsRef = (0,external_gc_element_namespaceObject.useRef)(props);
  propsRef.current = props;
  const [canOutdent, outdentListItem] = useOutdentListItem(propsRef.current.clientId);
  return (0,external_gc_compose_namespaceObject.useRefEffect)(element => {
    function onKeyDown(event) {
      if (event.defaultPrevented || event.keyCode !== external_gc_keycodes_namespaceObject.ENTER) {
        return;
      }

      const {
        content,
        clientId
      } = propsRef.current;

      if (content.length) {
        return;
      }

      event.preventDefault();

      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_gc_blocks_namespaceObject.cloneBlock)({ ...topParentListBlock,
        innerBlocks: topParentListBlock.innerBlocks.slice(0, blockIndex)
      });
      const middle = (0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_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_gc_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);
    };
  }, [canOutdent]);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list-item/hooks/use-space.js
/**
 * GeChiUI dependencies
 */




/**
 * Internal dependencies
 */


function useSpace(clientId) {
  const {
    getSelectionStart,
    getSelectionEnd
  } = (0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store);
  const [canIndent, indentListItem] = useIndentListItem(clientId);
  return (0,external_gc_compose_namespaceObject.useRefEffect)(element => {
    function onKeyDown(event) {
      const {
        keyCode,
        shiftKey,
        altKey,
        metaKey,
        ctrlKey
      } = event;

      if (event.defaultPrevented || !canIndent || keyCode !== external_gc_keycodes_namespaceObject.SPACE || // Only override when no modifiers are pressed.
      shiftKey || altKey || metaKey || ctrlKey) {
        return;
      }

      const selectionStart = getSelectionStart();
      const selectionEnd = getSelectionEnd();

      if (selectionStart.offset === 0 && selectionEnd.offset === 0) {
        event.preventDefault();
        indentListItem();
      }
    }

    element.addEventListener('keydown', onKeyDown);
    return () => {
      element.removeEventListener('keydown', onKeyDown);
    };
  }, [canIndent, indentListItem]);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list-item/hooks/use-split.js
/**
 * GeChiUI dependencies
 */




function useSplit(clientId) {
  // We can not rely on the isAfterOriginal parameter of the callback,
  // because if the value after the split is empty isAfterOriginal is false
  // while the value is in fact after the original. So to avoid that issue we use
  // a flag where the first execution of the callback is false (it is the before value)
  // and the second execution is true, it is the after value.
  const isAfter = (0,external_gc_element_namespaceObject.useRef)(false);
  const {
    getBlock
  } = (0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store);
  return (0,external_gc_element_namespaceObject.useCallback)(value => {
    const block = getBlock(clientId);

    if (isAfter.current) {
      return (0,external_gc_blocks_namespaceObject.cloneBlock)(block, {
        content: value
      });
    }

    isAfter.current = true;
    return (0,external_gc_blocks_namespaceObject.createBlock)(block.name, { ...block.attributes,
      content: value
    });
  }, [clientId, getBlock]);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list-item/hooks/use-merge.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */


const {
  name: use_merge_listItemName
} = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/list-item",
  title: "列表项目",
  category: "text",
  parent: ["core/list"],
  description: "建立列表项目。",
  textdomain: "default",
  attributes: {
    placeholder: {
      type: "string"
    },
    content: {
      type: "string",
      source: "html",
      selector: "li",
      "default": "",
      __experimentalRole: "content"
    }
  },
  supports: {
    className: false,
    __experimentalSelector: "li",
    typography: {
      fontSize: true,
      lineHeight: true,
      __experimentalFontFamily: true,
      __experimentalFontWeight: true,
      __experimentalFontStyle: true,
      __experimentalTextTransform: true,
      __experimentalTextDecoration: true,
      __experimentalLetterSpacing: true,
      __experimentalDefaultControls: {
        fontSize: true
      }
    }
  }
};
function useMerge(clientId, onMerge) {
  const registry = (0,external_gc_data_namespaceObject.useRegistry)();
  const {
    getPreviousBlockClientId,
    getNextBlockClientId,
    getBlockOrder,
    getBlockRootClientId,
    getBlockName
  } = (0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store);
  const {
    mergeBlocks,
    moveBlocksToPosition
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const [, outdentListItem] = useOutdentListItem(clientId);

  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) !== use_merge_listItemName) 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 => {
    if (forward) {
      const nextBlockClientId = getNextId(clientId);

      if (!nextBlockClientId) {
        onMerge(forward);
        return;
      }

      if (getParentListItemId(nextBlockClientId)) {
        outdentListItem(nextBlockClientId);
      } else {
        registry.batch(() => {
          moveBlocksToPosition(getBlockOrder(nextBlockClientId), nextBlockClientId, getPreviousBlockClientId(nextBlockClientId));
          mergeBlocks(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);
        registry.batch(() => {
          moveBlocksToPosition(getBlockOrder(clientId), clientId, previousBlockClientId);
          mergeBlocks(trailingId, clientId);
        });
      } else {
        onMerge(forward);
      }
    }
  };
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list-item/utils.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */

const {
  name: utils_listItemName
} = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/list-item",
  title: "列表项目",
  category: "text",
  parent: ["core/list"],
  description: "建立列表项目。",
  textdomain: "default",
  attributes: {
    placeholder: {
      type: "string"
    },
    content: {
      type: "string",
      source: "html",
      selector: "li",
      "default": "",
      __experimentalRole: "content"
    }
  },
  supports: {
    className: false,
    __experimentalSelector: "li",
    typography: {
      fontSize: true,
      lineHeight: true,
      __experimentalFontFamily: true,
      __experimentalFontWeight: true,
      __experimentalFontStyle: true,
      __experimentalTextTransform: true,
      __experimentalTextDecoration: true,
      __experimentalLetterSpacing: true,
      __experimentalDefaultControls: {
        fontSize: true
      }
    }
  }
};
const {
  name: listName
} = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/list",
  title: "列表",
  category: "text",
  description: "创建项目符号或编号列表。",
  keywords: ["项目符号列表", "有序列表", "编号列表"],
  textdomain: "default",
  attributes: {
    ordered: {
      type: "boolean",
      "default": false,
      __experimentalRole: "content"
    },
    values: {
      type: "string",
      source: "html",
      selector: "ol,ul",
      multiline: "li",
      __unstableMultilineWrapperTags: ["ol", "ul"],
      "default": "",
      __experimentalRole: "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
  },
  editorStyle: "gc-block-list-editor",
  style: "gc-block-list"
};
const {
  name: paragraphName
} = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/paragraph",
  title: "段落",
  category: "text",
  description: "这是文字内容的基本要素，请以此为基础开始撰写。",
  keywords: ["text"],
  textdomain: "default",
  attributes: {
    align: {
      type: "string"
    },
    content: {
      type: "string",
      source: "html",
      selector: "p",
      "default": "",
      __experimentalRole: "content"
    },
    dropCap: {
      type: "boolean",
      "default": false
    },
    placeholder: {
      type: "string"
    },
    direction: {
      type: "string",
      "enum": ["ltr", "rtl"]
    }
  },
  supports: {
    anchor: true,
    className: false,
    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,
      __experimentalDefaultControls: {
        fontSize: true
      }
    },
    __experimentalSelector: "p",
    __unstablePasteTextInline: true
  },
  editorStyle: "gc-block-paragraph-editor",
  style: "gc-block-paragraph"
};
function createListItem(listItemAttributes, listAttributes, children) {
  return createBlock(utils_listItemName, listItemAttributes, !children?.length ? [] : [createBlock(listName, listAttributes, children)]);
}

function convertBlockToList(block) {
  const list = (0,external_gc_blocks_namespaceObject.switchToBlockType)(block, listName);
  if (list) return list;
  const paragraph = (0,external_gc_blocks_namespaceObject.switchToBlockType)(block, paragraphName);
  if (paragraph) return (0,external_gc_blocks_namespaceObject.switchToBlockType)(paragraph, listName);
  return null;
}

function convertToListItems(blocks) {
  const listItems = [];

  for (let block of blocks) {
    if (block.name === utils_listItemName) {
      listItems.push(block);
    } else if (block.name === listName) {
      listItems.push(...block.innerBlocks);
    } else if (block = convertBlockToList(block)) {
      for (const {
        innerBlocks
      } of block) {
        listItems.push(...innerBlocks);
      }
    }
  }

  return listItems;
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list-item/edit.js


/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */



function edit_IndentUI({
  clientId
}) {
  const [canIndent, indentListItem] = useIndentListItem(clientId);
  const [canOutdent, outdentListItem] = useOutdentListItem(clientId);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    icon: (0,external_gc_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent,
    title: (0,external_gc_i18n_namespaceObject.__)('减少缩进量'),
    describedBy: (0,external_gc_i18n_namespaceObject.__)('减少列表项目缩进量'),
    disabled: !canOutdent,
    onClick: () => outdentListItem()
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    icon: (0,external_gc_i18n_namespaceObject.isRTL)() ? format_indent_rtl : format_indent,
    title: (0,external_gc_i18n_namespaceObject.__)('增加缩进量'),
    describedBy: (0,external_gc_i18n_namespaceObject.__)('增加列表项目缩进量'),
    isDisabled: !canIndent,
    onClick: () => indentListItem()
  }));
}
function ListItemEdit({
  attributes,
  setAttributes,
  onReplace,
  clientId,
  mergeBlocks
}) {
  const {
    placeholder,
    content
  } = attributes;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    ref: useCopy(clientId)
  });
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    allowedBlocks: ['core/list'],
    renderAppender: false,
    __unstableDisableDropZone: true
  });
  const useEnterRef = useEnter({
    content,
    clientId
  });
  const useSpaceRef = useSpace(clientId);
  const onSplit = useSplit(clientId);
  const onMerge = useMerge(clientId, mergeBlocks);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("li", { ...innerBlocksProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    ref: (0,external_gc_compose_namespaceObject.useMergeRefs)([useEnterRef, useSpaceRef]),
    identifier: "content",
    tagName: "div",
    onChange: nextContent => setAttributes({
      content: nextContent
    }),
    value: content,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('列表文字'),
    placeholder: placeholder || (0,external_gc_i18n_namespaceObject.__)('列表'),
    onSplit: onSplit,
    onMerge: onMerge,
    onReplace: onReplace ? (blocks, ...args) => {
      onReplace(convertToListItems(blocks), ...args);
    } : undefined
  }), innerBlocksProps.children), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(edit_IndentUI, {
    clientId: clientId
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list-item/save.js


/**
 * GeChiUI dependencies
 */

function list_item_save_save({
  attributes
}) {
  return (0,external_gc_element_namespaceObject.createElement)("li", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    value: attributes.content
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list-item/transforms.js
/**
 * GeChiUI dependencies
 */

const list_item_transforms_transforms = {
  to: [{
    type: 'block',
    blocks: ['core/paragraph'],
    transform: (attributes, innerBlocks = []) => [(0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', attributes), ...innerBlocks.map(block => (0,external_gc_blocks_namespaceObject.cloneBlock)(block))]
  }]
};
/* harmony default export */ var list_item_transforms = (list_item_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/list-item/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const list_item_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/list-item",
  title: "列表项目",
  category: "text",
  parent: ["core/list"],
  description: "建立列表项目。",
  textdomain: "default",
  attributes: {
    placeholder: {
      type: "string"
    },
    content: {
      type: "string",
      source: "html",
      selector: "li",
      "default": "",
      __experimentalRole: "content"
    }
  },
  supports: {
    className: false,
    __experimentalSelector: "li",
    typography: {
      fontSize: true,
      lineHeight: true,
      __experimentalFontFamily: true,
      __experimentalFontWeight: true,
      __experimentalFontStyle: true,
      __experimentalTextTransform: true,
      __experimentalTextDecoration: true,
      __experimentalLetterSpacing: true,
      __experimentalDefaultControls: {
        fontSize: true
      }
    }
  }
};



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
};
const list_item_init = () => initBlock({
  name: list_item_name,
  metadata: list_item_metadata,
  settings: list_item_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/login.js


/**
 * GeChiUI dependencies
 */

const login = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_login = (login);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/loginout/edit.js


/**
 * GeChiUI dependencies
 */



function LoginOutEdit({
  attributes,
  setAttributes
}) {
  const {
    displayLoginAsForm,
    redirectToCurrent
  } = attributes;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('以表单形式显示登录'),
    checked: displayLoginAsForm,
    onChange: () => setAttributes({
      displayLoginAsForm: !displayLoginAsForm
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('重定向到当前 URL'),
    checked: redirectToCurrent,
    onChange: () => setAttributes({
      redirectToCurrent: !redirectToCurrent
    })
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)({
      className: 'logged-in'
    })
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#login-pseudo-link"
  }, (0,external_gc_i18n_namespaceObject.__)('注销'))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/loginout/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */



const loginout_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/loginout",
  title: "登录/注销",
  category: "theme",
  description: "显示登录和注销链接。",
  keywords: ["login", "logout", "form"],
  textdomain: "default",
  attributes: {
    displayLoginAsForm: {
      type: "boolean",
      "default": false
    },
    redirectToCurrent: {
      type: "boolean",
      "default": true
    }
  },
  supports: {
    className: true,
    typography: {
      fontSize: true,
      lineHeight: true,
      __experimentalFontFamily: true,
      __experimentalFontWeight: true,
      __experimentalFontStyle: true,
      __experimentalTextTransform: true,
      __experimentalTextDecoration: true,
      __experimentalLetterSpacing: true,
      __experimentalDefaultControls: {
        fontSize: true
      }
    }
  }
};
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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/media-and-text.js


/**
 * GeChiUI dependencies
 */

const mediaAndText = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M3 6v11.5h8V6H3Zm11 3h7V7.5h-7V9Zm7 3.5h-7V11h7v1.5ZM14 16h7v-1.5h-7V16Z"
}));
/* harmony default export */ var media_and_text = (mediaAndText);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/media-text/constants.js
/**
 * GeChiUI dependencies
 */

const 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_gc_i18n_namespaceObject._x)('内容...' , 'content placeholder')
}]];

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/media-text/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */



/**
 * Internal dependencies
 */



const v1ToV5ImageFillStyles = (url, focalPoint) => {
  return url ? {
    backgroundImage: `url(${url})`,
    backgroundPosition: focalPoint ? `${focalPoint.x * 100}% ${focalPoint.y * 100}%` : `50% 50%`
  } : {};
};

const v6ImageFillStyles = (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 baseAttributes = {
  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: true
  }
};
const v4ToV5BlockAttributes = { ...baseAttributes,
  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: '',
    __experimentalRole: 'content'
  },
  mediaId: {
    type: 'number',
    __experimentalRole: 'content'
  },
  mediaUrl: {
    type: 'string',
    source: 'attribute',
    selector: 'figure video,figure img',
    attribute: 'src',
    __experimentalRole: 'content'
  },
  href: {
    type: 'string',
    source: 'attribute',
    selector: 'figure a',
    attribute: 'href',
    __experimentalRole: 'content'
  },
  mediaType: {
    type: 'string',
    __experimentalRole: 'content'
  }
};
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
    }
  }
}; // Version with wide as the default alignment.
// See: https://github.com/GeChiUI/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 || DEFAULT_MEDIA_SIZE_SLUG;
    const newRel = !rel ? undefined : rel;
    const imageClasses = classnames_default()({
      [`gc-image-${mediaId}`]: mediaId && mediaType === 'image',
      [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image'
    });
    let image = (0,external_gc_element_namespaceObject.createElement)("img", {
      src: mediaUrl,
      alt: mediaAlt,
      className: imageClasses || null
    });

    if (href) {
      image = (0,external_gc_element_namespaceObject.createElement)("a", {
        className: linkClass,
        href: href,
        target: linkTarget,
        rel: newRel
      }, image);
    }

    const mediaTypeRenders = {
      image: () => image,
      video: () => (0,external_gc_element_namespaceObject.createElement)("video", {
        controls: true,
        src: mediaUrl
      })
    };
    const className = classnames_default()({
      'has-media-on-the-right': 'right' === mediaPosition,
      'is-stacked-on-mobile': isStackedOnMobile,
      [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
      'is-image-fill': imageFill
    });
    const backgroundStyles = imageFill ? v6ImageFillStyles(mediaUrl, focalPoint) : {};
    let gridTemplateColumns;

    if (mediaWidth !== DEFAULT_MEDIA_WIDTH) {
      gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
    }

    const style = {
      gridTemplateColumns
    };

    if ('right' === mediaPosition) {
      return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
          className,
          style
        })
      }, (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save({
          className: 'gc-block-media-text__content'
        })
      }), (0,external_gc_element_namespaceObject.createElement)("figure", {
        className: "gc-block-media-text__media",
        style: backgroundStyles
      }, (mediaTypeRenders[mediaType] || noop)()));
    }

    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className,
        style
      })
    }, (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: "gc-block-media-text__media",
      style: backgroundStyles
    }, (mediaTypeRenders[mediaType] || noop)()), (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save({
        className: 'gc-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/GeChiUI/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 || DEFAULT_MEDIA_SIZE_SLUG;
    const newRel = !rel ? undefined : rel;
    const imageClasses = classnames_default()({
      [`gc-image-${mediaId}`]: mediaId && mediaType === 'image',
      [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image'
    });
    let image = (0,external_gc_element_namespaceObject.createElement)("img", {
      src: mediaUrl,
      alt: mediaAlt,
      className: imageClasses || null
    });

    if (href) {
      image = (0,external_gc_element_namespaceObject.createElement)("a", {
        className: linkClass,
        href: href,
        target: linkTarget,
        rel: newRel
      }, image);
    }

    const mediaTypeRenders = {
      image: () => image,
      video: () => (0,external_gc_element_namespaceObject.createElement)("video", {
        controls: true,
        src: mediaUrl
      })
    };
    const className = classnames_default()({
      '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 (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
          className,
          style
        })
      }, (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save({
          className: 'gc-block-media-text__content'
        })
      }), (0,external_gc_element_namespaceObject.createElement)("figure", {
        className: "gc-block-media-text__media",
        style: backgroundStyles
      }, (mediaTypeRenders[mediaType] || noop)()));
    }

    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className,
        style
      })
    }, (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: "gc-block-media-text__media",
      style: backgroundStyles
    }, (mediaTypeRenders[mediaType] || noop)()), (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save({
        className: 'gc-block-media-text__content'
      })
    }));
  },

  migrate: migrateDefaultAlign
}; // Version with CSS grid
// See: https://github.com/GeChiUI/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 || DEFAULT_MEDIA_SIZE_SLUG;
    const newRel = !rel ? undefined : rel;
    const imageClasses = classnames_default()({
      [`gc-image-${mediaId}`]: mediaId && mediaType === 'image',
      [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image'
    });
    let image = (0,external_gc_element_namespaceObject.createElement)("img", {
      src: mediaUrl,
      alt: mediaAlt,
      className: imageClasses || null
    });

    if (href) {
      image = (0,external_gc_element_namespaceObject.createElement)("a", {
        className: linkClass,
        href: href,
        target: linkTarget,
        rel: newRel
      }, image);
    }

    const mediaTypeRenders = {
      image: () => image,
      video: () => (0,external_gc_element_namespaceObject.createElement)("video", {
        controls: true,
        src: mediaUrl
      })
    };
    const className = classnames_default()({
      '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 (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className,
        style
      })
    }, (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: "gc-block-media-text__media",
      style: backgroundStyles
    }, (mediaTypeRenders[mediaType] || noop)()), (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save({
        className: 'gc-block-media-text__content'
      })
    }));
  },

  migrate: migrateDefaultAlign
}; // Version with ad-hoc color attributes
// See: https://github.com/GeChiUI/gutenberg/pull/21169

const media_text_deprecated_v3 = {
  attributes: { ...baseAttributes,
    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_gc_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 = (0,external_gc_element_namespaceObject.createElement)("img", {
      src: mediaUrl,
      alt: mediaAlt,
      className: mediaId && mediaType === 'image' ? `gc-image-${mediaId}` : null
    });

    if (href) {
      image = (0,external_gc_element_namespaceObject.createElement)("a", {
        className: linkClass,
        href: href,
        target: linkTarget,
        rel: newRel
      }, image);
    }

    const mediaTypeRenders = {
      image: () => image,
      video: () => (0,external_gc_element_namespaceObject.createElement)("video", {
        controls: true,
        src: mediaUrl
      })
    };
    const backgroundClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const className = classnames_default()({
      '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 (0,external_gc_element_namespaceObject.createElement)("div", {
      className: className,
      style: style
    }, (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: "gc-block-media-text__media",
      style: backgroundStyles
    }, (mediaTypeRenders[mediaType] || noop)()), (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-media-text__content"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  }

}; // Version with stack on mobile off by default
// See: https://github.com/GeChiUI/gutenberg/pull/14364

const media_text_deprecated_v2 = {
  attributes: { ...baseAttributes,
    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_gc_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: () => (0,external_gc_element_namespaceObject.createElement)("img", {
        src: mediaUrl,
        alt: mediaAlt,
        className: mediaId && mediaType === 'image' ? `gc-image-${mediaId}` : null
      }),
      video: () => (0,external_gc_element_namespaceObject.createElement)("video", {
        controls: true,
        src: mediaUrl
      })
    };
    const backgroundClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const className = classnames_default()({
      '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 (0,external_gc_element_namespaceObject.createElement)("div", {
      className: className,
      style: style
    }, (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: "gc-block-media-text__media",
      style: backgroundStyles
    }, (mediaTypeRenders[mediaType] || noop)()), (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-media-text__content"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  }

}; // Version without the gc-image-#### class on image
// See: https://github.com/GeChiUI/gutenberg/pull/11922

const media_text_deprecated_v1 = {
  attributes: { ...baseAttributes,
    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: () => (0,external_gc_element_namespaceObject.createElement)("img", {
        src: mediaUrl,
        alt: mediaAlt
      }),
      video: () => (0,external_gc_element_namespaceObject.createElement)("video", {
        controls: true,
        src: mediaUrl
      })
    };
    const backgroundClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const className = classnames_default()({
      '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 (0,external_gc_element_namespaceObject.createElement)("div", {
      className: className,
      style: style
    }, (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: "gc-block-media-text__media"
    }, (mediaTypeRenders[mediaType] || noop)()), (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-media-text__content"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null)));
  }

};
/* harmony default export */ var media_text_deprecated = ([media_text_deprecated_v6, media_text_deprecated_v5, media_text_deprecated_v4, media_text_deprecated_v3, media_text_deprecated_v2, media_text_deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/pull-left.js


/**
 * GeChiUI dependencies
 */

const pullLeft = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"
}));
/* harmony default export */ var pull_left = (pullLeft);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/pull-right.js


/**
 * GeChiUI dependencies
 */

const pullRight = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"
}));
/* harmony default export */ var pull_right = (pullRight);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/media.js


/**
 * GeChiUI dependencies
 */

const media = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "m7 6.5 4 2.5-4 2.5z"
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_media = (media);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/media-text/media-container.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */










/**
 * Constants
 */

const media_container_ALLOWED_MEDIA_TYPES = ['image', 'video'];

const media_container_noop = () => {};

function imageFillStyles(url, focalPoint) {
  return url ? {
    backgroundImage: `url(${url})`,
    backgroundPosition: focalPoint ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : `50% 50%`
  } : {};
}
const ResizableBoxContainer = (0,external_gc_element_namespaceObject.forwardRef)(({
  isSelected,
  isStackedOnMobile,
  ...props
}, ref) => {
  const isMobile = (0,external_gc_compose_namespaceObject.useViewportMatch)('small', '<');
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ResizableBox, {
    ref: ref,
    showHandle: isSelected && (!isMobile || !isStackedOnMobile),
    ...props
  });
});

function ToolbarEditButton({
  mediaId,
  mediaUrl,
  onSelectMedia
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "other"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaReplaceFlow, {
    mediaId: mediaId,
    mediaURL: mediaUrl,
    allowedTypes: media_container_ALLOWED_MEDIA_TYPES,
    accept: "image/*,video/*",
    onSelect: onSelectMedia
  }));
}

function PlaceholderContainer({
  className,
  mediaUrl,
  onSelectMedia
}) {
  const {
    createErrorNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);

  const onUploadError = message => {
    createErrorNotice(message, {
      type: 'snackbar'
    });
  };

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaPlaceholder, {
    icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
      icon: library_media
    }),
    labels: {
      title: (0,external_gc_i18n_namespaceObject.__)('媒体区')
    },
    className: className,
    onSelect: onSelectMedia,
    accept: "image/*,video/*",
    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
  } = props;
  const isTemporaryMedia = !mediaId && (0,external_gc_blob_namespaceObject.isBlobURL)(mediaUrl);
  const {
    toggleSelection
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);

  if (mediaUrl) {
    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 backgroundStyles = mediaType === 'image' && imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
    const mediaTypeRenderers = {
      image: () => (0,external_gc_element_namespaceObject.createElement)("img", {
        src: mediaUrl,
        alt: mediaAlt
      }),
      video: () => (0,external_gc_element_namespaceObject.createElement)("video", {
        controls: true,
        src: mediaUrl
      })
    };
    return (0,external_gc_element_namespaceObject.createElement)(ResizableBoxContainer, {
      as: "figure",
      className: classnames_default()(className, 'editor-media-container__resizer', {
        'is-transient': isTemporaryMedia
      }),
      style: backgroundStyles,
      size: {
        width: mediaWidth + '%'
      },
      minWidth: "10%",
      maxWidth: "100%",
      enable: enablePositions,
      onResizeStart: onResizeStart,
      onResize: onResize,
      onResizeStop: onResizeStop,
      axis: "x",
      isSelected: isSelected,
      isStackedOnMobile: isStackedOnMobile,
      ref: ref
    }, (0,external_gc_element_namespaceObject.createElement)(ToolbarEditButton, {
      onSelectMedia: onSelectMedia,
      mediaUrl: mediaUrl,
      mediaId: mediaId
    }), (mediaTypeRenderers[mediaType] || media_container_noop)(), isTemporaryMedia && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null), (0,external_gc_element_namespaceObject.createElement)(PlaceholderContainer, { ...props
    }));
  }

  return (0,external_gc_element_namespaceObject.createElement)(PlaceholderContainer, { ...props
  });
}

/* harmony default export */ var media_container = ((0,external_gc_element_namespaceObject.forwardRef)(MediaContainer));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/media-text/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */









/**
 * Internal dependencies
 */




const {
  useBlockEditingMode: edit_useBlockEditingMode
} = unlock(external_gc_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
      });
      return;
    }

    if ((0,external_gc_blob_namespaceObject.isBlobURL)(media.url)) {
      media.type = (0,external_gc_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
    });
  };
}

function MediaTextEdit({
  attributes,
  isSelected,
  setAttributes
}) {
  const {
    focalPoint,
    href,
    imageFill,
    isStackedOnMobile,
    linkClass,
    linkDestination,
    linkTarget,
    mediaAlt,
    mediaId,
    mediaPosition,
    mediaType,
    mediaUrl,
    mediaWidth,
    rel,
    verticalAlignment,
    allowedBlocks
  } = attributes;
  const mediaSizeSlug = attributes.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG;
  const {
    imageSizes,
    image
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSettings
    } = select(external_gc_blockEditor_namespaceObject.store);
    return {
      image: mediaId && isSelected ? select(external_gc_coreData_namespaceObject.store).getMedia(mediaId, {
        context: 'view'
      }) : null,
      imageSizes: getSettings()?.imageSizes
    };
  }, [isSelected, mediaId]);
  const refMediaContainer = (0,external_gc_element_namespaceObject.useRef)();

  const imperativeFocalPointPreview = value => {
    const {
      style
    } = refMediaContainer.current.resizable;
    const {
      x,
      y
    } = value;
    style.backgroundPosition = `${x * 100}% ${y * 100}%`;
  };

  const [temporaryMediaWidth, setTemporaryMediaWidth] = (0,external_gc_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 = classnames_default()({
    'has-media-on-the-right': 'right' === mediaPosition,
    'is-selected': isSelected,
    'is-stacked-on-mobile': isStackedOnMobile,
    [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
    'is-image-fill': 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 imageSizeOptions = imageSizes.filter(({
    slug
  }) => getImageSourceUrlBySizeSlug(image, slug)).map(({
    name,
    slug
  }) => ({
    value: slug,
    label: name
  }));

  const updateImage = newMediaSizeSlug => {
    const newUrl = getImageSourceUrlBySizeSlug(image, newMediaSizeSlug);

    if (!newUrl) {
      return null;
    }

    setAttributes({
      mediaUrl: newUrl,
      mediaSizeSlug: newMediaSizeSlug
    });
  };

  const mediaTextGeneralSettings = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在移动设备上堆叠显示'),
    checked: isStackedOnMobile,
    onChange: () => setAttributes({
      isStackedOnMobile: !isStackedOnMobile
    })
  }), mediaType === 'image' && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('裁剪图片以填满整个栏位'),
    checked: imageFill,
    onChange: () => setAttributes({
      imageFill: !imageFill
    })
  }), imageFill && mediaUrl && mediaType === 'image' && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FocalPointPicker, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('焦点选择器'),
    url: mediaUrl,
    value: focalPoint,
    onChange: value => setAttributes({
      focalPoint: value
    }),
    onDragStart: imperativeFocalPointPreview,
    onDrag: imperativeFocalPointPreview
  }), mediaType === 'image' && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextareaControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('替代文本'),
    value: mediaAlt,
    onChange: onMediaAltChange,
    help: (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ExternalLink, {
      href: "https://www.w3.org/WAI/tutorials/images/decision-tree"
    }, (0,external_gc_i18n_namespaceObject.__)('说明此图片的用途')), (0,external_gc_element_namespaceObject.createElement)("br", null), (0,external_gc_i18n_namespaceObject.__)('如果是装饰性的，请留空。'))
  }), mediaType === 'image' && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalImageSizeControl, {
    onChangeImage: updateImage,
    slug: mediaSizeSlug,
    imageSizeOptions: imageSizeOptions,
    isResizable: false,
    imageSizeHelp: (0,external_gc_i18n_namespaceObject.__)('选择来源图片的尺寸。')
  }), mediaUrl && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('媒体宽度'),
    value: temporaryMediaWidth || mediaWidth,
    onChange: commitWidthChange,
    min: WIDTH_CONSTRAINT_PERCENTAGE,
    max: 100 - WIDTH_CONSTRAINT_PERCENTAGE
  }));
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classNames,
    style
  });
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)({
    className: 'gc-block-media-text__content'
  }, {
    template: constants_TEMPLATE,
    allowedBlocks
  });
  const blockEditingMode = edit_useBlockEditingMode();
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, mediaTextGeneralSettings), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, blockEditingMode === 'default' && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockVerticalAlignmentControl, {
    onChange: onVerticalAlignmentChange,
    value: verticalAlignment
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    icon: pull_left,
    title: (0,external_gc_i18n_namespaceObject.__)('在左侧显示媒体'),
    isActive: mediaPosition === 'left',
    onClick: () => setAttributes({
      mediaPosition: 'left'
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    icon: pull_right,
    title: (0,external_gc_i18n_namespaceObject.__)('在右侧显示媒体'),
    isActive: mediaPosition === 'right',
    onClick: () => setAttributes({
      mediaPosition: 'right'
    })
  })), mediaType === 'image' && (0,external_gc_element_namespaceObject.createElement)(external_gc_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
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, mediaPosition === 'right' && (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  }), (0,external_gc_element_namespaceObject.createElement)(media_container, {
    className: "gc-block-media-text__media",
    onSelectMedia: onSelectMedia,
    onWidthChange: onWidthChange,
    commitWidthChange: commitWidthChange,
    ref: refMediaContainer,
    enableResize: blockEditingMode === 'default',
    focalPoint,
    imageFill,
    isSelected,
    isStackedOnMobile,
    mediaAlt,
    mediaId,
    mediaPosition,
    mediaType,
    mediaUrl,
    mediaWidth
  }), mediaPosition !== 'right' && (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  })));
}

/* harmony default export */ var media_text_edit = (MediaTextEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/media-text/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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 || DEFAULT_MEDIA_SIZE_SLUG;
  const newRel = !rel ? undefined : rel;
  const imageClasses = classnames_default()({
    [`gc-image-${mediaId}`]: mediaId && mediaType === 'image',
    [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image'
  });
  let image = (0,external_gc_element_namespaceObject.createElement)("img", {
    src: mediaUrl,
    alt: mediaAlt,
    className: imageClasses || null
  });

  if (href) {
    image = (0,external_gc_element_namespaceObject.createElement)("a", {
      className: linkClass,
      href: href,
      target: linkTarget,
      rel: newRel
    }, image);
  }

  const mediaTypeRenders = {
    image: () => image,
    video: () => (0,external_gc_element_namespaceObject.createElement)("video", {
      controls: true,
      src: mediaUrl
    })
  };
  const className = classnames_default()({
    'has-media-on-the-right': 'right' === mediaPosition,
    'is-stacked-on-mobile': isStackedOnMobile,
    [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment,
    'is-image-fill': imageFill
  });
  const backgroundStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {};
  let gridTemplateColumns;

  if (mediaWidth !== save_DEFAULT_MEDIA_WIDTH) {
    gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`;
  }

  const style = {
    gridTemplateColumns
  };

  if ('right' === mediaPosition) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className,
        style
      })
    }, (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save({
        className: 'gc-block-media-text__content'
      })
    }), (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: "gc-block-media-text__media",
      style: backgroundStyles
    }, (mediaTypeRenders[mediaType] || save_noop)()));
  }

  return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className,
      style
    })
  }, (0,external_gc_element_namespaceObject.createElement)("figure", {
    className: "gc-block-media-text__media",
    style: backgroundStyles
  }, (mediaTypeRenders[mediaType] || save_noop)()), (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save({
      className: 'gc-block-media-text__content'
    })
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/media-text/transforms.js
/**
 * GeChiUI dependencies
 */

const media_text_transforms_transforms = {
  from: [{
    type: 'block',
    blocks: ['core/image'],
    transform: ({
      alt,
      url,
      id,
      anchor
    }) => (0,external_gc_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_gc_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_gc_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_gc_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_gc_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_gc_blocks_namespaceObject.createBlock)('core/cover', coverAttributes, innerBlocks);
    }
  }]
};
/* harmony default export */ var media_text_transforms = (media_text_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/media-text/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const media_text_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/media-text",
  title: "媒体和文本",
  category: "media",
  description: "将媒体和文字并排设置来丰富布局。",
  keywords: ["image", "video"],
  textdomain: "default",
  attributes: {
    align: {
      type: "string",
      "default": "none"
    },
    mediaAlt: {
      type: "string",
      source: "attribute",
      selector: "figure img",
      attribute: "alt",
      "default": "",
      __experimentalRole: "content"
    },
    mediaPosition: {
      type: "string",
      "default": "left"
    },
    mediaId: {
      type: "number",
      __experimentalRole: "content"
    },
    mediaUrl: {
      type: "string",
      source: "attribute",
      selector: "figure video,figure img",
      attribute: "src",
      __experimentalRole: "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",
      __experimentalRole: "content"
    },
    rel: {
      type: "string",
      source: "attribute",
      selector: "figure a",
      attribute: "rel"
    },
    linkClass: {
      type: "string",
      source: "attribute",
      selector: "figure a",
      attribute: "class"
    },
    mediaType: {
      type: "string",
      __experimentalRole: "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"
    }
  },
  supports: {
    anchor: true,
    align: ["wide", "full"],
    html: false,
    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
      }
    }
  },
  editorStyle: "gc-block-media-text-editor",
  style: "gc-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_gc_i18n_namespaceObject.__)('那鹪鹩<br>找找这儿，翻翻那儿<br>你丢了什么吗？')
      }
    }, {
      name: 'core/paragraph',
      attributes: {
        content: (0,external_gc_i18n_namespaceObject.__)('——小林一茶')
      }
    }]
  },
  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
});

;// CONCATENATED MODULE: external ["gc","dom"]
var external_gc_dom_namespaceObject = window["gc"]["dom"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/missing/edit.js


/**
 * GeChiUI dependencies
 */








function MissingBlockWarning({
  attributes,
  convertToHTML,
  clientId
}) {
  const {
    originalName,
    originalUndelimitedContent
  } = attributes;
  const hasContent = !!originalUndelimitedContent;
  const hasHTMLBlock = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      canInsertBlockType,
      getBlockRootClientId
    } = select(external_gc_blockEditor_namespaceObject.store);
    return canInsertBlockType('core/html', getBlockRootClientId(clientId));
  }, [clientId]);
  const actions = [];
  let messageHTML;

  if (hasContent && hasHTMLBlock) {
    messageHTML = (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: block name */
    (0,external_gc_i18n_namespaceObject.__)('您的系统不支持“%s”区块。您可以原样保留此区块，将内容转换为自定义HTML区块，或移除此区块。'), originalName);
    actions.push((0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
      key: "convert",
      onClick: convertToHTML,
      variant: "primary"
    }, (0,external_gc_i18n_namespaceObject.__)('留作HTML')));
  } else {
    messageHTML = (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: block name */
    (0,external_gc_i18n_namespaceObject.__)('您的系统不支持“%s”区块。您可以原样保留此区块或移除此区块。'), originalName);
  }

  return (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)({
      className: 'has-warning'
    })
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, {
    actions: actions
  }, messageHTML), (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.RawHTML, null, (0,external_gc_dom_namespaceObject.safeHTML)(originalUndelimitedContent)));
}

const MissingEdit = (0,external_gc_data_namespaceObject.withDispatch)((dispatch, {
  clientId,
  attributes
}) => {
  const {
    replaceBlock
  } = dispatch(external_gc_blockEditor_namespaceObject.store);
  return {
    convertToHTML() {
      replaceBlock(clientId, (0,external_gc_blocks_namespaceObject.createBlock)('core/html', {
        content: attributes.originalUndelimitedContent
      }));
    }

  };
})(MissingBlockWarning);
/* harmony default export */ var missing_edit = (MissingEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/missing/save.js


/**
 * GeChiUI dependencies
 */

function missing_save_save({
  attributes
}) {
  // Preserve the missing block's content.
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.RawHTML, null, attributes.originalContent);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/missing/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */



const missing_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/missing",
  title: "不支持",
  category: "text",
  description: "您的系统不包括对此块的支持。",
  textdomain: "default",
  attributes: {
    originalName: {
      type: "string"
    },
    originalUndelimitedContent: {
      type: "string"
    },
    originalContent: {
      type: "string",
      source: "html"
    }
  },
  supports: {
    className: false,
    customClassName: false,
    inserter: false,
    html: false,
    reusable: false
  }
};

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_gc_blocks_namespaceObject.getBlockType)(originalName) : undefined;

      if (originalBlockType) {
        return originalBlockType.settings.title || originalName;
      }

      return '';
    }
  },

  edit: missing_edit,
  save: missing_save_save
};
const missing_init = () => initBlock({
  name: missing_name,
  metadata: missing_metadata,
  settings: missing_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/more.js


/**
 * GeChiUI dependencies
 */

const more = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"
}));
/* harmony default export */ var library_more = (more);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/more/edit.js


/**
 * GeChiUI dependencies
 */






const DEFAULT_TEXT = (0,external_gc_i18n_namespaceObject.__)('阅读更多');

function MoreEdit({
  attributes: {
    customText,
    noTeaser
  },
  insertBlocksAfter,
  setAttributes
}) {
  const onChangeInput = event => {
    setAttributes({
      customText: event.target.value !== '' ? event.target.value : undefined
    });
  };

  const onKeyDown = ({
    keyCode
  }) => {
    if (keyCode === external_gc_keycodes_namespaceObject.ENTER) {
      insertBlocksAfter([(0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)())]);
    }
  };

  const getHideExcerptHelp = checked => checked ? (0,external_gc_i18n_namespaceObject.__)('此摘要已隐藏。') : (0,external_gc_i18n_namespaceObject.__)('此摘要可见。');

  const toggleHideExcerpt = () => setAttributes({
    noTeaser: !noTeaser
  });

  const style = {
    width: `${(customText ? customText : DEFAULT_TEXT).length + 1.2}em`
  };
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在完整内容页上隐藏摘要'),
    checked: !!noTeaser,
    onChange: toggleHideExcerpt,
    help: getHideExcerptHelp
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)()
  }, (0,external_gc_element_namespaceObject.createElement)("input", {
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('“阅读更多”链接文字'),
    type: "text",
    value: customText,
    placeholder: DEFAULT_TEXT,
    onChange: onChangeInput,
    onKeyDown: onKeyDown,
    style: style
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/more/save.js


/**
 * GeChiUI dependencies
 */

function more_save_save({
  attributes: {
    customText,
    noTeaser
  }
}) {
  const moreTag = customText ? `<!--more ${customText}-->` : '<!--more-->';
  const noTeaserTag = noTeaser ? '<!--noteaser-->' : '';
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.RawHTML, null, [moreTag, noTeaserTag].filter(Boolean).join('\n'));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/more/transforms.js
/**
 * GeChiUI dependencies
 */

const more_transforms_transforms = {
  from: [{
    type: 'raw',
    schema: {
      'gc-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_gc_blocks_namespaceObject.createBlock)('core/more', attrs);
    }

  }]
};
/* harmony default export */ var more_transforms = (more_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/more/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */



const more_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/more",
  title: "更多",
  category: "design",
  description: "此区块前的内容将显示在您归档页的摘要中。",
  keywords: ["阅读更多"],
  textdomain: "default",
  attributes: {
    customText: {
      type: "string"
    },
    noTeaser: {
      type: "boolean",
      "default": false
    }
  },
  supports: {
    customClassName: false,
    className: false,
    html: false,
    multiple: false
  },
  editorStyle: "gc-block-more-editor"
};


const {
  name: more_name
} = more_metadata;

const more_settings = {
  icon: library_more,
  example: {},

  __experimentalLabel(attributes, {
    context
  }) {
    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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/navigation.js


/**
 * GeChiUI dependencies
 */

const navigation = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_navigation = (navigation);

;// CONCATENATED MODULE: external ["gc","a11y"]
var external_gc_a11y_namespaceObject = window["gc"]["a11y"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/icon/index.js
/**
 * GeChiUI dependencies
 */

/** @typedef {{icon: JSX.Element, size?: number} & import('@gechiui/primitives').SVGProps} IconProps */

/**
 * Return an SVG icon.
 *
 * @param {IconProps} props icon is the SVG component to render
 *                          size is a number specifiying the icon size in pixels
 *                          Other props will be passed to wrapped SVG component
 *
 * @return {JSX.Element}  Icon component
 */

function Icon({
  icon,
  size = 24,
  ...props
}) {
  return (0,external_gc_element_namespaceObject.cloneElement)(icon, {
    width: size,
    height: size,
    ...props
  });
}

/* harmony default export */ var build_module_icon = (Icon);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/close.js


/**
 * GeChiUI dependencies
 */

const close_close = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"
}));
/* harmony default export */ var library_close = (close_close);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/constants.js
const constants_DEFAULT_BLOCK = {
  name: 'core/navigation-link'
};
const constants_ALLOWED_BLOCKS = ['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'];
const PRIORITIZED_INSERTER_BLOCKS = ['core/navigation-link/page', 'core/navigation-link'];
const SELECT_NAVIGATION_MENUS_ARGS = ['postType', 'gc_navigation', {
  per_page: 100,
  status: ['publish', 'draft'],
  order: 'desc',
  orderby: 'date'
}];

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/use-navigation-menu.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */


function useNavigationMenu(ref) {
  const permissions = (0,external_gc_coreData_namespaceObject.useResourcePermissions)('navigation', ref);
  return (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      canCreate,
      canUpdate,
      canDelete,
      isResolving,
      hasResolved
    } = permissions;
    const {
      navigationMenus,
      isResolvingNavigationMenus,
      hasResolvedNavigationMenus
    } = selectNavigationMenus(select);
    const {
      navigationMenu,
      isNavigationMenuResolved,
      isNavigationMenuMissing
    } = selectExistingMenu(select, ref);
    return {
      navigationMenus,
      isResolvingNavigationMenus,
      hasResolvedNavigationMenus,
      navigationMenu,
      isNavigationMenuResolved,
      isNavigationMenuMissing,
      canSwitchNavigationMenu: ref ? navigationMenus?.length > 1 : navigationMenus?.length > 0,
      canUserCreateNavigationMenu: canCreate,
      isResolvingCanUserCreateNavigationMenu: isResolving,
      hasResolvedCanUserCreateNavigationMenu: hasResolved,
      canUserUpdateNavigationMenu: canUpdate,
      hasResolvedCanUserUpdateNavigationMenu: ref ? hasResolved : undefined,
      canUserDeleteNavigationMenu: canDelete,
      hasResolvedCanUserDeleteNavigationMenu: ref ? hasResolved : undefined
    };
  }, [ref, permissions]);
}

function selectNavigationMenus(select) {
  const {
    getEntityRecords,
    hasFinishedResolution,
    isResolving
  } = select(external_gc_coreData_namespaceObject.store);
  return {
    navigationMenus: getEntityRecords(...SELECT_NAVIGATION_MENUS_ARGS),
    isResolvingNavigationMenus: isResolving('getEntityRecords', SELECT_NAVIGATION_MENUS_ARGS),
    hasResolvedNavigationMenus: hasFinishedResolution('getEntityRecords', SELECT_NAVIGATION_MENUS_ARGS)
  };
}

function selectExistingMenu(select, ref) {
  if (!ref) {
    return {
      isNavigationMenuResolved: false,
      isNavigationMenuMissing: true
    };
  }

  const {
    getEntityRecord,
    getEditedEntityRecord,
    hasFinishedResolution
  } = select(external_gc_coreData_namespaceObject.store);
  const args = ['postType', 'gc_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
  };
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/use-navigation-entities.js
/**
 * GeChiUI dependencies
 */

/**
 * @typedef {Object} NavigationEntitiesData
 * @property {Array|undefined} pages                - a collection of GC 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_gc_coreData_namespaceObject.useEntityRecords)('root', 'menu', {
    per_page: -1,
    context: 'view'
  });
  const {
    records: pages,
    isResolving: isResolvingPages,
    hasResolved: hasResolvedPages
  } = (0,external_gc_coreData_namespaceObject.useEntityRecords)('postType', 'page', {
    parent: 0,
    order: 'asc',
    orderby: 'id',
    per_page: -1,
    context: 'view'
  });
  const {
    records: menuItems,
    hasResolved: hasResolvedMenuItems
  } = (0,external_gc_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
  };
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/placeholder/placeholder-preview.js


/**
 * GeChiUI dependencies
 */



const PlaceholderPreview = ({
  isVisible = true
}) => {
  return (0,external_gc_element_namespaceObject.createElement)("div", {
    "aria-hidden": !isVisible ? true : undefined,
    className: "gc-block-navigation-placeholder__preview"
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-navigation-placeholder__actions__indicator"
  }, (0,external_gc_element_namespaceObject.createElement)(build_module_icon, {
    icon: library_navigation
  }), (0,external_gc_i18n_namespaceObject.__)('导航')));
};

/* harmony default export */ var placeholder_preview = (PlaceholderPreview);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/more-vertical.js


/**
 * GeChiUI dependencies
 */

const moreVertical = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"
}));
/* harmony default export */ var more_vertical = (moreVertical);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/navigation-menu-selector.js


/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */




function buildMenuLabel(title, id, status) {
  if (!title?.rendered) {
    /* translators: %s is the index of the menu in the list of menus. */
    return (0,external_gc_i18n_namespaceObject.sprintf)((0,external_gc_i18n_namespaceObject.__)('(no title %s)'), id);
  }

  if (status === 'publish') {
    return (0,external_gc_htmlEntities_namespaceObject.decodeEntities)(title?.rendered);
  }

  return (0,external_gc_i18n_namespaceObject.sprintf)( // translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).
  (0,external_gc_i18n_namespaceObject.__)('%1$s（%2$s）'), (0,external_gc_htmlEntities_namespaceObject.decodeEntities)(title?.rendered), status);
}

function NavigationMenuSelector({
  currentMenuId,
  onSelectNavigationMenu,
  onSelectClassicMenu,
  onCreateNew,
  actionLabel,
  createNavigationMenuIsSuccess,
  createNavigationMenuIsError
}) {
  /* translators: %s: The name of a menu. */
  const createActionLabel = (0,external_gc_i18n_namespaceObject.__)("从“%s”创建");

  const [isCreatingMenu, setIsCreatingMenu] = (0,external_gc_element_namespaceObject.useState)(false);
  actionLabel = actionLabel || createActionLabel;
  const {
    menus: classicMenus
  } = useNavigationEntities();
  const {
    navigationMenus,
    isResolvingNavigationMenus,
    hasResolvedNavigationMenus,
    canUserCreateNavigationMenu,
    canSwitchNavigationMenu
  } = useNavigationMenu();
  const [currentTitle] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', 'gc_navigation', 'title');
  const menuChoices = (0,external_gc_element_namespaceObject.useMemo)(() => {
    return navigationMenus?.map(({
      id,
      title,
      status
    }, index) => {
      const label = buildMenuLabel(title, index + 1, status);
      return {
        value: id,
        label,
        ariaLabel: (0,external_gc_i18n_namespaceObject.sprintf)(actionLabel, label)
      };
    }) || [];
  }, [navigationMenus, actionLabel]);
  const hasNavigationMenus = !!navigationMenus?.length;
  const hasClassicMenus = !!classicMenus?.length;
  const showNavigationMenus = !!canSwitchNavigationMenu;
  const showClassicMenus = !!canUserCreateNavigationMenu;
  const noMenuSelected = hasNavigationMenus && !currentMenuId;
  const noBlockMenus = !hasNavigationMenus && hasResolvedNavigationMenus;
  const menuUnavailable = hasResolvedNavigationMenus && currentMenuId === null;
  let selectorLabel = '';

  if (isCreatingMenu || isResolvingNavigationMenus) {
    selectorLabel = (0,external_gc_i18n_namespaceObject.__)('正在加载...' );
  } else if (noMenuSelected || noBlockMenus || menuUnavailable) {
    // Note: classic Menus may be available.
    selectorLabel = (0,external_gc_i18n_namespaceObject.__)('选择或创建导航菜单');
  } else {
    // Current Menu's title.
    selectorLabel = currentTitle;
  }

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (isCreatingMenu && (createNavigationMenuIsSuccess || createNavigationMenuIsError)) {
      setIsCreatingMenu(false);
    }
  }, [hasResolvedNavigationMenus, createNavigationMenuIsSuccess, canUserCreateNavigationMenu, createNavigationMenuIsError, isCreatingMenu, menuUnavailable, noBlockMenus, noMenuSelected]);
  const NavigationMenuSelectorDropdown = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.DropdownMenu, {
    label: selectorLabel,
    icon: more_vertical,
    toggleProps: {
      isSmall: true
    }
  }, ({
    onClose
  }) => (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, showNavigationMenus && hasNavigationMenus && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuGroup, {
    label: (0,external_gc_i18n_namespaceObject.__)('菜单')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItemsChoice, {
    value: currentMenuId,
    onSelect: menuId => {
      setIsCreatingMenu(true);
      onSelectNavigationMenu(menuId);
      onClose();
    },
    choices: menuChoices,
    disabled: isCreatingMenu
  })), showClassicMenus && hasClassicMenus && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuGroup, {
    label: (0,external_gc_i18n_namespaceObject.__)('导入经典菜单')
  }, classicMenus?.map(menu => {
    const label = (0,external_gc_htmlEntities_namespaceObject.decodeEntities)(menu.name);
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItem, {
      onClick: () => {
        setIsCreatingMenu(true);
        onSelectClassicMenu(menu);
        onClose();
      },
      key: menu.id,
      "aria-label": (0,external_gc_i18n_namespaceObject.sprintf)(createActionLabel, label),
      disabled: isCreatingMenu
    }, label);
  })), canUserCreateNavigationMenu && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuGroup, {
    label: (0,external_gc_i18n_namespaceObject.__)('工具')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItem, {
    disabled: isCreatingMenu,
    onClick: () => {
      onClose();
      onCreateNew();
      setIsCreatingMenu(true);
    }
  }, (0,external_gc_i18n_namespaceObject.__)('创建新菜单')))));
  return NavigationMenuSelectorDropdown;
}

/* harmony default export */ var navigation_menu_selector = (NavigationMenuSelector);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/placeholder/index.js


/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */




function NavigationPlaceholder({
  isSelected,
  currentMenuId,
  clientId,
  canUserCreateNavigationMenu = false,
  isResolvingCanUserCreateNavigationMenu,
  onSelectNavigationMenu,
  onSelectClassicMenu,
  onCreateEmpty
}) {
  const {
    isResolvingMenus,
    hasResolvedMenus
  } = useNavigationEntities();
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!isSelected) {
      return;
    }

    if (isResolvingMenus) {
      (0,external_gc_a11y_namespaceObject.speak)((0,external_gc_i18n_namespaceObject.__)('正在加载导航区块设置选项。'));
    }

    if (hasResolvedMenus) {
      (0,external_gc_a11y_namespaceObject.speak)((0,external_gc_i18n_namespaceObject.__)('导航区块设置选项已就绪。'));
    }
  }, [hasResolvedMenus, isResolvingMenus, isSelected]);
  const isResolvingActions = isResolvingMenus && isResolvingCanUserCreateNavigationMenu;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
    className: "gc-block-navigation-placeholder"
  }, (0,external_gc_element_namespaceObject.createElement)(placeholder_preview, {
    isVisible: !isSelected
  }), (0,external_gc_element_namespaceObject.createElement)("div", {
    "aria-hidden": !isSelected ? true : undefined,
    className: "gc-block-navigation-placeholder__controls"
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-navigation-placeholder__actions"
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-navigation-placeholder__actions__indicator"
  }, (0,external_gc_element_namespaceObject.createElement)(build_module_icon, {
    icon: library_navigation
  }), " ", (0,external_gc_i18n_namespaceObject.__)('导航')), (0,external_gc_element_namespaceObject.createElement)("hr", null), isResolvingActions && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null), (0,external_gc_element_namespaceObject.createElement)(navigation_menu_selector, {
    currentMenuId: currentMenuId,
    clientId: clientId,
    onSelectNavigationMenu: onSelectNavigationMenu,
    onSelectClassicMenu: onSelectClassicMenu
  }), (0,external_gc_element_namespaceObject.createElement)("hr", null), canUserCreateNavigationMenu && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "tertiary",
    onClick: onCreateEmpty
  }, (0,external_gc_i18n_namespaceObject.__)('开始为空'))))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/menu.js


/**
 * GeChiUI dependencies
 */

const menu = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"
}));
/* harmony default export */ var library_menu = (menu);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/overlay-menu-icon.js


/**
 * GeChiUI dependencies
 */


function OverlayMenuIcon({
  icon
}) {
  if (icon === 'menu') {
    return (0,external_gc_element_namespaceObject.createElement)(build_module_icon, {
      icon: library_menu
    });
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
    xmlns: "http://www.w3.org/2000/svg",
    viewBox: "0 0 24 24",
    width: "24",
    height: "24",
    "aria-hidden": "true",
    focusable: "false"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Rect, {
    x: "4",
    y: "7.5",
    width: "16",
    height: "1.5"
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Rect, {
    x: "4",
    y: "15",
    width: "16",
    height: "1.5"
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/responsive-wrapper.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */


function ResponsiveWrapper({
  children,
  id,
  isOpen,
  isResponsive,
  onToggle,
  isHiddenByDefault,
  overlayBackgroundColor,
  overlayTextColor,
  hasIcon,
  icon
}) {
  if (!isResponsive) {
    return children;
  }

  const responsiveContainerClasses = classnames_default()('gc-block-navigation__responsive-container', {
    'has-text-color': !!overlayTextColor.color || !!overlayTextColor?.class,
    [(0,external_gc_blockEditor_namespaceObject.getColorClassName)('color', overlayTextColor?.slug)]: !!overlayTextColor?.slug,
    'has-background': !!overlayBackgroundColor.color || overlayBackgroundColor?.class,
    [(0,external_gc_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 = classnames_default()('gc-block-navigation__responsive-container-open', {
    'always-shown': isHiddenByDefault
  });
  const modalId = `${id}-modal`;
  const dialogProps = {
    className: 'gc-block-navigation__responsive-dialog',
    ...(isOpen && {
      role: 'dialog',
      'aria-modal': true,
      'aria-label': (0,external_gc_i18n_namespaceObject.__)('菜单')
    })
  };
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, !isOpen && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    "aria-haspopup": "true",
    "aria-label": hasIcon && (0,external_gc_i18n_namespaceObject.__)('打开菜单'),
    className: openButtonClasses,
    onClick: () => onToggle(true)
  }, hasIcon && (0,external_gc_element_namespaceObject.createElement)(OverlayMenuIcon, {
    icon: icon
  }), !hasIcon && (0,external_gc_i18n_namespaceObject.__)('菜单')), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: responsiveContainerClasses,
    style: styles,
    id: modalId
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-navigation__responsive-close",
    tabIndex: "-1"
  }, (0,external_gc_element_namespaceObject.createElement)("div", { ...dialogProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    className: "gc-block-navigation__responsive-container-close",
    "aria-label": hasIcon && (0,external_gc_i18n_namespaceObject.__)('关闭菜单'),
    onClick: () => onToggle(false)
  }, hasIcon && (0,external_gc_element_namespaceObject.createElement)(build_module_icon, {
    icon: library_close
  }), !hasIcon && (0,external_gc_i18n_namespaceObject.__)('关闭')), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-navigation__responsive-container-content",
    id: `${modalId}-content`
  }, children)))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/inner-blocks.js


/**
 * GeChiUI dependencies
 */




/**
 * Internal dependencies
 */



function NavigationInnerBlocks({
  clientId,
  hasCustomPlaceholder,
  orientation,
  templateLock
}) {
  const {
    isImmediateParentOfSelectedBlock,
    selectedBlockHasChildren,
    isSelected
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlockCount,
      hasSelectedInnerBlock,
      getSelectedBlockClientId
    } = select(external_gc_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_gc_coreData_namespaceObject.useEntityBlockEditor)('postType', 'gc_navigation');
  const shouldDirectInsert = (0,external_gc_element_namespaceObject.useMemo)(() => blocks.every(({
    name
  }) => name === 'core/navigation-link' || name === 'core/navigation-submenu' || name === 'core/page-list'), [blocks]); // 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_gc_element_namespaceObject.useMemo)(() => (0,external_gc_element_namespaceObject.createElement)(placeholder_preview, null), []);
  const hasMenuItems = !!blocks?.length; // If there is a `ref` attribute pointing to a `gc_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_gc_blockEditor_namespaceObject.useInnerBlocksProps)({
    className: 'gc-block-navigation__container'
  }, {
    value: blocks,
    onInput,
    onChange,
    allowedBlocks: constants_ALLOWED_BLOCKS,
    prioritizedInserterBlocks: PRIORITIZED_INSERTER_BLOCKS,
    __experimentalDefaultBlock: constants_DEFAULT_BLOCK,
    __experimentalDirectInsert: shouldDirectInsert,
    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/GeChiUI/gutenberg/issues/37572.
    renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || // Show the appender while dragging to allow inserting element between item and the appender.
    parentOrChildHasSelection ? external_gc_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false,
    placeholder: showPlaceholder ? placeholder : undefined
  });
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/navigation-menu-name-control.js


/**
 * GeChiUI dependencies
 */



function NavigationMenuNameControl() {
  const [title, updateTitle] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', 'gc_navigation', 'title');
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('菜单名称'),
    value: title,
    onChange: updateTitle
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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;
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/unsaved-inner-blocks.js


/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */



const EMPTY_OBJECT = {};
function UnsavedInnerBlocks({
  blocks,
  createNavigationMenu,
  hasSelection
}) {
  const originalBlocks = (0,external_gc_element_namespaceObject.useRef)();
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    // Initially store the uncontrolled inner blocks for
    // dirty state comparison.
    if (!originalBlocks?.current) {
      originalBlocks.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(originalBlocks?.current, blocks);
  const shouldDirectInsert = (0,external_gc_element_namespaceObject.useMemo)(() => blocks.every(({
    name
  }) => name === 'core/navigation-link' || name === 'core/navigation-submenu' || name === 'core/page-list'), [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_gc_element_namespaceObject.useContext)(external_gc_components_namespaceObject.Disabled.Context);
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)({
    className: 'gc-block-navigation__container'
  }, {
    renderAppender: hasSelection ? undefined : false,
    allowedBlocks: constants_ALLOWED_BLOCKS,
    __experimentalDefaultBlock: constants_DEFAULT_BLOCK,
    __experimentalDirectInsert: shouldDirectInsert
  });
  const {
    isSaving,
    hasResolvedAllNavigationMenus
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    if (isDisabled) {
      return EMPTY_OBJECT;
    }

    const {
      hasFinishedResolution,
      isSavingEntityRecord
    } = select(external_gc_coreData_namespaceObject.store);
    return {
      isSaving: isSavingEntityRecord('postType', 'gc_navigation'),
      hasResolvedAllNavigationMenus: hasFinishedResolution('getEntityRecords', SELECT_NAVIGATION_MENUS_ARGS)
    };
  }, [isDisabled]); // Automatically save the uncontrolled blocks.

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    // The block will be disabled when used in a BlockPreview.
    // In this case avoid automatic creation of a gc_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_gc_components_namespaceObject.Disabled : 'div';
  return (0,external_gc_element_namespaceObject.createElement)(Wrapper, { ...innerBlocksProps
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/navigation-menu-delete-control.js


/**
 * GeChiUI dependencies
 */





function NavigationMenuDeleteControl({
  onDelete
}) {
  const [isConfirmModalVisible, setIsConfirmModalVisible] = (0,external_gc_element_namespaceObject.useState)(false);
  const id = (0,external_gc_coreData_namespaceObject.useEntityId)('postType', 'gc_navigation');
  const [title] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', 'gc_navigation', 'title');
  const {
    deleteEntityRecord
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_coreData_namespaceObject.store);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    className: "gc-block-navigation-delete-menu-button",
    variant: "secondary",
    isDestructive: true,
    onClick: () => {
      setIsConfirmModalVisible(true);
    }
  }, (0,external_gc_i18n_namespaceObject.__)('删除菜单')), isConfirmModalVisible && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Modal, {
    title: (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: the name of a menu to delete */
    (0,external_gc_i18n_namespaceObject.__)('删除 %s'), title),
    onRequestClose: () => setIsConfirmModalVisible(false)
  }, (0,external_gc_element_namespaceObject.createElement)("p", null, (0,external_gc_i18n_namespaceObject.__)('您确定要删除此导航菜单吗？')), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalHStack, {
    justify: "right"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "tertiary",
    onClick: () => {
      setIsConfirmModalVisible(false);
    }
  }, (0,external_gc_i18n_namespaceObject.__)('取消')), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "primary",
    onClick: () => {
      deleteEntityRecord('postType', 'gc_navigation', id, {
        force: true
      });
      onDelete(title);
    }
  }, (0,external_gc_i18n_namespaceObject.__)('确认')))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/use-navigation-notice.js
/**
 * GeChiUI dependencies
 */




function useNavigationNotice({
  name,
  message = ''
} = {}) {
  const noticeRef = (0,external_gc_element_namespaceObject.useRef)();
  const {
    createWarningNotice,
    removeNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);
  const showNotice = (0,external_gc_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_gc_element_namespaceObject.useCallback)(() => {
    if (!noticeRef.current) {
      return;
    }

    removeNotice(noticeRef.current);
    noticeRef.current = null;
  }, [noticeRef, removeNotice]);
  return [showNotice, hideNotice];
}

/* harmony default export */ var use_navigation_notice = (useNavigationNotice);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/overlay-menu-preview.js


/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */


function OverlayMenuPreview({
  setAttributes,
  hasIcon,
  icon
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示图标按钮'),
    help: (0,external_gc_i18n_namespaceObject.__)('配置用于开启覆层菜单的按钮的视觉外观。'),
    onChange: value => setAttributes({
      hasIcon: value
    }),
    checked: hasIcon
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('图标'),
    value: icon,
    onChange: value => setAttributes({
      icon: value
    }),
    isBlock: true
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "handle",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('句柄'),
    label: (0,external_gc_element_namespaceObject.createElement)(OverlayMenuIcon, {
      icon: "handle"
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "menu",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('菜单'),
    label: (0,external_gc_element_namespaceObject.createElement)(OverlayMenuIcon, {
      icon: "menu"
    })
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/menu-items-to-blocks.js
/**
 * GeChiUI dependencies
 */


/**
 * Convert a flat menu item structure to a nested blocks structure.
 *
 * @param {Object[]} menuItems An array of menu items.
 *
 * @return {GCBlock[]} An array of blocks.
 */

function menuItemsToBlocks(menuItems) {
  if (!menuItems) {
    return null;
  }

  const menuTree = createDataTree(menuItems);
  const blocks = mapMenuItemsToBlocks(menuTree);
  return (0,external_gc_hooks_namespaceObject.applyFilters)('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems);
}
/**
 * A recursive function that maps menu item nodes to blocks.
 *
 * @param {GCNavMenuItem[]} menuItems An array of GCNavMenuItem 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_gc_blocks_namespaceObject.parse)(menuItem.content.raw);

      if (!block) {
        return (0,external_gc_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_gc_blocks_namespaceObject.createBlock)(blockType, attributes, nestedBlocks); // Create mapping for menuItem -> block.

    mapping[menuItem.id] = block.clientId;
    return block;
  });
  return {
    innerBlocks,
    mapping
  };
}
/**
 * A GC nav_menu_item object.
 * For more documentation on the individual fields present on a menu item please see:
 * https://core.trac.gechiui.com/browser/tags/5.7.1/src/gc-includes/nav-menu.php#L789
 *
 * @typedef GCNavMenuItem
 *
 * @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 {GCNavMenuItem} 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 GCNavMenuItem 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 GC 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;
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js
/**
 * GeChiUI 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) {
  const registry = (0,external_gc_data_namespaceObject.useRegistry)();
  const {
    editEntityRecord
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_coreData_namespaceObject.store);
  const [status, setStatus] = (0,external_gc_element_namespaceObject.useState)(CLASSIC_MENU_CONVERSION_IDLE);
  const [error, setError] = (0,external_gc_element_namespaceObject.useState)(null);
  const convertClassicMenuToBlockMenu = (0,external_gc_element_namespaceObject.useCallback)(async (menuId, menuName, postStatus = 'publish') => {
    let navigationMenu;
    let classicMenuItems; // 1. Fetch the classic Menu items.

    try {
      classicMenuItems = await registry.resolveSelect(external_gc_coreData_namespaceObject.store).getMenuItems({
        menus: menuId,
        per_page: -1,
        context: 'view'
      });
    } catch (err) {
      throw new Error((0,external_gc_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
      (0,external_gc_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_gc_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
      (0,external_gc_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 `gc_navigation` Post with the blocks.

    try {
      navigationMenu = await createNavigationMenu(menuName, innerBlocks, postStatus);
      /**
       * Immediately trigger editEntityRecord to change the gc_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 gc_navigation post created as draft.
       */

      await editEntityRecord('postType', 'gc_navigation', navigationMenu.id, {
        status: 'publish'
      }, {
        throwOnError: true
      });
    } catch (err) {
      throw new Error((0,external_gc_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
      (0,external_gc_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
        cause: err
      });
    }

    return navigationMenu;
  }, [createNavigationMenu, editEntityRecord, registry]);
  const convert = (0,external_gc_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.

      throw new Error((0,external_gc_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
      (0,external_gc_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), {
        cause: err
      });
    });
  }, [convertClassicMenuToBlockMenu]);
  return {
    convert,
    status,
    error
  };
}

/* harmony default export */ var use_convert_classic_menu_to_block_menu = (useConvertClassicToBlockMenu);

;// CONCATENATED MODULE: ./node_modules/@gechiui/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;
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/use-template-part-area-label.js
/**
 * GeChiUI dependencies
 */



/**
 * Internal dependencies
 */
// TODO: this util should perhaps be refactored somewhere like core-data.


function useTemplatePartAreaLabel(clientId) {
  return (0,external_gc_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_gc_blockEditor_namespaceObject.store);
    const withAscendingResults = true;
    const parentTemplatePartClientIds = getBlockParentsByBlockName(clientId, 'core/template-part', withAscendingResults);

    if (!parentTemplatePartClientIds?.length) {
      return;
    } // FIXME: @gechiui/block-library should not depend on @gechiui/editor.
    // Blocks can be loaded into a *non-post* block editor.
    // This code is lifted from this file:
    // packages/block-library/src/template-part/edit/advanced-controls.js

    /* eslint-disable @gechiui/data-no-store-string-literals */


    const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
    /* eslint-enable @gechiui/data-no-store-string-literals */


    const {
      getEditedEntityRecord
    } = select(external_gc_coreData_namespaceObject.store);

    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,
        slug
      } = templatePartBlock.attributes;
      const templatePartEntityId = createTemplatePartId(theme, slug);
      const templatePartEntity = getEditedEntityRecord('postType', 'gc_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]);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/use-generate-default-navigation-title.js
/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */


const DRAFT_MENU_PARAMS = ['postType', 'gc_navigation', {
  status: 'draft',
  per_page: -1
}];
const PUBLISHED_MENU_PARAMS = ['postType', 'gc_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_gc_element_namespaceObject.useContext)(external_gc_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_gc_data_namespaceObject.useRegistry)();
  return (0,external_gc_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_gc_coreData_namespaceObject.store);
    const [draftNavigationMenus, navigationMenus] = await Promise.all([getEntityRecords(...DRAFT_MENU_PARAMS), getEntityRecords(...PUBLISHED_MENU_PARAMS)]);
    const title = area ? (0,external_gc_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
    (0,external_gc_i18n_namespaceObject.__)('%s 导航'), area) : // translators: 'navigation' as in website navigation.
    (0,external_gc_i18n_namespaceObject.__)('导航'); // 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]);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/use-create-navigation-menu.js
/**
 * GeChiUI 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_gc_element_namespaceObject.useState)(CREATE_NAVIGATION_MENU_IDLE);
  const [value, setValue] = (0,external_gc_element_namespaceObject.useState)(null);
  const [error, setError] = (0,external_gc_element_namespaceObject.useState)(null);
  const {
    saveEntityRecord,
    editEntityRecord
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_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_gc_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_gc_blocks_namespaceObject.serialize)(blocks),
      status: postStatus
    }; // Return affords ability to await on this function directly

    return saveEntityRecord('postType', 'gc_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', 'gc_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
  };
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/use-inner-blocks.js
/**
 * GeChiUI dependencies
 */


const EMPTY_ARRAY = [];
function useInnerBlocks(clientId) {
  return (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlock,
      getBlocks,
      hasSelectedInnerBlock
    } = select(external_gc_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 ? EMPTY_ARRAY : getBlocks(clientId);

    return {
      innerBlocks: _hasUncontrolledInnerBlocks ? _uncontrolledInnerBlocks : _controlledInnerBlocks,
      hasUncontrolledInnerBlocks: _hasUncontrolledInnerBlocks,
      uncontrolledInnerBlocks: _uncontrolledInnerBlocks,
      controlledInnerBlocks: _controlledInnerBlocks,
      isInnerBlockSelected: hasSelectedInnerBlock(clientId, true)
    };
  }, [clientId]);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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: classnames_default()('gc-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
    }
  };
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/manage-menus-button.js


/**
 * GeChiUI dependencies
 */




const ManageMenusButton = ({
  className = '',
  disabled,
  isMenuItem = false
}) => {
  let ComponentName = external_gc_components_namespaceObject.Button;

  if (isMenuItem) {
    ComponentName = external_gc_components_namespaceObject.MenuItem;
  }

  return (0,external_gc_element_namespaceObject.createElement)(ComponentName, {
    variant: "link",
    disabled: disabled,
    className: className,
    href: (0,external_gc_url_namespaceObject.addQueryArgs)('edit.php', {
      post_type: 'gc_navigation'
    })
  }, (0,external_gc_i18n_namespaceObject.__)('管理菜单'));
};

/* harmony default export */ var manage_menus_button = (ManageMenusButton);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/deleted-navigation-warning.js


/**
 * GeChiUI dependencies
 */




function DeletedNavigationWarning({
  onCreateNew
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('导航菜单已被删除或不可用。'), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    onClick: onCreateNew,
    variant: "link"
  }, (0,external_gc_i18n_namespaceObject.__)('创建一个新菜单？')));
}

/* harmony default export */ var deleted_navigation_warning = (DeletedNavigationWarning);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/add-submenu.js


/**
 * GeChiUI dependencies
 */

const addSubmenu = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var add_submenu = (addSubmenu);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/chevron-up.js


/**
 * GeChiUI dependencies
 */

const chevronUp = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var chevron_up = (chevronUp);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/chevron-down.js


/**
 * GeChiUI dependencies
 */

const chevronDown = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var chevron_down = (chevronDown);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/leaf-more-menu.js


/**
 * GeChiUI 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_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const clientId = block.clientId;
  const isDisabled = !BLOCKS_THAT_CAN_BE_CONVERTED_TO_SUBMENU.includes(block.name);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItem, {
    icon: add_submenu,
    disabled: isDisabled,
    onClick: () => {
      const updateSelectionOnInsert = false;
      const newLink = (0,external_gc_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_gc_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();
    }
  }, (0,external_gc_i18n_namespaceObject.__)('添加子菜单链接'));
}

function LeafMoreMenu(props) {
  const {
    block
  } = props;
  const {
    clientId
  } = block;
  const {
    moveBlocksDown,
    moveBlocksUp,
    removeBlocks
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const removeLabel = (0,external_gc_i18n_namespaceObject.sprintf)(
  /* translators: %s: block name */
  (0,external_gc_i18n_namespaceObject.__)('移除 %s'), (0,external_gc_blockEditor_namespaceObject.BlockTitle)({
    clientId,
    maximumLength: 25
  }));
  const rootClientId = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlockRootClientId
    } = select(external_gc_blockEditor_namespaceObject.store);
    return getBlockRootClientId(clientId);
  }, [clientId]);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.DropdownMenu, {
    icon: more_vertical,
    label: (0,external_gc_i18n_namespaceObject.__)('选项'),
    className: "block-editor-block-settings-menu",
    popoverProps: POPOVER_PROPS,
    noIcons: true,
    ...props
  }, ({
    onClose
  }) => (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuGroup, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItem, {
    icon: chevron_up,
    onClick: () => {
      moveBlocksUp([clientId], rootClientId);
      onClose();
    }
  }, (0,external_gc_i18n_namespaceObject.__)('上移')), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItem, {
    icon: chevron_down,
    onClick: () => {
      moveBlocksDown([clientId], rootClientId);
      onClose();
    }
  }, (0,external_gc_i18n_namespaceObject.__)('下移')), (0,external_gc_element_namespaceObject.createElement)(AddSubmenuItem, {
    block: block,
    onClose: onClose,
    expanded: true,
    expandedState: props.expandedState,
    expand: props.expand,
    setInsertedBlock: props.setInsertedBlock
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuGroup, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItem, {
    onClick: () => {
      removeBlocks([clientId], false);
      onClose();
    }
  }, removeLabel))));
}

;// CONCATENATED MODULE: external ["gc","escapeHtml"]
var external_gc_escapeHtml_namespaceObject = window["gc"]["escapeHtml"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-link/update-attributes.js
/**
 * GeChiUI dependencies
 */


/**
 * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} GCNavigationLinkKind
 */

/**
 * Navigation Link Block Attributes
 *
 * @typedef {Object} GCNavigationLinkBlockAttributes
 *
 * @property {string}               [label]         Link text.
 * @property {GCNavigationLinkKind} [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 {GCNavigationLinkBlockAttributes} 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/GeChiUI/gutenberg/pull/41063
  // - https://github.com/GeChiUI/gutenberg/pull/18617.

  const label = useNewLabel ? (0,external_gc_escapeHtml_namespaceObject.escapeHTML)(newLabel) : originalLabel || (0,external_gc_escapeHtml_namespaceObject.escapeHTML)(newUrlWithoutHttp); // In https://github.com/GeChiUI/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_gc_url_namespaceObject.safeDecodeURI)(newUrl))
    }),
    ...(label && {
      label
    }),
    ...(undefined !== opensInNewTab && {
      opensInNewTab
    }),
    ...(id && Number.isInteger(id) && {
      id
    }),
    ...(kind && {
      kind
    }),
    ...(type && type !== 'URL' && {
      type
    })
  });
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-link/link-ui.js


/**
 * GeChiUI dependencies
 */









/**
 * Given the Link block's type attribute, return the query params to give to
 * /gc/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 {};
  }
}
/**
 * Add transforms to Link Control
 *
 * @param {Object} props          Component props.
 * @param {string} props.clientId Block client ID.
 */

function LinkControlTransforms({
  clientId
}) {
  const {
    getBlock,
    blockTransforms
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlock: _getBlock,
      getBlockRootClientId,
      getBlockTransformItems
    } = select(external_gc_blockEditor_namespaceObject.store);
    return {
      getBlock: _getBlock,
      blockTransforms: getBlockTransformItems(_getBlock(clientId), getBlockRootClientId(clientId))
    };
  }, [clientId]);
  const {
    replaceBlock
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const featuredBlocks = ['core/page-list', 'core/site-logo', 'core/social-links', 'core/search'];
  const transforms = blockTransforms.filter(item => {
    return featuredBlocks.includes(item.name);
  });

  if (!transforms?.length) {
    return null;
  }

  if (!clientId) {
    return null;
  }

  return (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "link-control-transform"
  }, (0,external_gc_element_namespaceObject.createElement)("h3", {
    className: "link-control-transform__subheading"
  }, (0,external_gc_i18n_namespaceObject.__)('转换')), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "link-control-transform__items"
  }, transforms.map((item, index) => {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
      key: `transform-${index}`,
      onClick: () => replaceBlock(clientId, (0,external_gc_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), item.name)),
      className: "link-control-transform__item"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
      icon: item.icon
    }), item.title);
  })));
}

function LinkUI(props) {
  const {
    saveEntityRecord
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_coreData_namespaceObject.store);
  const pagesPermissions = (0,external_gc_coreData_namespaceObject.useResourcePermissions)('pages');
  const postsPermissions = (0,external_gc_coreData_namespaceObject.useResourcePermissions)('posts');

  async function handleCreate(pageTitle) {
    const postType = props.link.type || 'page';
    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 &#038; No"
      // - decodeEntities( title.rendered ) = "Yes & No"
      // See:
      // - https://github.com/GeChiUI/gutenberg/pull/41063
      // - https://github.com/GeChiUI/gutenberg/blob/a1e1fdc0e6278457e9f4fc0b31ac6d2095f5450b/packages/core-data/src/fetch/__experimental-fetch-link-suggestions.js#L212-L218
      title: (0,external_gc_htmlEntities_namespaceObject.decodeEntities)(page.title.rendered),
      url: page.link,
      kind: 'post-type'
    };
  }

  const {
    label,
    url,
    opensInNewTab,
    type,
    kind
  } = props.link;
  let userCanCreate = false;

  if (!type || type === 'page') {
    userCanCreate = pagesPermissions.canCreate;
  } else if (type === 'post') {
    userCanCreate = postsPermissions.canCreate;
  } // Memoize link value to avoid overriding the LinkControl's internal state.
  // This is a temporary fix. See https://github.com/GeChiUI/gutenberg/issues/50976#issuecomment-1568226407.


  const link = (0,external_gc_element_namespaceObject.useMemo)(() => ({
    url,
    opensInNewTab,
    title: label && (0,external_gc_dom_namespaceObject.__unstableStripHTML)(label)
  }), [label, opensInNewTab, url]);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Popover, {
    placement: "bottom",
    onClose: props.onClose,
    anchor: props.anchor,
    shift: true
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalLinkControl, {
    hasTextControl: true,
    hasRichPreviews: true,
    className: props.className,
    value: link,
    showInitialSuggestions: true,
    withCreateSuggestion: userCanCreate,
    createSuggestion: handleCreate,
    createSuggestionButtonText: searchTerm => {
      let format;

      if (type === 'post') {
        /* translators: %s: search term. */
        format = (0,external_gc_i18n_namespaceObject.__)('创建草稿文章。<mark>%s</mark>');
      } else {
        /* translators: %s: search term. */
        format = (0,external_gc_i18n_namespaceObject.__)('创建草稿页面。<mark>%s</mark>');
      }

      return (0,external_gc_element_namespaceObject.createInterpolateElement)((0,external_gc_i18n_namespaceObject.sprintf)(format, searchTerm), {
        mark: (0,external_gc_element_namespaceObject.createElement)("mark", null)
      });
    },
    noDirectEntry: !!type,
    noURLSuggestion: !!type,
    suggestionsQuery: getSuggestionsQuery(type, kind),
    onChange: props.onChange,
    onRemove: props.onRemove,
    onCancel: props.onCancel,
    renderControlBottom: !url ? () => (0,external_gc_element_namespaceObject.createElement)(LinkControlTransforms, {
      clientId: props.clientId
    }) : null
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/menu-inspector-controls.js


/**
 * GeChiUI dependencies
 */




/**
 * Internal dependencies
 */








/* translators: %s: The name of a menu. */

const actionLabel = (0,external_gc_i18n_namespaceObject.__)("切换到'%s'");

const BLOCKS_WITH_LINK_UI_SUPPORT = ['core/navigation-link', 'core/navigation-submenu'];
const {
  PrivateListView
} = unlock(external_gc_blockEditor_namespaceObject.privateApis);

function AdditionalBlockContent({
  block,
  insertedBlock,
  setInsertedBlock
}) {
  const {
    updateBlockAttributes
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_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 (0,external_gc_element_namespaceObject.createElement)(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_gc_data_namespaceObject.useSelect)(select => {
    return !!select(external_gc_blockEditor_namespaceObject.store).getBlockCount(clientId);
  }, [clientId]);
  const {
    navigationMenu
  } = useNavigationMenu(currentMenuId);

  if (currentMenuId && isNavigationMenuMissing) {
    return (0,external_gc_element_namespaceObject.createElement)(deleted_navigation_warning, {
      onCreateNew: onCreateNew
    });
  }

  if (isLoading) {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null);
  }

  const description = navigationMenu ? (0,external_gc_i18n_namespaceObject.sprintf)(
  /* translators: %s: The name of a menu. */
  (0,external_gc_i18n_namespaceObject.__)('导航菜单的结构：%s'), navigationMenu?.title?.rendered || (0,external_gc_i18n_namespaceObject.__)('未命名的菜单')) : (0,external_gc_i18n_namespaceObject.__)('您尚未创建任何菜单。默认显示页面列表');
  return (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-navigation__menu-inspector-controls"
  }, !hasChildren && (0,external_gc_element_namespaceObject.createElement)("p", {
    className: "gc-block-navigation__menu-inspector-controls__empty-message"
  }, (0,external_gc_i18n_namespaceObject.__)('此导航菜单为空。')), (0,external_gc_element_namespaceObject.createElement)(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 (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "list"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: null
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalHStack, {
    className: "gc-block-navigation-off-canvas-editor__header"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalHeading, {
    className: "gc-block-navigation-off-canvas-editor__title",
    level: 2
  }, (0,external_gc_i18n_namespaceObject.__)('菜单')), blockEditingMode === 'default' && (0,external_gc_element_namespaceObject.createElement)(navigation_menu_selector, {
    currentMenuId: currentMenuId,
    onSelectClassicMenu: onSelectClassicMenu,
    onSelectNavigationMenu: onSelectNavigationMenu,
    onCreateNew: onCreateNew,
    createNavigationMenuIsSuccess: createNavigationMenuIsSuccess,
    createNavigationMenuIsError: createNavigationMenuIsError,
    actionLabel: actionLabel,
    isManageMenusButtonDisabled: isManageMenusButtonDisabled
  })), (0,external_gc_element_namespaceObject.createElement)(MainContent, { ...props
  })));
};

/* harmony default export */ var menu_inspector_controls = (MenuInspectorControls);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/edit/index.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */









/**
 * Internal dependencies
 */




















const {
  useBlockEditingMode: navigation_edit_useBlockEditingMode
} = unlock(external_gc_blockEditor_namespaceObject.privateApis);

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
}) {
  const {
    openSubmenusOnClick,
    overlayMenu,
    showSubmenuIcon,
    templateLock,
    layout: {
      justifyContent,
      orientation = 'horizontal',
      flexWrap = 'wrap'
    } = {},
    hasIcon,
    icon = 'handle'
  } = attributes;
  const ref = attributes.ref;
  const setRef = (0,external_gc_element_namespaceObject.useCallback)(postId => {
    setAttributes({
      ref: postId
    });
  }, [setAttributes]);
  const recursionId = `navigationMenu/${ref}`;
  const hasAlreadyRendered = (0,external_gc_blockEditor_namespaceObject.__experimentalUseHasRecursion)(recursionId);
  const blockEditingMode = navigation_edit_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 = () => {
    createNavigationMenu('');
  };

  const {
    hasUncontrolledInnerBlocks,
    uncontrolledInnerBlocks,
    isInnerBlockSelected,
    innerBlocks
  } = useInnerBlocks(clientId);
  const hasSubmenus = !!innerBlocks.find(block => block.name === 'core/navigation-submenu');
  const {
    replaceInnerBlocks,
    selectBlock,
    __unstableMarkNextChangeAsNotPersistent
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const [isResponsiveMenuOpen, setResponsiveMenuVisibility] = (0,external_gc_element_namespaceObject.useState)(false);
  const [overlayMenuPreview, setOverlayMenuPreview] = (0,external_gc_element_namespaceObject.useState)(false);
  const {
    hasResolvedNavigationMenus,
    isNavigationMenuResolved,
    isNavigationMenuMissing,
    canUserUpdateNavigationMenu,
    hasResolvedCanUserUpdateNavigationMenu,
    canUserDeleteNavigationMenu,
    hasResolvedCanUserDeleteNavigationMenu,
    canUserCreateNavigationMenu,
    isResolvingCanUserCreateNavigationMenu,
    hasResolvedCanUserCreateNavigationMenu
  } = 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_gc_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 gc_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_gc_data_namespaceObject.useSelect)(external_gc_coreData_namespaceObject.store));
  const navigationFallbackId = !(ref || hasUnsavedBlocks) ? getNavigationFallbackId() : null;
  (0,external_gc_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_gc_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_gc_blockEditor_namespaceObject.__experimentalUseBlockOverlayActive)(clientId);
  const isResponsive = 'never' !== overlayMenu;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    ref: navRef,
    className: classnames_default()(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_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor?.slug)]: !!textColor?.slug,
      'has-background': !!backgroundColor.color || backgroundColor.class,
      [(0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor?.slug)]: !!backgroundColor?.slug,
      [`has-text-decoration-${textDecoration}`]: textDecoration,
      'block-editor-block-content-overlay': hasBlockOverlay
    }),
    style: {
      color: !textColor?.slug && textColor?.color,
      backgroundColor: !backgroundColor?.slug && backgroundColor?.color
    }
  }); // Turn on contrast checker for web only since it's not supported on mobile yet.

  const enableContrastChecking = external_gc_element_namespaceObject.Platform.OS === 'web';
  const [detectedBackgroundColor, setDetectedBackgroundColor] = (0,external_gc_element_namespaceObject.useState)();
  const [detectedColor, setDetectedColor] = (0,external_gc_element_namespaceObject.useState)();
  const [detectedOverlayBackgroundColor, setDetectedOverlayBackgroundColor] = (0,external_gc_element_namespaceObject.useState)();
  const [detectedOverlayColor, setDetectedOverlayColor] = (0,external_gc_element_namespaceObject.useState)();

  const onSelectClassicMenu = async classicMenu => {
    const navMenu = await convertClassicMenu(classicMenu.id, classicMenu.name, 'draft');

    if (navMenu) {
      handleUpdateMenu(navMenu.id, {
        focusNavigationBlock: true
      });
    }
  };

  const onSelectNavigationMenu = menuId => {
    handleUpdateMenu(menuId);
  };

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    hideNavigationMenuStatusNotice();

    if (isCreatingNavigationMenu) {
      (0,external_gc_a11y_namespaceObject.speak)((0,external_gc_i18n_namespaceObject.__)(`Creating Navigation Menu.`));
    }

    if (createNavigationMenuIsSuccess) {
      handleUpdateMenu(createNavigationMenuPost?.id, {
        focusNavigationBlock: true
      });
      showNavigationMenuStatusNotice((0,external_gc_i18n_namespaceObject.__)(`Navigation Menu successfully created.`));
    }

    if (createNavigationMenuIsError) {
      showNavigationMenuStatusNotice((0,external_gc_i18n_namespaceObject.__)('创建导航菜单失败。'));
    }
  }, [createNavigationMenuStatus, createNavigationMenuError, createNavigationMenuPost?.id, createNavigationMenuIsError, createNavigationMenuIsSuccess, isCreatingNavigationMenu, handleUpdateMenu, hideNavigationMenuStatusNotice, showNavigationMenuStatusNotice]);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    hideClassicMenuConversionNotice();

    if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING) {
      (0,external_gc_a11y_namespaceObject.speak)((0,external_gc_i18n_namespaceObject.__)('经典菜单导入中。'));
    }

    if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_SUCCESS) {
      showClassicMenuConversionNotice((0,external_gc_i18n_namespaceObject.__)('经典菜单导入成功。'));
    }

    if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_ERROR) {
      showClassicMenuConversionNotice((0,external_gc_i18n_namespaceObject.__)('经典菜单导入失败。'));
    }
  }, [classicMenuConversionStatus, classicMenuConversionError, hideClassicMenuConversionNotice, showClassicMenuConversionNotice]);
  (0,external_gc_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]);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!isSelected && !isInnerBlockSelected) {
      hideNavigationMenuPermissionsNotice();
    }

    if (isSelected || isInnerBlockSelected) {
      if (ref && !navMenuResolvedButMissing && hasResolvedCanUserUpdateNavigationMenu && !canUserUpdateNavigationMenu) {
        showNavigationMenuPermissionsNotice((0,external_gc_i18n_namespaceObject.__)('您无权编辑此菜单。所做的任何更改将不会被保存。'));
      }

      if (!ref && hasResolvedCanUserCreateNavigationMenu && !canUserCreateNavigationMenu) {
        showNavigationMenuPermissionsNotice((0,external_gc_i18n_namespaceObject.__)('您无权创建导航菜单。'));
      }
    }
  }, [isSelected, isInnerBlockSelected, canUserUpdateNavigationMenu, hasResolvedCanUserUpdateNavigationMenu, canUserCreateNavigationMenu, hasResolvedCanUserCreateNavigationMenu, ref, hideNavigationMenuPermissionsNotice, showNavigationMenuPermissionsNotice, navMenuResolvedButMissing]);
  const hasManagePermissions = canUserCreateNavigationMenu || canUserUpdateNavigationMenu;
  const overlayMenuPreviewClasses = classnames_default()('gc-block-navigation__overlay-menu-preview', {
    open: overlayMenuPreview
  });
  const colorGradientSettings = (0,external_gc_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
  const stylingInspectorControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, hasSubmenuIndicatorSetting && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('显示')
  }, isResponsive && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    className: overlayMenuPreviewClasses,
    onClick: () => {
      setOverlayMenuPreview(!overlayMenuPreview);
    }
  }, hasIcon && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(OverlayMenuIcon, {
    icon: icon
  }), (0,external_gc_element_namespaceObject.createElement)(build_module_icon, {
    icon: library_close
  })), !hasIcon && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("span", null, (0,external_gc_i18n_namespaceObject.__)('菜单')), (0,external_gc_element_namespaceObject.createElement)("span", null, (0,external_gc_i18n_namespaceObject.__)('关闭')))), overlayMenuPreview && (0,external_gc_element_namespaceObject.createElement)(OverlayMenuPreview, {
    setAttributes: setAttributes,
    hasIcon: hasIcon,
    icon: icon
  })), (0,external_gc_element_namespaceObject.createElement)("h3", null, (0,external_gc_i18n_namespaceObject.__)('叠加菜单')), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('配置叠加菜单'),
    value: overlayMenu,
    help: (0,external_gc_i18n_namespaceObject.__)('折叠菜单图标中的导航选项并打开覆盖层。'),
    onChange: value => setAttributes({
      overlayMenu: value
    }),
    isBlock: true,
    hideLabelFromVision: true
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "never",
    label: (0,external_gc_i18n_namespaceObject.__)('禁用')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "mobile",
    label: (0,external_gc_i18n_namespaceObject.__)('移动端')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "always",
    label: (0,external_gc_i18n_namespaceObject.__)('总是')
  })), hasSubmenus && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("h3", null, (0,external_gc_i18n_namespaceObject.__)('子菜单')), (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_i18n_namespaceObject.__)('点击打开')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    checked: showSubmenuIcon,
    onChange: value => {
      setAttributes({
        showSubmenuIcon: value
      });
    },
    disabled: attributes.openSubmenusOnClick,
    label: (0,external_gc_i18n_namespaceObject.__)('显示箭头')
  })))), colorGradientSettings.hasColorsOrGradients && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "color"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, {
    __experimentalIsRenderedInSidebar: true,
    settings: [{
      colorValue: textColor.color,
      label: (0,external_gc_i18n_namespaceObject.__)('文字'),
      onColorChange: setTextColor,
      resetAllFilter: () => setTextColor()
    }, {
      colorValue: backgroundColor.color,
      label: (0,external_gc_i18n_namespaceObject.__)('背景'),
      onColorChange: setBackgroundColor,
      resetAllFilter: () => setBackgroundColor()
    }, {
      colorValue: overlayTextColor.color,
      label: (0,external_gc_i18n_namespaceObject.__)('子菜单和覆盖文字'),
      onColorChange: setOverlayTextColor,
      resetAllFilter: () => setOverlayTextColor()
    }, {
      colorValue: overlayBackgroundColor.color,
      label: (0,external_gc_i18n_namespaceObject.__)('子菜单和覆盖背景'),
      onColorChange: setOverlayBackgroundColor,
      resetAllFilter: () => setOverlayBackgroundColor()
    }],
    panelId: clientId,
    ...colorGradientSettings,
    gradients: [],
    disableCustomGradients: true
  }), enableContrastChecking && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.ContrastChecker, {
    backgroundColor: detectedBackgroundColor,
    textColor: detectedColor
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.ContrastChecker, {
    backgroundColor: detectedOverlayBackgroundColor,
    textColor: detectedOverlayColor
  }))));
  const isManageMenusButtonDisabled = !hasManagePermissions || !hasResolvedNavigationMenus;

  if (hasUnsavedBlocks && !isCreatingNavigationMenu) {
    return (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(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, (0,external_gc_element_namespaceObject.createElement)(ResponsiveWrapper, {
      id: clientId,
      onToggle: setResponsiveMenuVisibility,
      isOpen: isResponsiveMenuOpen,
      hasIcon: hasIcon,
      icon: icon,
      isResponsive: isResponsive,
      isHiddenByDefault: 'always' === overlayMenu,
      overlayBackgroundColor: overlayBackgroundColor,
      overlayTextColor: overlayTextColor
    }, (0,external_gc_element_namespaceObject.createElement)(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 (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(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
    }), (0,external_gc_element_namespaceObject.createElement)(deleted_navigation_warning, {
      onCreateNew: createUntitledEmptyNavigationMenu
    }));
  }

  if (isEntityAvailable && hasAlreadyRendered) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('区块不能在其内部渲染。')));
  }

  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 (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(PlaceholderComponent, {
      isSelected: isSelected,
      currentMenuId: ref,
      clientId: clientId,
      canUserCreateNavigationMenu: canUserCreateNavigationMenu,
      isResolvingCanUserCreateNavigationMenu: isResolvingCanUserCreateNavigationMenu,
      onSelectNavigationMenu: onSelectNavigationMenu,
      onSelectClassicMenu: onSelectClassicMenu,
      onCreateEmpty: createUntitledEmptyNavigationMenu
    }));
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_coreData_namespaceObject.EntityProvider, {
    kind: "postType",
    type: "gc_navigation",
    id: ref
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalRecursionProvider, {
    uniqueId: recursionId
  }, (0,external_gc_element_namespaceObject.createElement)(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 && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "advanced"
  }, hasResolvedCanUserUpdateNavigationMenu && canUserUpdateNavigationMenu && (0,external_gc_element_namespaceObject.createElement)(NavigationMenuNameControl, null), hasResolvedCanUserDeleteNavigationMenu && canUserDeleteNavigationMenu && (0,external_gc_element_namespaceObject.createElement)(NavigationMenuDeleteControl, {
    onDelete: (deletedMenuTitle = '') => {
      replaceInnerBlocks(clientId, []);
      showNavigationMenuStatusNotice((0,external_gc_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header navigation).
      (0,external_gc_i18n_namespaceObject.__)('导航菜单 %s 已成功删除。'), deletedMenuTitle));
    }
  }), (0,external_gc_element_namespaceObject.createElement)(manage_menus_button, {
    disabled: isManageMenusButtonDisabled,
    className: "gc-block-navigation-manage-menus-button"
  })), isLoading && (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-navigation__loading-indicator-container"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, {
    className: "gc-block-navigation__loading-indicator"
  }))), !isLoading && (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(ResponsiveWrapper, {
    id: clientId,
    onToggle: setResponsiveMenuVisibility,
    label: (0,external_gc_i18n_namespaceObject.__)('菜单'),
    hasIcon: hasIcon,
    icon: icon,
    isOpen: isResponsiveMenuOpen,
    isResponsive: isResponsive,
    isHiddenByDefault: 'always' === overlayMenu,
    overlayBackgroundColor: overlayBackgroundColor,
    overlayTextColor: overlayTextColor
  }, isEntityAvailable && (0,external_gc_element_namespaceObject.createElement)(NavigationInnerBlocks, {
    clientId: clientId,
    hasCustomPlaceholder: !!CustomPlaceholder,
    templateLock: templateLock,
    orientation: orientation
  })))));
}

/* harmony default export */ var navigation_edit = ((0,external_gc_blockEditor_namespaceObject.withColors)({
  textColor: 'color'
}, {
  backgroundColor: 'color'
}, {
  overlayBackgroundColor: 'color'
}, {
  overlayTextColor: 'color'
})(Navigation));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/save.js


/**
 * GeChiUI 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
    // `gc_navigation` entity rather than the hard-coded block html.
    return;
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/deprecated.js


/**
 * GeChiUI 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 (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
  },

  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 (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
  },

  isEligible: ({
    itemsJustification,
    orientation
  }) => !!itemsJustification || !!orientation,
  migrate: (0,external_gc_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 (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
  },

  migrate: (0,external_gc_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_gc_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateIsResponsive),

  save() {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
  }

}, {
  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 (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
  },

  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_gc_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_gc_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 (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
  }

}];
/* harmony default export */ var navigation_deprecated = (navigation_deprecated_deprecated);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */


const navigation_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/navigation",
  title: "导航",
  category: "theme",
  description: "允许访问者在您的系统内不断浏览的区块集合。",
  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"],
    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"
      }
    },
    __experimentalStyle: {
      elements: {
        link: {
          color: {
            text: "inherit"
          }
        }
      }
    }
  },
  viewScript: ["file:./view.min.js", "file:./view-modal.min.js"],
  editorStyle: "gc-block-navigation-editor",
  style: "gc-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_gc_i18n_namespaceObject.__)('首页'),
        url: 'https://make.gechiui.com/'
      }
    }, {
      name: 'core/navigation-link',
      attributes: {
        // translators: 'About' as in a website's about page.
        label: (0,external_gc_i18n_namespaceObject.__)('关于我们'),
        url: 'https://make.gechiui.com/'
      }
    }, {
      name: 'core/navigation-link',
      attributes: {
        // translators: 'Contact' as in a website's contact page.
        label: (0,external_gc_i18n_namespaceObject.__)('联系方式'),
        url: 'https://make.gechiui.com/'
      }
    }]
  },
  edit: navigation_edit,
  save: navigation_save_save,
  deprecated: navigation_deprecated
};
const navigation_init = () => initBlock({
  name: navigation_name,
  metadata: navigation_metadata,
  settings: navigation_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/custom-link.js


/**
 * GeChiUI dependencies
 */

const customLink = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "https://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var custom_link = (customLink);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-link/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */














/**
 * Internal dependencies
 */

const {
  name: edit_name
} = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/navigation-link",
  title: "自定义链接",
  category: "design",
  parent: ["core/navigation"],
  description: "将页面、链接或其他项目添加到导航中。",
  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
      }
    }
  },
  editorStyle: "gc-block-navigation-link-editor",
  style: "gc-block-navigation-link"
};



/**
 * A React hook to determine if it's dragging within the target element.
 *
 * @typedef {import('@gechiui/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_gc_element_namespaceObject.useState)(false);
  (0,external_gc_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;
};

const useIsInvalidLink = (kind, type, id) => {
  const isPostType = kind === 'post-type' || type === 'post' || type === 'page';
  const hasId = Number.isInteger(id);
  const postStatus = (0,external_gc_data_namespaceObject.useSelect)(select => {
    if (!isPostType) {
      return null;
    }

    const {
      getEntityRecord
    } = select(external_gc_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_gc_i18n_namespaceObject.__)('选择文章');
      break;

    case 'page':
      /* translators: label for missing page in navigation link block */
      missingText = (0,external_gc_i18n_namespaceObject.__)('选择页面');
      break;

    case 'category':
      /* translators: label for missing category in navigation link block */
      missingText = (0,external_gc_i18n_namespaceObject.__)('选择分类');
      break;

    case 'tag':
      /* translators: label for missing tag in navigation link block */
      missingText = (0,external_gc_i18n_namespaceObject.__)('选择标签');
      break;

    default:
      /* translators: label for missing values in navigation link block */
      missingText = (0,external_gc_i18n_namespaceObject.__)('添加链接...' );
  }

  return missingText;
}

function NavigationLinkEdit({
  attributes,
  isSelected,
  setAttributes,
  insertBlocksAfter,
  mergeBlocks,
  onReplace,
  context,
  clientId
}) {
  const {
    id,
    label,
    type,
    url,
    description,
    rel,
    title,
    kind
  } = attributes;
  const [isInvalid, isDraft] = useIsInvalidLink(kind, type, id);
  const {
    maxNestingLevel
  } = context;
  const {
    replaceBlock,
    __unstableMarkNextChangeAsNotPersistent
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const [isLinkOpen, setIsLinkOpen] = (0,external_gc_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_gc_element_namespaceObject.useState)(null);
  const listItemRef = (0,external_gc_element_namespaceObject.useRef)(null);
  const isDraggingWithin = useIsDraggingWithin(listItemRef);

  const itemLabelPlaceholder = (0,external_gc_i18n_namespaceObject.__)('添加标签...' );

  const ref = (0,external_gc_element_namespaceObject.useRef)(); // 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_gc_element_namespaceObject.useState)(false);
  const {
    innerBlocks,
    isAtMaxNesting,
    isTopLevelLink,
    isParentOfSelectedBlock,
    hasChildren
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlocks,
      getBlockCount,
      getBlockName,
      getBlockRootClientId,
      hasSelectedInnerBlock,
      getBlockParentsByBlockName
    } = select(external_gc_blockEditor_namespaceObject.store);
    return {
      innerBlocks: getBlocks(clientId),
      isAtMaxNesting: getBlockParentsByBlockName(clientId, [edit_name, 'core/navigation-submenu']).length >= maxNestingLevel,
      isTopLevelLink: getBlockName(getBlockRootClientId(clientId)) === 'core/navigation',
      isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true),
      hasChildren: !!getBlockCount(clientId)
    };
  }, [clientId]);
  /**
   * Transform to submenu block.
   */

  function transformToSubmenu() {
    const newSubmenu = (0,external_gc_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks.length > 0 ? innerBlocks : [(0,external_gc_blocks_namespaceObject.createBlock)('core/navigation-link')]);
    replaceBlock(clientId, newSubmenu);
  }

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    // 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.
    if (!url) {
      setIsLinkOpen(true);
    }
  }, [url]);
  (0,external_gc_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]);
  /**
   * 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_gc_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_gc_element_namespaceObject.useEffect)(() => {
    if (isLinkOpen && url) {
      // Does this look like a URL and have something TLD-ish?
      if ((0,external_gc_url_namespaceObject.isURL)((0,external_gc_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) {
        // Focus and select the label text.
        selectLabelText();
      } else {
        // Focus it (but do not select).
        (0,external_gc_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true);
      }
    }
  }, [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);
  }
  /**
   * 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_gc_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k') || (!url || isDraft || isInvalid) && event.keyCode === external_gc_keycodes_namespaceObject.ENTER) {
      setIsLinkOpen(true);
    }
  }

  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    ref: (0,external_gc_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, listItemRef]),
    className: classnames_default()('gc-block-navigation-item', {
      'is-editing': isSelected || isParentOfSelectedBlock,
      'is-dragging-within': isDraggingWithin,
      'has-link': !!url,
      'has-child': hasChildren,
      'has-text-color': !!textColor || !!customTextColor,
      [(0,external_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor,
      'has-background': !!backgroundColor || customBackgroundColor,
      [(0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor
    }),
    style: {
      color: !textColor && customTextColor,
      backgroundColor: !backgroundColor && customBackgroundColor
    },
    onKeyDown
  });
  const ALLOWED_BLOCKS = ['core/navigation-link', 'core/navigation-submenu', 'core/page-list'];
  const DEFAULT_BLOCK = {
    name: 'core/navigation-link'
  };
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)({ ...blockProps,
    className: 'remove-outline' // Remove the outline from the inner blocks container.

  }, {
    allowedBlocks: ALLOWED_BLOCKS,
    __experimentalDefaultBlock: DEFAULT_BLOCK,
    __experimentalDirectInsert: true,
    renderAppender: false
  });

  if (!url || isInvalid || isDraft) {
    blockProps.onClick = () => setIsLinkOpen(true);
  }

  const classes = classnames_default()('gc-block-navigation-item__content', {
    'gc-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_gc_i18n_namespaceObject.__)('无效') : (0,external_gc_i18n_namespaceObject.__)('草稿')})`;
  const tooltipText = isInvalid || isDraft ? (0,external_gc_i18n_namespaceObject.__)('此项目已被删除，或者是一个草稿') : (0,external_gc_i18n_namespaceObject.__)('此项目缺少链接');
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    name: "link",
    icon: library_link,
    title: (0,external_gc_i18n_namespaceObject.__)('链接'),
    shortcut: external_gc_keycodes_namespaceObject.displayShortcut.primary('k'),
    onClick: () => setIsLinkOpen(true)
  }), !isAtMaxNesting && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    name: "submenu",
    icon: add_submenu,
    title: (0,external_gc_i18n_namespaceObject.__)('添加子菜单'),
    onClick: transformToSubmenu
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    value: label ? (0,external_gc_dom_namespaceObject.__unstableStripHTML)(label) : '',
    onChange: labelValue => {
      setAttributes({
        label: labelValue
      });
    },
    label: (0,external_gc_i18n_namespaceObject.__)('标签'),
    autoComplete: "off",
    onFocus: () => setIsLabelFieldFocused(true),
    onBlur: () => setIsLabelFieldFocused(false)
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    value: url || '',
    onChange: urlValue => {
      updateAttributes({
        url: urlValue
      }, setAttributes, attributes);
    },
    label: (0,external_gc_i18n_namespaceObject.__)('URL'),
    autoComplete: "off"
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextareaControl, {
    __nextHasNoMarginBottom: true,
    value: description || '',
    onChange: descriptionValue => {
      setAttributes({
        description: descriptionValue
      });
    },
    label: (0,external_gc_i18n_namespaceObject.__)('描述'),
    help: (0,external_gc_i18n_namespaceObject.__)('如果当前主题支持，此描述将在菜单中显示。')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    value: title || '',
    onChange: titleValue => {
      setAttributes({
        title: titleValue
      });
    },
    label: (0,external_gc_i18n_namespaceObject.__)('title属性'),
    autoComplete: "off",
    help: (0,external_gc_i18n_namespaceObject.__)('附加信息可帮助澄清链接的目的。')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    value: rel || '',
    onChange: relValue => {
      setAttributes({
        rel: relValue
      });
    },
    label: (0,external_gc_i18n_namespaceObject.__)('Rel属性'),
    autoComplete: "off",
    help: (0,external_gc_i18n_namespaceObject.__)('The relationship of the linked URL as space-separated link types.')
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)("a", {
    className: classes
  }, !url ? (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-navigation-link__placeholder-text"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Tooltip, {
    position: "top center",
    text: tooltipText
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("span", null, missingText), (0,external_gc_element_namespaceObject.createElement)("span", {
    className: "gc-block-navigation-link__missing_text-tooltip"
  }, tooltipText)))) : (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, !isInvalid && !isDraft && !isLabelFieldFocused && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    ref: ref,
    identifier: "label",
    className: "gc-block-navigation-item__label",
    value: label,
    onChange: labelValue => setAttributes({
      label: labelValue
    }),
    onMerge: mergeBlocks,
    onReplace: onReplace,
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)('core/navigation-link')),
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('导航链接文字'),
    placeholder: itemLabelPlaceholder,
    withoutInteractiveFormatting: true,
    allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'],
    onClick: () => {
      if (!url) {
        setIsLinkOpen(true);
      }
    }
  }), description && (0,external_gc_element_namespaceObject.createElement)("span", {
    className: "gc-block-navigation-item__description"
  }, description)), (isInvalid || isDraft || isLabelFieldFocused) && (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-navigation-link__placeholder-text gc-block-navigation-link__label"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Tooltip, {
    position: "top center",
    text: tooltipText
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("span", {
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('导航链接文字')
  }, // 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_gc_htmlEntities_namespaceObject.decodeEntities)(label)} ${isInvalid || isDraft ? placeholderText : ''}`.trim()), (0,external_gc_element_namespaceObject.createElement)("span", {
    className: "gc-block-navigation-link__missing_text-tooltip"
  }, tooltipText))))), isLinkOpen && (0,external_gc_element_namespaceObject.createElement)(LinkUI, {
    className: "gc-block-navigation-link__inline-link-input",
    clientId: clientId,
    link: attributes,
    onClose: () => setIsLinkOpen(false),
    anchor: popoverAnchor,
    onRemove: removeLink,
    onChange: updatedValue => {
      updateAttributes(updatedValue, setAttributes, attributes);
    }
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-link/save.js


/**
 * GeChiUI dependencies
 */

function navigation_link_save_save() {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/page.js


/**
 * GeChiUI dependencies
 */

const page = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"
}));
/* harmony default export */ var library_page = (page);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/tag.js


/**
 * GeChiUI dependencies
 */

const tag = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"
}));
/* harmony default export */ var library_tag = (tag);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/custom-post-type.js


/**
 * GeChiUI dependencies
 */

const customPostType = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var custom_post_type = (customPostType);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-link/hooks.js
/**
 * GeChiUI 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;
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-link/transforms.js
/**
 * GeChiUI dependencies
 */

const navigation_link_transforms_transforms = {
  from: [{
    type: 'block',
    blocks: ['core/site-logo'],
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/navigation-link');
    }
  }, {
    type: 'block',
    blocks: ['core/spacer'],
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/navigation-link');
    }
  }, {
    type: 'block',
    blocks: ['core/home-link'],
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/navigation-link');
    }
  }, {
    type: 'block',
    blocks: ['core/social-links'],
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/navigation-link');
    }
  }, {
    type: 'block',
    blocks: ['core/search'],
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/navigation-link');
    }
  }, {
    type: 'block',
    blocks: ['core/page-list'],
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/navigation-link');
    }
  }],
  to: [{
    type: 'block',
    blocks: ['core/navigation-submenu'],
    transform: (attributes, innerBlocks) => (0,external_gc_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks)
  }, {
    type: 'block',
    blocks: ['core/spacer'],
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/spacer');
    }
  }, {
    type: 'block',
    blocks: ['core/site-logo'],
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/site-logo');
    }
  }, {
    type: 'block',
    blocks: ['core/home-link'],
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/home-link');
    }
  }, {
    type: 'block',
    blocks: ['core/social-links'],
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/social-links');
    }
  }, {
    type: 'block',
    blocks: ['core/search'],
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/search', {
        showLabel: false,
        buttonUseIcon: true,
        buttonPosition: 'button-inside'
      });
    }
  }, {
    type: 'block',
    blocks: ['core/page-list'],
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/page-list');
    }
  }]
};
/* harmony default export */ var navigation_link_transforms = (navigation_link_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-link/index.js


/**
 * GeChiUI dependencies
 */




/**
 * Internal dependencies
 */


const navigation_link_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/navigation-link",
  title: "自定义链接",
  category: "design",
  parent: ["core/navigation"],
  description: "将页面、链接或其他项目添加到导航中。",
  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
      }
    }
  },
  editorStyle: "gc-block-navigation-link-editor",
  style: "gc-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_gc_i18n_namespaceObject._x)('链接示例', '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 (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
    }

  }],
  transforms: navigation_link_transforms
};
const navigation_link_init = () => {
  (0,external_gc_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/navigation-link', enhanceNavigationLinkVariations);
  return initBlock({
    name: navigation_link_name,
    metadata: navigation_link_metadata,
    settings: navigation_link_settings
  });
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/remove-submenu.js


/**
 * GeChiUI dependencies
 */

const removeSubmenu = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var remove_submenu = (removeSubmenu);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-submenu/icons.js


/**
 * GeChiUI dependencies
 */

const ItemSubmenuIcon = () => (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  width: "12",
  height: "12",
  viewBox: "0 0 12 12",
  fill: "none"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
  d: "M1.50002 4L6.00002 8L10.5 4",
  strokeWidth: "1.5"
}));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-submenu/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */














/**
 * Internal dependencies
 */


const {
  name: navigation_submenu_edit_name
} = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/navigation-submenu",
  title: "子菜单",
  category: "design",
  parent: ["core/navigation"],
  description: "将子菜单添加到您的导航中。",
  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
  },
  editorStyle: "gc-block-navigation-submenu-editor",
  style: "gc-block-navigation-submenu"
};



const navigation_submenu_edit_ALLOWED_BLOCKS = ['core/navigation-link', 'core/navigation-submenu', 'core/page-list'];
const edit_DEFAULT_BLOCK = {
  name: 'core/navigation-link'
};
/**
 * A React hook to determine if it's dragging within the target element.
 *
 * @typedef {import('@gechiui/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_gc_element_namespaceObject.useState)(false);
  (0,external_gc_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'} GCNavigationLinkKind
 */

/**
 * Navigation Link Block Attributes
 *
 * @typedef {Object} GCNavigationLinkBlockAttributes
 *
 * @property {string}               [label]         Link text.
 * @property {GCNavigationLinkKind} [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,
    type,
    url,
    description,
    rel,
    title
  } = attributes;
  const {
    showSubmenuIcon,
    maxNestingLevel,
    openSubmenusOnClick
  } = context;
  const {
    __unstableMarkNextChangeAsNotPersistent,
    replaceBlock
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const [isLinkOpen, setIsLinkOpen] = (0,external_gc_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_gc_element_namespaceObject.useState)(null);
  const listItemRef = (0,external_gc_element_namespaceObject.useRef)(null);
  const isDraggingWithin = edit_useIsDraggingWithin(listItemRef);

  const itemLabelPlaceholder = (0,external_gc_i18n_namespaceObject.__)('添加文字...' );

  const ref = (0,external_gc_element_namespaceObject.useRef)();
  const pagesPermissions = (0,external_gc_coreData_namespaceObject.useResourcePermissions)('pages');
  const postsPermissions = (0,external_gc_coreData_namespaceObject.useResourcePermissions)('posts');
  const {
    isAtMaxNesting,
    isTopLevelItem,
    isParentOfSelectedBlock,
    isImmediateParentOfSelectedBlock,
    hasChildren,
    selectedBlockHasChildren,
    onlyDescendantIsEmptyLink
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      hasSelectedInnerBlock,
      getSelectedBlockClientId,
      getBlockParentsByBlockName,
      getBlock,
      getBlockCount,
      getBlockOrder
    } = select(external_gc_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 {
      isAtMaxNesting: getBlockParentsByBlockName(clientId, navigation_submenu_edit_name).length >= maxNestingLevel,
      isTopLevelItem: getBlockParentsByBlockName(clientId, navigation_submenu_edit_name).length === 0,
      isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true),
      isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false),
      hasChildren: !!getBlockCount(clientId),
      selectedBlockHasChildren: !!selectedBlockChildren?.length,
      onlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink
    };
  }, [clientId]);
  const prevHasChildren = (0,external_gc_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_gc_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_gc_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_gc_element_namespaceObject.useEffect)(() => {
    if (isLinkOpen && url) {
      // Does this look like a URL and have something TLD-ish?
      if ((0,external_gc_url_namespaceObject.isURL)((0,external_gc_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) {
        // Focus and select the label text.
        selectLabelText();
      } else {
        // Focus it (but do not select).
        (0,external_gc_dom_namespaceObject.placeCaretAtHorizontalEdge)(ref.current, true);
      }
    }
  }, [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);
  }

  let userCanCreate = false;

  if (!type || type === 'page') {
    userCanCreate = pagesPermissions.canCreate;
  } else if (type === 'post') {
    userCanCreate = postsPermissions.canCreate;
  }

  const {
    textColor,
    customTextColor,
    backgroundColor,
    customBackgroundColor
  } = getColors(context, !isTopLevelItem);

  function onKeyDown(event) {
    if (external_gc_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) {
      setIsLinkOpen(true);
    }
  }

  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    ref: (0,external_gc_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, listItemRef]),
    className: classnames_default()('gc-block-navigation-item', {
      'is-editing': isSelected || isParentOfSelectedBlock,
      'is-dragging-within': isDraggingWithin,
      'has-link': !!url,
      'has-child': hasChildren,
      'has-text-color': !!textColor || !!customTextColor,
      [(0,external_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor,
      'has-background': !!backgroundColor || customBackgroundColor,
      [(0,external_gc_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 = isAtMaxNesting ? navigation_submenu_edit_ALLOWED_BLOCKS.filter(blockName => blockName !== 'core/navigation-submenu') : navigation_submenu_edit_ALLOWED_BLOCKS;
  const navigationChildBlockProps = getNavigationChildBlockProps(innerBlocksColors);
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(navigationChildBlockProps, {
    allowedBlocks,
    __experimentalDefaultBlock: edit_DEFAULT_BLOCK,
    __experimentalDirectInsert: true,
    // Ensure block toolbar is not too far removed from item
    // being edited.
    // see: https://github.com/GeChiUI/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_gc_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false
  });
  const ParentElement = openSubmenusOnClick ? 'button' : 'a';

  function transformToLink() {
    const newLinkBlock = (0,external_gc_blocks_namespaceObject.createBlock)('core/navigation-link', attributes);
    replaceBlock(clientId, newLinkBlock);
  }

  (0,external_gc_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 (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, !openSubmenusOnClick && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    name: "link",
    icon: library_link,
    title: (0,external_gc_i18n_namespaceObject.__)('链接'),
    shortcut: external_gc_keycodes_namespaceObject.displayShortcut.primary('k'),
    onClick: () => setIsLinkOpen(true)
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    name: "revert",
    icon: remove_submenu,
    title: (0,external_gc_i18n_namespaceObject.__)('转换为链接'),
    onClick: transformToLink,
    className: "gc-block-navigation__submenu__revert",
    isDisabled: !canConvertToLink
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    value: label || '',
    onChange: labelValue => {
      setAttributes({
        label: labelValue
      });
    },
    label: (0,external_gc_i18n_namespaceObject.__)('标签'),
    autoComplete: "off"
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    value: url || '',
    onChange: urlValue => {
      setAttributes({
        url: urlValue
      });
    },
    label: (0,external_gc_i18n_namespaceObject.__)('URL'),
    autoComplete: "off"
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextareaControl, {
    __nextHasNoMarginBottom: true,
    value: description || '',
    onChange: descriptionValue => {
      setAttributes({
        description: descriptionValue
      });
    },
    label: (0,external_gc_i18n_namespaceObject.__)('描述'),
    help: (0,external_gc_i18n_namespaceObject.__)('如果当前主题支持，此描述将在菜单中显示。')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    value: title || '',
    onChange: titleValue => {
      setAttributes({
        title: titleValue
      });
    },
    label: (0,external_gc_i18n_namespaceObject.__)('title属性'),
    autoComplete: "off",
    help: (0,external_gc_i18n_namespaceObject.__)('附加信息可帮助澄清链接的目的。')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    value: rel || '',
    onChange: relValue => {
      setAttributes({
        rel: relValue
      });
    },
    label: (0,external_gc_i18n_namespaceObject.__)('Rel属性'),
    autoComplete: "off",
    help: (0,external_gc_i18n_namespaceObject.__)('The relationship of the linked URL as space-separated link types.')
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(ParentElement, {
    className: "gc-block-navigation-item__content"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    ref: ref,
    identifier: "label",
    className: "gc-block-navigation-item__label",
    value: label,
    onChange: labelValue => setAttributes({
      label: labelValue
    }),
    onMerge: mergeBlocks,
    onReplace: onReplace,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('导航链接文字'),
    placeholder: itemLabelPlaceholder,
    withoutInteractiveFormatting: true,
    allowedFormats: ['core/bold', 'core/italic', 'core/image', 'core/strikethrough'],
    onClick: () => {
      if (!openSubmenusOnClick && !url) {
        setIsLinkOpen(true);
      }
    }
  }), !openSubmenusOnClick && isLinkOpen && (0,external_gc_element_namespaceObject.createElement)(LinkUI, {
    className: "gc-block-navigation-link__inline-link-input",
    clientId: clientId,
    link: attributes,
    onClose: () => setIsLinkOpen(false),
    anchor: popoverAnchor,
    hasCreateSuggestion: userCanCreate,
    onRemove: () => {
      setAttributes({
        url: ''
      });
      (0,external_gc_a11y_namespaceObject.speak)((0,external_gc_i18n_namespaceObject.__)('已移除链接。'), 'assertive');
    },
    onChange: updatedValue => {
      updateAttributes(updatedValue, setAttributes, attributes);
    }
  })), (showSubmenuIcon || openSubmenusOnClick) && (0,external_gc_element_namespaceObject.createElement)("span", {
    className: "gc-block-navigation__submenu-icon"
  }, (0,external_gc_element_namespaceObject.createElement)(ItemSubmenuIcon, null)), (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-submenu/save.js


/**
 * GeChiUI dependencies
 */

function navigation_submenu_save_save() {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-submenu/transforms.js
/**
 * GeChiUI dependencies
 */

const navigation_submenu_transforms_transforms = {
  to: [{
    type: 'block',
    blocks: ['core/navigation-link'],
    isMatch: (attributes, block) => block?.innerBlocks?.length === 0,
    transform: attributes => (0,external_gc_blocks_namespaceObject.createBlock)('core/navigation-link', attributes)
  }, {
    type: 'block',
    blocks: ['core/spacer'],
    isMatch: (attributes, block) => block?.innerBlocks?.length === 0,
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/spacer');
    }
  }, {
    type: 'block',
    blocks: ['core/site-logo'],
    isMatch: (attributes, block) => block?.innerBlocks?.length === 0,
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/site-logo');
    }
  }, {
    type: 'block',
    blocks: ['core/home-link'],
    isMatch: (attributes, block) => block?.innerBlocks?.length === 0,
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/home-link');
    }
  }, {
    type: 'block',
    blocks: ['core/social-links'],
    isMatch: (attributes, block) => block?.innerBlocks?.length === 0,
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/social-links');
    }
  }, {
    type: 'block',
    blocks: ['core/search'],
    isMatch: (attributes, block) => block?.innerBlocks?.length === 0,
    transform: () => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/search');
    }
  }]
};
/* harmony default export */ var navigation_submenu_transforms = (navigation_submenu_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-submenu/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const navigation_submenu_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/navigation-submenu",
  title: "子菜单",
  category: "design",
  parent: ["core/navigation"],
  description: "将子菜单添加到您的导航中。",
  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
  },
  editorStyle: "gc-block-navigation-submenu-editor",
  style: "gc-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: ({
    label
  }) => label,
  edit: NavigationSubmenuEdit,
  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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/page-break.js


/**
 * GeChiUI dependencies
 */

const pageBreak = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var page_break = (pageBreak);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/nextpage/edit.js


/**
 * GeChiUI dependencies
 */


function NextPageEdit() {
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)()
  }, (0,external_gc_element_namespaceObject.createElement)("span", null, (0,external_gc_i18n_namespaceObject.__)('分页符')));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/nextpage/save.js


/**
 * GeChiUI dependencies
 */

function nextpage_save_save() {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.RawHTML, null, '<!--nextpage-->');
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/nextpage/transforms.js
/**
 * GeChiUI dependencies
 */

const nextpage_transforms_transforms = {
  from: [{
    type: 'raw',
    schema: {
      'gc-block': {
        attributes: ['data-block']
      }
    },
    isMatch: node => node.dataset && node.dataset.block === 'core/nextpage',

    transform() {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/nextpage', {});
    }

  }]
};
/* harmony default export */ var nextpage_transforms = (nextpage_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/nextpage/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */



const nextpage_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/nextpage",
  title: "分页符",
  category: "design",
  description: "将您的内容分成多个页面。",
  keywords: ["下一页", "pagination"],
  parent: ["core/post-content"],
  textdomain: "default",
  supports: {
    customClassName: false,
    className: false,
    html: false
  },
  editorStyle: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/pattern/edit.js


/**
 * GeChiUI dependencies
 */




/**
 * Internal dependencies
 */



const PatternEdit = ({
  attributes,
  clientId
}) => {
  const selectedPattern = (0,external_gc_data_namespaceObject.useSelect)(select => select(external_gc_blockEditor_namespaceObject.store).__experimentalGetParsedPattern(attributes.slug), [attributes.slug]);
  const {
    replaceBlocks,
    __unstableMarkNextChangeAsNotPersistent
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const {
    setBlockEditingMode
  } = unlock((0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store));
  const {
    getBlockRootClientId,
    getBlockEditingMode
  } = unlock((0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store)); // 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_gc_element_namespaceObject.useEffect)(() => {
    if (selectedPattern?.blocks) {
      // 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/GeChiUI/gutenberg/issues/50628.

        const clonedBlocks = selectedPattern.blocks.map(block => (0,external_gc_blocks_namespaceObject.cloneBlock)(block));
        const rootEditingMode = getBlockEditingMode(rootClientId); // 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, selectedPattern?.blocks, __unstableMarkNextChangeAsNotPersistent, replaceBlocks, getBlockEditingMode, setBlockEditingMode, getBlockRootClientId]);
  const props = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...props
  });
};

/* harmony default export */ var pattern_edit = (PatternEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/pattern/index.js
/**
 * Internal dependencies
 */

const pattern_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/pattern",
  title: "区块样板占位符",
  category: "theme",
  description: "显示一个区块样板。",
  supports: {
    html: false,
    inserter: false
  },
  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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/pages.js


/**
 * GeChiUI dependencies
 */

const pages = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M7 13.8h6v-1.5H7v1.5zM18 16V4c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2zM5.5 16V4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5zM7 10.5h8V9H7v1.5zm0-3.3h8V5.8H7v1.4zM20.2 6v13c0 .7-.6 1.2-1.2 1.2H8v1.5h11c1.5 0 2.7-1.2 2.7-2.8V6h-1.5z"
}));
/* harmony default export */ var library_pages = (pages);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/page-list/use-convert-to-navigation-links.js
/**
 * GeChiUI 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_gc_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_gc_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks);
        listOfLinksArray[index] = transformedBlock;
      }
    });
  };

  transformSubmenus(navigationLinks);
  return navigationLinks;
}
function useConvertToNavigationLinks({
  clientId,
  pages,
  parentPageID
}) {
  const {
    replaceBlock,
    selectBlock
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const {
    parentNavBlockClientId
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSelectedBlockClientId,
      getBlockParentsByBlockName
    } = select(external_gc_blockEditor_namespaceObject.store);

    const _selectedBlockClientId = getSelectedBlockClientId();

    return {
      parentNavBlockClientId: getBlockParentsByBlockName(_selectedBlockClientId, 'core/navigation', true)[0]
    };
  }, [clientId]);
  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(parentNavBlockClientId);
  };
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/page-list/convert-to-links-modal.js


/**
 * GeChiUI dependencies
 */


const convertDescription = (0,external_gc_i18n_namespaceObject.__)('此菜单会自动与系统上的页面保持同步。您可以通过单击下面的“编辑”自行管理菜单。');
function ConvertToLinksModal({
  onClick,
  onClose,
  disabled
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Modal, {
    onRequestClose: onClose,
    title: (0,external_gc_i18n_namespaceObject.__)('编辑这个菜单'),
    className: 'gc-block-page-list-modal',
    aria: {
      describedby: 'gc-block-page-list-modal__description'
    }
  }, (0,external_gc_element_namespaceObject.createElement)("p", {
    id: 'gc-block-page-list-modal__description'
  }, convertDescription), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-page-list-modal-buttons"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "tertiary",
    onClick: onClose
  }, (0,external_gc_i18n_namespaceObject.__)('取消')), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "primary",
    disabled: disabled,
    onClick: onClick
  }, (0,external_gc_i18n_namespaceObject.__)('编辑'))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/page-list/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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 (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-page-list__loading-indicator-container"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, {
      className: "gc-block-page-list__loading-indicator"
    })));
  }

  if (pages === null) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Notice, {
      status: 'warning',
      isDismissible: false
    }, (0,external_gc_i18n_namespaceObject.__)('页面列表：无法检索页面。')));
  }

  if (pages.length === 0) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Notice, {
      status: 'info',
      isDismissible: false
    }, (0,external_gc_i18n_namespaceObject.__)('页面列表：无法检索页面。')));
  }

  if (blockList.length === 0) {
    const parentPageDetails = pages.find(page => page.id === parentPageID);

    if (parentPageDetails?.title?.rendered) {
      return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
      }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.sprintf)( // translators: %s: Page title.
      (0,external_gc_i18n_namespaceObject.__)('页面列表：“%s”页面没有子级。'), parentPageDetails.title.rendered)));
    }

    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Notice, {
      status: 'warning',
      isDismissible: false
    }, (0,external_gc_i18n_namespaceObject.__)('页面列表：无法检索页面。')));
  }

  if (pages.length > 0) {
    return (0,external_gc_element_namespaceObject.createElement)("ul", { ...innerBlocksProps
    });
  }
}

function PageListEdit({
  context,
  clientId,
  attributes,
  setAttributes
}) {
  const {
    parentPageID
  } = attributes;
  const [isOpen, setOpen] = (0,external_gc_element_namespaceObject.useState)(false);
  const openModal = (0,external_gc_element_namespaceObject.useCallback)(() => setOpen(true), []);

  const closeModal = () => setOpen(false);

  const {
    records: pages,
    hasResolved: hasResolvedPages
  } = (0,external_gc_coreData_namespaceObject.useEntityRecords)('postType', 'page', {
    per_page: MAX_PAGE_COUNT,
    _fields: ['id', 'link', 'menu_order', 'parent', 'title', 'type'],
    // TODO: When https://core.trac.gechiui.com/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_gc_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.gechiui.com/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 convertToNavigationLinks = useConvertToNavigationLinks({
    clientId,
    pages,
    parentPageID
  });
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()('gc-block-page-list', {
      'has-text-color': !!context.textColor,
      [(0,external_gc_blockEditor_namespaceObject.getColorClassName)('color', context.textColor)]: !!context.textColor,
      'has-background': !!context.backgroundColor,
      [(0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', context.backgroundColor)]: !!context.backgroundColor
    }),
    style: { ...context.style?.color
    }
  });

  const 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_gc_i18n_namespaceObject.__)('（无标题）'),
        title: page.title?.rendered,
        link: page.url,
        hasChildren
      };
      let item = null;
      const children = getBlockList(page.id);
      item = (0,external_gc_blocks_namespaceObject.createBlock)('core/page-list-item', pageProps, children);
      template.push(item);
      return template;
    }, []);
  };

  const 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;
    }, []);
  };

  const pagesTree = (0,external_gc_element_namespaceObject.useMemo)(makePagesTree, [pagesByParentId]);
  const blockList = (0,external_gc_element_namespaceObject.useMemo)(getBlockList, [pagesByParentId, parentPageID]);
  const {
    isNested,
    hasSelectedChild,
    parentBlock,
    hasDraggedChild,
    isChildOfNavigation
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlockParentsByBlockName,
      hasSelectedInnerBlock,
      getBlockRootClientId,
      hasDraggedInnerBlock
    } = select(external_gc_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),
      parentBlock: getBlockRootClientId(clientId)
    };
  }, [clientId]);
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    allowedBlocks: ['core/page-list-item'],
    renderAppender: false,
    __unstableDisableDropZone: true,
    templateLock: isChildOfNavigation ? false : 'all',
    onInput: NOOP,
    onChange: NOOP,
    value: blockList
  });
  const {
    selectBlock
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (hasSelectedChild || hasDraggedChild) {
      openModal();
      selectBlock(parentBlock);
    }
  }, [hasSelectedChild, hasDraggedChild, parentBlock, selectBlock, openModal]);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    setAttributes({
      isNested
    });
  }, [isNested, setAttributes]);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, pagesTree.length > 0 && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ComboboxControl, {
    className: "editor-page-attributes__parent",
    label: (0,external_gc_i18n_namespaceObject.__)('父页'),
    value: parentPageID,
    options: pagesTree,
    onChange: value => setAttributes({
      parentPageID: value !== null && value !== void 0 ? value : 0
    }),
    help: (0,external_gc_i18n_namespaceObject.__)('选择一个页面，仅显示其子页面。')
  })), allowConvertToLinks && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('编辑这个菜单')
  }, (0,external_gc_element_namespaceObject.createElement)("p", null, convertDescription), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "primary",
    disabled: !hasResolvedPages,
    onClick: convertToNavigationLinks
  }, (0,external_gc_i18n_namespaceObject.__)('编辑')))), allowConvertToLinks && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "other"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    title: (0,external_gc_i18n_namespaceObject.__)('编辑'),
    onClick: openModal
  }, (0,external_gc_i18n_namespaceObject.__)('编辑'))), isOpen && (0,external_gc_element_namespaceObject.createElement)(ConvertToLinksModal, {
    onClick: convertToNavigationLinks,
    onClose: closeModal,
    disabled: !hasResolvedPages
  })), (0,external_gc_element_namespaceObject.createElement)(BlockContent, {
    blockProps: blockProps,
    innerBlocksProps: innerBlocksProps,
    hasResolvedPages: hasResolvedPages,
    blockList: blockList,
    pages: pages,
    parentPageID: parentPageID
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/page-list/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const page_list_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/page-list",
  title: "页面列表",
  category: "widgets",
  description: "显示所有页面的列表。",
  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
      }
    }
  },
  editorStyle: "gc-block-page-list-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/navigation-link/icons.js


/**
 * GeChiUI dependencies
 */

const icons_ItemSubmenuIcon = () => (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  width: "12",
  height: "12",
  viewBox: "0 0 12 12",
  fill: "none"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
  d: "M1.50002 4L6.00002 8L10.5 4",
  strokeWidth: "1.5"
}));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/page-list-item/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */




function useFrontPageId() {
  return (0,external_gc_data_namespaceObject.useSelect)(select => {
    const canReadSettings = select(external_gc_coreData_namespaceObject.store).canUser('read', 'settings');

    if (!canReadSettings) {
      return undefined;
    }

    const site = select(external_gc_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_gc_blockEditor_namespaceObject.useBlockProps)(navigationChildBlockProps, {
    className: 'gc-block-pages-list__item'
  });
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps);
  return (0,external_gc_element_namespaceObject.createElement)("li", {
    key: id,
    className: classnames_default()('gc-block-pages-list__item', {
      'has-child': hasChildren,
      'gc-block-navigation-item': isNavigationChild,
      'open-on-click': context.openSubmenusOnClick,
      'open-on-hover-click': !context.openSubmenusOnClick && context.showSubmenuIcon,
      'menu-item-home': id === frontPageId
    })
  }, hasChildren && context.openSubmenusOnClick ? (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("button", {
    className: "gc-block-navigation-item__content gc-block-navigation-submenu__toggle",
    "aria-expanded": "false"
  }, (0,external_gc_htmlEntities_namespaceObject.decodeEntities)(label)), (0,external_gc_element_namespaceObject.createElement)("span", {
    className: "gc-block-page-list__submenu-icon gc-block-navigation__submenu-icon"
  }, (0,external_gc_element_namespaceObject.createElement)(icons_ItemSubmenuIcon, null))) : (0,external_gc_element_namespaceObject.createElement)("a", {
    className: classnames_default()('gc-block-pages-list__item__link', {
      'gc-block-navigation-item__content': isNavigationChild
    }),
    href: link
  }, (0,external_gc_htmlEntities_namespaceObject.decodeEntities)(title)), hasChildren && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, !context.openSubmenusOnClick && context.showSubmenuIcon && (0,external_gc_element_namespaceObject.createElement)("button", {
    className: "gc-block-navigation-item__content gc-block-navigation-submenu__toggle gc-block-page-list__submenu-icon gc-block-navigation__submenu-icon",
    "aria-expanded": "false"
  }, (0,external_gc_element_namespaceObject.createElement)(icons_ItemSubmenuIcon, null)), (0,external_gc_element_namespaceObject.createElement)("ul", { ...innerBlocksProps
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/page-list-item/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const page_list_item_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/page-list-item",
  title: "页面列表项",
  category: "widgets",
  parent: ["core/page-list"],
  description: "在页面的列表中显示一个页面。",
  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
  },
  editorStyle: "gc-block-page-list-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/paragraph.js


/**
 * GeChiUI dependencies
 */

const paragraph = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_paragraph = (paragraph);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/paragraph/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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 = classnames_default()({
      'has-drop-cap': align === ((0,external_gc_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center' ? false : dropCap,
      [`has-text-align-${align}`]: align
    });
    return (0,external_gc_element_namespaceObject.createElement)("p", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className,
        dir: direction
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const backgroundClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const fontSizeClass = (0,external_gc_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
    const className = classnames_default()({
      '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 (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const backgroundClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const fontSizeClass = (0,external_gc_blockEditor_namespaceObject.getFontSizeClass)(fontSize);
    const className = classnames_default()({
      '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 (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const backgroundClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const fontSizeClass = fontSize && `is-${fontSize}-text`;
    const className = classnames_default()({
      [`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 (0,external_gc_element_namespaceObject.createElement)(external_gc_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 = classnames_default()({
      [`align${width}`]: width,
      'has-background': backgroundColor,
      'has-drop-cap': dropCap
    });
    const styles = {
      backgroundColor,
      color: textColor,
      fontSize,
      textAlign: align
    };
    return (0,external_gc_element_namespaceObject.createElement)("p", {
      style: styles,
      className: className ? className : undefined
    }, 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 (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.RawHTML, null, attributes.content);
  },

  migrate(attributes) {
    return attributes;
  }

}];
/* harmony default export */ var paragraph_deprecated = (paragraph_deprecated_deprecated);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/format-ltr.js


/**
 * GeChiUI dependencies
 */

const formatLtr = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "-2 -2 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var format_ltr = (formatLtr);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/paragraph/use-enter.js
/**
 * GeChiUI dependencies
 */






function useOnEnter(props) {
  const {
    batch
  } = (0,external_gc_data_namespaceObject.useRegistry)();
  const {
    moveBlocksToPosition,
    replaceInnerBlocks,
    duplicateBlocks,
    insertBlock
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const {
    getBlockRootClientId,
    getBlockIndex,
    getBlockOrder,
    getBlockName,
    getBlock,
    getNextBlockClientId
  } = (0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store);
  const propsRef = (0,external_gc_element_namespaceObject.useRef)(props);
  propsRef.current = props;
  return (0,external_gc_compose_namespaceObject.useRefEffect)(element => {
    function onKeyDown(event) {
      if (event.defaultPrevented) {
        return;
      }

      if (event.keyCode !== external_gc_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_gc_blocks_namespaceObject.hasBlockSupport)(getBlockName(wrapperClientId), '__experimentalOnEnter', false)) {
        return;
      }

      const order = getBlockOrder(wrapperClientId);
      event.preventDefault();
      const position = order.indexOf(clientId); // If it is the last block, exit.

      if (position === order.length - 1) {
        moveBlocksToPosition([clientId], wrapperClientId, getBlockRootClientId(wrapperClientId), getBlockIndex(wrapperClientId) + 1);
        return;
      } // 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_gc_blocks_namespaceObject.createBlock)('core/paragraph'), blockIndex + 1, getBlockRootClientId(wrapperClientId), true);
      });
    }

    element.addEventListener('keydown', onKeyDown);
    return () => {
      element.removeEventListener('keydown', onKeyDown);
    };
  }, []);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/paragraph/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */


const paragraph_edit_name = 'core/paragraph';

function ParagraphRTLControl({
  direction,
  setDirection
}) {
  return (0,external_gc_i18n_namespaceObject.isRTL)() && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    icon: format_ltr,
    title: (0,external_gc_i18n_namespaceObject._x)('从左到右', 'editor button'),
    isActive: direction === 'ltr',
    onClick: () => {
      setDirection(direction === 'ltr' ? undefined : 'ltr');
    }
  });
}

function hasDropCapDisabled(align) {
  return align === ((0,external_gc_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center';
}

function ParagraphBlock({
  attributes,
  mergeBlocks,
  onReplace,
  onRemove,
  setAttributes,
  clientId
}) {
  const {
    align,
    content,
    direction,
    dropCap,
    placeholder
  } = attributes;
  const isDropCapFeatureEnabled = (0,external_gc_blockEditor_namespaceObject.useSetting)('typography.dropCap');
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    ref: useOnEnter({
      clientId,
      content
    }),
    className: classnames_default()({
      'has-drop-cap': hasDropCapDisabled(align) ? false : dropCap,
      [`has-text-align-${align}`]: align
    }),
    style: {
      direction
    }
  });
  let helpText;

  if (hasDropCapDisabled(align)) {
    helpText = (0,external_gc_i18n_namespaceObject.__)('不适用于对齐文本。');
  } else if (dropCap) {
    helpText = (0,external_gc_i18n_namespaceObject.__)('显示大型首字母。');
  } else {
    helpText = (0,external_gc_i18n_namespaceObject.__)('切换显示大型首字母。');
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: align,
    onChange: newAlign => setAttributes({
      align: newAlign,
      dropCap: hasDropCapDisabled(newAlign) ? false : dropCap
    })
  }), (0,external_gc_element_namespaceObject.createElement)(ParagraphRTLControl, {
    direction: direction,
    setDirection: newDirection => setAttributes({
      direction: newDirection
    })
  })), isDropCapFeatureEnabled && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "typography"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    hasValue: () => !!dropCap,
    label: (0,external_gc_i18n_namespaceObject.__)('首字下沉'),
    onDeselect: () => setAttributes({
      dropCap: undefined
    }),
    resetAllFilter: () => ({
      dropCap: undefined
    }),
    panelId: clientId
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('首字下沉'),
    checked: !!dropCap,
    onChange: () => setAttributes({
      dropCap: !dropCap
    }),
    help: helpText,
    disabled: hasDropCapDisabled(align) ? true : false
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    identifier: "content",
    tagName: "p",
    ...blockProps,
    value: content,
    onChange: newContent => setAttributes({
      content: newContent
    }),
    onSplit: (value, isOriginal) => {
      let newAttributes;

      if (isOriginal || value) {
        newAttributes = { ...attributes,
          content: value
        };
      }

      const block = (0,external_gc_blocks_namespaceObject.createBlock)(paragraph_edit_name, newAttributes);

      if (isOriginal) {
        block.clientId = clientId;
      }

      return block;
    },
    onMerge: mergeBlocks,
    onReplace: onReplace,
    onRemove: onRemove,
    "aria-label": content ? (0,external_gc_i18n_namespaceObject.__)('段落区块') : (0,external_gc_i18n_namespaceObject.__)('空区块；开始写作或按正斜杠来选择区块'),
    "data-empty": content ? false : true,
    placeholder: placeholder || (0,external_gc_i18n_namespaceObject.__)('输入/来选择一个区块'),
    "data-custom-placeholder": placeholder ? true : undefined,
    __unstableEmbedURLOnPaste: true,
    __unstableAllowPrefixTransformations: true
  }));
}

/* harmony default export */ var paragraph_edit = (ParagraphBlock);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/paragraph/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */



function paragraph_save_save({
  attributes
}) {
  const {
    align,
    content,
    dropCap,
    direction
  } = attributes;
  const className = classnames_default()({
    'has-drop-cap': align === ((0,external_gc_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center' ? false : dropCap,
    [`has-text-align-${align}`]: align
  });
  return (0,external_gc_element_namespaceObject.createElement)("p", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className,
      dir: direction
    })
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    value: content
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/paragraph/transforms.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */

const {
  name: paragraph_transforms_name
} = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/paragraph",
  title: "段落",
  category: "text",
  description: "这是文字内容的基本要素，请以此为基础开始撰写。",
  keywords: ["text"],
  textdomain: "default",
  attributes: {
    align: {
      type: "string"
    },
    content: {
      type: "string",
      source: "html",
      selector: "p",
      "default": "",
      __experimentalRole: "content"
    },
    dropCap: {
      type: "boolean",
      "default": false
    },
    placeholder: {
      type: "string"
    },
    direction: {
      type: "string",
      "enum": ["ltr", "rtl"]
    }
  },
  supports: {
    anchor: true,
    className: false,
    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,
      __experimentalDefaultControls: {
        fontSize: true
      }
    },
    __experimentalSelector: "p",
    __unstablePasteTextInline: true
  },
  editorStyle: "gc-block-paragraph-editor",
  style: "gc-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_gc_blocks_namespaceObject.getBlockAttributes)(paragraph_transforms_name, node.outerHTML);
      const {
        textAlign
      } = node.style || {};

      if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') {
        attributes.align = textAlign;
      }

      return (0,external_gc_blocks_namespaceObject.createBlock)(paragraph_transforms_name, attributes);
    }

  }]
};
/* harmony default export */ var paragraph_transforms = (paragraph_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/paragraph/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const paragraph_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/paragraph",
  title: "段落",
  category: "text",
  description: "这是文字内容的基本要素，请以此为基础开始撰写。",
  keywords: ["text"],
  textdomain: "default",
  attributes: {
    align: {
      type: "string"
    },
    content: {
      type: "string",
      source: "html",
      selector: "p",
      "default": "",
      __experimentalRole: "content"
    },
    dropCap: {
      type: "boolean",
      "default": false
    },
    placeholder: {
      type: "string"
    },
    direction: {
      type: "string",
      "enum": ["ltr", "rtl"]
    }
  },
  supports: {
    anchor: true,
    className: false,
    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,
      __experimentalDefaultControls: {
        fontSize: true
      }
    },
    __experimentalSelector: "p",
    __unstablePasteTextInline: true
  },
  editorStyle: "gc-block-paragraph-editor",
  style: "gc-block-paragraph"
};


const {
  name: paragraph_name
} = paragraph_metadata;

const paragraph_settings = {
  icon: library_paragraph,
  example: {
    attributes: {
      content: (0,external_gc_i18n_namespaceObject.__)('曼查有个地方，地名就不用提了，不久前住着一位贵族。他那类贵族，矛架上有一支长矛，还有一面皮盾、一匹瘦马和一只猎兔狗。')
    }
  },

  __experimentalLabel(attributes, {
    context
  }) {
    if (context === 'accessibility') {
      const {
        content
      } = attributes;
      return !content || content.length === 0 ? (0,external_gc_i18n_namespaceObject.__)('空') : 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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/post-author.js


/**
 * GeChiUI dependencies
 */

const postAuthor = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var post_author = (postAuthor);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-author/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getEditedEntityRecord,
      getUser,
      getUsers
    } = select(external_gc_coreData_namespaceObject.store);

    const _authorId = getEditedEntityRecord('postType', postType, postId)?.author;

    return {
      authorId: _authorId,
      authorDetails: _authorId ? getUser(_authorId) : null,
      authors: getUsers(edit_AUTHORS_QUERY)
    };
  }, [postType, postId]);
  const {
    editEntityRecord
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_coreData_namespaceObject.store);
  const {
    textAlign,
    showAvatar,
    showBio,
    byline,
    isLink,
    linkTarget
  } = attributes;
  const avatarSizes = [];

  const authorName = authorDetails?.name || (0,external_gc_i18n_namespaceObject.__)('文章作者');

  if (authorDetails?.avatar_urls) {
    Object.keys(authorDetails.avatar_urls).forEach(size => {
      avatarSizes.push({
        value: size,
        label: `${size} x ${size}`
      });
    });
  }

  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`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;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, showAuthorControl && (showCombobox && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ComboboxControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('作者'),
    options: authorOptions,
    value: authorId,
    onChange: handleSelect,
    allowReset: false
  }) || (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('作者'),
    value: authorId,
    options: authorOptions,
    onChange: handleSelect
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示头像'),
    checked: showAvatar,
    onChange: () => setAttributes({
      showAvatar: !showAvatar
    })
  }), showAvatar && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('头像尺寸'),
    value: attributes.avatarSize,
    options: avatarSizes,
    onChange: size => {
      setAttributes({
        avatarSize: Number(size)
      });
    }
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示简历'),
    checked: showBio,
    onChange: () => setAttributes({
      showBio: !showBio
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('将作者名称链接到作者页面'),
    checked: isLink,
    onChange: () => setAttributes({
      isLink: !isLink
    })
  }), isLink && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新窗口打开'),
    onChange: value => setAttributes({
      linkTarget: value ? '_blank' : '_self'
    }),
    checked: linkTarget === '_blank'
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, showAvatar && authorDetails?.avatar_urls && (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-post-author__avatar"
  }, (0,external_gc_element_namespaceObject.createElement)("img", {
    width: attributes.avatarSize,
    src: authorDetails.avatar_urls[attributes.avatarSize],
    alt: authorDetails.name
  })), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-post-author__content"
  }, (!external_gc_blockEditor_namespaceObject.RichText.isEmpty(byline) || isSelected) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    className: "gc-block-post-author__byline",
    multiline: false,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('作者署名文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('写署名...'),
    value: byline,
    onChange: value => setAttributes({
      byline: value
    })
  }), (0,external_gc_element_namespaceObject.createElement)("p", {
    className: "gc-block-post-author__name"
  }, isLink ? (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#post-author-pseudo-link",
    onClick: event => event.preventDefault()
  }, authorName) : authorName), showBio && (0,external_gc_element_namespaceObject.createElement)("p", {
    className: "gc-block-post-author__bio",
    dangerouslySetInnerHTML: {
      __html: authorDetails?.description
    }
  }))));
}

/* harmony default export */ var post_author_edit = (PostAuthorEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-author/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_author_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/post-author",
  title: "文章作者",
  category: "theme",
  description: "显示文章作者的详细信息，例如姓名、头像和个人说明。",
  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
    },
    linkTarget: {
      type: "string",
      "default": "_self"
    }
  },
  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: ".gc-block-post-author__avatar img",
      __experimentalDefaultControls: {
        background: true,
        text: true
      }
    }
  },
  style: "gc-block-post-author"
};

const {
  name: post_author_name
} = post_author_metadata;

const post_author_settings = {
  icon: post_author,
  edit: post_author_edit
};
const post_author_init = () => initBlock({
  name: post_author_name,
  metadata: post_author_metadata,
  settings: post_author_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-author-name/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */







function PostAuthorNameEdit({
  context: {
    postType,
    postId
  },
  attributes: {
    textAlign,
    isLink,
    linkTarget
  },
  setAttributes
}) {
  const {
    authorName
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getEditedEntityRecord,
      getUser
    } = select(external_gc_coreData_namespaceObject.store);

    const _authorId = getEditedEntityRecord('postType', postType, postId)?.author;

    return {
      authorName: _authorId ? getUser(_authorId) : null
    };
  }, [postType, postId]);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });

  const displayName = authorName?.name || (0,external_gc_i18n_namespaceObject.__)('作者名称');

  const displayAuthor = isLink ? (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#author-pseudo-link",
    onClick: event => event.preventDefault(),
    className: "gc-block-post-author-name__link"
  }, displayName) : displayName;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('链接到作者归档'),
    onChange: () => setAttributes({
      isLink: !isLink
    }),
    checked: isLink
  }), isLink && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新窗口打开'),
    onChange: value => setAttributes({
      linkTarget: value ? '_blank' : '_self'
    }),
    checked: linkTarget === '_blank'
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, " ", displayAuthor, " "));
}

/* harmony default export */ var post_author_name_edit = (PostAuthorNameEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-author-name/transforms.js
/**
 * GeChiUI dependencies
 */

const post_author_name_transforms_transforms = {
  from: [{
    type: 'block',
    blocks: ['core/post-author'],
    transform: ({
      textAlign
    }) => (0,external_gc_blocks_namespaceObject.createBlock)('core/post-author-name', {
      textAlign
    })
  }],
  to: [{
    type: 'block',
    blocks: ['core/post-author'],
    transform: ({
      textAlign
    }) => (0,external_gc_blocks_namespaceObject.createBlock)('core/post-author', {
      textAlign
    })
  }]
};
/* harmony default export */ var post_author_name_transforms = (post_author_name_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-author-name/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_author_name_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/post-author-name",
  title: "文章作者名称",
  category: "theme",
  description: "作者名称。",
  textdomain: "default",
  attributes: {
    textAlign: {
      type: "string"
    },
    isLink: {
      type: "boolean",
      "default": false
    },
    linkTarget: {
      type: "string",
      "default": "_self"
    }
  },
  usesContext: ["postType", "postId"],
  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
      }
    }
  }
};


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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-author-biography/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */






function PostAuthorBiographyEdit({
  context: {
    postType,
    postId
  },
  attributes: {
    textAlign
  },
  setAttributes
}) {
  const {
    authorDetails
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getEditedEntityRecord,
      getUser
    } = select(external_gc_coreData_namespaceObject.store);

    const _authorId = getEditedEntityRecord('postType', postType, postId)?.author;

    return {
      authorDetails: _authorId ? getUser(_authorId) : null
    };
  }, [postType, postId]);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });

  const displayAuthorBiography = authorDetails?.description || (0,external_gc_i18n_namespaceObject.__)('作者简介');

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps,
    dangerouslySetInnerHTML: {
      __html: displayAuthorBiography
    }
  }));
}

/* harmony default export */ var post_author_biography_edit = (PostAuthorBiographyEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-author-biography/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_author_biography_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/post-author-biography",
  title: "文章作者简介",
  category: "theme",
  description: "作者简介",
  textdomain: "default",
  attributes: {
    textAlign: {
      type: "string"
    }
  },
  usesContext: ["postType", "postId"],
  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
      }
    }
  }
};

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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/block-default.js


/**
 * GeChiUI dependencies
 */

const blockDefault = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var block_default = (blockDefault);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-comment/edit.js


/**
 * GeChiUI dependencies
 */





const post_comment_edit_ALLOWED_BLOCKS = ['core/avatar', 'core/comment-author-name', 'core/comment-content', 'core/comment-date', 'core/comment-edit-link', 'core/comment-reply-link'];
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_gc_element_namespaceObject.useState)(commentId);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    template: post_comment_edit_TEMPLATE,
    allowedBlocks: post_comment_edit_ALLOWED_BLOCKS
  });

  if (!commentId) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
      icon: block_default,
      label: (0,external_gc_i18n_namespaceObject._x)('发表评论', 'block title'),
      instructions: (0,external_gc_i18n_namespaceObject.__)('要显示评论，请输入评论ID。')
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
      __nextHasNoMarginBottom: true,
      value: commentId,
      onChange: val => setCommentIdInput(parseInt(val))
    }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
      variant: "primary",
      onClick: () => {
        setAttributes({
          commentId: commentIdInput
        });
      }
    }, (0,external_gc_i18n_namespaceObject.__)('保存'))));
  }

  return (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-comment/save.js


/**
 * GeChiUI dependencies
 */

function post_comment_save_save() {
  const blockProps = external_gc_blockEditor_namespaceObject.useBlockProps.save();
  const innerBlocksProps = external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-comment/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_comment_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  __experimental: "fse",
  name: "core/post-comment",
  title: "发表评论（已弃用）",
  category: "theme",
  description: "此块已弃用。请改用“评论”块。",
  textdomain: "default",
  attributes: {
    commentId: {
      type: "number"
    }
  },
  providesContext: {
    commentId: "commentId"
  },
  supports: {
    html: false,
    inserter: false
  }
};


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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/post-comments-count.js


/**
 * GeChiUI dependencies
 */

const postCommentsCount = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var post_comments_count = (postCommentsCount);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-comments-count/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */






function PostCommentsCountEdit({
  attributes,
  context,
  setAttributes
}) {
  const {
    textAlign
  } = attributes;
  const {
    postId
  } = context;
  const [commentsCount, setCommentsCount] = (0,external_gc_element_namespaceObject.useState)();
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!postId) {
      return;
    }

    const currentPostId = postId;
    external_gc_apiFetch_default()({
      path: (0,external_gc_url_namespaceObject.addQueryArgs)('/gc/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-GC-Total'));
      }
    });
  }, [postId]);
  const hasPostAndComments = postId && commentsCount !== undefined;
  const blockStyles = { ...blockProps.style,
    textDecoration: hasPostAndComments ? blockProps.style?.textDecoration : undefined
  };
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps,
    style: blockStyles
  }, hasPostAndComments ? commentsCount : (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('文章评论区块：未找到文章。'))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-comments-count/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_comments_count_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  __experimental: "fse",
  name: "core/post-comments-count",
  title: "文章评论计数",
  category: "theme",
  description: "显示帖子的评论数。",
  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
      }
    }
  }
};

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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/post-comments-form.js


/**
 * GeChiUI dependencies
 */

const postCommentsForm = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var post_comments_form = (postCommentsForm);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-comments-form/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */


function PostCommentsFormEdit({
  attributes,
  context,
  setAttributes
}) {
  const {
    textAlign
  } = attributes;
  const {
    postId,
    postType
  } = context;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(post_comments_form_form, {
    postId: postId,
    postType: postType
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-comments-form/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_comments_form_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/post-comments-form",
  title: "文章评论表单",
  category: "theme",
  description: "显示文章的评论表单。",
  textdomain: "default",
  attributes: {
    textAlign: {
      type: "string"
    }
  },
  usesContext: ["postId", "postType"],
  supports: {
    html: false,
    color: {
      gradients: 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
      }
    }
  },
  editorStyle: "gc-block-post-comments-form-editor",
  style: ["gc-block-post-comments-form", "gc-block-buttons", "gc-block-button"]
};

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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-comments-link/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */









function PostCommentsLinkEdit({
  context,
  attributes,
  setAttributes
}) {
  const {
    textAlign
  } = attributes;
  const {
    postType,
    postId
  } = context;
  const [commentsCount, setCommentsCount] = (0,external_gc_element_namespaceObject.useState)();
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!postId) {
      return;
    }

    const currentPostId = postId;
    external_gc_apiFetch_default()({
      path: (0,external_gc_url_namespaceObject.addQueryArgs)('/gc/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-GC-Total'));
      }
    });
  }, [postId]);
  const post = (0,external_gc_data_namespaceObject.useSelect)(select => select(external_gc_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_gc_i18n_namespaceObject.__)('没有评论');
    } else {
      commentsText = (0,external_gc_i18n_namespaceObject.sprintf)(
      /* translators: %s: Number of comments */
      (0,external_gc_i18n_namespaceObject._n)('%s 条评论', '%s comments', commentsNumber), commentsNumber.toLocaleString());
    }
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, link && commentsText !== undefined ? (0,external_gc_element_namespaceObject.createElement)("a", {
    href: link + '#comments',
    onClick: event => event.preventDefault()
  }, commentsText) : (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('发表评论链接区块：未找到文章。'))));
}

/* harmony default export */ var post_comments_link_edit = (PostCommentsLinkEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-comments-link/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_comments_link_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  __experimental: "fse",
  name: "core/post-comments-link",
  title: "文章评论链接",
  category: "theme",
  description: "显示指向当前文章评论的链接。",
  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
      }
    }
  }
};

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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/post-content.js


/**
 * GeChiUI dependencies
 */

const postContent = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "https://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z"
}));
/* harmony default export */ var post_content = (postContent);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/utils/hooks.js
/**
 * GeChiUI 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_gc_data_namespaceObject.useSelect)(select => select(external_gc_coreData_namespaceObject.store).canUserEditEntityRecord(kind, name, recordId), [kind, name, recordId]);
}
/* harmony default export */ var hooks = ({
  useCanEditEntity
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-content/edit.js


/**
 * GeChiUI dependencies
 */




/**
 * Internal dependencies
 */



function ReadOnlyContent({
  userCanEdit,
  postType,
  postId
}) {
  const [,, content] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  return content?.protected && !userCanEdit ? (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('此内容受密码保护。'))) : (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps,
    dangerouslySetInnerHTML: {
      __html: content?.rendered
    }
  });
}

function EditableContent({
  context = {}
}) {
  const {
    postType,
    postId
  } = context;
  const [blocks, onInput, onChange] = (0,external_gc_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, {
    id: postId
  });
  const entityRecord = (0,external_gc_data_namespaceObject.useSelect)(select => {
    return select(external_gc_coreData_namespaceObject.store).getEntityRecord('postType', postType, postId);
  }, [postType, postId]);
  const hasInnerBlocks = !!entityRecord?.content?.raw || blocks?.length;
  const initialInnerBlocks = [['core/paragraph']];
  const props = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)((0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: 'entry-content'
  }), {
    value: blocks,
    onInput,
    onChange,
    template: !hasInnerBlocks ? initialInnerBlocks : undefined
  });
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...props
  });
}

function Content(props) {
  const {
    context: {
      queryId,
      postType,
      postId
    } = {}
  } = props;
  const userCanEdit = useCanEditEntity('postType', postType, postId);

  if (userCanEdit === undefined) {
    return null;
  }

  const isDescendentOfQueryLoop = Number.isFinite(queryId);
  const isEditable = userCanEdit && !isDescendentOfQueryLoop;
  return isEditable ? (0,external_gc_element_namespaceObject.createElement)(EditableContent, { ...props
  }) : (0,external_gc_element_namespaceObject.createElement)(ReadOnlyContent, {
    userCanEdit: userCanEdit,
    postType: postType,
    postId: postId
  });
}

function edit_Placeholder({
  layoutClassNames
}) {
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: layoutClassNames
  });
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)("p", null, (0,external_gc_i18n_namespaceObject.__)('这是文章内容区块，它会显示单篇文章或页面上的全部区块。')), (0,external_gc_element_namespaceObject.createElement)("p", null, (0,external_gc_i18n_namespaceObject.__)('这可以是文章中连续段落的简单排列，或是包含图库、视频、表格、分栏以及任何其他任何区块类型的精心组合。')), (0,external_gc_element_namespaceObject.createElement)("p", null, (0,external_gc_i18n_namespaceObject.__)('如果您的系统存在已经注册的自定义文章类型，文章内容区块也可以显示这些项目的内容。')));
}

function RecursionError() {
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('区块不能在其内部渲染。')));
}

function PostContentEdit({
  context,
  attributes,
  __unstableLayoutClassNames: layoutClassNames
}) {
  const {
    postId: contextPostId,
    postType: contextPostType
  } = context;
  const {
    layout = {}
  } = attributes;
  const hasAlreadyRendered = (0,external_gc_blockEditor_namespaceObject.__experimentalUseHasRecursion)(contextPostId);

  if (contextPostId && contextPostType && hasAlreadyRendered) {
    return (0,external_gc_element_namespaceObject.createElement)(RecursionError, null);
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalRecursionProvider, {
    uniqueId: contextPostId
  }, contextPostId && contextPostType ? (0,external_gc_element_namespaceObject.createElement)(Content, {
    context: context,
    layout: layout
  }) : (0,external_gc_element_namespaceObject.createElement)(edit_Placeholder, {
    layoutClassNames: layoutClassNames
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-content/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_content_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/post-content",
  title: "文章内容",
  category: "theme",
  description: "显示文章的或页面的内容。",
  textdomain: "default",
  usesContext: ["postId", "postType", "queryId"],
  supports: {
    align: ["wide", "full"],
    html: false,
    layout: true,
    dimensions: {
      minHeight: true
    },
    typography: {
      fontSize: true,
      lineHeight: true,
      __experimentalFontFamily: true,
      __experimentalFontWeight: true,
      __experimentalFontStyle: true,
      __experimentalTextTransform: true,
      __experimentalTextDecoration: true,
      __experimentalLetterSpacing: true,
      __experimentalDefaultControls: {
        fontSize: true
      }
    }
  },
  editorStyle: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-date/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */










function PostDateEdit({
  attributes: {
    textAlign,
    format,
    isLink,
    displayType
  },
  context: {
    postId,
    postType: postTypeSlug,
    queryId
  },
  setAttributes
}) {
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign,
      [`gc-block-post-date__modified-date`]: displayType === 'modified'
    })
  }); // 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_gc_element_namespaceObject.useState)(null); // Memoize popoverProps to avoid returning a new object every time.

  const popoverProps = (0,external_gc_element_namespaceObject.useMemo)(() => ({
    anchor: popoverAnchor
  }), [popoverAnchor]);
  const isDescendentOfQueryLoop = Number.isFinite(queryId);
  const dateSettings = (0,external_gc_date_namespaceObject.getSettings)();
  const [siteFormat = dateSettings.formats.date] = (0,external_gc_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format');
  const [siteTimeFormat = dateSettings.formats.time] = (0,external_gc_coreData_namespaceObject.useEntityProp)('root', 'site', 'time_format');
  const [date, setDate] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, displayType, postId);
  const postType = (0,external_gc_data_namespaceObject.useSelect)(select => postTypeSlug ? select(external_gc_coreData_namespaceObject.store).getPostType(postTypeSlug) : null, [postTypeSlug]);
  const dateLabel = displayType === 'date' ? (0,external_gc_i18n_namespaceObject.__)('文章日期') : (0,external_gc_i18n_namespaceObject.__)('文章修改日期');
  let postDate = date ? (0,external_gc_element_namespaceObject.createElement)("time", {
    dateTime: (0,external_gc_date_namespaceObject.dateI18n)('c', date),
    ref: setPopoverAnchor
  }, (0,external_gc_date_namespaceObject.dateI18n)(format || siteFormat, date)) : dateLabel;

  if (isLink && date) {
    postDate = (0,external_gc_element_namespaceObject.createElement)("a", {
      href: "#post-date-pseudo-link",
      onClick: event => event.preventDefault()
    }, postDate);
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  }), date && !isDescendentOfQueryLoop && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Dropdown, {
    popoverProps: popoverProps,
    renderContent: ({
      onClose
    }) => (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalPublishDateTimePicker, {
      currentDate: date,
      onChange: setDate,
      is12Hour: is12HourFormat(siteTimeFormat),
      onClose: onClose
    }),
    renderToggle: ({
      isOpen,
      onToggle
    }) => {
      const openOnArrowDown = event => {
        if (!isOpen && event.keyCode === external_gc_keycodes_namespaceObject.DOWN) {
          event.preventDefault();
          onToggle();
        }
      };

      return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
        "aria-expanded": isOpen,
        icon: library_edit,
        title: (0,external_gc_i18n_namespaceObject.__)('更改日期'),
        onClick: onToggle,
        onKeyDown: openOnArrowDown
      });
    }
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalDateFormatPicker, {
    format: format,
    defaultFormat: siteFormat,
    onChange: nextFormat => setAttributes({
      format: nextFormat
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: postType?.labels.singular_name ? (0,external_gc_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post".
    (0,external_gc_i18n_namespaceObject.__)('链接至 %s'), postType.labels.singular_name.toLowerCase()) : (0,external_gc_i18n_namespaceObject.__)('链接到文章'),
    onChange: () => setAttributes({
      isLink: !isLink
    }),
    checked: isLink
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示最后修改日期'),
    onChange: value => setAttributes({
      displayType: value ? 'modified' : 'date'
    }),
    checked: displayType === 'modified',
    help: (0,external_gc_i18n_namespaceObject.__)('仅显示文章是否已修改')
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, 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);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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 */ var post_date_deprecated = ([post_date_deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-date/variations.js
/**
 * GeChiUI dependencies
 */


const post_date_variations_variations = [{
  name: 'post-date-modified',
  title: (0,external_gc_i18n_namespaceObject.__)('文章修改日期'),
  description: (0,external_gc_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 */ var post_date_variations = (post_date_variations_variations);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-date/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_date_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/post-date",
  title: "文章日期",
  category: "theme",
  description: "添加此文章的日期。",
  textdomain: "default",
  attributes: {
    textAlign: {
      type: "string"
    },
    format: {
      type: "string"
    },
    isLink: {
      type: "boolean",
      "default": false
    },
    displayType: {
      type: "string",
      "default": "date"
    }
  },
  usesContext: ["postId", "postType", "queryId"],
  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
      }
    }
  }
};



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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/post-excerpt.js


/**
 * GeChiUI dependencies
 */

const postExcerpt = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M12.75 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.395.395 0 00.199-.166c.05-.083.114-.253.114-.584V7.2H8.8V4h3.95v5.333zM7.95 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.394.394 0 00.198-.166c.05-.083.115-.253.115-.584V7.2H4V4h3.95v5.333zM13 20H4v-1.5h9V20zM20 16H4v-1.5h16V16z"
}));
/* harmony default export */ var post_excerpt = (postExcerpt);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-excerpt/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_coreData_namespaceObject.useEntityProp)('postType', postType, 'excerpt', postId);
  /**
   * 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.gechiui.com/browser/branches/6.1/src/gc-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_gc_data_namespaceObject.useSelect)(select => {
    if (postType === 'page') {
      return true;
    }

    return !!select(external_gc_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_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`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_gc_i18n_namespaceObject._x)('字数', '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_gc_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 (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentToolbar, {
      value: textAlign,
      onChange: newAlign => setAttributes({
        textAlign: newAlign
      })
    })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)("p", null, (0,external_gc_i18n_namespaceObject.__)('此块将显示摘录。'))));
  }

  if (isProtected && !userCanEdit) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('该内容当前受到保护，没有可用的摘录。')));
  }

  const readMoreLink = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    className: "gc-block-post-excerpt__more-link",
    tagName: "a",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('“阅读更多”链接文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('添加 "阅读更多" 链接文本'),
    value: moreText,
    onChange: newMoreText => setAttributes({
      moreText: newMoreText
    }),
    withoutInteractiveFormatting: true
  });
  const excerptClassName = classnames_default()('gc-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 ? (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    className: excerptClassName,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('摘录文本'),
    value: isSelected ? rawOrRenderedExcerpt : (!isTrimmed ? rawOrRenderedExcerpt : trimmedExcerpt + ELLIPSIS) || (0,external_gc_i18n_namespaceObject.__)('未找到摘录'),
    onChange: setExcerpt,
    tagName: "p"
  }) : (0,external_gc_element_namespaceObject.createElement)("p", {
    className: excerptClassName
  }, !isTrimmed ? rawOrRenderedExcerpt || (0,external_gc_i18n_namespaceObject.__)('未找到摘录') : trimmedExcerpt + ELLIPSIS);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentToolbar, {
    value: textAlign,
    onChange: newAlign => setAttributes({
      textAlign: newAlign
    })
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新行上显示链接'),
    checked: showMoreOnNewLine,
    onChange: newShowMoreOnNewLine => setAttributes({
      showMoreOnNewLine: newShowMoreOnNewLine
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('最大字数'),
    value: excerptLength,
    onChange: value => {
      setAttributes({
        excerptLength: value
      });
    },
    min: "10",
    max: "100"
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, excerptContent, !showMoreOnNewLine && ' ', showMoreOnNewLine ? (0,external_gc_element_namespaceObject.createElement)("p", {
    className: "gc-block-post-excerpt__more-text"
  }, readMoreLink) : readMoreLink));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-excerpt/transforms.js
/**
 * GeChiUI dependencies
 */

const post_excerpt_transforms_transforms = {
  from: [{
    type: 'block',
    blocks: ['core/post-content'],
    transform: () => (0,external_gc_blocks_namespaceObject.createBlock)('core/post-excerpt')
  }],
  to: [{
    type: 'block',
    blocks: ['core/post-content'],
    transform: () => (0,external_gc_blocks_namespaceObject.createBlock)('core/post-content')
  }]
};
/* harmony default export */ var post_excerpt_transforms = (post_excerpt_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-excerpt/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_excerpt_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/post-excerpt",
  title: "摘要",
  category: "theme",
  description: "显示文章的摘要。",
  textdomain: "default",
  attributes: {
    textAlign: {
      type: "string"
    },
    moreText: {
      type: "string"
    },
    showMoreOnNewLine: {
      type: "boolean",
      "default": true
    },
    excerptLength: {
      type: "number",
      "default": 55
    }
  },
  usesContext: ["postId", "postType", "queryId"],
  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
      }
    }
  },
  editorStyle: "gc-block-post-excerpt-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/post-featured-image.js


/**
 * GeChiUI dependencies
 */

const postFeaturedImage = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var post_featured_image = (postFeaturedImage);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-featured-image/dimension-controls.js


/**
 * GeChiUI dependencies
 */



const SCALE_OPTIONS = (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
  value: "cover",
  label: (0,external_gc_i18n_namespaceObject._x)('Cover', 'Scale option for Image dimension control')
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
  value: "contain",
  label: (0,external_gc_i18n_namespaceObject._x)('Contain', 'Scale option for Image dimension control')
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
  value: "fill",
  label: (0,external_gc_i18n_namespaceObject._x)('Fill', 'Scale option for Image dimension control')
}));
const DEFAULT_SCALE = 'cover';
const DEFAULT_SIZE = 'full';
const scaleHelp = {
  cover: (0,external_gc_i18n_namespaceObject.__)('缩放或裁剪图片用以填充整个空间而不失真。'),
  contain: (0,external_gc_i18n_namespaceObject.__)('缩放图片用以填充空间而不会剪裁或失真。'),
  fill: (0,external_gc_i18n_namespaceObject.__)('图片将拉伸并失真以完全填满空间。')
};

const DimensionControls = ({
  clientId,
  attributes: {
    aspectRatio,
    width,
    height,
    scale,
    sizeSlug
  },
  setAttributes,
  imageSizeOptions = []
}) => {
  const defaultUnits = ['px', '%', 'vw', 'em', 'rem'];
  const units = (0,external_gc_components_namespaceObject.__experimentalUseCustomUnits)({
    availableUnits: (0,external_gc_blockEditor_namespaceObject.useSetting)('spacing.units') || defaultUnits
  });

  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_gc_i18n_namespaceObject._x)('Scale', 'Image scaling options');

  const showScaleControl = height || aspectRatio && aspectRatio !== 'auto';
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "dimensions"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    hasValue: () => !!aspectRatio,
    label: (0,external_gc_i18n_namespaceObject.__)('宽高比'),
    onDeselect: () => setAttributes({
      aspectRatio: undefined
    }),
    resetAllFilter: () => ({
      aspectRatio: undefined
    }),
    isShownByDefault: true,
    panelId: clientId
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('宽高比'),
    value: aspectRatio,
    options: [// These should use the same values as AspectRatioDropdown in @gechiui/block-editor
    {
      label: (0,external_gc_i18n_namespaceObject.__)('原始'),
      value: 'auto'
    }, {
      label: (0,external_gc_i18n_namespaceObject.__)('实心方块'),
      value: '1'
    }, {
      label: (0,external_gc_i18n_namespaceObject.__)('16:9'),
      value: '16/9'
    }, {
      label: (0,external_gc_i18n_namespaceObject.__)('4:3'),
      value: '4/3'
    }, {
      label: (0,external_gc_i18n_namespaceObject.__)('3:2'),
      value: '3/2'
    }, {
      label: (0,external_gc_i18n_namespaceObject.__)('9:16'),
      value: '9/16'
    }, {
      label: (0,external_gc_i18n_namespaceObject.__)('3:4'),
      value: '3/4'
    }, {
      label: (0,external_gc_i18n_namespaceObject.__)('2:3'),
      value: '2/3'
    }],
    onChange: nextAspectRatio => setAttributes({
      aspectRatio: nextAspectRatio
    })
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    className: "single-column",
    hasValue: () => !!height,
    label: (0,external_gc_i18n_namespaceObject.__)('高度'),
    onDeselect: () => setAttributes({
      height: undefined
    }),
    resetAllFilter: () => ({
      height: undefined
    }),
    isShownByDefault: true,
    panelId: clientId
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalUnitControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('高度'),
    labelPosition: "top",
    value: height || '',
    min: 0,
    onChange: nextHeight => onDimensionChange('height', nextHeight),
    units: units
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    className: "single-column",
    hasValue: () => !!width,
    label: (0,external_gc_i18n_namespaceObject.__)('宽度'),
    onDeselect: () => setAttributes({
      width: undefined
    }),
    resetAllFilter: () => ({
      width: undefined
    }),
    isShownByDefault: true,
    panelId: clientId
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalUnitControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('宽度'),
    labelPosition: "top",
    value: width || '',
    min: 0,
    onChange: nextWidth => onDimensionChange('width', nextWidth),
    units: units
  })), showScaleControl && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    hasValue: () => !!scale && scale !== DEFAULT_SCALE,
    label: scaleLabel,
    onDeselect: () => setAttributes({
      scale: DEFAULT_SCALE
    }),
    resetAllFilter: () => ({
      scale: DEFAULT_SCALE
    }),
    isShownByDefault: true,
    panelId: clientId
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControl, {
    __nextHasNoMarginBottom: true,
    label: scaleLabel,
    value: scale,
    help: scaleHelp[scale],
    onChange: value => setAttributes({
      scale: value
    }),
    isBlock: true
  }, SCALE_OPTIONS)), !!imageSizeOptions.length && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    hasValue: () => !!sizeSlug,
    label: (0,external_gc_i18n_namespaceObject.__)('分辨率'),
    onDeselect: () => setAttributes({
      sizeSlug: undefined
    }),
    resetAllFilter: () => ({
      sizeSlug: undefined
    }),
    isShownByDefault: false,
    panelId: clientId
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('分辨率'),
    value: sizeSlug || DEFAULT_SIZE,
    options: imageSizeOptions,
    onChange: nextSizeSlug => setAttributes({
      sizeSlug: nextSizeSlug
    }),
    help: (0,external_gc_i18n_namespaceObject.__)('选择来源图片的尺寸。')
  })));
};

/* harmony default export */ var dimension_controls = (DimensionControls);

;// CONCATENATED MODULE: ./node_modules/@gechiui/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);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-featured-image/overlay.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */



const Overlay = ({
  clientId,
  attributes,
  setAttributes,
  overlayColor,
  setOverlayColor
}) => {
  const {
    dimRatio
  } = attributes;

  const {
    gradientClass,
    gradientValue,
    setGradient
  } = (0,external_gc_blockEditor_namespaceObject.__experimentalUseGradient)();

  const colorGradientSettings = (0,external_gc_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
  const borderProps = (0,external_gc_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  const overlayStyles = {
    backgroundColor: overlayColor.color,
    backgroundImage: gradientValue,
    ...borderProps.style
  };

  if (!colorGradientSettings.hasColorsOrGradients) {
    return null;
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, !!dimRatio && (0,external_gc_element_namespaceObject.createElement)("span", {
    "aria-hidden": "true",
    className: classnames_default()('gc-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
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "color"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, {
    __experimentalIsRenderedInSidebar: true,
    settings: [{
      colorValue: overlayColor.color,
      gradientValue,
      label: (0,external_gc_i18n_namespaceObject.__)('覆盖'),
      onColorChange: setOverlayColor,
      onGradientChange: setGradient,
      isShownByDefault: true,
      resetAllFilter: () => ({
        overlayColor: undefined,
        customOverlayColor: undefined,
        gradient: undefined,
        customGradient: undefined
      })
    }],
    panelId: clientId,
    ...colorGradientSettings
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    hasValue: () => dimRatio !== undefined,
    label: (0,external_gc_i18n_namespaceObject.__)('覆盖不透明度'),
    onDeselect: () => setAttributes({
      dimRatio: 0
    }),
    resetAllFilter: () => ({
      dimRatio: 0
    }),
    isShownByDefault: true,
    panelId: clientId
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('覆盖不透明度'),
    value: dimRatio,
    onChange: newDimRatio => setAttributes({
      dimRatio: newDimRatio
    }),
    min: 0,
    max: 100,
    step: 10,
    required: true
  }))));
};

/* harmony default export */ var overlay = ((0,external_gc_compose_namespaceObject.compose)([(0,external_gc_blockEditor_namespaceObject.withColors)({
  overlayColor: 'background-color'
})])(Overlay));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-featured-image/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */








/**
 * Internal dependencies
 */



const post_featured_image_edit_ALLOWED_MEDIA_TYPES = ['image'];

function getMediaSourceUrlBySizeSlug(media, slug) {
  return media?.media_details?.sizes?.[slug]?.source_url || media?.source_url;
}

function PostFeaturedImageEdit({
  clientId,
  attributes,
  setAttributes,
  context: {
    postId,
    postType: postTypeSlug,
    queryId
  }
}) {
  const isDescendentOfQueryLoop = Number.isFinite(queryId);
  const {
    isLink,
    aspectRatio,
    height,
    width,
    scale,
    sizeSlug,
    rel,
    linkTarget
  } = attributes;
  const [featuredImage, setFeaturedImage] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'featured_media', postId);
  const {
    media,
    postType
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getMedia,
      getPostType
    } = select(external_gc_coreData_namespaceObject.store);
    return {
      media: featuredImage && getMedia(featuredImage, {
        context: 'view'
      }),
      postType: postTypeSlug && getPostType(postTypeSlug)
    };
  }, [featuredImage, postTypeSlug]);
  const mediaUrl = getMediaSourceUrlBySizeSlug(media, sizeSlug);
  const imageSizes = (0,external_gc_data_namespaceObject.useSelect)(select => select(external_gc_blockEditor_namespaceObject.store).getSettings().imageSizes, []);
  const imageSizeOptions = imageSizes.filter(({
    slug
  }) => {
    return media?.media_details?.sizes?.[slug]?.source_url;
  }).map(({
    name,
    slug
  }) => ({
    value: slug,
    label: name
  }));
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    style: {
      width,
      height,
      aspectRatio
    }
  });
  const borderProps = (0,external_gc_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);

  const placeholder = content => {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
      className: classnames_default()('block-editor-media-placeholder', borderProps.className),
      withIllustration: true,
      style: {
        height: !!aspectRatio && '100%',
        width: !!aspectRatio && '100%',
        ...borderProps.style
      }
    }, content);
  };

  const onSelectImage = value => {
    if (value?.id) {
      setFeaturedImage(value.id);
    }
  };

  const {
    createErrorNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);

  const onUploadError = message => {
    createErrorNotice(message, {
      type: 'snackbar'
    });
  };

  const controls = (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(dimension_controls, {
    clientId: clientId,
    attributes: attributes,
    setAttributes: setAttributes,
    imageSizeOptions: imageSizeOptions
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: postType?.labels.singular_name ? (0,external_gc_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "Page".
    (0,external_gc_i18n_namespaceObject.__)('链接至 %s'), postType.labels.singular_name) : (0,external_gc_i18n_namespaceObject.__)('链接到文章'),
    onChange: () => setAttributes({
      isLink: !isLink
    }),
    checked: isLink
  }), isLink && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新窗口打开'),
    onChange: value => setAttributes({
      linkTarget: value ? '_blank' : '_self'
    }),
    checked: linkTarget === '_blank'
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('链接rel'),
    value: rel,
    onChange: newRel => setAttributes({
      rel: newRel
    })
  })))));
  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 consious 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 (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, controls, (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, placeholder(), (0,external_gc_element_namespaceObject.createElement)(overlay, {
      attributes: attributes,
      setAttributes: setAttributes,
      clientId: clientId
    })));
  }

  const label = (0,external_gc_i18n_namespaceObject.__)('添加特色图片');

  const imageStyles = { ...borderProps.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) {
    image = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaPlaceholder, {
      onSelect: onSelectImage,
      accept: "image/*",
      allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
      onError: onUploadError,
      placeholder: placeholder,
      mediaLibraryButton: ({
        open
      }) => {
        return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
          icon: library_upload,
          variant: "primary",
          label: label,
          showTooltip: true,
          tooltipPosition: "top center",
          onClick: () => {
            open();
          }
        });
      }
    });
  } else {
    // We have a Featured image so show a Placeholder if is loading.
    image = !media ? placeholder() : (0,external_gc_element_namespaceObject.createElement)("img", {
      className: borderProps.className,
      src: mediaUrl,
      alt: media.alt_text ? (0,external_gc_i18n_namespaceObject.sprintf)( // translators: %s: The image's alt text.
      (0,external_gc_i18n_namespaceObject.__)('特色图片：%s'), media.alt_text) : (0,external_gc_i18n_namespaceObject.__)('特色图片'),
      style: imageStyles
    });
  }
  /**
   * 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 (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, controls, !!media && !isDescendentOfQueryLoop && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "other"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaReplaceFlow, {
    mediaId: featuredImage,
    mediaURL: mediaUrl,
    allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES,
    accept: "image/*",
    onSelect: onSelectImage,
    onError: onUploadError
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItem, {
    onClick: () => setFeaturedImage(0)
  }, (0,external_gc_i18n_namespaceObject.__)('重置')))), (0,external_gc_element_namespaceObject.createElement)("figure", { ...blockProps
  }, image, (0,external_gc_element_namespaceObject.createElement)(overlay, {
    attributes: attributes,
    setAttributes: setAttributes,
    clientId: clientId
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-featured-image/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_featured_image_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/post-featured-image",
  title: "文章特色图片",
  category: "theme",
  description: "显示文章的特色图片。",
  textdomain: "default",
  attributes: {
    isLink: {
      type: "boolean",
      "default": false
    },
    aspectRatio: {
      type: "string"
    },
    width: {
      type: "string"
    },
    height: {
      type: "string"
    },
    scale: {
      type: "string",
      "default": "cover"
    },
    sizeSlug: {
      type: "string"
    },
    rel: {
      type: "string",
      attribute: "rel",
      "default": ""
    },
    linkTarget: {
      type: "string",
      "default": "_self"
    },
    overlayColor: {
      type: "string"
    },
    customOverlayColor: {
      type: "string"
    },
    dimRatio: {
      type: "number",
      "default": 0
    },
    gradient: {
      type: "string"
    },
    customGradient: {
      type: "string"
    }
  },
  usesContext: ["postId", "postType", "queryId"],
  supports: {
    align: ["left", "right", "center", "wide", "full"],
    color: {
      __experimentalDuotone: "img, .gc-block-post-featured-image__placeholder, .components-placeholder__illustration, .components-placeholder::before",
      text: false,
      background: false
    },
    __experimentalBorder: {
      color: true,
      radius: true,
      width: true,
      __experimentalSelector: "img, .block-editor-media-placeholder, .gc-block-post-featured-image__overlay",
      __experimentalSkipSerialization: true,
      __experimentalDefaultControls: {
        color: true,
        radius: true,
        width: true
      }
    },
    html: false,
    spacing: {
      margin: true,
      padding: true
    }
  },
  editorStyle: "gc-block-post-featured-image-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-navigation-link/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */




function PostNavigationLinkEdit({
  attributes: {
    type,
    label,
    showTitle,
    textAlign,
    linkLabel,
    arrow
  },
  setAttributes
}) {
  const isNext = type === 'next';
  let placeholder = isNext ? (0,external_gc_i18n_namespaceObject.__)('下篇文章') : (0,external_gc_i18n_namespaceObject.__)('上篇文章');
  const arrowMap = {
    none: '',
    arrow: isNext ? '→' : '←',
    chevron: isNext ? '»' : '«'
  };
  const displayArrow = arrowMap[arrow];

  if (showTitle) {
    /* translators: Label before for next and previous post. There is a space after the colon. */
    placeholder = isNext ? (0,external_gc_i18n_namespaceObject.__)('下一篇： ') : (0,external_gc_i18n_namespaceObject.__)('上一篇： ');
  }

  const ariaLabel = isNext ? (0,external_gc_i18n_namespaceObject.__)('下篇文章') : (0,external_gc_i18n_namespaceObject.__)('上篇文章');
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('以链接方式显示标题'),
    help: (0,external_gc_i18n_namespaceObject.__)('如果您输入了自定义标签，它将在标题前加上前缀。'),
    checked: !!showTitle,
    onChange: () => setAttributes({
      showTitle: !showTitle
    })
  }), showTitle && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('将标签包括在内作为链接的一部分'),
    checked: !!linkLabel,
    onChange: () => setAttributes({
      linkLabel: !linkLabel
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('箭'),
    value: arrow,
    onChange: value => {
      setAttributes({
        arrow: value
      });
    },
    help: (0,external_gc_i18n_namespaceObject.__)('下一个和上一个链接的装饰箭头。'),
    isBlock: true
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "none",
    label: (0,external_gc_i18n_namespaceObject._x)('无', 'Arrow option for Next/Previous link')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "arrow",
    label: (0,external_gc_i18n_namespaceObject._x)('Arrow', 'Arrow option for Next/Previous link')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "chevron",
    label: (0,external_gc_i18n_namespaceObject._x)('Chevron', 'Arrow option for Next/Previous link')
  })))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentToolbar, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, !isNext && displayArrow && (0,external_gc_element_namespaceObject.createElement)("span", {
    className: `gc-block-post-navigation-link__arrow-previous is-arrow-${arrow}`
  }, displayArrow), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    tagName: "a",
    "aria-label": ariaLabel,
    placeholder: placeholder,
    value: label,
    allowedFormats: ['core/bold', 'core/italic'],
    onChange: newLabel => setAttributes({
      label: newLabel
    })
  }), showTitle && (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#post-navigation-pseudo-link",
    onClick: event => event.preventDefault()
  }, (0,external_gc_i18n_namespaceObject.__)('标题示例')), isNext && displayArrow && (0,external_gc_element_namespaceObject.createElement)("span", {
    className: `gc-block-post-navigation-link__arrow-next is-arrow-${arrow}`,
    "aria-hidden": true
  }, displayArrow)));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/next.js


/**
 * GeChiUI dependencies
 */

const next = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_next = (next);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/previous.js


/**
 * GeChiUI dependencies
 */

const previous = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_previous = (previous);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-navigation-link/variations.js
/**
 * GeChiUI dependencies
 */


const post_navigation_link_variations_variations = [{
  isDefault: true,
  name: 'post-next',
  title: (0,external_gc_i18n_namespaceObject.__)('下篇文章'),
  description: (0,external_gc_i18n_namespaceObject.__)('显示与当前文章相邻的下一篇文章的链接。'),
  icon: library_next,
  attributes: {
    type: 'next'
  },
  scope: ['inserter', 'transform']
}, {
  name: 'post-previous',
  title: (0,external_gc_i18n_namespaceObject.__)('上篇文章'),
  description: (0,external_gc_i18n_namespaceObject.__)('显示与当前文章相邻的上一篇文章的链接。'),
  icon: library_previous,
  attributes: {
    type: 'previous'
  },
  scope: ['inserter', 'transform']
}];
/**
 * 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 */ var post_navigation_link_variations = (post_navigation_link_variations_variations);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-navigation-link/index.js
/**
 * Internal dependencies
 */

const post_navigation_link_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/post-navigation-link",
  title: "文章导航链接",
  category: "theme",
  description: "显示与当前文章相邻的下一篇或上一篇文章的链接。",
  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"
    }
  },
  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,
      __experimentalDefaultControls: {
        fontSize: true
      }
    }
  },
  style: "gc-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
};
const post_navigation_link_init = () => initBlock({
  name: post_navigation_link_name,
  metadata: post_navigation_link_metadata,
  settings: post_navigation_link_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-template/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */








const post_template_edit_TEMPLATE = [['core/post-title'], ['core/post-date'], ['core/post-excerpt']];

function PostTemplateInnerBlocks() {
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)({
    className: 'gc-block-post'
  }, {
    template: post_template_edit_TEMPLATE,
    __unstableDisableLayoutClassNames: true
  });
  return (0,external_gc_element_namespaceObject.createElement)("li", { ...innerBlocksProps
  });
}

function PostTemplateBlockPreview({
  blocks,
  blockContextId,
  isHidden,
  setActiveBlockContextId
}) {
  const blockPreviewProps = (0,external_gc_blockEditor_namespaceObject.__experimentalUseBlockPreview)({
    blocks,
    props: {
      className: 'gc-block-post'
    }
  });

  const handleOnClick = () => {
    setActiveBlockContextId(blockContextId);
  };

  const style = {
    display: isHidden ? 'none' : undefined
  };
  return (0,external_gc_element_namespaceObject.createElement)("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_gc_element_namespaceObject.memo)(PostTemplateBlockPreview);
function PostTemplateEdit({
  setAttributes,
  clientId,
  context: {
    query: {
      perPage,
      offset = 0,
      postType,
      order,
      orderBy,
      author,
      search,
      exclude,
      sticky,
      inherit,
      taxQuery,
      parents,
      pages,
      // 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
    } = {},
    queryContext = [{
      page: 1
    }],
    templateSlug,
    previewPostType
  },
  attributes: {
    layout
  },
  __unstableLayoutClassNames
}) {
  const {
    type: layoutType,
    columnCount = 3
  } = layout || {};
  const [{
    page
  }] = queryContext;
  const [activeBlockContextId, setActiveBlockContextId] = (0,external_gc_element_namespaceObject.useState)();
  const {
    posts,
    blocks
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getEntityRecords,
      getTaxonomies
    } = select(external_gc_coreData_namespaceObject.store);
    const {
      getBlocks
    } = select(external_gc_blockEditor_namespaceObject.store);
    const taxonomies = getTaxonomies({
      type: postType,
      per_page: -1,
      context: 'view'
    });
    const templateCategory = inherit && templateSlug?.startsWith('category-') && getEntityRecords('taxonomy', 'category', {
      context: 'view',
      per_page: 1,
      _fields: ['id'],
      slug: templateSlug.replace('category-', '')
    });
    const query = {
      offset: perPage ? perPage * (page - 1) + offset : 0,
      order,
      orderby: orderBy
    }; // There is no need to build the taxQuery if we inherit.

    if (taxQuery && !inherit) {
      // 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 sticky is not set, it will return all posts in the results.
    // If sticky is set to `only`, it will limit the results to sticky posts only.
    // If it is anything else, it will exclude sticky posts from results. For the record the value stored is `exclude`.


    if (sticky) {
      query.sticky = sticky === 'only';
    } // If `inherit` is truthy, adjust conditionally the query to create a better preview.


    if (inherit) {
      // Change the post-type if needed.
      if (templateSlug?.startsWith('archive-')) {
        query.postType = templateSlug.replace('archive-', '');
        postType = query.postType;
      } else if (templateCategory) {
        query.categories = templateCategory[0]?.id;
      }
    } // When we preview Query Loop blocks we should prefer the current
    // block's postType, which is passed through block context.


    const usedPostType = previewPostType || postType;
    return {
      posts: getEntityRecords('postType', usedPostType, { ...query,
        ...restQueryArgs
      }),
      blocks: getBlocks(clientId)
    };
  }, [perPage, page, offset, order, orderBy, clientId, author, search, postType, exclude, sticky, inherit, templateSlug, taxQuery, parents, restQueryArgs, previewPostType]);
  const blockContexts = (0,external_gc_element_namespaceObject.useMemo)(() => posts?.map(post => ({
    postType: post.type,
    postId: post.id
  })), [posts]);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()(__unstableLayoutClassNames, {
      [`columns-${columnCount}`]: layoutType === 'grid' && columnCount // Ensure column count is flagged via classname for backwards compatibility.

    })
  });

  if (!posts) {
    return (0,external_gc_element_namespaceObject.createElement)("p", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null));
  }

  if (!posts.length) {
    return (0,external_gc_element_namespaceObject.createElement)("p", { ...blockProps
    }, " ", (0,external_gc_i18n_namespaceObject.__)('未找到结果。'));
  }

  const setDisplayLayout = newDisplayLayout => setAttributes({
    layout: { ...layout,
      ...newDisplayLayout
    }
  });

  const displayLayoutControls = [{
    icon: library_list,
    title: (0,external_gc_i18n_namespaceObject.__)('列表视图'),
    onClick: () => setDisplayLayout({
      type: 'default'
    }),
    isActive: layoutType === 'default' || layoutType === 'constrained'
  }, {
    icon: library_grid,
    title: (0,external_gc_i18n_namespaceObject.__)('网格视图'),
    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 (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, {
    controls: displayLayoutControls
  })), (0,external_gc_element_namespaceObject.createElement)("ul", { ...blockProps
  }, blockContexts && blockContexts.map(blockContext => (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockContextProvider, {
    key: blockContext.postId,
    value: blockContext
  }, blockContext.postId === (activeBlockContextId || blockContexts[0]?.postId) ? (0,external_gc_element_namespaceObject.createElement)(PostTemplateInnerBlocks, null) : null, (0,external_gc_element_namespaceObject.createElement)(MemoizedPostTemplateBlockPreview, {
    blocks: blocks,
    blockContextId: blockContext.postId,
    setActiveBlockContextId: setActiveBlockContextId,
    isHidden: blockContext.postId === (activeBlockContextId || blockContexts[0]?.postId)
  })))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-template/save.js


/**
 * GeChiUI dependencies
 */

function PostTemplateSave() {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-template/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_template_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/post-template",
  title: "文章模板",
  category: "theme",
  parent: ["core/query"],
  description: "包含用于呈现文章的区块元素，如标题、日期、特色图片、内容或摘要等。",
  textdomain: "default",
  usesContext: ["queryId", "query", "queryContext", "displayLayout", "templateSlug", "previewPostType"],
  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: {
      blockGap: {
        __experimentalDefault: "1.25em"
      },
      __experimentalDefaultControls: {
        blockGap: true
      }
    }
  },
  style: "gc-block-post-template",
  editorStyle: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/post-categories.js


/**
 * GeChiUI dependencies
 */

const postCategories = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var post_categories = (postCategories);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-terms/use-post-terms.js
/**
 * GeChiUI dependencies
 */


function usePostTerms({
  postId,
  term
}) {
  const {
    slug
  } = term;
  return (0,external_gc_data_namespaceObject.useSelect)(select => {
    const visible = term?.visibility?.publicly_queryable;

    if (!visible) {
      return {
        postTerms: [],
        _isLoading: false,
        hasPostTerms: false
      };
    }

    const {
      getEntityRecords,
      isResolving
    } = select(external_gc_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]);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-terms/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_data_namespaceObject.useSelect)(select => {
    if (!term) return {};
    const {
      getTaxonomy
    } = select(external_gc_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_gc_blockEditor_namespaceObject.useBlockDisplayInformation)(clientId);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign,
      [`taxonomy-${term}`]: term
    })
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentToolbar, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "advanced"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    autoComplete: "off",
    label: (0,external_gc_i18n_namespaceObject.__)('分隔符'),
    value: separator || '',
    onChange: nextValue => {
      setAttributes({
        separator: nextValue
      });
    },
    help: (0,external_gc_i18n_namespaceObject.__)('输入用于分隔项目的字符。')
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, isLoading && hasPost && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null), !isLoading && hasPostTerms && (isSelected || prefix) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    allowedFormats: ALLOWED_FORMATS,
    className: "gc-block-post-terms__prefix",
    multiline: false,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('前缀'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('前缀') + ' ',
    value: prefix,
    onChange: value => setAttributes({
      prefix: value
    }),
    tagName: "span"
  }), (!hasPost || !term) && (0,external_gc_element_namespaceObject.createElement)("span", null, blockInformation.title), hasPost && !isLoading && hasPostTerms && postTerms.map(postTerm => (0,external_gc_element_namespaceObject.createElement)("a", {
    key: postTerm.id,
    href: postTerm.link,
    onClick: event => event.preventDefault()
  }, (0,external_gc_htmlEntities_namespaceObject.decodeEntities)(postTerm.name))).reduce((prev, curr) => (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, prev, (0,external_gc_element_namespaceObject.createElement)("span", {
    className: "gc-block-post-terms__separator"
  }, separator || ' '), curr)), hasPost && !isLoading && !hasPostTerms && (selectedTerm?.labels?.no_terms || (0,external_gc_i18n_namespaceObject.__)('未找到项目。')), !isLoading && hasPostTerms && (isSelected || suffix) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    allowedFormats: ALLOWED_FORMATS,
    className: "gc-block-post-terms__suffix",
    multiline: false,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('后缀'),
    placeholder: ' ' + (0,external_gc_i18n_namespaceObject.__)('后缀'),
    value: suffix,
    onChange: value => setAttributes({
      suffix: value
    }),
    tagName: "span",
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)()))
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/post-terms.js


/**
 * GeChiUI dependencies
 */

const postTerms = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var post_terms = (postTerms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-terms/hooks.js
/**
 * GeChiUI 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
  };
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-terms/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */


const post_terms_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/post-terms",
  title: "文章项目",
  category: "theme",
  description: "文章项目。",
  textdomain: "default",
  attributes: {
    term: {
      type: "string"
    },
    textAlign: {
      type: "string"
    },
    separator: {
      type: "string",
      "default": ", "
    },
    prefix: {
      type: "string",
      "default": ""
    },
    suffix: {
      type: "string",
      "default": ""
    }
  },
  usesContext: ["postId", "postType"],
  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
      }
    }
  },
  style: "gc-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_gc_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceVariations);
  return initBlock({
    name: post_terms_name,
    metadata: post_terms_metadata,
    settings: post_terms_settings
  });
};

;// CONCATENATED MODULE: external ["gc","wordcount"]
var external_gc_wordcount_namespaceObject = window["gc"]["wordcount"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-time-to-read/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId);
  const [blocks] = (0,external_gc_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, {
    id: postId
  });
  const minutesToReadString = (0,external_gc_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_gc_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_gc_i18n_namespaceObject._x)('字数', 'Word count type. Do not translate!');

    const minutesToRead = Math.max(1, Math.round((0,external_gc_wordcount_namespaceObject.count)(content, wordCountType) / AVERAGE_READING_RATE));
    return (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %d is the number of minutes the post will take to read. */
    (0,external_gc_i18n_namespaceObject._n)('%d minute', '%d minutes', minutesToRead), minutesToRead);
  }, [contentStructure, blocks]);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, minutesToReadString));
}

/* harmony default export */ var post_time_to_read_edit = (PostTimeToReadEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-time-to-read/icon.js


/**
 * GeChiUI dependencies
 */

/* harmony default export */ var icon = ((0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  width: "24",
  height: "24",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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"
})));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-time-to-read/index.js
/**
 * Internal dependencies
 */

const post_time_to_read_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  __experimental: true,
  name: "core/post-time-to-read",
  title: "阅读时长",
  category: "theme",
  description: "显示完成阅读文章所需的分钟数。",
  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
      }
    }
  }
};


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
};
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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-title/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */



const {
  useBlockEditingMode: post_title_edit_useBlockEditingMode
} = unlock(external_gc_blockEditor_namespaceObject.privateApis);
function PostTitleEdit({
  attributes: {
    level,
    textAlign,
    isLink,
    rel,
    linkTarget
  },
  setAttributes,
  context: {
    postType,
    postId,
    queryId
  },
  insertBlocksAfter
}) {
  const TagName = 'h' + level;
  const isDescendentOfQueryLoop = Number.isFinite(queryId);
  /**
   * Hack: 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.
   */

  const userCanEdit = useCanEditEntity('postType', !isDescendentOfQueryLoop && postType, postId);
  const [rawTitle = '', setTitle, fullTitle] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId);
  const [link] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', postType, 'link', postId);

  const onSplitAtEnd = () => {
    insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)()));
  };

  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  const blockEditingMode = post_title_edit_useBlockEditingMode();
  let titleElement = (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
  }, (0,external_gc_i18n_namespaceObject.__)('标题'));

  if (postType && postId) {
    titleElement = userCanEdit ? (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.PlainText, {
      tagName: TagName,
      placeholder: (0,external_gc_i18n_namespaceObject.__)('无标题'),
      value: rawTitle,
      onChange: setTitle,
      __experimentalVersion: 2,
      __unstableOnSplitAtEnd: onSplitAtEnd,
      ...blockProps
    }) : (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps,
      dangerouslySetInnerHTML: {
        __html: fullTitle?.rendered
      }
    });
  }

  if (isLink && postType && postId) {
    titleElement = userCanEdit ? (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.PlainText, {
      tagName: "a",
      href: link,
      target: linkTarget,
      rel: rel,
      placeholder: !rawTitle.length ? (0,external_gc_i18n_namespaceObject.__)('无标题') : null,
      value: rawTitle,
      onChange: setTitle,
      __experimentalVersion: 2,
      __unstableOnSplitAtEnd: onSplitAtEnd
    })) : (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)("a", {
      href: link,
      target: linkTarget,
      rel: rel,
      onClick: event => event.preventDefault(),
      dangerouslySetInnerHTML: {
        __html: fullTitle?.rendered
      }
    }));
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, blockEditingMode === 'default' && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.HeadingLevelDropdown, {
    value: level,
    onChange: newLevel => setAttributes({
      level: newLevel
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('将标题设置为链接'),
    onChange: () => setAttributes({
      isLink: !isLink
    }),
    checked: isLink
  }), isLink && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新窗口打开'),
    onChange: value => setAttributes({
      linkTarget: value ? '_blank' : '_self'
    }),
    checked: linkTarget === '_blank'
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('链接rel'),
    value: rel,
    onChange: newRel => setAttributes({
      rel: newRel
    })
  })))), titleElement);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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 */ var post_title_deprecated = ([post_title_deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/post-title/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const post_title_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/post-title",
  title: "标题",
  category: "theme",
  description: "显示文章、页面或任何其他内容类型的标题。",
  textdomain: "default",
  usesContext: ["postId", "postType", "queryId"],
  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,
      __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,
        fontAppearance: true,
        textTransform: true
      }
    }
  },
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/preformatted.js


/**
 * GeChiUI dependencies
 */

const preformatted = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_preformatted = (preformatted);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/preformatted/edit.js


/**
 * GeChiUI dependencies
 */


function PreformattedEdit({
  attributes,
  mergeBlocks,
  setAttributes,
  onRemove,
  style
}) {
  const {
    content
  } = attributes;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    style
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    tagName: "pre",
    identifier: "content",
    preserveWhiteSpace: true,
    value: content,
    onChange: nextContent => {
      setAttributes({
        content: nextContent
      });
    },
    onRemove: onRemove,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('预格式化文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('编写预格式化文字...' ),
    onMerge: mergeBlocks,
    ...blockProps,
    __unstablePastePlainText: true
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/preformatted/save.js


/**
 * GeChiUI dependencies
 */

function preformatted_save_save({
  attributes
}) {
  const {
    content
  } = attributes;
  return (0,external_gc_element_namespaceObject.createElement)("pre", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    value: content
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/preformatted/transforms.js
/**
 * GeChiUI dependencies
 */

const preformatted_transforms_transforms = {
  from: [{
    type: 'block',
    blocks: ['core/code', 'core/paragraph'],
    transform: ({
      content,
      anchor
    }) => (0,external_gc_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_gc_blocks_namespaceObject.createBlock)('core/paragraph', { ...attributes,
      content: attributes.content.replace(/\n/g, '<br>')
    })
  }, {
    type: 'block',
    blocks: ['core/code'],
    transform: attributes => (0,external_gc_blocks_namespaceObject.createBlock)('core/code', attributes)
  }]
};
/* harmony default export */ var preformatted_transforms = (preformatted_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/preformatted/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */



const preformatted_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/preformatted",
  title: "预格式",
  category: "text",
  description: "添加符合间距和标签的文字，也可设置样式。",
  textdomain: "default",
  attributes: {
    content: {
      type: "string",
      source: "html",
      selector: "pre",
      "default": "",
      __unstablePreserveWhiteSpace: true,
      __experimentalRole: "content"
    }
  },
  supports: {
    anchor: 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
      }
    }
  },
  style: "gc-block-preformatted"
};


const {
  name: preformatted_name
} = preformatted_metadata;

const preformatted_settings = {
  icon: library_preformatted,
  example: {
    attributes: {
      /* eslint-disable @gechiui/i18n-no-collapsible-whitespace */
      // translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work.
      content: (0,external_gc_i18n_namespaceObject.__)('几多欢喜，几多忧愁，几多风雨，几多烦忧，\n兜兜转转，磕磕碰碰，我们一路行走，一路堆积着流年里的一抹闲愁，\n热烈与沉寂，都是时光的角落，渐渐走丢的自我，寻不到出口，\n且，又遗忘了来时的路。')
      /* eslint-enable @gechiui/i18n-no-collapsible-whitespace */

    }
  },
  transforms: preformatted_transforms,
  edit: PreformattedEdit,
  save: preformatted_save_save,

  merge(attributes, attributesToMerge) {
    return {
      content: attributes.content + attributesToMerge.content
    };
  }

};
const preformatted_init = () => initBlock({
  name: preformatted_name,
  metadata: preformatted_metadata,
  settings: preformatted_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/pullquote.js


/**
 * GeChiUI dependencies
 */

const pullquote = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_pullquote = (pullquote);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/pullquote/shared.js
const SOLID_COLOR_CLASS = `is-style-solid-color`;

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/pullquote/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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) {
  return (0,external_gc_richText_namespaceObject.toHTMLString)({
    value: (0,external_gc_richText_namespaceObject.replace)((0,external_gc_richText_namespaceObject.create)({
      html: value,
      multilineTag: 'p'
    }), new RegExp(external_gc_richText_namespaceObject.__UNSTABLE_LINE_SEPARATOR, 'g'), '\n')
  });
}

const pullquote_deprecated_v5 = {
  attributes: {
    value: {
      type: 'string',
      source: 'html',
      selector: 'blockquote',
      multiline: 'p',
      __experimentalRole: 'content'
    },
    citation: {
      type: 'string',
      source: 'html',
      selector: 'cite',
      default: '',
      __experimentalRole: 'content'
    },
    textAlign: {
      type: 'string'
    }
  },

  save({
    attributes
  }) {
    const {
      textAlign,
      citation,
      value
    } = attributes;
    const shouldShowCitation = !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation);
    return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: classnames_default()({
          [`has-text-align-${textAlign}`]: textAlign
        })
      })
    }, (0,external_gc_element_namespaceObject.createElement)("blockquote", null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: value,
      multiline: true
    }), shouldShowCitation && (0,external_gc_element_namespaceObject.createElement)(external_gc_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.gechiui.com/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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
      figureClasses = classnames_default()({
        '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_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const blockquoteClasses = classnames_default()({
      'has-text-color': textColor || customTextColor,
      [blockquoteTextColorClass]: blockquoteTextColorClass
    });
    const blockquoteStyles = blockquoteTextColorClass ? undefined : {
      color: customTextColor
    };
    return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className: figureClasses,
        style: figureStyles
      })
    }, (0,external_gc_element_namespaceObject.createElement)("blockquote", {
      className: blockquoteClasses,
      style: blockquoteStyles
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: value,
      multiline: true
    }), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor);
      figureClasses = classnames_default()({
        '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_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const blockquoteClasses = (textColor || customTextColor) && classnames_default()('has-text-color', {
      [blockquoteTextColorClass]: blockquoteTextColorClass
    });
    const blockquoteStyles = blockquoteTextColorClass ? undefined : {
      color: customTextColor
    };
    return (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: figureClasses,
      style: figureStyles
    }, (0,external_gc_element_namespaceObject.createElement)("blockquote", {
      className: blockquoteClasses,
      style: blockquoteStyles
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: value,
      multiline: true
    }), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_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_gc_data_namespaceObject.select)(external_gc_blockEditor_namespaceObject.store).getSettings().colors) !== null && _select$getSettings$c !== void 0 ? _select$getSettings$c : [];
      const colorObject = (0,external_gc_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colors, mainColor);
      figureStyles = {
        borderColor: colorObject.color
      };
    }

    const blockquoteTextColorClass = (0,external_gc_blockEditor_namespaceObject.getColorClassName)('color', textColor);
    const blockquoteClasses = textColor || customTextColor ? classnames_default()('has-text-color', {
      [blockquoteTextColorClass]: blockquoteTextColorClass
    }) : undefined;
    const blockquoteStyle = blockquoteTextColorClass ? undefined : {
      color: customTextColor
    };
    return (0,external_gc_element_namespaceObject.createElement)("figure", {
      className: figureClass,
      style: figureStyles
    }, (0,external_gc_element_namespaceObject.createElement)("blockquote", {
      className: blockquoteClasses,
      style: blockquoteStyle
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: value,
      multiline: true
    }), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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 (0,external_gc_element_namespaceObject.createElement)("blockquote", null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: value,
      multiline: true
    }), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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 (0,external_gc_element_namespaceObject.createElement)("blockquote", {
      className: `align${align}`
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      value: value,
      multiline: true
    }), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var pullquote_deprecated = ([pullquote_deprecated_v5, pullquote_deprecated_v4, pullquote_deprecated_v3, pullquote_deprecated_v2, pullquote_deprecated_v1, deprecated_v0]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/pullquote/figure.js
const Figure = 'figure';

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/pullquote/blockquote.js
const BlockQuote = 'blockquote';

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/pullquote/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */



const isWebPlatform = external_gc_element_namespaceObject.Platform.OS === 'web';

function PullQuoteEdit({
  attributes,
  setAttributes,
  isSelected,
  insertBlocksAfter
}) {
  const {
    textAlign,
    citation,
    value
  } = attributes;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    })
  });
  const shouldShowCitation = !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)(Figure, { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(BlockQuote, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    identifier: "value",
    tagName: "p",
    value: value,
    onChange: nextValue => setAttributes({
      value: nextValue
    }),
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('引用文字'),
    placeholder: // translators: placeholder text used for the quote
    (0,external_gc_i18n_namespaceObject.__)('添加引用'),
    textAlign: "center"
  }), shouldShowCitation && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    identifier: "citation",
    tagName: isWebPlatform ? 'cite' : undefined,
    style: {
      display: 'block'
    },
    value: citation,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('引文'),
    placeholder: // translators: placeholder text used for the citation
    (0,external_gc_i18n_namespaceObject.__)('添加引文'),
    onChange: nextCitation => setAttributes({
      citation: nextCitation
    }),
    className: "gc-block-pullquote__citation",
    __unstableMobileNoFocusOnMount: true,
    textAlign: "center",
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)()))
  }))));
}

/* harmony default export */ var pullquote_edit = (PullQuoteEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/pullquote/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


function pullquote_save_save({
  attributes
}) {
  const {
    textAlign,
    citation,
    value
  } = attributes;
  const shouldShowCitation = !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation);
  return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className: classnames_default()({
        [`has-text-align-${textAlign}`]: textAlign
      })
    })
  }, (0,external_gc_element_namespaceObject.createElement)("blockquote", null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    tagName: "p",
    value: value
  }), shouldShowCitation && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    tagName: "cite",
    value: citation
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/pullquote/transforms.js
/**
 * GeChiUI dependencies
 */


const pullquote_transforms_transforms = {
  from: [{
    type: 'block',
    isMultiBlock: true,
    blocks: ['core/paragraph'],
    transform: attributes => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/pullquote', {
        value: (0,external_gc_richText_namespaceObject.toHTMLString)({
          value: (0,external_gc_richText_namespaceObject.join)(attributes.map(({
            content
          }) => (0,external_gc_richText_namespaceObject.create)({
            html: content
          })), '\n')
        }),
        anchor: attributes.anchor
      });
    }
  }, {
    type: 'block',
    blocks: ['core/heading'],
    transform: ({
      content,
      anchor
    }) => {
      return (0,external_gc_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_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
          content: value
        }));
      }

      if (citation) {
        paragraphs.push((0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
          content: citation
        }));
      }

      if (paragraphs.length === 0) {
        return (0,external_gc_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_gc_blocks_namespaceObject.createBlock)('core/heading', {
          content: citation
        });
      }

      const headingBlock = (0,external_gc_blocks_namespaceObject.createBlock)('core/heading', {
        content: value
      });

      if (!citation) {
        return headingBlock;
      }

      return [headingBlock, (0,external_gc_blocks_namespaceObject.createBlock)('core/heading', {
        content: citation
      })];
    }
  }]
};
/* harmony default export */ var pullquote_transforms = (pullquote_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/pullquote/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const pullquote_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/pullquote",
  title: "引文",
  category: "text",
  description: "为您文中的引用增添特殊的视觉显示效果。",
  textdomain: "default",
  attributes: {
    value: {
      type: "string",
      source: "html",
      selector: "p",
      __experimentalRole: "content"
    },
    citation: {
      type: "string",
      source: "html",
      selector: "cite",
      "default": "",
      __experimentalRole: "content"
    },
    textAlign: {
      type: "string"
    }
  },
  supports: {
    anchor: true,
    align: ["left", "right", "wide", "full"],
    color: {
      gradients: true,
      background: 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,
        fontAppearance: 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"
      }
    }
  },
  editorStyle: "gc-block-pullquote-editor",
  style: "gc-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_gc_i18n_namespaceObject.__)('技术上最难的事情之一就是扰乱自己。'),
      citation: (0,external_gc_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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/loop.js


/**
 * GeChiUI dependencies
 */

const loop = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_loop = (loop);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/settings.js


/**
 * GeChiUI dependencies
 */

const settings_settings = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"
}));
/* harmony default export */ var library_settings = (settings_settings);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/utils.js
/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */

const {
  name: queryLoopName
} = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/query",
  title: "循环查询",
  category: "theme",
  description: "一个可以根据不同的查询参数和视觉配置来显示文章类型的高级区块。",
  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: []
      }
    },
    tagName: {
      type: "string",
      "default": "div"
    },
    namespace: {
      type: "string"
    }
  },
  providesContext: {
    queryId: "queryId",
    query: "query",
    displayLayout: "displayLayout"
  },
  supports: {
    align: ["wide", "full"],
    html: false,
    layout: true
  },
  editorStyle: "gc-block-query-editor"
};
/** @typedef {import('@gechiui/blocks').GCBlockVariation} GCBlockVariation */

/**
 * @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 enitities that now implement the `IHasNameAndId` interface.
 */

const mapToIHasNameAndId = (entities, path) => {
  return (entities || []).map(entity => ({ ...entity,
    name: (0,external_gc_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.
 *
 * @return {Object} The helper object related to post types.
 */

const usePostTypes = () => {
  const postTypes = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getPostTypes
    } = select(external_gc_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_gc_element_namespaceObject.useMemo)(() => {
    if (!postTypes?.length) return;
    return postTypes.reduce((accumulator, type) => {
      accumulator[type.slug] = type.taxonomies;
      return accumulator;
    }, {});
  }, [postTypes]);
  const postTypesSelectOptions = (0,external_gc_element_namespaceObject.useMemo)(() => (postTypes || []).map(({
    labels,
    slug
  }) => ({
    label: labels.singular_name,
    value: slug
  })), [postTypes]);
  return {
    postTypesTaxonomiesMap,
    postTypesSelectOptions
  };
};
/**
 * 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_gc_data_namespaceObject.useSelect)(select => {
    const {
      getTaxonomies
    } = select(external_gc_coreData_namespaceObject.store);
    const filteredTaxonomies = getTaxonomies({
      type: postType,
      per_page: -1,
      context: 'view'
    });
    return filteredTaxonomies;
  }, [postType]);
  return 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_gc_data_namespaceObject.useSelect)(select => {
    const type = select(external_gc_coreData_namespaceObject.store).getPostType(postType);
    return type?.viewable && type?.hierarchical;
  }, [postType]);
}
/**
 * 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_gc_data_namespaceObject.useSelect)(select => select(external_gc_blocks_namespaceObject.store).getActiveBlockVariation(queryLoopName, 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 {GCBlock[]}        blocks               The list of blocks to look through and transform(mutate).
 * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes.
 * @return {{ newBlocks: GCBlock[], 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
    }
  } = queryBlockAttributes;
  const clonedBlocks = blocks.map(block => (0,external_gc_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
      };
      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) {
  const activeVariationName = (0,external_gc_data_namespaceObject.useSelect)(select => select(external_gc_blocks_namespaceObject.store).getActiveBlockVariation(queryLoopName, attributes)?.name, [attributes]);
  const blockName = `${queryLoopName}/${activeVariationName}`;
  const activeVariationPatterns = (0,external_gc_data_namespaceObject.useSelect)(select => {
    if (!activeVariationName) {
      return;
    }

    const {
      getBlockRootClientId,
      getPatternsByBlockTypes
    } = select(external_gc_blockEditor_namespaceObject.store);
    const rootClientId = getBlockRootClientId(clientId);
    return getPatternsByBlockTypes(blockName, rootClientId);
  }, [clientId, activeVariationName]);
  return activeVariationPatterns?.length ? blockName : queryLoopName;
}
/**
 * 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 {GCBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`.
 */

function useScopedBlockVariations(attributes) {
  const {
    activeVariationName,
    blockVariations
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getActiveBlockVariation,
      getBlockVariations
    } = select(external_gc_blocks_namespaceObject.store);
    return {
      activeVariationName: getActiveBlockVariation(queryLoopName, attributes)?.name,
      blockVariations: getBlockVariations(queryLoopName, 'block')
    };
  }, [attributes]);
  const variations = (0,external_gc_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_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlockRootClientId,
      getPatternsByBlockTypes
    } = select(external_gc_blockEditor_namespaceObject.store);
    const rootClientId = getBlockRootClientId(clientId);
    return getPatternsByBlockTypes(name, rootClientId);
  }, [name, clientId]);
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/edit/query-toolbar.js


/**
 * GeChiUI dependencies
 */




/**
 * Internal dependencies
 */


function QueryToolbar({
  attributes: {
    query
  },
  setQuery,
  openPatternSelectionModal,
  name,
  clientId
}) {
  const hasPatterns = !!usePatterns(clientId, name).length;
  const maxPageInputId = (0,external_gc_compose_namespaceObject.useInstanceId)(QueryToolbar, 'blocks-query-pagination-max-page-input');
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, !query.inherit && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Dropdown, {
    contentClassName: "block-library-query-toolbar__popover",
    renderToggle: ({
      onToggle
    }) => (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
      icon: library_settings,
      label: (0,external_gc_i18n_namespaceObject.__)('显示设置'),
      onClick: onToggle
    }),
    renderContent: () => (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.BaseControl, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalNumberControl, {
      __unstableInputWidth: "60px",
      label: (0,external_gc_i18n_namespaceObject.__)('每页项目数'),
      labelPosition: "edge",
      min: 1,
      max: 100,
      onChange: value => {
        if (isNaN(value) || value < 1 || value > 100) {
          return;
        }

        setQuery({
          perPage: value
        });
      },
      step: "1",
      value: query.perPage,
      isDragEnabled: false
    })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.BaseControl, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalNumberControl, {
      __unstableInputWidth: "60px",
      label: (0,external_gc_i18n_namespaceObject.__)('偏移'),
      labelPosition: "edge",
      min: 0,
      max: 100,
      onChange: value => {
        if (isNaN(value) || value < 0 || value > 100) {
          return;
        }

        setQuery({
          offset: value
        });
      },
      step: "1",
      value: query.offset,
      isDragEnabled: false
    })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.BaseControl, {
      id: maxPageInputId,
      help: (0,external_gc_i18n_namespaceObject.__)('限制要显示的页面数目，即使有更多查询结果。要显示所有页面，请使用0（零）。')
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalNumberControl, {
      id: maxPageInputId,
      __unstableInputWidth: "60px",
      label: (0,external_gc_i18n_namespaceObject.__)('要显示的最大页数'),
      labelPosition: "edge",
      min: 0,
      onChange: value => {
        if (isNaN(value) || value < 0) {
          return;
        }

        setQuery({
          pages: value
        });
      },
      step: "1",
      value: query.pages,
      isDragEnabled: false
    })))
  })), hasPatterns && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, {
    className: "gc-block-template-part__block-control-group"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    onClick: openPatternSelectionModal
  }, (0,external_gc_i18n_namespaceObject.__)('替换'))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/edit/inspector-controls/order-control.js


/**
 * GeChiUI dependencies
 */


const orderOptions = [{
  label: (0,external_gc_i18n_namespaceObject.__)('从最新至最旧排序'),
  value: 'date/desc'
}, {
  label: (0,external_gc_i18n_namespaceObject.__)('从最旧至最新排序'),
  value: 'date/asc'
}, {
  /* translators: label for ordering posts by title in ascending order */
  label: (0,external_gc_i18n_namespaceObject.__)('标题升序排列'),
  value: 'title/asc'
}, {
  /* translators: label for ordering posts by title in descending order */
  label: (0,external_gc_i18n_namespaceObject.__)('标题降序排列'),
  value: 'title/desc'
}];

function OrderControl({
  order,
  orderBy,
  onChange
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('排序'),
    value: `${orderBy}/${order}`,
    options: orderOptions,
    onChange: value => {
      const [newOrderBy, newOrder] = value.split('/');
      onChange({
        order: newOrder,
        orderBy: newOrderBy
      });
    }
  });
}

/* harmony default export */ var order_control = (OrderControl);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/edit/inspector-controls/author-control.js


/**
 * GeChiUI 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_gc_data_namespaceObject.useSelect)(select => {
    const {
      getUsers
    } = select(external_gc_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 `FormTokenFiels` 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 (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FormTokenField, {
    label: (0,external_gc_i18n_namespaceObject.__)('作者'),
    value: sanitizedValue,
    suggestions: authorsInfo.names,
    onChange: onAuthorChange,
    __experimentalShowHowTo: false
  });
}

/* harmony default export */ var author_control = (AuthorControl);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/edit/inspector-controls/parent-control.js


/**
 * GeChiUI 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_gc_element_namespaceObject.useState)('');
  const [value, setValue] = (0,external_gc_element_namespaceObject.useState)(parent_control_EMPTY_ARRAY);
  const [suggestions, setSuggestions] = (0,external_gc_element_namespaceObject.useState)(parent_control_EMPTY_ARRAY);
  const debouncedSearch = (0,external_gc_compose_namespaceObject.useDebounce)(setSearch, 250);
  const {
    searchResults,
    searchHasResolved
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    if (!search) {
      return {
        searchResults: parent_control_EMPTY_ARRAY,
        searchHasResolved: true
      };
    }

    const {
      getEntityRecords,
      hasFinishedResolution
    } = select(external_gc_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_gc_data_namespaceObject.useSelect)(select => {
    if (!parents?.length) return parent_control_EMPTY_ARRAY;
    const {
      getEntityRecords
    } = select(external_gc_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_gc_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_gc_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_gc_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 (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FormTokenField, {
    label: (0,external_gc_i18n_namespaceObject.__)('上层项目'),
    value: value,
    onInputChange: debouncedSearch,
    suggestions: suggestions,
    onChange: onParentChange,
    __experimentalShowHowTo: false
  });
}

/* harmony default export */ var parent_control = (ParentControl);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/edit/inspector-controls/taxonomy-controls.js


/**
 * GeChiUI 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 GC 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 (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, taxonomies.map(taxonomy => {
    const termIds = taxQuery?.[taxonomy.slug] || [];

    const handleChange = newTermIds => onChange({
      taxQuery: { ...taxQuery,
        [taxonomy.slug]: newTermIds
      }
    });

    return (0,external_gc_element_namespaceObject.createElement)(TaxonomyItem, {
      key: taxonomy.slug,
      taxonomy: taxonomy,
      termIds: termIds,
      onChange: handleChange
    });
  }));
}
/**
 * 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_gc_element_namespaceObject.useState)('');
  const [value, setValue] = (0,external_gc_element_namespaceObject.useState)(taxonomy_controls_EMPTY_ARRAY);
  const [suggestions, setSuggestions] = (0,external_gc_element_namespaceObject.useState)(taxonomy_controls_EMPTY_ARRAY);
  const debouncedSearch = (0,external_gc_compose_namespaceObject.useDebounce)(setSearch, 250);
  const {
    searchResults,
    searchHasResolved
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    if (!search) {
      return {
        searchResults: taxonomy_controls_EMPTY_ARRAY,
        searchHasResolved: true
      };
    }

    const {
      getEntityRecords,
      hasFinishedResolution
    } = select(external_gc_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_gc_data_namespaceObject.useSelect)(select => {
    if (!termIds?.length) return taxonomy_controls_EMPTY_ARRAY;
    const {
      getEntityRecords
    } = select(external_gc_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_gc_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_gc_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 (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "block-library-query-inspector__taxonomy-control"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FormTokenField, {
    label: taxonomy.name,
    value: value,
    onInputChange: debouncedSearch,
    suggestions: suggestions,
    onChange: onTermsChange,
    __experimentalShowHowTo: false
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/edit/inspector-controls/sticky-control.js


/**
 * GeChiUI dependencies
 */


const stickyOptions = [{
  label: (0,external_gc_i18n_namespaceObject.__)('包括'),
  value: ''
}, {
  label: (0,external_gc_i18n_namespaceObject.__)('排除'),
  value: 'exclude'
}, {
  label: (0,external_gc_i18n_namespaceObject.__)('仅'),
  value: 'only'
}];
function StickyControl({
  value,
  onChange
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('置顶文章'),
    options: stickyOptions,
    value: value,
    onChange: onChange,
    help: (0,external_gc_i18n_namespaceObject.__)('文章可以被“置顶”，即将其放置在文章首页的最顶部，直到有新的置顶文章被发布。')
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/edit/inspector-controls/create-new-post-link.js


/**
 * GeChiUI dependencies
 */




const CreateNewPostLink = ({
  attributes: {
    query: {
      postType
    } = {}
  } = {}
}) => {
  if (!postType) return null;
  const newPostUrl = (0,external_gc_url_namespaceObject.addQueryArgs)('post-new.php', {
    post_type: postType
  });
  return (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-query__create-new-link"
  }, (0,external_gc_element_namespaceObject.createInterpolateElement)((0,external_gc_i18n_namespaceObject.__)('<a>Add new post</a>'), // eslint-disable-next-line jsx-a11y/anchor-has-content
  {
    a: (0,external_gc_element_namespaceObject.createElement)("a", {
      href: newPostUrl
    })
  }));
};

/* harmony default export */ var create_new_post_link = (CreateNewPostLink);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/edit/inspector-controls/index.js


/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */









const {
  BlockInfo
} = unlock(external_gc_blockEditor_namespaceObject.privateApis);
function QueryInspectorControls(props) {
  const {
    attributes,
    setQuery,
    setDisplayLayout
  } = props;
  const {
    query,
    displayLayout
  } = attributes;
  const {
    order,
    orderBy,
    author: authorIds,
    postType,
    sticky,
    inherit,
    taxQuery,
    parents
  } = query;
  const allowedControls = useAllowedControls(attributes);
  const [showSticky, setShowSticky] = (0,external_gc_element_namespaceObject.useState)(postType === 'post');
  const {
    postTypesTaxonomiesMap,
    postTypesSelectOptions
  } = usePostTypes();
  const taxonomies = useTaxonomies(postType);
  const isPostTypeHierarchical = useIsPostTypeHierarchical(postType);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    setShowSticky(postType === 'post');
  }, [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 = [];
    setQuery(updateQuery);
  };

  const [querySearch, setQuerySearch] = (0,external_gc_element_namespaceObject.useState)(query.search);
  const onChangeDebounced = (0,external_gc_element_namespaceObject.useCallback)((0,external_gc_compose_namespaceObject.debounce)(() => {
    if (query.search !== querySearch) {
      setQuery({
        search: querySearch
      });
    }
  }, 250), [querySearch, query.search]);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    onChangeDebounced();
    return onChangeDebounced.cancel;
  }, [querySearch, onChangeDebounced]);
  const showInheritControl = isControlAllowed(allowedControls, 'inherit');
  const showPostTypeControl = !inherit && isControlAllowed(allowedControls, 'postType');
  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 showFiltersPanel = showTaxControl || showAuthorControl || showSearchControl || showParentControl;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(BlockInfo, null, (0,external_gc_element_namespaceObject.createElement)(create_new_post_link, { ...props
  })), showSettingsPanel && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, showInheritControl && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('从模版继承查询'),
    help: (0,external_gc_i18n_namespaceObject.__)('切换以使用通过当前样板设置的全局查询上下文，例如归档或搜索。禁用以单独定义设置。'),
    checked: !!inherit,
    onChange: value => setQuery({
      inherit: !!value
    })
  }), showPostTypeControl && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    options: postTypesSelectOptions,
    value: postType,
    label: (0,external_gc_i18n_namespaceObject.__)('文章类型'),
    onChange: onPostTypeChange,
    help: (0,external_gc_i18n_namespaceObject.__)('GeChiUI包含不同类型的内容，它们被分为称为“Post类型”的集合。默认情况下，有一些不同的插件，比如文章和页面，但插件可以添加更多。')
  }), showColumnsControl && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('栏目'),
    value: displayLayout.columns,
    onChange: value => setDisplayLayout({
      columns: value
    }),
    min: 2,
    max: Math.max(6, displayLayout.columns)
  }), displayLayout.columns > 6 && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Notice, {
    status: "warning",
    isDismissible: false
  }, (0,external_gc_i18n_namespaceObject.__)('该栏数超过建议的数量，可能会导致页面无法完整呈现。'))), showOrderControl && (0,external_gc_element_namespaceObject.createElement)(order_control, {
    order,
    orderBy,
    onChange: setQuery
  }), showStickyControl && (0,external_gc_element_namespaceObject.createElement)(StickyControl, {
    value: sticky,
    onChange: value => setQuery({
      sticky: value
    })
  }))), !inherit && showFiltersPanel && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanel, {
    className: "block-library-query-toolspanel__filters",
    label: (0,external_gc_i18n_namespaceObject.__)('筛选条件'),
    resetAll: () => {
      setQuery({
        author: '',
        parents: [],
        search: '',
        taxQuery: null
      });
      setQuerySearch('');
    }
  }, showTaxControl && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    label: (0,external_gc_i18n_namespaceObject.__)('分类法'),
    hasValue: () => Object.values(taxQuery || {}).some(terms => !!terms.length),
    onDeselect: () => setQuery({
      taxQuery: null
    })
  }, (0,external_gc_element_namespaceObject.createElement)(TaxonomyControls, {
    onChange: setQuery,
    query: query
  })), showAuthorControl && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    hasValue: () => !!authorIds,
    label: (0,external_gc_i18n_namespaceObject.__)('作者'),
    onDeselect: () => setQuery({
      author: ''
    })
  }, (0,external_gc_element_namespaceObject.createElement)(author_control, {
    value: authorIds,
    onChange: setQuery
  })), showSearchControl && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    hasValue: () => !!querySearch,
    label: (0,external_gc_i18n_namespaceObject.__)('关键字'),
    onDeselect: () => setQuerySearch('')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('关键字'),
    value: querySearch,
    onChange: setQuerySearch
  })), showParentControl && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToolsPanelItem, {
    hasValue: () => !!parents?.length,
    label: (0,external_gc_i18n_namespaceObject.__)('上层项目'),
    onDeselect: () => setQuery({
      parents: []
    })
  }, (0,external_gc_element_namespaceObject.createElement)(parent_control, {
    parents: parents,
    postType: postType,
    onChange: setQuery
  })))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/edit/query-content.js


/**
 * GeChiUI dependencies
 */







/**
 * Internal dependencies
 */



const DEFAULTS_POSTS_PER_PAGE = 3;
const query_content_TEMPLATE = [['core/post-template']];
function QueryContent({
  attributes,
  setAttributes,
  openPatternSelectionModal,
  name,
  clientId
}) {
  const {
    queryId,
    query,
    displayLayout,
    tagName: TagName = 'div',
    query: {
      inherit
    } = {}
  } = attributes;
  const {
    __unstableMarkNextChangeAsNotPersistent
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const instanceId = (0,external_gc_compose_namespaceObject.useInstanceId)(QueryContent);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    template: query_content_TEMPLATE
  });
  const {
    postsPerPage
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSettings
    } = select(external_gc_blockEditor_namespaceObject.store);
    const {
      getEntityRecord,
      canUser
    } = select(external_gc_coreData_namespaceObject.store);
    const settingPerPage = canUser('read', 'settings') ? +getEntityRecord('root', 'site')?.posts_per_page : +getSettings().postsPerPage;
    return {
      postsPerPage: 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.

  (0,external_gc_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;
    }

    if (!!Object.keys(newQuery).length) {
      __unstableMarkNextChangeAsNotPersistent();

      updateQuery(newQuery);
    }
  }, [query.perPage, postsPerPage, inherit]); // We need this for multi-query block pagination.
  // Query parameters for each block are scoped to their ID.

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!Number.isFinite(queryId)) {
      __unstableMarkNextChangeAsNotPersistent();

      setAttributes({
        queryId: instanceId
      });
    }
  }, [queryId, instanceId]);

  const updateQuery = newQuery => setAttributes({
    query: { ...query,
      ...newQuery
    }
  });

  const updateDisplayLayout = newDisplayLayout => setAttributes({
    displayLayout: { ...displayLayout,
      ...newDisplayLayout
    }
  });

  const htmlElementMessages = {
    main: (0,external_gc_i18n_namespaceObject.__)('<main>元素应仅用于文档的主要内容。'),
    section: (0,external_gc_i18n_namespaceObject.__)("<section>元素应该代表文档的一个独立部分，不能用另一个元素更好地表示。"),
    aside: (0,external_gc_i18n_namespaceObject.__)("<aside>元素应代表文档的一部分，其内容仅与文档的主要内容间接相关。")
  };
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(QueryInspectorControls, {
    attributes: attributes,
    setQuery: updateQuery,
    setDisplayLayout: updateDisplayLayout
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(QueryToolbar, {
    name: name,
    clientId: clientId,
    attributes: attributes,
    setQuery: updateQuery,
    openPatternSelectionModal: openPatternSelectionModal
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "advanced"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('HTML 元素'),
    options: [{
      label: (0,external_gc_i18n_namespaceObject.__)('默认（<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]
  })), (0,external_gc_element_namespaceObject.createElement)(TagName, { ...innerBlocksProps
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/edit/query-placeholder.js


/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */


function QueryPlaceholder({
  attributes,
  clientId,
  name,
  openPatternSelectionModal,
  setAttributes
}) {
  const [isStartingBlank, setIsStartingBlank] = (0,external_gc_element_namespaceObject.useState)(false);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  const blockNameForPatterns = useBlockNameForPatterns(clientId, attributes);
  const {
    blockType,
    allVariations,
    hasPatterns
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlockVariations,
      getBlockType
    } = select(external_gc_blocks_namespaceObject.store);
    const {
      getBlockRootClientId,
      getPatternsByBlockTypes
    } = select(external_gc_blockEditor_namespaceObject.store);
    const rootClientId = getBlockRootClientId(clientId);
    return {
      blockType: getBlockType(name),
      allVariations: getBlockVariations(name),
      hasPatterns: !!getPatternsByBlockTypes(blockNameForPatterns, rootClientId).length
    };
  }, [name, blockNameForPatterns, clientId]);
  const matchingVariation = (0,external_gc_blockEditor_namespaceObject.__experimentalGetMatchingVariation)(attributes, allVariations);
  const icon = matchingVariation?.icon?.src || matchingVariation?.icon || blockType?.icon?.src;
  const label = matchingVariation?.title || blockType?.title;

  if (isStartingBlank) {
    return (0,external_gc_element_namespaceObject.createElement)(QueryVariationPicker, {
      clientId: clientId,
      attributes: attributes,
      setAttributes: setAttributes,
      icon: icon,
      label: label
    });
  }

  return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
    icon: icon,
    label: label,
    instructions: (0,external_gc_i18n_namespaceObject.__)('为查询循环选择一个样板或以空白开始。')
  }, !!hasPatterns && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "primary",
    onClick: openPatternSelectionModal
  }, (0,external_gc_i18n_namespaceObject.__)('选择')), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "secondary",
    onClick: () => {
      setIsStartingBlank(true);
    }
  }, (0,external_gc_i18n_namespaceObject.__)('开始空白'))));
}

function QueryVariationPicker({
  clientId,
  attributes,
  setAttributes,
  icon,
  label
}) {
  const scopeVariations = useScopedBlockVariations(attributes);
  const {
    replaceInnerBlocks
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalBlockVariationPicker, {
    icon: icon,
    label: label,
    variations: scopeVariations,
    onSelect: variation => {
      if (variation.attributes) {
        setAttributes({ ...variation.attributes,
          query: { ...variation.attributes.query,
            postType: attributes.query.postType || variation.attributes.query.postType
          },
          namespace: attributes.namespace
        });
      }

      if (variation.innerBlocks) {
        replaceInnerBlocks(clientId, (0,external_gc_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(variation.innerBlocks), false);
      }
    }
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/edit/pattern-selection-modal.js


/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */



function PatternSelectionModal({
  clientId,
  attributes,
  setIsPatternSelectionModalOpen
}) {
  const [searchValue, setSearchValue] = (0,external_gc_element_namespaceObject.useState)('');
  const {
    replaceBlock,
    selectBlock
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);

  const onBlockPatternSelect = (pattern, blocks) => {
    const {
      newBlocks,
      queryClientIds
    } = getTransformedBlocksFromPattern(blocks, attributes);
    replaceBlock(clientId, newBlocks);

    if (queryClientIds[0]) {
      selectBlock(queryClientIds[0]);
    }
  }; // When we preview Query Loop blocks we should prefer the current
  // block's postType, which is passed through block context.


  const blockPreviewContext = (0,external_gc_element_namespaceObject.useMemo)(() => ({
    previewPostType: attributes.query.postType
  }), [attributes.query.postType]);
  const blockNameForPatterns = useBlockNameForPatterns(clientId, attributes);
  const blockPatterns = usePatterns(clientId, blockNameForPatterns);
  const filteredBlockPatterns = (0,external_gc_element_namespaceObject.useMemo)(() => {
    return searchPatterns(blockPatterns, searchValue);
  }, [blockPatterns, searchValue]);
  const shownBlockPatterns = (0,external_gc_compose_namespaceObject.useAsyncList)(filteredBlockPatterns);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Modal, {
    overlayClassName: "block-library-query-pattern__selection-modal",
    title: (0,external_gc_i18n_namespaceObject.__)('选择一个样板'),
    onRequestClose: () => setIsPatternSelectionModalOpen(false),
    isFullScreen: true
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "block-library-query-pattern__selection-content"
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "block-library-query-pattern__selection-search"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SearchControl, {
    __nextHasNoMarginBottom: true,
    onChange: setSearchValue,
    value: searchValue,
    label: (0,external_gc_i18n_namespaceObject.__)('搜索区块样板'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('搜索')
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockContextProvider, {
    value: blockPreviewContext
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
    blockPatterns: filteredBlockPatterns,
    shownPatterns: shownBlockPatterns,
    onClickPattern: onBlockPatternSelect
  }))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/edit/index.js


/**
 * GeChiUI dependencies
 */



/**
 * Internal dependencies
 */





const QueryEdit = props => {
  const {
    clientId,
    attributes
  } = props;
  const [isPatternSelectionModalOpen, setIsPatternSelectionModalOpen] = (0,external_gc_element_namespaceObject.useState)(false);
  const hasInnerBlocks = (0,external_gc_data_namespaceObject.useSelect)(select => !!select(external_gc_blockEditor_namespaceObject.store).getBlocks(clientId).length, [clientId]);
  const Component = hasInnerBlocks ? QueryContent : QueryPlaceholder;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(Component, { ...props,
    openPatternSelectionModal: () => setIsPatternSelectionModalOpen(true)
  }), isPatternSelectionModalOpen && (0,external_gc_element_namespaceObject.createElement)(PatternSelectionModal, {
    clientId: clientId,
    attributes: attributes,
    setIsPatternSelectionModalOpen: setIsPatternSelectionModalOpen
  }));
};

/* harmony default export */ var query_edit = (QueryEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/save.js


/**
 * GeChiUI dependencies
 */

function QuerySave({
  attributes: {
    tagName: Tag = 'div'
  }
}) {
  const blockProps = external_gc_blockEditor_namespaceObject.useBlockProps.save();
  const innerBlocksProps = external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  return (0,external_gc_element_namespaceObject.createElement)(Tag, { ...innerBlocksProps
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/icons.js


/**
 * GeChiUI dependencies
 */

const titleDate = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 48 48"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
  d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"
}));
const titleExcerpt = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 48 48"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
  d: "M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"
}));
const titleDateExcerpt = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 48 48"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
  d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"
}));
const imageDateTitle = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 48 48"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
  d: "M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"
}));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/variations.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */


const QUERY_DEFAULT_ATTRIBUTES = {
  query: {
    perPage: 3,
    pages: 0,
    offset: 0,
    postType: 'post',
    order: 'desc',
    orderBy: 'date',
    author: '',
    search: '',
    exclude: [],
    sticky: '',
    inherit: false
  }
};
const query_variations_variations = [{
  name: 'posts-list',
  title: (0,external_gc_i18n_namespaceObject.__)('文章列表'),
  description: (0,external_gc_i18n_namespaceObject.__)('显示您系统上近期文章的列表，不包括置顶文章。'),
  icon: post_list,
  attributes: {
    query: {
      perPage: 4,
      pages: 1,
      offset: 0,
      postType: 'post',
      order: 'desc',
      orderBy: 'date',
      author: '',
      search: '',
      sticky: 'exclude',
      inherit: false
    }
  },
  scope: ['inserter']
}, {
  name: 'title-date',
  title: (0,external_gc_i18n_namespaceObject.__)('标题和日期'),
  icon: titleDate,
  attributes: { ...QUERY_DEFAULT_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_gc_i18n_namespaceObject.__)('标题和摘要'),
  icon: titleExcerpt,
  attributes: { ...QUERY_DEFAULT_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_gc_i18n_namespaceObject.__)('标题、日期和摘要'),
  icon: titleDateExcerpt,
  attributes: { ...QUERY_DEFAULT_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_gc_i18n_namespaceObject.__)('图片、日期和标题'),
  icon: imageDateTitle,
  attributes: { ...QUERY_DEFAULT_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 */ var query_variations = (query_variations_variations);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/deprecated.js


/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */


const {
  cleanEmptyObject: deprecated_cleanEmptyObject
} = unlock(external_gc_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_gc_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_gc_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_gc_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 (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
  }

}; // 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_gc_blockEditor_namespaceObject.useBlockProps.save();
    const innerBlocksProps = external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
    return (0,external_gc_element_namespaceObject.createElement)(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_gc_blockEditor_namespaceObject.useBlockProps.save();
    const innerBlocksProps = external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
    return (0,external_gc_element_namespaceObject.createElement)(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_gc_blockEditor_namespaceObject.useBlockProps.save();
    const innerBlocksProps = external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
    return (0,external_gc_element_namespaceObject.createElement)(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_gc_blockEditor_namespaceObject.useBlockProps.save();
    const innerBlocksProps = external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
    return (0,external_gc_element_namespaceObject.createElement)(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 */ var query_deprecated = (query_deprecated_deprecated);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const query_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/query",
  title: "循环查询",
  category: "theme",
  description: "一个可以根据不同的查询参数和视觉配置来显示文章类型的高级区块。",
  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: []
      }
    },
    tagName: {
      type: "string",
      "default": "div"
    },
    namespace: {
      type: "string"
    }
  },
  providesContext: {
    queryId: "queryId",
    query: "query",
    displayLayout: "displayLayout"
  },
  supports: {
    align: ["wide", "full"],
    html: false,
    layout: true
  },
  editorStyle: "gc-block-query-editor"
};




const {
  name: query_name
} = query_metadata;

const query_settings = {
  icon: library_loop,
  edit: query_edit,
  save: QuerySave,
  variations: query_variations,
  deprecated: query_deprecated
};
const query_init = () => initBlock({
  name: query_name,
  metadata: query_metadata,
  settings: query_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-no-results/edit.js


/**
 * GeChiUI dependencies
 */


const query_no_results_edit_TEMPLATE = [['core/paragraph', {
  placeholder: (0,external_gc_i18n_namespaceObject.__)('添加当查询返回无结果时所要显示的文本或区块。')
}]];
function QueryNoResultsEdit() {
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    template: query_no_results_edit_TEMPLATE
  });
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-no-results/save.js


/**
 * GeChiUI dependencies
 */

function QueryNoResultsSave() {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-no-results/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const query_no_results_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/query-no-results",
  title: "无结果",
  category: "theme",
  description: "包含在没有找到查询结果的时候用于渲染内容的区块元素。",
  parent: ["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
      }
    }
  }
};


const {
  name: query_no_results_name
} = query_no_results_metadata;

const query_no_results_settings = {
  icon: library_loop,
  edit: QueryNoResultsEdit,
  save: QueryNoResultsSave
};
const query_no_results_init = () => initBlock({
  name: query_no_results_name,
  metadata: query_no_results_metadata,
  settings: query_no_results_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-pagination/query-pagination-arrow-controls.js


/**
 * GeChiUI dependencies
 */


function QueryPaginationArrowControls({
  value,
  onChange
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('箭'),
    value: value,
    onChange: onChange,
    help: (0,external_gc_i18n_namespaceObject.__)('附加到下一页和上一页链接的装饰箭头。'),
    isBlock: true
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "none",
    label: (0,external_gc_i18n_namespaceObject._x)('无', 'Arrow option for Query Pagination Next/Previous blocks')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "arrow",
    label: (0,external_gc_i18n_namespaceObject._x)('Arrow', 'Arrow option for Query Pagination Next/Previous blocks')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalToggleGroupControlOption, {
    value: "chevron",
    label: (0,external_gc_i18n_namespaceObject._x)('Chevron', 'Arrow option for Query Pagination Next/Previous blocks')
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-pagination/query-pagination-label-control.js


/**
 * GeChiUI dependencies
 */


function QueryPaginationLabelControl({
  value,
  onChange
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示label标签文本'),
    help: (0,external_gc_i18n_namespaceObject.__)('关闭以隐藏标签文本，例如："下一页"。'),
    onChange: onChange,
    checked: value === true
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-pagination/edit.js


/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */



const query_pagination_edit_TEMPLATE = [['core/query-pagination-previous'], ['core/query-pagination-numbers'], ['core/query-pagination-next']];
const query_pagination_edit_ALLOWED_BLOCKS = ['core/query-pagination-previous', 'core/query-pagination-numbers', 'core/query-pagination-next'];
function edit_QueryPaginationEdit({
  attributes: {
    paginationArrow,
    showLabel
  },
  setAttributes,
  clientId
}) {
  const hasNextPreviousBlocks = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlocks
    } = select(external_gc_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);
    });
  }, []);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    template: query_pagination_edit_TEMPLATE,
    allowedBlocks: query_pagination_edit_ALLOWED_BLOCKS
  }); // Always show label text if paginationArrow is set to 'none'.

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (paginationArrow === 'none' && !showLabel) {
      setAttributes({
        showLabel: true
      });
    }
  }, [paginationArrow, setAttributes, showLabel]);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, hasNextPreviousBlocks && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(QueryPaginationArrowControls, {
    value: paginationArrow,
    onChange: value => {
      setAttributes({
        paginationArrow: value
      });
    }
  }), paginationArrow !== 'none' && (0,external_gc_element_namespaceObject.createElement)(QueryPaginationLabelControl, {
    value: showLabel,
    onChange: value => {
      setAttributes({
        showLabel: value
      });
    }
  }))), (0,external_gc_element_namespaceObject.createElement)("nav", { ...innerBlocksProps
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-pagination/save.js


/**
 * GeChiUI dependencies
 */

function query_pagination_save_save() {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-pagination/deprecated.js


/**
 * GeChiUI dependencies
 */

const query_pagination_deprecated_deprecated = [// Version with wrapper `div` element.
{
  save() {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
  }

}];
/* harmony default export */ var query_pagination_deprecated = (query_pagination_deprecated_deprecated);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-pagination/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const query_pagination_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/query-pagination",
  title: "分页",
  category: "theme",
  parent: ["core/query"],
  description: "如果适用，显示下一组/上一组文章的分页导航。",
  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
      }
    }
  },
  editorStyle: "gc-block-query-pagination-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-pagination-next/edit.js


/**
 * GeChiUI 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 (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#pagination-next-pseudo-link",
    onClick: event => event.preventDefault(),
    ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)()
  }, showLabel && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.PlainText, {
    __experimentalVersion: 2,
    tagName: "span",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('下一页链接'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('下一页'),
    value: label,
    onChange: newLabel => setAttributes({
      label: newLabel
    })
  }), displayArrow && (0,external_gc_element_namespaceObject.createElement)("span", {
    className: `gc-block-query-pagination-next-arrow is-arrow-${paginationArrow}`,
    "aria-hidden": true
  }, displayArrow));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-pagination-next/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const query_pagination_next_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/query-pagination-next",
  title: "下一页",
  category: "theme",
  parent: ["core/query-pagination"],
  description: "显示“下一篇文章”的页面链接。",
  textdomain: "default",
  attributes: {
    label: {
      type: "string"
    }
  },
  usesContext: ["queryId", "query", "paginationArrow", "showLabel"],
  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
      }
    }
  }
};

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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-pagination-numbers/edit.js


/**
 * GeChiUI dependencies
 */


const createPaginationItem = (content, Tag = 'a', extraClass = '') => (0,external_gc_element_namespaceObject.createElement)(Tag, {
  className: `page-numbers ${extraClass}`
}, content);

const previewPaginationNumbers = () => (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, createPaginationItem(1), createPaginationItem(2), createPaginationItem(3, 'span', 'current'), createPaginationItem(4), createPaginationItem(5), createPaginationItem('...', 'span', 'dots'), createPaginationItem(8));

function QueryPaginationNumbersEdit() {
  const paginationNumbers = previewPaginationNumbers();
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)()
  }, paginationNumbers);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-pagination-numbers/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const query_pagination_numbers_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/query-pagination-numbers",
  title: "页码",
  category: "theme",
  parent: ["core/query-pagination"],
  description: "显示分页的页码列表",
  textdomain: "default",
  usesContext: ["queryId", "query"],
  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
      }
    }
  },
  editorStyle: "gc-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
};
const query_pagination_numbers_init = () => initBlock({
  name: query_pagination_numbers_name,
  metadata: query_pagination_numbers_metadata,
  settings: query_pagination_numbers_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-pagination-previous/edit.js


/**
 * GeChiUI 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 (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#pagination-previous-pseudo-link",
    onClick: event => event.preventDefault(),
    ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)()
  }, displayArrow && (0,external_gc_element_namespaceObject.createElement)("span", {
    className: `gc-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`,
    "aria-hidden": true
  }, displayArrow), showLabel && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.PlainText, {
    __experimentalVersion: 2,
    tagName: "span",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('上一页链接'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('上一页'),
    value: label,
    onChange: newLabel => setAttributes({
      label: newLabel
    })
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-pagination-previous/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const query_pagination_previous_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/query-pagination-previous",
  title: "上一页",
  category: "theme",
  parent: ["core/query-pagination"],
  description: "显示“上一篇文章”的页面链接。",
  textdomain: "default",
  attributes: {
    label: {
      type: "string"
    }
  },
  usesContext: ["queryId", "query", "paginationArrow", "showLabel"],
  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
      }
    }
  }
};

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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-title/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */




const SUPPORTED_TYPES = ['archive', 'search'];
function QueryTitleEdit({
  attributes: {
    type,
    level,
    textAlign,
    showPrefix,
    showSearchTerm
  },
  setAttributes
}) {
  const TagName = `h${level}`;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()('gc-block-query-title__placeholder', {
      [`has-text-align-${textAlign}`]: textAlign
    })
  });

  if (!SUPPORTED_TYPES.includes(type)) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('不支持提供的类型。')));
  }

  let titleElement;

  if (type === 'archive') {
    titleElement = (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
      title: (0,external_gc_i18n_namespaceObject.__)('设置')
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
      __nextHasNoMarginBottom: true,
      label: (0,external_gc_i18n_namespaceObject.__)('在标题中显示归档类型'),
      onChange: () => setAttributes({
        showPrefix: !showPrefix
      }),
      checked: showPrefix
    }))), (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
    }, showPrefix ? (0,external_gc_i18n_namespaceObject.__)('归档类型：名称') : (0,external_gc_i18n_namespaceObject.__)('归档标题')));
  }

  if (type === 'search') {
    titleElement = (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
      title: (0,external_gc_i18n_namespaceObject.__)('设置')
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
      __nextHasNoMarginBottom: true,
      label: (0,external_gc_i18n_namespaceObject.__)('在标题中显示搜索项目'),
      onChange: () => setAttributes({
        showSearchTerm: !showSearchTerm
      }),
      checked: showSearchTerm
    }))), (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
    }, showSearchTerm ? (0,external_gc_i18n_namespaceObject.__)('“搜索项目”的搜索结果') : (0,external_gc_i18n_namespaceObject.__)('搜索结果')));
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.HeadingLevelDropdown, {
    value: level,
    onChange: newLevel => setAttributes({
      level: newLevel
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), titleElement);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-title/variations.js
/**
 * GeChiUI dependencies
 */


const query_title_variations_variations = [{
  isDefault: true,
  name: 'archive-title',
  title: (0,external_gc_i18n_namespaceObject.__)('归档标题'),
  description: (0,external_gc_i18n_namespaceObject.__)('根据查询的对象显示归档标题。'),
  icon: library_title,
  attributes: {
    type: 'archive'
  },
  scope: ['inserter']
}, {
  isDefault: false,
  name: 'search-title',
  title: (0,external_gc_i18n_namespaceObject.__)('搜索结果标题'),
  description: (0,external_gc_i18n_namespaceObject.__)('根据查询的对象显示搜索结果标题。'),
  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 */ var query_title_variations = (query_title_variations_variations);

;// CONCATENATED MODULE: ./node_modules/@gechiui/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 */ var query_title_deprecated = ([query_title_deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/query-title/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const query_title_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/query-title",
  title: "查询标题",
  category: "theme",
  description: "显示查询标题。",
  textdomain: "default",
  attributes: {
    type: {
      type: "string"
    },
    textAlign: {
      type: "string"
    },
    level: {
      type: "number",
      "default": 1
    },
    showPrefix: {
      type: "boolean",
      "default": true
    },
    showSearchTerm: {
      type: "boolean",
      "default": true
    }
  },
  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,
        fontAppearance: true,
        textTransform: true
      }
    }
  },
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/quote.js


/**
 * GeChiUI dependencies
 */

const quote = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_quote = (quote);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/quote/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */



const migrateToQuoteV2 = attributes => {
  const {
    value,
    ...restAttributes
  } = attributes;
  return [{ ...restAttributes
  }, value ? (0,external_gc_blocks_namespaceObject.parseWithAttributeSchema)(value, {
    type: 'array',
    source: 'query',
    selector: 'p',
    query: {
      content: {
        type: 'string',
        source: 'html'
      }
    }
  }).map(({
    content
  }) => (0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
    content
  })) : (0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph')];
};
const quote_deprecated_v3 = {
  attributes: {
    value: {
      type: 'string',
      source: 'html',
      selector: 'blockquote',
      multiline: 'p',
      default: '',
      __experimentalRole: 'content'
    },
    citation: {
      type: 'string',
      source: 'html',
      selector: 'cite',
      default: '',
      __experimentalRole: '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 = classnames_default()({
      [`has-text-align-${align}`]: align
    });
    return (0,external_gc_element_namespaceObject.createElement)("blockquote", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      multiline: true,
      value: value
    }), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "cite",
      value: citation
    }));
  },

  migrate: migrateToQuoteV2
};
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: migrateToQuoteV2,

  save({
    attributes
  }) {
    const {
      align,
      value,
      citation
    } = attributes;
    return (0,external_gc_element_namespaceObject.createElement)("blockquote", {
      style: {
        textAlign: align ? align : null
      }
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      multiline: true,
      value: value
    }), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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 migrateToQuoteV2({ ...restAttributes,
        className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large'
      });
    }

    return migrateToQuoteV2(attributes);
  },

  save({
    attributes
  }) {
    const {
      align,
      value,
      citation,
      style
    } = attributes;
    return (0,external_gc_element_namespaceObject.createElement)("blockquote", {
      className: style === 2 ? 'is-large' : '',
      style: {
        textAlign: align ? align : null
      }
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      multiline: true,
      value: value
    }), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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 migrateToQuoteV2({ ...restAttributes
      });
    }

    return migrateToQuoteV2(attributes);
  },

  save({
    attributes
  }) {
    const {
      align,
      value,
      citation,
      style
    } = attributes;
    return (0,external_gc_element_namespaceObject.createElement)("blockquote", {
      className: `blocks-quote-style-${style}`,
      style: {
        textAlign: align ? align : null
      }
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      multiline: true,
      value: value
    }), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var quote_deprecated = ([quote_deprecated_v3, quote_deprecated_v2, quote_deprecated_v1, quote_deprecated_v0]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/quote/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */








/**
 * Internal dependencies
 */


const edit_isWebPlatform = external_gc_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_gc_data_namespaceObject.useRegistry)();
  const {
    updateBlockAttributes,
    replaceInnerBlocks
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  (0,external_gc_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_gc_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
}) {
  const {
    align,
    citation
  } = attributes;
  edit_useMigrateOnLoad(attributes, clientId);
  const hasSelection = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      isBlockSelected,
      hasSelectedInnerBlock
    } = select(external_gc_blockEditor_namespaceObject.store);
    return hasSelectedInnerBlock(clientId) || isBlockSelected(clientId);
  }, []);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()(className, {
      [`has-text-align-${align}`]: align
    }),
    ...(!edit_isWebPlatform && {
      style
    })
  });
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    template: quote_edit_TEMPLATE,
    templateInsertUpdatesSelection: true
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: align,
    onChange: nextAlign => {
      setAttributes({
        align: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.BlockQuotation, { ...innerBlocksProps
  }, innerBlocksProps.children, (!external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation) || hasSelection) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    identifier: "citation",
    tagName: edit_isWebPlatform ? 'cite' : undefined,
    style: {
      display: 'block'
    },
    value: citation,
    onChange: nextCitation => {
      setAttributes({
        citation: nextCitation
      });
    },
    __unstableMobileNoFocusOnMount: true,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('引用引文'),
    placeholder: // translators: placeholder text used for the
    // citation
    (0,external_gc_i18n_namespaceObject.__)('添加引文'),
    className: "gc-block-quote__citation",
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)())),
    ...(!edit_isWebPlatform ? {
      textAlign: align
    } : {})
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/quote/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


function quote_save_save({
  attributes
}) {
  const {
    align,
    citation
  } = attributes;
  const className = classnames_default()({
    [`has-text-align-${align}`]: align
  });
  return (0,external_gc_element_namespaceObject.createElement)("blockquote", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className
    })
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(citation) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    tagName: "cite",
    value: citation
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/quote/transforms.js
/**
 * GeChiUI dependencies
 */

const quote_transforms_transforms = {
  from: [{
    type: 'block',
    blocks: ['core/pullquote'],
    transform: ({
      value,
      citation,
      anchor,
      fontSize,
      style
    }) => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/quote', {
        citation,
        anchor,
        fontSize,
        style
      }, [(0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
        content: value
      })]);
    }
  }, {
    type: 'prefix',
    prefix: '>',
    transform: content => (0,external_gc_blocks_namespaceObject.createBlock)('core/quote', {}, [(0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
      content
    })])
  }, {
    type: 'raw',
    schema: () => ({
      blockquote: {
        children: '*'
      }
    }),
    selector: 'blockquote',
    transform: (node, handler) => {
      return (0,external_gc_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 tranformation
      // 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_gc_blocks_namespaceObject.createBlock)('core/quote', {}, blocks.map(block => (0,external_gc_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: ({
      citation,
      anchor,
      fontSize,
      style
    }, innerBlocks) => {
      const value = innerBlocks.map(({
        attributes
      }) => `${attributes.content}`).join('<br>');
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/pullquote', {
        value,
        citation,
        anchor,
        fontSize,
        style
      });
    }
  }, {
    type: 'block',
    blocks: ['core/paragraph'],
    transform: ({
      citation
    }, innerBlocks) => citation ? [...innerBlocks, (0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
      content: citation
    })] : innerBlocks
  }, {
    type: 'block',
    blocks: ['core/group'],
    transform: ({
      citation,
      anchor
    }, innerBlocks) => (0,external_gc_blocks_namespaceObject.createBlock)('core/group', {
      anchor
    }, citation ? [...innerBlocks, (0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
      content: citation
    })] : innerBlocks)
  }],
  ungroup: ({
    citation
  }, innerBlocks) => citation ? [...innerBlocks, (0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
    content: citation
  })] : innerBlocks
};
/* harmony default export */ var quote_transforms = (quote_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/quote/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const quote_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/quote",
  title: "引用",
  category: "text",
  description: "为您文中的引用增添特殊的视觉显示效果。",
  keywords: ["blockquote", "cite"],
  textdomain: "default",
  attributes: {
    value: {
      type: "string",
      source: "html",
      selector: "blockquote",
      multiline: "p",
      "default": "",
      __experimentalRole: "content"
    },
    citation: {
      type: "string",
      source: "html",
      selector: "cite",
      "default": "",
      __experimentalRole: "content"
    },
    align: {
      type: "string"
    }
  },
  supports: {
    anchor: true,
    html: false,
    __experimentalOnEnter: 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,
      link: true,
      __experimentalDefaultControls: {
        background: true,
        text: true
      }
    }
  },
  styles: [{
    name: "default",
    label: "Default",
    isDefault: true
  }, {
    name: "plain",
    label: "Plain"
  }],
  editorStyle: "gc-block-quote-editor",
  style: "gc-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_gc_i18n_namespaceObject.__)('在引用其他人时，我们引用自己。')
      }
    }]
  },
  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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/symbol.js


/**
 * GeChiUI dependencies
 */

const symbol = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_symbol = (symbol);

;// CONCATENATED MODULE: external ["gc","reusableBlocks"]
var external_gc_reusableBlocks_namespaceObject = window["gc"]["reusableBlocks"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/ungroup.js


/**
 * GeChiUI dependencies
 */

const ungroup = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_ungroup = (ungroup);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/block/edit.js


/**
 * GeChiUI dependencies
 */







function ReusableBlockEdit({
  attributes: {
    ref
  },
  clientId
}) {
  const hasAlreadyRendered = (0,external_gc_blockEditor_namespaceObject.__experimentalUseHasRecursion)(ref);
  const {
    record,
    hasResolved
  } = (0,external_gc_coreData_namespaceObject.useEntityRecord)('postType', 'gc_block', ref);
  const isMissing = hasResolved && !record;
  const {
    canRemove,
    innerBlockCount
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      canRemoveBlock,
      getBlockCount
    } = select(external_gc_blockEditor_namespaceObject.store);
    return {
      canRemove: canRemoveBlock(clientId),
      innerBlockCount: getBlockCount(clientId)
    };
  }, [clientId]);
  const {
    __experimentalConvertBlockToStatic: convertBlockToStatic
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_reusableBlocks_namespaceObject.store);
  const [blocks, onInput, onChange] = (0,external_gc_coreData_namespaceObject.useEntityBlockEditor)('postType', 'gc_block', {
    id: ref
  });
  const [title, setTitle] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', 'gc_block', 'title', ref);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: 'block-library-block__reusable-block-container'
  });
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    value: blocks,
    onInput,
    onChange,
    renderAppender: blocks?.length ? undefined : external_gc_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender
  });

  if (hasAlreadyRendered) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('区块不能在其内部渲染。')));
  }

  if (isMissing) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('区块已被删除或不可用。')));
  }

  if (!hasResolved) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null)));
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalRecursionProvider, {
    uniqueId: ref
  }, canRemove && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    onClick: () => convertBlockToStatic(clientId),
    label: innerBlockCount > 1 ? (0,external_gc_i18n_namespaceObject.__)('拆分模板') : (0,external_gc_i18n_namespaceObject.__)('拆分模板'),
    icon: library_ungroup,
    showTooltip: true
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('名称'),
    value: title,
    onChange: setTitle
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...innerBlocksProps
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/block/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const block_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/block",
  title: "区块样板",
  category: "reusable",
  description: "创建并保存内容以在整个系统中重复使用。更新模式，更改将应用于它使用的所有位置。",
  keywords: ["reusable"],
  textdomain: "default",
  attributes: {
    ref: {
      type: "number"
    }
  },
  supports: {
    customClassName: false,
    html: false,
    inserter: false
  }
};

const {
  name: block_name
} = block_metadata;

const block_settings = {
  edit: ReusableBlockEdit,
  icon: library_symbol
};
const block_init = () => initBlock({
  name: block_name,
  metadata: block_metadata,
  settings: block_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/read-more/edit.js


/**
 * GeChiUI dependencies
 */




function ReadMore({
  attributes: {
    content,
    linkTarget
  },
  setAttributes,
  insertBlocksAfter
}) {
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新窗口打开'),
    onChange: value => setAttributes({
      linkTarget: value ? '_blank' : '_self'
    }),
    checked: linkTarget === '_blank'
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    tagName: "a",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('“阅读更多”链接文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('阅读更多'),
    value: content,
    onChange: newValue => setAttributes({
      content: newValue
    }),
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)())),
    withoutInteractiveFormatting: true,
    ...blockProps
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/read-more/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const read_more_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/read-more",
  title: "阅读更多",
  category: "theme",
  description: "显示文章、页面或任何其他内容类型的链接。",
  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
      }
    }
  },
  style: "gc-block-read-more"
};

const {
  name: read_more_name
} = read_more_metadata;

const read_more_settings = {
  icon: library_link,
  edit: ReadMore
};
const read_more_init = () => initBlock({
  name: read_more_name,
  metadata: read_more_metadata,
  settings: read_more_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/rss.js


/**
 * GeChiUI dependencies
 */

const rss = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_rss = (rss);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/rss/edit.js


/**
 * GeChiUI dependencies
 */







const DEFAULT_MIN_ITEMS = 1;
const DEFAULT_MAX_ITEMS = 20;
function RSSEdit({
  attributes,
  setAttributes
}) {
  const [isEditing, setIsEditing] = (0,external_gc_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_gc_url_namespaceObject.prependHTTP)(feedURL)
      });
      setIsEditing(false);
    }
  }

  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();

  if (isEditing) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
      icon: library_rss,
      label: "RSS"
    }, (0,external_gc_element_namespaceObject.createElement)("form", {
      onSubmit: onSubmitURL,
      className: "gc-block-rss__placeholder-form"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalHStack, {
      wrap: true
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalInputControl, {
      __next36pxDefaultSize: true,
      placeholder: (0,external_gc_i18n_namespaceObject.__)('在此输入URL...' ),
      value: feedURL,
      onChange: value => setAttributes({
        feedURL: value
      }),
      className: "gc-block-rss__placeholder-input"
    }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
      variant: "primary",
      type: "submit"
    }, (0,external_gc_i18n_namespaceObject.__)('使用URL'))))));
  }

  const toolbarControls = [{
    icon: library_edit,
    title: (0,external_gc_i18n_namespaceObject.__)('编辑RSS URL'),
    onClick: () => setIsEditing(true)
  }, {
    icon: library_list,
    title: (0,external_gc_i18n_namespaceObject.__)('列表视图'),
    onClick: () => setAttributes({
      blockLayout: 'list'
    }),
    isActive: blockLayout === 'list'
  }, {
    icon: library_grid,
    title: (0,external_gc_i18n_namespaceObject.__)('网格视图'),
    onClick: () => setAttributes({
      blockLayout: 'grid'
    }),
    isActive: blockLayout === 'grid'
  }];
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, {
    controls: toolbarControls
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('项目数量'),
    value: itemsToShow,
    onChange: value => setAttributes({
      itemsToShow: value
    }),
    min: DEFAULT_MIN_ITEMS,
    max: DEFAULT_MAX_ITEMS,
    required: true
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示作者'),
    checked: displayAuthor,
    onChange: toggleAttribute('displayAuthor')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示日期'),
    checked: displayDate,
    onChange: toggleAttribute('displayDate')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示摘要'),
    checked: displayExcerpt,
    onChange: toggleAttribute('displayExcerpt')
  }), displayExcerpt && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('摘要的最大字数'),
    value: excerptLength,
    onChange: value => setAttributes({
      excerptLength: value
    }),
    min: 10,
    max: 100,
    required: true
  }), blockLayout === 'grid' && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('栏目'),
    value: columns,
    onChange: value => setAttributes({
      columns: value
    }),
    min: 2,
    max: 6,
    required: true
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Disabled, null, (0,external_gc_element_namespaceObject.createElement)((external_gc_serverSideRender_default()), {
    block: "core/rss",
    attributes: attributes
  }))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/rss/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const rss_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/rss",
  title: "RSS",
  category: "widgets",
  description: "显示来自任何RSS或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
  },
  editorStyle: "gc-block-rss-editor",
  style: "gc-block-rss"
};

const {
  name: rss_name
} = rss_metadata;

const rss_settings = {
  icon: library_rss,
  example: {
    attributes: {
      feedURL: 'https://www.gechiui.com'
    }
  },
  edit: RSSEdit
};
const rss_init = () => initBlock({
  name: rss_name,
  metadata: rss_metadata,
  settings: rss_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/search.js


/**
 * GeChiUI dependencies
 */

const search = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_search = (search);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/search/icons.js


/**
 * GeChiUI dependencies
 */

const buttonOnly = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Rect, {
  x: "7",
  y: "10",
  width: "10",
  height: "4",
  rx: "1",
  fill: "currentColor"
}));
const buttonOutside = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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"
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Rect, {
  x: "16",
  y: "10",
  width: "4",
  height: "4",
  rx: "1",
  fill: "currentColor"
}));
const buttonInside = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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"
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Rect, {
  x: "14",
  y: "10",
  width: "4",
  height: "4",
  rx: "1",
  fill: "currentColor"
}));
const noButton = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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"
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Rect, {
  x: "8",
  y: "11",
  width: "8",
  height: "2",
  fill: "currentColor"
}));
const toggleLabel = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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"
}), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Rect, {
  x: "4",
  y: "7",
  width: "10",
  height: "2",
  fill: "currentColor"
}));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/search/utils.js
/**
 * Constants
 */
const PC_WIDTH_DEFAULT = 50;
const PX_WIDTH_DEFAULT = 350;
const MIN_WIDTH = 220;
const MIN_WIDTH_UNIT = 'px';
/**
 * 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 === '%';
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/search/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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 BUTTON_BEHAVIOR_EXPAND = 'expand-searchfield';
function SearchEdit({
  className,
  attributes,
  setAttributes,
  toggleSelection,
  isSelected,
  clientId
}) {
  const {
    label,
    showLabel,
    placeholder,
    width,
    widthUnit,
    align,
    buttonText,
    buttonPosition,
    buttonUseIcon,
    buttonBehavior,
    isSearchFieldHidden,
    style
  } = attributes;
  const insertedInNavigationBlock = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlockParentsByBlockName,
      wasBlockJustInserted
    } = select(external_gc_blockEditor_namespaceObject.store);
    return !!getBlockParentsByBlockName(clientId, 'core/navigation')?.length && wasBlockJustInserted(clientId);
  }, [clientId]);
  const {
    __unstableMarkNextChangeAsNotPersistent
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!insertedInNavigationBlock) return; // This side-effect should not create an undo level.

    __unstableMarkNextChangeAsNotPersistent();

    setAttributes({
      showLabel: false,
      buttonUseIcon: true,
      buttonPosition: 'button-inside'
    });
  }, [insertedInNavigationBlock]);
  const borderRadius = style?.border?.radius;
  const borderProps = (0,external_gc_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.style.borderRadius = `${borderRadius}px`;
  }

  const colorProps = (0,external_gc_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  const fluidTypographySettings = (0,external_gc_blockEditor_namespaceObject.useSetting)('typography.fluid');
  const layout = (0,external_gc_blockEditor_namespaceObject.useSetting)('layout');
  const typographyProps = (0,external_gc_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes, {
    typography: {
      fluid: fluidTypographySettings
    },
    layout: {
      wideSize: layout?.wideSize
    }
  });
  const unitControlInstanceId = (0,external_gc_compose_namespaceObject.useInstanceId)(external_gc_components_namespaceObject.__experimentalUnitControl);
  const unitControlInputId = `gc-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_gc_element_namespaceObject.useRef)();
  const buttonRef = (0,external_gc_element_namespaceObject.useRef)();
  const units = (0,external_gc_components_namespaceObject.__experimentalUseCustomUnits)({
    availableUnits: ['%', 'px'],
    defaultValues: {
      '%': PC_WIDTH_DEFAULT,
      px: PX_WIDTH_DEFAULT
    }
  });
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (hasOnlyButton && !isSelected) {
      setAttributes({
        isSearchFieldHidden: true
      });
    }
  }, [hasOnlyButton, isSelected, setAttributes]); // Show the search field when width changes.

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!hasOnlyButton || !isSelected) {
      return;
    }

    setAttributes({
      isSearchFieldHidden: false
    });
  }, [hasOnlyButton, isSelected, setAttributes, width]);

  const getBlockClassNames = () => {
    return classnames_default()(className, isButtonPositionInside ? 'gc-block-search__button-inside' : undefined, isButtonPositionOutside ? 'gc-block-search__button-outside' : undefined, hasNoButton ? 'gc-block-search__no-button' : undefined, hasOnlyButton ? 'gc-block-search__button-only' : undefined, !buttonUseIcon && !hasNoButton ? 'gc-block-search__text-button' : undefined, buttonUseIcon && !hasNoButton ? 'gc-block-search__icon-button' : undefined, hasOnlyButton && BUTTON_BEHAVIOR_EXPAND === buttonBehavior ? 'gc-block-search__button-behavior-expand' : undefined, hasOnlyButton && isSearchFieldHidden ? 'gc-block-search__searchfield-hidden' : undefined);
  };

  const buttonPositionControls = [{
    role: 'menuitemradio',
    title: (0,external_gc_i18n_namespaceObject.__)('按钮在外部'),
    isActive: buttonPosition === 'button-outside',
    icon: buttonOutside,
    onClick: () => {
      setAttributes({
        buttonPosition: 'button-outside',
        isSearchFieldHidden: false
      });
    }
  }, {
    role: 'menuitemradio',
    title: (0,external_gc_i18n_namespaceObject.__)('按钮在内部'),
    isActive: buttonPosition === 'button-inside',
    icon: buttonInside,
    onClick: () => {
      setAttributes({
        buttonPosition: 'button-inside',
        isSearchFieldHidden: false
      });
    }
  }, {
    role: 'menuitemradio',
    title: (0,external_gc_i18n_namespaceObject.__)('无按钮'),
    isActive: buttonPosition === 'no-button',
    icon: noButton,
    onClick: () => {
      setAttributes({
        buttonPosition: 'no-button',
        isSearchFieldHidden: false
      });
    }
  }, {
    role: 'menuitemradio',
    title: (0,external_gc_i18n_namespaceObject.__)('仅按钮'),
    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 = classnames_default()('gc-block-search__input', isButtonPositionInside ? undefined : borderProps.className, typographyProps.className);
    const textFieldStyles = { ...(isButtonPositionInside ? {
        borderRadius
      } : borderProps.style),
      ...typographyProps.style,
      textDecoration: undefined
    };
    return (0,external_gc_element_namespaceObject.createElement)("input", {
      type: "search",
      className: textFieldClasses,
      style: textFieldStyles,
      "aria-label": (0,external_gc_i18n_namespaceObject.__)('可选的占位文字') // 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_gc_i18n_namespaceObject.__)('可选的占位文字...' ),
      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 = classnames_default()('gc-block-search__button', colorProps.className, typographyProps.className, isButtonPositionInside ? undefined : borderProps.className, buttonUseIcon ? 'has-icon' : undefined, (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('button'));
    const buttonStyles = { ...colorProps.style,
      ...typographyProps.style,
      ...(isButtonPositionInside ? {
        borderRadius
      } : borderProps.style)
    };

    const handleButtonClick = () => {
      if (hasOnlyButton && BUTTON_BEHAVIOR_EXPAND === buttonBehavior) {
        setAttributes({
          isSearchFieldHidden: !isSearchFieldHidden
        });
      }
    };

    return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, buttonUseIcon && (0,external_gc_element_namespaceObject.createElement)("button", {
      type: "button",
      className: buttonClasses,
      style: buttonStyles,
      "aria-label": buttonText ? (0,external_gc_dom_namespaceObject.__unstableStripHTML)(buttonText) : (0,external_gc_i18n_namespaceObject.__)('搜索'),
      onClick: handleButtonClick,
      ref: buttonRef
    }, (0,external_gc_element_namespaceObject.createElement)(build_module_icon, {
      icon: library_search
    })), !buttonUseIcon && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
      className: buttonClasses,
      style: buttonStyles,
      "aria-label": (0,external_gc_i18n_namespaceObject.__)('按钮文字'),
      placeholder: (0,external_gc_i18n_namespaceObject.__)('添加按钮文字...' ),
      withoutInteractiveFormatting: true,
      value: buttonText,
      onChange: html => setAttributes({
        buttonText: html
      }),
      onClick: handleButtonClick
    }));
  };

  const controls = (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    title: (0,external_gc_i18n_namespaceObject.__)('切换搜索标签'),
    icon: toggleLabel,
    onClick: () => {
      setAttributes({
        showLabel: !showLabel
      });
    },
    className: showLabel ? 'is-pressed' : undefined
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarDropdownMenu, {
    icon: getButtonPositionIcon(),
    label: (0,external_gc_i18n_namespaceObject.__)('更改按钮位置'),
    controls: buttonPositionControls
  }), !hasNoButton && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    title: (0,external_gc_i18n_namespaceObject.__)('使用带图标的按钮'),
    icon: buttonWithIcon,
    onClick: () => {
      setAttributes({
        buttonUseIcon: !buttonUseIcon
      });
    },
    className: buttonUseIcon ? 'is-pressed' : undefined
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('显示设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.BaseControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('宽度'),
    id: unitControlInputId
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalUnitControl, {
    id: unitControlInputId,
    min: `${MIN_WIDTH}${MIN_WIDTH_UNIT}`,
    onChange: newWidth => {
      const filteredWidth = widthUnit === '%' && parseInt(newWidth, 10) > 100 ? 100 : newWidth;
      setAttributes({
        width: parseInt(filteredWidth, 10)
      });
    },
    onUnitChange: newUnit => {
      setAttributes({
        width: '%' === newUnit ? PC_WIDTH_DEFAULT : PX_WIDTH_DEFAULT,
        widthUnit: newUnit
      });
    },
    __unstableInputWidth: '80px',
    value: `${width}${widthUnit}`,
    units: units
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ButtonGroup, {
    className: "gc-block-search__components-button-group",
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('百分比宽度')
  }, [25, 50, 75, 100].map(widthValue => {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
      key: widthValue,
      isSmall: true,
      variant: widthValue === width && widthUnit === '%' ? 'primary' : undefined,
      onClick: () => setAttributes({
        width: widthValue,
        widthUnit: '%'
      })
    }, 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_gc_blockEditor_namespaceObject.useBlockProps)({
    className: getBlockClassNames(),
    style: { ...typographyProps.style,
      // Input opts out of text decoration.
      textDecoration: undefined
    }
  });
  const labelClassnames = classnames_default()('gc-block-search__label', typographyProps.className);
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, controls, showLabel && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    className: labelClassnames,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('标签文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('添加标签...' ),
    withoutInteractiveFormatting: true,
    value: label,
    onChange: html => setAttributes({
      label: html
    }),
    style: typographyProps.style
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ResizableBox, {
    size: {
      width: `${width}${widthUnit}`
    },
    className: classnames_default()('gc-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
  }, (isButtonPositionInside || isButtonPositionOutside || hasOnlyButton) && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, renderTextField(), renderButton()), hasNoButton && renderTextField()));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/search/variations.js
/**
 * GeChiUI dependencies
 */

const search_variations_variations = [{
  name: 'default',
  isDefault: true,
  attributes: {
    buttonText: (0,external_gc_i18n_namespaceObject.__)('搜索'),
    label: (0,external_gc_i18n_namespaceObject.__)('搜索')
  }
}];
/* harmony default export */ var search_variations = (search_variations_variations);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/search/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */


const search_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/search",
  title: "搜索",
  category: "widgets",
  description: "帮助访客找到您的内容。",
  keywords: ["find"],
  textdomain: "default",
  attributes: {
    label: {
      type: "string",
      __experimentalRole: "content"
    },
    showLabel: {
      type: "boolean",
      "default": true
    },
    placeholder: {
      type: "string",
      "default": "",
      __experimentalRole: "content"
    },
    width: {
      type: "number"
    },
    widthUnit: {
      type: "string"
    },
    buttonText: {
      type: "string",
      __experimentalRole: "content"
    },
    buttonPosition: {
      type: "string",
      "default": "button-outside"
    },
    buttonUseIcon: {
      type: "boolean",
      "default": false
    },
    query: {
      type: "object",
      "default": {}
    },
    buttonBehavior: {
      type: "string",
      "default": "expand-searchfield"
    },
    isSearchFieldHidden: {
      type: "boolean",
      "default": false
    }
  },
  supports: {
    align: ["left", "center", "right"],
    color: {
      gradients: true,
      __experimentalSkipSerialization: true,
      __experimentalDefaultControls: {
        background: true,
        text: true
      }
    },
    typography: {
      __experimentalSkipSerialization: true,
      __experimentalSelector: ".gc-block-search__label, .gc-block-search__input, .gc-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
      }
    },
    html: false
  },
  viewScript: "file:./view.min.js",
  editorStyle: "gc-block-search-editor",
  style: "gc-block-search"
};


const {
  name: search_name
} = search_metadata;

const search_settings = {
  icon: library_search,
  example: {
    attributes: {
      buttonText: (0,external_gc_i18n_namespaceObject.__)('搜索'),
      label: (0,external_gc_i18n_namespaceObject.__)('搜索')
    },
    viewportWidth: 400
  },
  variations: search_variations,
  edit: SearchEdit
};
const search_init = () => initBlock({
  name: search_name,
  metadata: search_metadata,
  settings: search_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/separator.js


/**
 * GeChiUI dependencies
 */

const separator = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M4.5 12.5v4H3V7h1.5v3.987h15V7H21v9.5h-1.5v-4h-15Z"
}));
/* harmony default export */ var library_separator = (separator);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/separator/use-deprecated-opacity.js
/**
 * GeChiUI dependencies
 */


function useDeprecatedOpacity(opacity, currentColor, setAttributes) {
  const [deprecatedOpacityWithNoColor, setDeprecatedOpacityWithNoColor] = (0,external_gc_element_namespaceObject.useState)(false);
  const previousColor = (0,external_gc_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_gc_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_gc_element_namespaceObject.useEffect)(() => {
    if (opacity === 'css' && (deprecatedOpacityWithNoColor && currentColor || previousColor && currentColor !== previousColor)) {
      setAttributes({
        opacity: 'alpha-channel'
      });
      setDeprecatedOpacityWithNoColor(false);
    }
  }, [deprecatedOpacityWithNoColor, currentColor, previousColor]);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/separator/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */



/**
 * Internal dependencies
 */


function SeparatorEdit({
  attributes,
  setAttributes
}) {
  const {
    backgroundColor,
    opacity,
    style
  } = attributes;
  const colorProps = (0,external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor);
  const className = classnames_default()({
    '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
  };
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.HorizontalRule, { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)({
      className,
      style: hasCustomColor ? styles : undefined
    })
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/separator/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


function separatorSave({
  attributes
}) {
  const {
    backgroundColor,
    style,
    opacity
  } = attributes;
  const customColor = style?.color?.background;
  const colorProps = (0,external_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor);
  const className = classnames_default()({
    '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 (0,external_gc_element_namespaceObject.createElement)("hr", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className,
      style: styles
    })
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/separator/transforms.js
/**
 * GeChiUI dependencies
 */

const separator_transforms_transforms = {
  from: [{
    type: 'enter',
    regExp: /^-{3,}$/,
    transform: () => (0,external_gc_blocks_namespaceObject.createBlock)('core/separator')
  }, {
    type: 'raw',
    selector: 'hr',
    schema: {
      hr: {}
    }
  }]
};
/* harmony default export */ var separator_transforms = (separator_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/separator/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_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_gc_blockEditor_namespaceObject.getColorClassName)('color', color);
    const className = classnames_default()({
      'has-text-color has-background': color || customColor,
      [backgroundClass]: backgroundClass,
      [colorClass]: colorClass
    });
    const style = {
      backgroundColor: backgroundClass ? undefined : customColor,
      color: colorClass ? undefined : customColor
    };
    return (0,external_gc_element_namespaceObject.createElement)("hr", { ...external_gc_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
    };
  }

};
/* harmony default export */ var separator_deprecated = ([separator_deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/separator/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */



const separator_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/separator",
  title: "分隔符",
  category: "design",
  description: "用水平分隔符在点子或章节之间创造分隔符。",
  keywords: ["horizontal-line", "hr", "divider"],
  textdomain: "default",
  attributes: {
    opacity: {
      type: "string",
      "default": "alpha-channel"
    }
  },
  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"]
    }
  },
  styles: [{
    name: "default",
    label: "Default",
    isDefault: true
  }, {
    name: "wide",
    label: "宽线"
  }, {
    name: "dots",
    label: "Dots"
  }],
  editorStyle: "gc-block-separator-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/shortcode.js


/**
 * GeChiUI dependencies
 */

const shortcode = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_shortcode = (shortcode);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/shortcode/edit.js


/**
 * GeChiUI dependencies
 */




function ShortcodeEdit({
  attributes,
  setAttributes
}) {
  const instanceId = (0,external_gc_compose_namespaceObject.useInstanceId)(ShortcodeEdit);
  const inputId = `blocks-shortcode-input-${instanceId}`;
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)({
      className: 'components-placeholder'
    })
  }, (0,external_gc_element_namespaceObject.createElement)("label", {
    htmlFor: inputId,
    className: "components-placeholder__label"
  }, (0,external_gc_element_namespaceObject.createElement)(build_module_icon, {
    icon: library_shortcode
  }), (0,external_gc_i18n_namespaceObject.__)('简码')), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.PlainText, {
    className: "blocks-shortcode__textarea",
    id: inputId,
    value: attributes.text,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('简码文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('在此编写简码...' ),
    onChange: text => setAttributes({
      text
    })
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/shortcode/save.js


/**
 * GeChiUI dependencies
 */

function shortcode_save_save({
  attributes
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.RawHTML, null, attributes.text);
}

;// CONCATENATED MODULE: external ["gc","autop"]
var external_gc_autop_namespaceObject = window["gc"]["autop"];
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/shortcode/transforms.js
/**
 * GeChiUI 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.gechiui.com/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_gc_autop_namespaceObject.removep)((0,external_gc_autop_namespaceObject.autop)(content));
        }
      }
    },
    priority: 20
  }]
};
/* harmony default export */ var shortcode_transforms = (shortcode_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/shortcode/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */





const shortcode_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/shortcode",
  title: "简码",
  category: "widgets",
  description: "通过 GeChiUI 简码插入额外的自定义元素。",
  textdomain: "default",
  attributes: {
    text: {
      type: "string",
      source: "raw"
    }
  },
  supports: {
    className: false,
    customClassName: false,
    html: false
  },
  editorStyle: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/site-logo.js


/**
 * GeChiUI dependencies
 */

const siteLogo = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var site_logo = (siteLogo);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/site-logo/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */











/**
 * Internal dependencies
 */


/**
 * Module constants
 */


const site_logo_edit_ALLOWED_MEDIA_TYPES = ['image'];
const ACCEPT_MEDIA_STRING = 'image/*';

const SiteLogo = ({
  alt,
  attributes: {
    align,
    width,
    height,
    isLink,
    linkTarget,
    shouldSyncIcon
  },
  containerRef,
  isSelected,
  setAttributes,
  setLogo,
  logoUrl,
  siteUrl,
  logoId,
  iconId,
  setIcon,
  canUserEdit
}) => {
  const clientWidth = useClientWidth(containerRef, [align]);
  const isLargeViewport = (0,external_gc_compose_namespaceObject.useViewportMatch)('medium');
  const isWideAligned = ['wide', 'full'].includes(align);
  const isResizable = !isWideAligned && isLargeViewport;
  const [{
    naturalWidth,
    naturalHeight
  }, setNaturalSize] = (0,external_gc_element_namespaceObject.useState)({});
  const [isEditingImage, setIsEditingImage] = (0,external_gc_element_namespaceObject.useState)(false);
  const {
    toggleSelection
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  const classes = classnames_default()('custom-logo-link', {
    'is-transient': (0,external_gc_blob_namespaceObject.isBlobURL)(logoUrl)
  });
  const {
    imageEditing,
    maxWidth,
    title
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const settings = select(external_gc_blockEditor_namespaceObject.store).getSettings();
    const siteEntities = select(external_gc_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase');
    return {
      title: siteEntities?.name,
      imageEditing: settings.imageEditing,
      maxWidth: settings.maxWidth
    };
  }, []);
  (0,external_gc_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_gc_element_namespaceObject.useEffect)(() => {
    if (!isSelected) {
      setIsEditingImage(false);
    }
  }, [isSelected]);

  function onResizeStart() {
    toggleSelection(false);
  }

  function onResizeStop() {
    toggleSelection(true);
  }

  const img = (0,external_gc_element_namespaceObject.createElement)("img", {
    className: "custom-logo",
    src: logoUrl,
    alt: alt,
    onLoad: event => {
      setNaturalSize({
        naturalWidth: event.target.naturalWidth,
        naturalHeight: event.target.naturalHeight
      });
    }
  });
  let imgWrapper = img; // Disable reason: Image itself is not meant to be interactive, but
  // should direct focus to block.

  if (isLink) {
    imgWrapper =
    /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
    (0,external_gc_element_namespaceObject.createElement)("a", {
      href: siteUrl,
      className: classes,
      rel: "home",
      title: title,
      onClick: event => event.preventDefault()
    }, img)
    /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
    ;
  }

  let imageWidthWithinContainer;

  if (clientWidth && naturalWidth && naturalHeight) {
    const exceedMaxWidth = naturalWidth > clientWidth;
    imageWidthWithinContainer = exceedMaxWidth ? clientWidth : naturalWidth;
  }

  if (!isResizable || !imageWidthWithinContainer) {
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      style: {
        width,
        height
      }
    }, 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/GeChiUI/gutenberg/issues/7584.

  if (align === 'center') {
    // When the image is centered, show both handles.
    showRightHandle = true;
    showLeftHandle = true;
  } else if ((0,external_gc_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 ? (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalImageEditor, {
    id: logoId,
    url: logoUrl,
    width: currentWidth,
    height: currentHeight,
    clientWidth: clientWidth,
    naturalHeight: naturalHeight,
    naturalWidth: naturalWidth,
    onSaveImage: imageAttributes => {
      setLogo(imageAttributes.id);
    },
    onFinishEditing: () => {
      setIsEditingImage(false);
    }
  }) : (0,external_gc_element_namespaceObject.createElement)(external_gc_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)
      });
    }
  }, imgWrapper);
  const syncSiteIconHelpText = (0,external_gc_element_namespaceObject.createInterpolateElement)((0,external_gc_i18n_namespaceObject.__)('系统图标是你在浏览器选项卡、书签栏和GeChiUI移动应用程序中看到的内容。若要使用与系统LOGO不同的自定义图标，请使用<a>系统图标设置</a>。'), {
    a: // eslint-disable-next-line jsx-a11y/anchor-has-content
    (0,external_gc_element_namespaceObject.createElement)("a", {
      href: siteUrl + '/gc-admin/customize.php?autofocus[section]=title_tagline',
      target: "_blank",
      rel: "noopener noreferrer"
    })
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('图片宽度'),
    onChange: newWidth => setAttributes({
      width: newWidth
    }),
    min: minWidth,
    max: maxWidthBuffer,
    initialPosition: Math.min(defaultWidth, maxWidthBuffer),
    value: width || '',
    disabled: !isResizable
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('将图片链接至首页'),
    onChange: () => setAttributes({
      isLink: !isLink
    }),
    checked: isLink
  }), isLink && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新窗口打开'),
    onChange: value => setAttributes({
      linkTarget: value ? '_blank' : '_self'
    }),
    checked: linkTarget === '_blank'
  })), canUserEdit && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('用作系统图标'),
    onChange: value => {
      setAttributes({
        shouldSyncIcon: value
      });
      setIcon(value ? logoId : undefined);
    },
    checked: !!shouldSyncIcon,
    help: syncSiteIconHelpText
  })))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, canEditImage && !isEditingImage && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    onClick: () => setIsEditingImage(true),
    icon: library_crop,
    label: (0,external_gc_i18n_namespaceObject.__)('裁剪')
  })), 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({
  onRemoveLogo,
  ...mediaReplaceProps
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaReplaceFlow, { ...mediaReplaceProps,
    allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
    accept: ACCEPT_MEDIA_STRING
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItem, {
    onClick: onRemoveLogo
  }, (0,external_gc_i18n_namespaceObject.__)('重置')));
}

const InspectorLogoPreview = ({
  mediaItemData = {},
  itemGroupProps
}) => {
  const {
    alt_text: alt,
    source_url: logoUrl,
    slug: logoSlug,
    media_details: logoMediaDetails
  } = mediaItemData;
  const logoLabel = logoMediaDetails?.sizes?.full?.file || logoSlug;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalItemGroup, { ...itemGroupProps,
    as: "span"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalHStack, {
    justify: "flex-start",
    as: "span"
  }, (0,external_gc_element_namespaceObject.createElement)("img", {
    src: logoUrl,
    alt: alt
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FlexItem, {
    as: "span"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalTruncate, {
    numberOfLines: 1,
    className: "block-library-site-logo__inspector-media-replace-title"
  }, logoLabel))));
};

function LogoEdit({
  attributes,
  className,
  setAttributes,
  isSelected
}) {
  const {
    width,
    shouldSyncIcon
  } = attributes;
  const ref = (0,external_gc_element_namespaceObject.useRef)();
  const {
    siteLogoId,
    canUserEdit,
    url,
    siteIconId,
    mediaItemData,
    isRequestingMediaItem,
    mediaUpload
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      canUser,
      getEntityRecord,
      getEditedEntityRecord
    } = select(external_gc_coreData_namespaceObject.store);

    const _canUserEdit = canUser('update', 'settings');

    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_gc_coreData_namespaceObject.store).getMedia(_siteLogoId, {
      context: 'view'
    });

    const _isRequestingMediaItem = _siteLogoId && !select(external_gc_coreData_namespaceObject.store).hasFinishedResolution('getMedia', [_siteLogoId, {
      context: 'view'
    }]);

    return {
      siteLogoId: _siteLogoId,
      canUserEdit: _canUserEdit,
      url: siteData?.home,
      mediaItemData: mediaItem,
      isRequestingMediaItem: _isRequestingMediaItem,
      siteIconId: _siteIconId,
      mediaUpload: select(external_gc_blockEditor_namespaceObject.store).getSettings().mediaUpload
    };
  }, []);
  const {
    editEntityRecord
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_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.
      setLogo(undefined);
      return;
    }

    setLogo(media.id, shouldForceSync);
  };

  const onRemoveLogo = () => {
    setLogo(null);
    setAttributes({
      width: undefined
    });
  };

  const {
    createErrorNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);

  const onUploadError = message => {
    createErrorNotice(message, {
      type: 'snackbar'
    });
  };

  const onFilesDrop = filesList => {
    mediaUpload({
      allowedTypes: ['image'],
      filesList,

      onFileChange([image]) {
        if ((0,external_gc_blob_namespaceObject.isBlobURL)(image?.url)) {
          return;
        }

        onInitialSelectLogo(image);
      },

      onError: onUploadError
    });
  };

  const mediaReplaceFlowProps = {
    mediaURL: logoUrl,
    onSelect: onSelectLogo,
    onError: onUploadError,
    onRemoveLogo
  };
  const controls = canUserEdit && logoUrl && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "other"
  }, (0,external_gc_element_namespaceObject.createElement)(SiteLogoReplaceFlow, { ...mediaReplaceFlowProps
  }));
  let logoImage;
  const isLoading = siteLogoId === undefined || isRequestingMediaItem;

  if (isLoading) {
    logoImage = (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null);
  }

  if (!!logoUrl) {
    logoImage = (0,external_gc_element_namespaceObject.createElement)(SiteLogo, {
      alt: alt,
      attributes: attributes,
      className: className,
      containerRef: ref,
      isSelected: isSelected,
      setAttributes: setAttributes,
      logoUrl: logoUrl,
      setLogo: setLogo,
      logoId: mediaItemData?.id || siteLogoId,
      siteUrl: url,
      setIcon: setIcon,
      iconId: siteIconId,
      canUserEdit: canUserEdit
    });
  }

  const placeholder = content => {
    const placeholderClassName = classnames_default()('block-editor-media-placeholder', className);
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
      className: placeholderClassName,
      preview: logoImage,
      withIllustration: true,
      style: {
        width
      }
    }, content);
  };

  const classes = classnames_default()(className, {
    'is-default-size': !width
  });
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    ref,
    className: classes
  });

  const label = (0,external_gc_i18n_namespaceObject.__)('添加系统  logo');

  const mediaInspectorPanel = (canUserEdit || logoUrl) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('媒体')
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "block-library-site-logo__inspector-media-replace-container"
  }, !canUserEdit && !!logoUrl && (0,external_gc_element_namespaceObject.createElement)(InspectorLogoPreview, {
    mediaItemData: mediaItemData,
    itemGroupProps: {
      isBordered: true,
      className: 'block-library-site-logo__inspector-readonly-logo-preview'
    }
  }), canUserEdit && !!logoUrl && (0,external_gc_element_namespaceObject.createElement)(SiteLogoReplaceFlow, { ...mediaReplaceFlowProps,
    name: (0,external_gc_element_namespaceObject.createElement)(InspectorLogoPreview, {
      mediaItemData: mediaItemData
    }),
    popoverProps: {}
  }), canUserEdit && !logoUrl && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaUpload, {
    onSelect: onInitialSelectLogo,
    allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
    render: ({
      open
    }) => (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "block-library-site-logo__inspector-upload-container"
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
      onClick: open,
      variant: "secondary"
    }, isLoading ? (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null) : (0,external_gc_i18n_namespaceObject.__)('添加媒体')), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.DropZone, {
      onFilesDrop: onFilesDrop
    }))
  })))));
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, controls, mediaInspectorPanel, !!logoUrl && logoImage, !logoUrl && !canUserEdit && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
    className: "site-logo_placeholder"
  }, !!isLoading && (0,external_gc_element_namespaceObject.createElement)("span", {
    className: "components-placeholder__preview"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null))), !logoUrl && canUserEdit && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaPlaceholder, {
    onSelect: onInitialSelectLogo,
    accept: ACCEPT_MEDIA_STRING,
    allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES,
    onError: onUploadError,
    placeholder: placeholder,
    mediaLibraryButton: ({
      open
    }) => {
      return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
        icon: library_upload,
        variant: "primary",
        label: label,
        showTooltip: true,
        tooltipPosition: "top center",
        onClick: () => {
          open();
        }
      });
    }
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/site-logo/transforms.js
/**
 * GeChiUI dependencies
 */

const site_logo_transforms_transforms = {
  to: [{
    type: 'block',
    blocks: ['core/site-title'],
    transform: ({
      isLink,
      linkTarget
    }) => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/site-title', {
        isLink,
        linkTarget
      });
    }
  }]
};
/* harmony default export */ var site_logo_transforms = (site_logo_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/site-logo/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const site_logo_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/site-logo",
  title: "系统 Logo ",
  category: "theme",
  description: "显示代表该系统的图像。更新此区块后，更改将应用到所有地方。",
  textdomain: "default",
  attributes: {
    width: {
      type: "number"
    },
    isLink: {
      type: "boolean",
      "default": true
    },
    linkTarget: {
      type: "string",
      "default": "_self"
    },
    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
      }
    }
  },
  styles: [{
    name: "default",
    label: "Default",
    isDefault: true
  }, {
    name: "rounded",
    label: "Rounded"
  }],
  editorStyle: "gc-block-site-logo-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/site-tagline/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */






function SiteTaglineEdit({
  attributes,
  setAttributes,
  insertBlocksAfter
}) {
  const {
    textAlign
  } = attributes;
  const {
    canUserEdit,
    tagline
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      canUser,
      getEntityRecord,
      getEditedEntityRecord
    } = select(external_gc_coreData_namespaceObject.store);
    const canEdit = canUser('update', 'settings');
    const settings = canEdit ? getEditedEntityRecord('root', 'site') : {};
    const readOnlySettings = getEntityRecord('root', '__unstableBase');
    return {
      canUserEdit: canUser('update', 'settings'),
      tagline: canEdit ? settings?.description : readOnlySettings?.description
    };
  }, []);
  const {
    editEntityRecord
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_coreData_namespaceObject.store);

  function setTagline(newTagline) {
    editEntityRecord('root', 'site', undefined, {
      description: newTagline
    });
  }

  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign,
      'gc-block-site-tagline__placeholder': !canUserEdit && !tagline
    })
  });
  const siteTaglineContent = canUserEdit ? (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    allowedFormats: [],
    onChange: setTagline,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('系统副标题文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('填写系统副标题...' ),
    tagName: "p",
    value: tagline,
    disableLineBreaks: true,
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)())),
    ...blockProps
  }) : (0,external_gc_element_namespaceObject.createElement)("p", { ...blockProps
  }, tagline || (0,external_gc_i18n_namespaceObject.__)('系统副标题占位符'));
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    onChange: newAlign => setAttributes({
      textAlign: newAlign
    }),
    value: textAlign
  })), siteTaglineContent);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/site-tagline/icon.js


/**
 * GeChiUI dependencies
 */

/* harmony default export */ var site_tagline_icon = ((0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  width: "24",
  height: "24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
  d: "M4 10.5h16V9H4v1.5ZM4 15h9v-1.5H4V15Z"
})));

;// CONCATENATED MODULE: ./node_modules/@gechiui/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 */ var site_tagline_deprecated = ([site_tagline_deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/site-tagline/index.js
/**
 * Internal dependencies
 */

const site_tagline_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/site-tagline",
  title: "系统副标题",
  category: "theme",
  description: "用几句话描述一下这个系统是关于什么的。副标题可以用于搜索结果或在社交网络上共享，即使它没有显示在主题设计中。",
  keywords: ["description"],
  textdomain: "default",
  attributes: {
    textAlign: {
      type: "string"
    }
  },
  example: {},
  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,
      __experimentalDefaultControls: {
        fontSize: true
      }
    }
  },
  editorStyle: "gc-block-site-tagline-editor"
};



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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/map-marker.js


/**
 * GeChiUI dependencies
 */

const mapMarker = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "https://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var map_marker = (mapMarker);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/site-title/edit/index.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */








const HEADING_LEVELS = [0, 1, 2, 3, 4, 5, 6];
function SiteTitleEdit({
  attributes,
  setAttributes,
  insertBlocksAfter
}) {
  const {
    level,
    textAlign,
    isLink,
    linkTarget
  } = attributes;
  const {
    canUserEdit,
    title
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      canUser,
      getEntityRecord,
      getEditedEntityRecord
    } = select(external_gc_coreData_namespaceObject.store);
    const canEdit = canUser('update', 'settings');
    const settings = canEdit ? getEditedEntityRecord('root', 'site') : {};
    const readOnlySettings = getEntityRecord('root', '__unstableBase');
    return {
      canUserEdit: canEdit,
      title: canEdit ? settings?.title : readOnlySettings?.name
    };
  }, []);
  const {
    editEntityRecord
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_coreData_namespaceObject.store);

  function setTitle(newTitle) {
    editEntityRecord('root', 'site', undefined, {
      title: newTitle
    });
  }

  const TagName = level === 0 ? 'p' : `h${level}`;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign,
      'gc-block-site-title__placeholder': !canUserEdit && !title
    })
  });
  const siteTitleContent = canUserEdit ? (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    tagName: isLink ? 'a' : 'span',
    href: isLink ? '#site-title-pseudo-link' : undefined,
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('系统标题文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('填写系统标题...' ),
    value: title,
    onChange: setTitle,
    allowedFormats: [],
    disableLineBreaks: true,
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)()))
  })) : (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
  }, isLink ? (0,external_gc_element_namespaceObject.createElement)("a", {
    href: "#site-title-pseudo-link",
    onClick: event => event.preventDefault()
  }, (0,external_gc_htmlEntities_namespaceObject.decodeEntities)(title) || (0,external_gc_i18n_namespaceObject.__)('系统标题占位符')) : (0,external_gc_element_namespaceObject.createElement)("span", null, (0,external_gc_htmlEntities_namespaceObject.decodeEntities)(title) || (0,external_gc_i18n_namespaceObject.__)('系统标题占位符')));
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.HeadingLevelDropdown, {
    options: HEADING_LEVELS,
    value: level,
    onChange: newLevel => setAttributes({
      level: newLevel
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('将标题链接到主页'),
    onChange: () => setAttributes({
      isLink: !isLink
    }),
    checked: isLink
  }), isLink && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新窗口打开'),
    onChange: value => setAttributes({
      linkTarget: value ? '_blank' : '_self'
    }),
    checked: linkTarget === '_blank'
  }))), siteTitleContent);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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 */ var site_title_deprecated = ([site_title_deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/site-title/transforms.js
/**
 * GeChiUI dependencies
 */

const site_title_transforms_transforms = {
  to: [{
    type: 'block',
    blocks: ['core/site-logo'],
    transform: ({
      isLink,
      linkTarget
    }) => {
      return (0,external_gc_blocks_namespaceObject.createBlock)('core/site-logo', {
        isLink,
        linkTarget
      });
    }
  }]
};
/* harmony default export */ var site_title_transforms = (site_title_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/site-title/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const site_title_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/site-title",
  title: "系统标题",
  category: "theme",
  description: "显示此系统的名称。更新该区块后，其更改将显示在所有应用该区块的位置。也会显示在浏览器标题栏和搜索结果中。",
  textdomain: "default",
  attributes: {
    level: {
      type: "number",
      "default": 1
    },
    textAlign: {
      type: "string"
    },
    isLink: {
      type: "boolean",
      "default": true
    },
    linkTarget: {
      type: "string",
      "default": "_self"
    }
  },
  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,
      __experimentalDefaultControls: {
        fontSize: true,
        lineHeight: true,
        fontAppearance: true,
        letterSpacing: true,
        textTransform: true
      }
    }
  },
  editorStyle: "gc-block-site-title-editor",
  style: "gc-block-site-title"
};



const {
  name: site_title_name
} = site_title_metadata;

const site_title_settings = {
  icon: map_marker,
  example: {},
  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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/share.js


/**
 * GeChiUI dependencies
 */

const share = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_share = (share);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/keyboard-return.js


/**
 * GeChiUI dependencies
 */

const keyboardReturn = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "-2 -2 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"
}));
/* harmony default export */ var keyboard_return = (keyboardReturn);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/social-link/icons/gechiui.js


/**
 * GeChiUI dependencies
 */

const GeChiUIIcon = () => (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  width: "24",
  height: "24",
  viewBox: "0 0 24 24",
  version: "1.1",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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"
}));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/social-link/icons/chain.js


/**
 * GeChiUI dependencies
 */

const ChainIcon = () => (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  width: "24",
  height: "24",
  viewBox: "0 0 24 24",
  version: "1.1"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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"
}));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/social-link/icons/feed.js


/**
 * GeChiUI dependencies
 */

const FeedIcon = () => (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  width: "24",
  height: "24",
  viewBox: "0 0 24 24",
  version: "1.1"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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"
}));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/social-link/icons/mail.js


/**
 * GeChiUI dependencies
 */

const MailIcon = () => (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  width: "24",
  height: "24",
  viewBox: "0 0 24 24",
  version: "1.1"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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"
}));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/social-link/variations.js
/**
 * Internal dependencies
 */

const social_link_variations_variations = [{
  isDefault: true,
  name: 'gechiui',
  attributes: {
    service: 'gechiui'
  },
  title: 'GeChiUI',
  icon: GeChiUIIcon
}, {
  name: 'chain',
  attributes: {
    service: 'chain'
  },
  title: 'Chain',
  icon: ChainIcon
},{
  name: 'feed',
  attributes: {
    service: 'feed'
  },
  title: 'RSS Feed',
  icon: FeedIcon
},{
  name: 'mail',
  attributes: {
    service: 'mail'
  },
  title: 'Mail',
  keywords: ['email', 'e-mail'],
  icon: MailIcon
}];
/**
 * 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 */ var social_link_variations = (social_link_variations_variations);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/social-link/social-list.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */



/**
 * Retrieves the social service's icon component.
 *
 * @param {string} name key for a social service (lowercase slug)
 *
 * @return {GCComponent} 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_gc_i18n_namespaceObject.__)('社交图标');
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/social-link/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */








/**
 * Internal dependencies
 */



const SocialLinkURLPopover = ({
  url,
  setAttributes,
  setPopover,
  popoverAnchor,
  clientId
}) => {
  const {
    removeBlock
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.URLPopover, {
    anchor: popoverAnchor,
    onClose: () => setPopover(false)
  }, (0,external_gc_element_namespaceObject.createElement)("form", {
    className: "block-editor-url-popover__link-editor",
    onSubmit: event => {
      event.preventDefault();
      setPopover(false);
    }
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "block-editor-url-input"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.URLInput, {
    __nextHasNoMarginBottom: true,
    value: url,
    onChange: nextURL => setAttributes({
      url: nextURL
    }),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('输入地址'),
    disableSuggestions: true,
    onKeyDown: event => {
      if (!!url || event.defaultPrevented || ![external_gc_keycodes_namespaceObject.BACKSPACE, external_gc_keycodes_namespaceObject.DELETE].includes(event.keyCode)) {
        return;
      }

      removeBlock(clientId);
    }
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    icon: keyboard_return,
    label: (0,external_gc_i18n_namespaceObject.__)('应用'),
    type: "submit"
  })));
};

const SocialLinkEdit = ({
  attributes,
  context,
  isSelected,
  setAttributes,
  clientId
}) => {
  const {
    url,
    service,
    label,
    rel
  } = attributes;
  const {
    showLabels,
    iconColor,
    iconColorValue,
    iconBackgroundColor,
    iconBackgroundColorValue
  } = context;
  const [showURLPopover, setPopover] = (0,external_gc_element_namespaceObject.useState)(false);
  const classes = classnames_default()('gc-social-link', 'gc-social-link-' + service, {
    'gc-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_gc_element_namespaceObject.useState)(null);
  const IconComponent = getIconBySite(service);
  const socialLinkName = getNameBySite(service);
  const socialLinkLabel = label !== null && label !== void 0 ? label : socialLinkName;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classes,
    style: {
      color: iconColorValue,
      backgroundColor: iconBackgroundColorValue
    }
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: name of the social service. */
    (0,external_gc_i18n_namespaceObject.__)('%s标签'), socialLinkName),
    initialOpen: false
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelRow, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('链接标签'),
    help: (0,external_gc_i18n_namespaceObject.__)('简短描述此链接以帮助屏幕阅读器用户。'),
    value: label || '',
    onChange: value => setAttributes({
      label: value
    })
  })))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "advanced"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('链接rel'),
    value: rel || '',
    onChange: value => setAttributes({
      rel: value
    })
  })), (0,external_gc_element_namespaceObject.createElement)("li", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    className: "gc-block-social-link-anchor",
    ref: setPopoverAnchor,
    onClick: () => setPopover(true)
  }, (0,external_gc_element_namespaceObject.createElement)(IconComponent, null), (0,external_gc_element_namespaceObject.createElement)("span", {
    className: classnames_default()('gc-block-social-link-label', {
      'screen-reader-text': !showLabels
    })
  }, socialLinkLabel), isSelected && showURLPopover && (0,external_gc_element_namespaceObject.createElement)(SocialLinkURLPopover, {
    url: url,
    setAttributes: setAttributes,
    setPopover: setPopover,
    popoverAnchor: popoverAnchor,
    clientId: clientId
  }))));
};

/* harmony default export */ var social_link_edit = (SocialLinkEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/social-link/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */



const social_link_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/social-link",
  title: "社交图标",
  category: "widgets",
  parent: ["core/social-links"],
  description: "显示链接至您的社交媒体资料或系统的图标。",
  textdomain: "default",
  attributes: {
    url: {
      type: "string"
    },
    service: {
      type: "string"
    },
    label: {
      type: "string"
    },
    rel: {
      type: "string"
    }
  },
  usesContext: ["openInNewTab", "showLabels", "iconColor", "iconColorValue", "iconBackgroundColor", "iconBackgroundColorValue"],
  supports: {
    reusable: false,
    html: false
  },
  editorStyle: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/social-links/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


/**
 * The specific handling by `className` below is needed because `itemsJustification`
 * was introduced in https://github.com/GeChiUI/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 = classnames_default()(size, {
      'has-icon-color': iconColorValue,
      'has-icon-background-color': iconBackgroundColorValue,
      [`items-justified-${itemsJustification}`]: itemsJustification
    });
    const style = {
      '--gc--social-links--icon-color': iconColorValue,
      '--gc--social-links--icon-background-color': iconBackgroundColorValue
    };
    return (0,external_gc_element_namespaceObject.createElement)("ul", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className,
        style
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InnerBlocks.Content, null));
  }
}];
/* harmony default export */ var social_links_deprecated = (social_links_deprecated_deprecated);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/check.js


/**
 * GeChiUI dependencies
 */

const check = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_check = (check);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/social-links/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */






const social_links_edit_ALLOWED_BLOCKS = ['core/social-link'];
const sizeOptions = [{
  name: (0,external_gc_i18n_namespaceObject.__)('小'),
  value: 'has-small-icon-size'
}, {
  name: (0,external_gc_i18n_namespaceObject.__)('常规'),
  value: 'has-normal-icon-size'
}, {
  name: (0,external_gc_i18n_namespaceObject.__)('大'),
  value: 'has-large-icon-size'
}, {
  name: (0,external_gc_i18n_namespaceObject.__)('特大'),
  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 logosOnly = attributes.className?.includes('is-style-logos-only'); // Remove icon background color when logos only style is selected or
  // restore it when any other style is selected.

  const backgroundBackup = (0,external_gc_element_namespaceObject.useRef)({});
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (logosOnly) {
      backgroundBackup.current = {
        iconBackgroundColor,
        iconBackgroundColorValue,
        customIconBackgroundColor
      };
      setAttributes({
        iconBackgroundColor: undefined,
        customIconBackgroundColor: undefined,
        iconBackgroundColorValue: undefined
      });
    } else {
      setAttributes({ ...backgroundBackup.current
      });
    }
  }, [logosOnly]);
  const SocialPlaceholder = (0,external_gc_element_namespaceObject.createElement)("li", {
    className: "gc-block-social-links__social-placeholder"
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-social-links__social-placeholder-icons"
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-social-link gc-social-link-twitter"
  }), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-social-link gc-social-link-facebook"
  }), (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-social-link gc-social-link-instagram"
  })));
  const SelectedSocialPlaceholder = (0,external_gc_element_namespaceObject.createElement)("li", {
    className: "gc-block-social-links__social-prompt"
  }, (0,external_gc_i18n_namespaceObject.__)('点击加号以添加')); // Fallback color values are used maintain selections in case switching
  // themes and named colors in palette do not match.

  const className = classnames_default()(size, {
    'has-visible-labels': showLabels,
    'has-icon-color': iconColor.color || iconColorValue,
    'has-icon-background-color': iconBackgroundColor.color || iconBackgroundColorValue
  });
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className
  });
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    allowedBlocks: social_links_edit_ALLOWED_BLOCKS,
    placeholder: isSelected ? SelectedSocialPlaceholder : SocialPlaceholder,
    templateLock: false,
    orientation: (_attributes$layout$or = attributes.layout?.orientation) !== null && _attributes$layout$or !== void 0 ? _attributes$layout$or : 'horizontal',
    __experimentalAppenderTagName: 'li'
  });
  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_gc_i18n_namespaceObject.__)('图标颜色'),
    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_gc_i18n_namespaceObject.__)('图标背景'),
      resetAllFilter: () => {
        setIconBackgroundColor(undefined);
        setAttributes({
          iconBackgroundColorValue: undefined
        });
      }
    });
  }

  const colorGradientSettings = (0,external_gc_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)();
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "other"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarDropdownMenu, {
    label: (0,external_gc_i18n_namespaceObject.__)('尺寸'),
    text: (0,external_gc_i18n_namespaceObject.__)('尺寸'),
    icon: null,
    popoverProps: POPOVER_PROPS
  }, ({
    onClose
  }) => (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuGroup, null, sizeOptions.map(entry => {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItem, {
      icon: (size === entry.value || !size && entry.value === 'has-normal-icon-size') && library_check,
      isSelected: size === entry.value,
      key: entry.value,
      onClick: () => {
        setAttributes({
          size: entry.value
        });
      },
      onClose: onClose,
      role: "menuitemradio"
    }, entry.name);
  })))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('在新标签页中打开链接'),
    checked: openInNewTab,
    onChange: () => setAttributes({
      openInNewTab: !openInNewTab
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示标签'),
    checked: showLabels,
    onChange: () => setAttributes({
      showLabels: !showLabels
    })
  }))), colorGradientSettings.hasColorsOrGradients && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "color"
  }, colorSettings.map(({
    onChange,
    label,
    value,
    resetAllFilter
  }) => (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, {
    key: `social-links-color-${label}`,
    __experimentalIsRenderedInSidebar: true,
    settings: [{
      colorValue: value,
      label,
      onColorChange: onChange,
      isShownByDefault: true,
      resetAllFilter,
      enableAlpha: true
    }],
    panelId: clientId,
    ...colorGradientSettings
  })), !logosOnly && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.ContrastChecker, {
    textColor: iconColorValue,
    backgroundColor: iconBackgroundColorValue,
    isLargeText: false
  })), (0,external_gc_element_namespaceObject.createElement)("ul", { ...innerBlocksProps
  }));
}
const iconColorAttributes = {
  iconColor: 'icon-color',
  iconBackgroundColor: 'icon-background-color'
};
/* harmony default export */ var social_links_edit = ((0,external_gc_blockEditor_namespaceObject.withColors)(iconColorAttributes)(SocialLinksEdit));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/social-links/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


function social_links_save_save(props) {
  const {
    attributes: {
      iconBackgroundColorValue,
      iconColorValue,
      showLabels,
      size
    }
  } = props;
  const className = classnames_default()(size, {
    'has-visible-labels': showLabels,
    'has-icon-color': iconColorValue,
    'has-icon-background-color': iconBackgroundColorValue
  });
  const blockProps = external_gc_blockEditor_namespaceObject.useBlockProps.save({
    className
  });
  const innerBlocksProps = external_gc_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps);
  return (0,external_gc_element_namespaceObject.createElement)("ul", { ...innerBlocksProps
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/social-links/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */




const social_links_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/social-links",
  title: "社交图标",
  category: "widgets",
  description: "显示链接到您的社交媒体资料或系统的图标。",
  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
      }
    }
  },
  styles: [{
    name: "default",
    label: "Default",
    isDefault: true
  }, {
    name: "logos-only",
    label: "仅 Logo"
  }, {
    name: "pill-shape",
    label: "药丸形状"
  }],
  editorStyle: "gc-block-social-links-editor",
  style: "gc-block-social-links"
};

const {
  name: social_links_name
} = social_links_metadata;

const social_links_settings = {
  example: {
    innerBlocks: [{
      name: 'core/social-link',
      attributes: {
        service: 'gechiui',
        url: 'https://www.gechiui.com'
      }
    }, {
      name: 'core/social-link',
      attributes: {
        service: 'facebook',
        url: 'https://www.facebook.com/GeChiUI/'
      }
    }, {
      name: 'core/social-link',
      attributes: {
        service: 'twitter',
        url: 'https://twitter.com/GeChiUI'
      }
    }]
  },
  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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/resize-corner-n-e.js


/**
 * GeChiUI dependencies
 */

const resizeCornerNE = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M7 18h4.5v1.5h-7v-7H6V17L17 6h-4.5V4.5h7v7H18V7L7 18Z"
}));
/* harmony default export */ var resize_corner_n_e = (resizeCornerNE);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/spacer/deprecated.js


/**
 * GeChiUI 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 (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        style: {
          height: attributes.height,
          width: attributes.width
        },
        'aria-hidden': true
      })
    });
  }

}];
/* harmony default export */ var spacer_deprecated = (spacer_deprecated_deprecated);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/spacer/constants.js
const MIN_SPACER_SIZE = 0;

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/spacer/controls.js


/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */



function DimensionInput({
  label,
  onChange,
  isResizing,
  value = ''
}) {
  const inputId = (0,external_gc_compose_namespaceObject.useInstanceId)(external_gc_components_namespaceObject.__experimentalUnitControl, 'block-spacer-height-input');
  const spacingSizes = (0,external_gc_blockEditor_namespaceObject.useSetting)('spacing.spacingSizes'); // 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 availableUnitSettings = ((0,external_gc_blockEditor_namespaceObject.useSetting)('spacing.units') || undefined)?.filter(availableUnit => availableUnit !== '%');
  const units = (0,external_gc_components_namespaceObject.__experimentalUseCustomUnits)({
    availableUnits: availableUnitSettings || ['px', 'em', 'rem', 'vw', 'vh'],
    defaultValues: {
      px: 100,
      em: 10,
      rem: 10,
      vw: 10,
      vh: 25
    }
  });

  const handleOnChange = unprocessedValue => {
    onChange(unprocessedValue.all);
  }; // Force the unit to update to `px` when the Spacer is being resized.


  const [parsedQuantity, parsedUnit] = (0,external_gc_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
  const computedValue = (0,external_gc_blockEditor_namespaceObject.isValueSpacingPreset)(value) ? value : [parsedQuantity, isResizing ? 'px' : parsedUnit].join('');
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (!spacingSizes || spacingSizes?.length === 0) && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.BaseControl, {
    label: label,
    id: inputId
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalUnitControl, {
    id: inputId,
    isResetValueOnUnitChange: true,
    min: MIN_SPACER_SIZE,
    onChange: handleOnChange,
    style: {
      maxWidth: 80
    },
    value: computedValue,
    units: units
  })), spacingSizes?.length > 0 && (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.View, {
    className: "tools-panel-item-spacing"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalSpacingSizesControl, {
    values: {
      all: computedValue
    },
    onChange: handleOnChange,
    label: label,
    sides: ['all'],
    units: units,
    allowReset: false,
    splitOnAxis: false,
    showSideInLabel: false
  })));
}

function SpacerControls({
  setAttributes,
  orientation,
  height,
  width,
  isResizing
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, orientation === 'horizontal' && (0,external_gc_element_namespaceObject.createElement)(DimensionInput, {
    label: (0,external_gc_i18n_namespaceObject.__)('宽度'),
    value: width,
    onChange: nextWidth => setAttributes({
      width: nextWidth
    }),
    isResizing: isResizing
  }), orientation !== 'horizontal' && (0,external_gc_element_namespaceObject.createElement)(DimensionInput, {
    label: (0,external_gc_i18n_namespaceObject.__)('高度'),
    value: height,
    onChange: nextHeight => setAttributes({
      height: nextHeight
    }),
    isResizing: isResizing
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/spacer/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */




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 (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ResizableBox, {
    className: classnames_default()('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_gc_data_namespaceObject.useSelect)(select => {
    const editorSettings = select(external_gc_blockEditor_namespaceObject.store).getSettings();
    return editorSettings?.disableCustomSpacingSizes;
  });
  const {
    orientation
  } = context;
  const {
    orientation: parentOrientation,
    type
  } = parentLayout || {}; // Check if the spacer is inside a flex container.

  const isFlexLayout = type === '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 = (0,external_gc_blockEditor_namespaceObject.useSetting)('spacing.spacingSizes');
  const [isResizing, setIsResizing] = (0,external_gc_element_namespaceObject.useState)(false);
  const [temporaryHeight, setTemporaryHeight] = (0,external_gc_element_namespaceObject.useState)(null);
  const [temporaryWidth, setTemporaryWidth] = (0,external_gc_element_namespaceObject.useState)(null);

  const onResizeStart = () => toggleSelection(false);

  const onResizeStop = () => toggleSelection(true);

  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_gc_blockEditor_namespaceObject.getSpacingPresetCssVar)(height) || undefined;
  };

  const getWidthForHorizontalBlocks = () => {
    if (isFlexLayout) {
      return undefined;
    }

    return temporaryWidth || (0,external_gc_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 (0,external_gc_element_namespaceObject.createElement)(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 (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(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_gc_element_namespaceObject.useEffect)(() => {
    if (isFlexLayout && selfStretch !== 'fill' && selfStretch !== 'fit' && !flexSize) {
      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_gc_blockEditor_namespaceObject.getCustomValueFromPreset)(width, spacingSizes) || (0,external_gc_blockEditor_namespaceObject.getCustomValueFromPreset)(height, spacingSizes) || '100px';
        setAttributes({
          width: '0px',
          style: { ...blockStyle,
            layout: { ...layout,
              flexSize: newSize,
              selfStretch: 'fixed'
            }
          }
        });
      } else {
        const newSize = (0,external_gc_blockEditor_namespaceObject.getCustomValueFromPreset)(height, spacingSizes) || (0,external_gc_blockEditor_namespaceObject.getCustomValueFromPreset)(width, spacingSizes) || '100px';
        setAttributes({
          height: '0px',
          style: { ...blockStyle,
            layout: { ...layout,
              flexSize: newSize,
              selfStretch: 'fixed'
            }
          }
        });
      }
    } else if (isFlexLayout && (selfStretch === 'fill' || selfStretch === 'fit')) {
      if (inheritedOrientation === 'horizontal') {
        setAttributes({
          width: undefined
        });
      } else {
        setAttributes({
          height: undefined
        });
      }
    } else if (!isFlexLayout && (selfStretch || flexSize)) {
      if (inheritedOrientation === 'horizontal') {
        setAttributes({
          width: flexSize
        });
      } else {
        setAttributes({
          height: flexSize
        });
      }

      setAttributes({
        style: { ...blockStyle,
          layout: { ...layout,
            flexSize: undefined,
            selfStretch: undefined
          }
        }
      });
    }
  }, [blockStyle, flexSize, height, inheritedOrientation, isFlexLayout, layout, selfStretch, setAttributes, spacingSizes, width]);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.View, { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)({
      style,
      className: classnames_default()(className, {
        'custom-sizes-disabled': disableCustomSpacingSizes
      })
    })
  }, resizableBoxWithOrientation(inheritedOrientation)), !isFlexLayout && (0,external_gc_element_namespaceObject.createElement)(SpacerControls, {
    setAttributes: setAttributes,
    height: temporaryHeight || height,
    width: temporaryWidth || width,
    orientation: inheritedOrientation,
    isResizing: isResizing
  }));
};

/* harmony default export */ var spacer_edit = (SpacerEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/spacer/save.js


/**
 * GeChiUI 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 (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      style: {
        height: (0,external_gc_blockEditor_namespaceObject.getSpacingPresetCssVar)(finalHeight),
        width: (0,external_gc_blockEditor_namespaceObject.getSpacingPresetCssVar)(width)
      },
      'aria-hidden': true
    })
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/spacer/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */




const spacer_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/spacer",
  title: "空格",
  category: "design",
  description: "在区块间添加空白并自定义其高度。",
  textdomain: "default",
  attributes: {
    height: {
      type: "string",
      "default": "100px"
    },
    width: {
      type: "string"
    }
  },
  usesContext: ["orientation"],
  supports: {
    anchor: true,
    spacing: {
      margin: ["top", "bottom"],
      __experimentalDefaultControls: {
        margin: true
      }
    }
  },
  editorStyle: "gc-block-spacer-editor",
  style: "gc-block-spacer"
};

const {
  name: spacer_name
} = spacer_metadata;

const spacer_settings = {
  icon: resize_corner_n_e,
  edit: spacer_edit,
  save: spacer_save_save,
  deprecated: spacer_deprecated
};
const spacer_init = () => initBlock({
  name: spacer_name,
  metadata: spacer_metadata,
  settings: spacer_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/block-table.js


/**
 * GeChiUI dependencies
 */

const blockTable = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var block_table = (blockTable);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/table/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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'
}; // In #41140 support was added to global styles for caption elements which
// added a `gc-element-caption` classname to the embed figcaption element.

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: {
            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'
            }
          }
        }
      }
    },
    body: {
      type: 'array',
      default: [],
      source: 'query',
      selector: 'tbody tr',
      query: {
        cells: {
          type: 'array',
          default: [],
          source: 'query',
          selector: 'td,th',
          query: {
            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'
            }
          }
        }
      }
    },
    foot: {
      type: 'array',
      default: [],
      source: 'query',
      selector: 'tfoot tr',
      query: {
        cells: {
          type: 'array',
          default: [],
          source: 'query',
          selector: 'td,th',
          query: {
            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'
            }
          }
        }
      }
    }
  },
  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: '.gc-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_gc_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
    const borderProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
    const classes = classnames_default()(colorProps.className, borderProps.className, {
      'has-fixed-layout': hasFixedLayout
    });
    const hasCaption = !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption);

    const Section = ({
      type,
      rows
    }) => {
      if (!rows.length) {
        return null;
      }

      const Tag = `t${type}`;
      return (0,external_gc_element_namespaceObject.createElement)(Tag, null, rows.map(({
        cells
      }, rowIndex) => (0,external_gc_element_namespaceObject.createElement)("tr", {
        key: rowIndex
      }, cells.map(({
        content,
        tag,
        scope,
        align
      }, cellIndex) => {
        const cellClasses = classnames_default()({
          [`has-text-align-${align}`]: align
        });
        return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
          className: cellClasses ? cellClasses : undefined,
          "data-align": align,
          tagName: tag,
          value: content,
          key: cellIndex,
          scope: tag === 'th' ? scope : undefined
        });
      }))));
    };

    return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
    }, (0,external_gc_element_namespaceObject.createElement)("table", {
      className: classes === '' ? undefined : classes,
      style: { ...colorProps.style,
        ...borderProps.style
      }
    }, (0,external_gc_element_namespaceObject.createElement)(Section, {
      type: "head",
      rows: head
    }), (0,external_gc_element_namespaceObject.createElement)(Section, {
      type: "body",
      rows: body
    }), (0,external_gc_element_namespaceObject.createElement)(Section, {
      type: "foot",
      rows: foot
    })), hasCaption && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "figcaption",
      value: caption
    }));
  }

}; // Deprecation migrating table block to use colors block support feature.

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: {
            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'
            }
          }
        }
      }
    },
    body: {
      type: 'array',
      default: [],
      source: 'query',
      selector: 'tbody tr',
      query: {
        cells: {
          type: 'array',
          default: [],
          source: 'query',
          selector: 'td,th',
          query: {
            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'
            }
          }
        }
      }
    },
    foot: {
      type: 'array',
      default: [],
      source: 'query',
      selector: 'tfoot tr',
      query: {
        cells: {
          type: 'array',
          default: [],
          source: 'query',
          selector: 'td,th',
          query: {
            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'
            }
          }
        }
      }
    }
  },
  supports: {
    anchor: true,
    align: true,
    __experimentalSelector: '.gc-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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const classes = classnames_default()(backgroundClass, {
      'has-fixed-layout': hasFixedLayout,
      'has-background': !!backgroundClass
    });
    const hasCaption = !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption);

    const Section = ({
      type,
      rows
    }) => {
      if (!rows.length) {
        return null;
      }

      const Tag = `t${type}`;
      return (0,external_gc_element_namespaceObject.createElement)(Tag, null, rows.map(({
        cells
      }, rowIndex) => (0,external_gc_element_namespaceObject.createElement)("tr", {
        key: rowIndex
      }, cells.map(({
        content,
        tag,
        scope,
        align
      }, cellIndex) => {
        const cellClasses = classnames_default()({
          [`has-text-align-${align}`]: align
        });
        return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
          className: cellClasses ? cellClasses : undefined,
          "data-align": align,
          tagName: tag,
          value: content,
          key: cellIndex,
          scope: tag === 'th' ? scope : undefined
        });
      }))));
    };

    return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
    }, (0,external_gc_element_namespaceObject.createElement)("table", {
      className: classes === '' ? undefined : classes
    }, (0,external_gc_element_namespaceObject.createElement)(Section, {
      type: "head",
      rows: head
    }), (0,external_gc_element_namespaceObject.createElement)(Section, {
      type: "body",
      rows: body
    }), (0,external_gc_element_namespaceObject.createElement)(Section, {
      type: "foot",
      rows: foot
    })), hasCaption && (0,external_gc_element_namespaceObject.createElement)(external_gc_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 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: {
            content: {
              type: 'string',
              source: 'html'
            },
            tag: {
              type: 'string',
              default: 'td',
              source: 'tag'
            },
            scope: {
              type: 'string',
              source: 'attribute',
              attribute: 'scope'
            }
          }
        }
      }
    },
    body: {
      type: 'array',
      default: [],
      source: 'query',
      selector: 'tbody tr',
      query: {
        cells: {
          type: 'array',
          default: [],
          source: 'query',
          selector: 'td,th',
          query: {
            content: {
              type: 'string',
              source: 'html'
            },
            tag: {
              type: 'string',
              default: 'td',
              source: 'tag'
            },
            scope: {
              type: 'string',
              source: 'attribute',
              attribute: 'scope'
            }
          }
        }
      }
    },
    foot: {
      type: 'array',
      default: [],
      source: 'query',
      selector: 'tfoot tr',
      query: {
        cells: {
          type: 'array',
          default: [],
          source: 'query',
          selector: 'td,th',
          query: {
            content: {
              type: 'string',
              source: 'html'
            },
            tag: {
              type: 'string',
              default: 'td',
              source: 'tag'
            },
            scope: {
              type: 'string',
              source: 'attribute',
              attribute: 'scope'
            }
          }
        }
      }
    }
  },
  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_gc_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor);
    const classes = classnames_default()(backgroundClass, {
      'has-fixed-layout': hasFixedLayout,
      'has-background': !!backgroundClass
    });

    const Section = ({
      type,
      rows
    }) => {
      if (!rows.length) {
        return null;
      }

      const Tag = `t${type}`;
      return (0,external_gc_element_namespaceObject.createElement)(Tag, null, rows.map(({
        cells
      }, rowIndex) => (0,external_gc_element_namespaceObject.createElement)("tr", {
        key: rowIndex
      }, cells.map(({
        content,
        tag,
        scope
      }, cellIndex) => (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
        tagName: tag,
        value: content,
        key: cellIndex,
        scope: tag === 'th' ? scope : undefined
      })))));
    };

    return (0,external_gc_element_namespaceObject.createElement)("table", {
      className: classes
    }, (0,external_gc_element_namespaceObject.createElement)(Section, {
      type: "head",
      rows: head
    }), (0,external_gc_element_namespaceObject.createElement)(Section, {
      type: "body",
      rows: body
    }), (0,external_gc_element_namespaceObject.createElement)(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 */ var table_deprecated = ([table_deprecated_v3, table_deprecated_v2, table_deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/align-left.js


/**
 * GeChiUI dependencies
 */

const alignLeft = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"
}));
/* harmony default export */ var align_left = (alignLeft);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/align-center.js


/**
 * GeChiUI dependencies
 */

const alignCenter = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"
}));
/* harmony default export */ var align_center = (alignCenter);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/align-right.js


/**
 * GeChiUI dependencies
 */

const alignRight = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.Path, {
  d: "M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"
}));
/* harmony default export */ var align_right = (alignRight);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/table-row-before.js


/**
 * GeChiUI dependencies
 */

const tableRowBefore = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "-2 -2 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var table_row_before = (tableRowBefore);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/table-row-after.js


/**
 * GeChiUI dependencies
 */

const tableRowAfter = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "-2 -2 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var table_row_after = (tableRowAfter);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/table-row-delete.js


/**
 * GeChiUI dependencies
 */

const tableRowDelete = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "-2 -2 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var table_row_delete = (tableRowDelete);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/table-column-before.js


/**
 * GeChiUI dependencies
 */

const tableColumnBefore = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "-2 -2 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var table_column_before = (tableColumnBefore);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/table-column-after.js


/**
 * GeChiUI dependencies
 */

const tableColumnAfter = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "-2 -2 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var table_column_after = (tableColumnAfter);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/table-column-delete.js


/**
 * GeChiUI dependencies
 */

const tableColumnDelete = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "-2 -2 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var table_column_delete = (tableColumnDelete);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/table.js


/**
 * GeChiUI dependencies
 */

const table = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_table = (table);

;// CONCATENATED MODULE: ./node_modules/@gechiui/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);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/table/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */







/**
 * Internal dependencies
 */


const ALIGNMENT_CONTROLS = [{
  icon: align_left,
  title: (0,external_gc_i18n_namespaceObject.__)('栏位靠左对齐'),
  align: 'left'
}, {
  icon: align_center,
  title: (0,external_gc_i18n_namespaceObject.__)('栏位居中对齐'),
  align: 'center'
}, {
  icon: align_right,
  title: (0,external_gc_i18n_namespaceObject.__)('栏位靠右对齐'),
  align: 'right'
}];
const cellAriaLabel = {
  head: (0,external_gc_i18n_namespaceObject.__)('Header单元格文字'),
  body: (0,external_gc_i18n_namespaceObject.__)('Body单元格文字'),
  foot: (0,external_gc_i18n_namespaceObject.__)('Footer单元格文字')
};
const edit_placeholder = {
  head: (0,external_gc_i18n_namespaceObject.__)('页眉标签'),
  foot: (0,external_gc_i18n_namespaceObject.__)('页脚标签')
};

function TSection({
  name,
  ...props
}) {
  const TagName = `t${name}`;
  return (0,external_gc_element_namespaceObject.createElement)(TagName, { ...props
  });
}

function TableEdit({
  attributes,
  setAttributes,
  insertBlocksAfter,
  isSelected
}) {
  const {
    hasFixedLayout,
    caption,
    head,
    foot
  } = attributes;
  const [initialRowCount, setInitialRowCount] = (0,external_gc_element_namespaceObject.useState)(2);
  const [initialColumnCount, setInitialColumnCount] = (0,external_gc_element_namespaceObject.useState)(2);
  const [selectedCell, setSelectedCell] = (0,external_gc_element_namespaceObject.useState)();
  const colorProps = (0,external_gc_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes);
  const borderProps = (0,external_gc_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes);
  const tableRef = (0,external_gc_element_namespaceObject.useRef)();
  const [hasTableCreated, setHasTableCreated] = (0,external_gc_element_namespaceObject.useState)(false);
  /**
   * 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_gc_element_namespaceObject.useEffect)(() => {
    if (!isSelected) {
      setSelectedCell();
    }
  }, [isSelected]);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (hasTableCreated) {
      tableRef?.current?.querySelector('td[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_gc_i18n_namespaceObject.__)('在上方插入行'),
    isDisabled: !selectedCell,
    onClick: onInsertRowBefore
  }, {
    icon: table_row_after,
    title: (0,external_gc_i18n_namespaceObject.__)('在下方插入行'),
    isDisabled: !selectedCell,
    onClick: onInsertRowAfter
  }, {
    icon: table_row_delete,
    title: (0,external_gc_i18n_namespaceObject.__)('删除行'),
    isDisabled: !selectedCell,
    onClick: onDeleteRow
  }, {
    icon: table_column_before,
    title: (0,external_gc_i18n_namespaceObject.__)('在前方插入列'),
    isDisabled: !selectedCell,
    onClick: onInsertColumnBefore
  }, {
    icon: table_column_after,
    title: (0,external_gc_i18n_namespaceObject.__)('在后方插入列'),
    isDisabled: !selectedCell,
    onClick: onInsertColumnAfter
  }, {
    icon: table_column_delete,
    title: (0,external_gc_i18n_namespaceObject.__)('删除列'),
    isDisabled: !selectedCell,
    onClick: onDeleteColumn
  }];
  const renderedSections = sections.map(name => (0,external_gc_element_namespaceObject.createElement)(TSection, {
    name: name,
    key: name
  }, attributes[name].map(({
    cells
  }, rowIndex) => (0,external_gc_element_namespaceObject.createElement)("tr", {
    key: rowIndex
  }, cells.map(({
    content,
    tag: CellTag,
    scope,
    align,
    colspan,
    rowspan
  }, columnIndex) => (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    tagName: CellTag,
    key: columnIndex,
    className: classnames_default()({
      [`has-text-align-${align}`]: align
    }, 'gc-block-table__cell-content'),
    scope: CellTag === 'th' ? scope : undefined,
    colSpan: colspan,
    rowSpan: rowspan,
    value: content,
    onChange: onChange,
    onFocus: () => {
      setSelectedCell({
        sectionName: name,
        rowIndex,
        columnIndex,
        type: 'cell'
      });
    },
    "aria-label": cellAriaLabel[name],
    placeholder: edit_placeholder[name]
  }))))));
  const isEmpty = !sections.length;
  return (0,external_gc_element_namespaceObject.createElement)("figure", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)({
      ref: tableRef
    })
  }, !isEmpty && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('修改栏位对齐方式'),
    alignmentControls: ALIGNMENT_CONTROLS,
    value: getCellAlignment(),
    onChange: nextAlign => onChangeColumnAlignment(nextAlign)
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "other"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarDropdownMenu, {
    hasArrowIndicator: true,
    icon: library_table,
    label: (0,external_gc_i18n_namespaceObject.__)('编辑表格'),
    controls: tableControls
  }))), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置'),
    className: "blocks-table-settings"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('定宽单元格'),
    checked: !!hasFixedLayout,
    onChange: onChangeFixedLayout
  }), !isEmpty && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('页眉章节'),
    checked: !!(head && head.length),
    onChange: onToggleHeaderSection
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('页脚章节'),
    checked: !!(foot && foot.length),
    onChange: onToggleFooterSection
  })))), !isEmpty && (0,external_gc_element_namespaceObject.createElement)("table", {
    className: classnames_default()(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_gc_components_namespaceObject.__experimentalHasSplitBorders)(attributes?.style?.border)
    }),
    style: { ...colorProps.style,
      ...borderProps.style
    }
  }, renderedSections), !isEmpty && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    identifier: "caption",
    tagName: "figcaption",
    className: (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('表格说明文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('添加说明文字'),
    value: caption,
    onChange: value => setAttributes({
      caption: value
    }) // Deselect the selected table cell when the caption is focused.
    ,
    onFocus: () => setSelectedCell(),
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)()))
  }), isEmpty && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
    label: (0,external_gc_i18n_namespaceObject.__)('表格'),
    icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
      icon: block_table,
      showColors: true
    }),
    instructions: (0,external_gc_i18n_namespaceObject.__)('插入表格来共享数据。')
  }, (0,external_gc_element_namespaceObject.createElement)("form", {
    className: "blocks-table__placeholder-form",
    onSubmit: onCreateTable
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    type: "number",
    label: (0,external_gc_i18n_namespaceObject.__)('栏目数'),
    value: initialColumnCount,
    onChange: onChangeInitialColumnCount,
    min: "1",
    className: "blocks-table__placeholder-input"
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    type: "number",
    label: (0,external_gc_i18n_namespaceObject.__)('行数'),
    value: initialRowCount,
    onChange: onChangeInitialRowCount,
    min: "1",
    className: "blocks-table__placeholder-input"
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    className: "blocks-table__placeholder-button",
    variant: "primary",
    type: "submit"
  }, (0,external_gc_i18n_namespaceObject.__)('创建表格')))));
}

/* harmony default export */ var table_edit = (TableEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/table/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes);
  const borderProps = (0,external_gc_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes);
  const classes = classnames_default()(colorProps.className, borderProps.className, {
    'has-fixed-layout': hasFixedLayout
  });
  const hasCaption = !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption);

  const Section = ({
    type,
    rows
  }) => {
    if (!rows.length) {
      return null;
    }

    const Tag = `t${type}`;
    return (0,external_gc_element_namespaceObject.createElement)(Tag, null, rows.map(({
      cells
    }, rowIndex) => (0,external_gc_element_namespaceObject.createElement)("tr", {
      key: rowIndex
    }, cells.map(({
      content,
      tag,
      scope,
      align,
      colspan,
      rowspan
    }, cellIndex) => {
      const cellClasses = classnames_default()({
        [`has-text-align-${align}`]: align
      });
      return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
        className: cellClasses ? cellClasses : undefined,
        "data-align": align,
        tagName: tag,
        value: content,
        key: cellIndex,
        scope: tag === 'th' ? scope : undefined,
        colSpan: colspan,
        rowSpan: rowspan
      });
    }))));
  };

  return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
  }, (0,external_gc_element_namespaceObject.createElement)("table", {
    className: classes === '' ? undefined : classes,
    style: { ...colorProps.style,
      ...borderProps.style
    }
  }, (0,external_gc_element_namespaceObject.createElement)(Section, {
    type: "head",
    rows: head
  }), (0,external_gc_element_namespaceObject.createElement)(Section, {
    type: "body",
    rows: body
  }), (0,external_gc_element_namespaceObject.createElement)(Section, {
    type: "foot",
    rows: foot
  })), hasCaption && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    tagName: "figcaption",
    value: caption,
    className: (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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();
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/table/transforms.js
/**
 * GeChiUI 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_gc_blocks_namespaceObject.createBlock)('core/table', attributes);
    }
  }]
};
/* harmony default export */ var table_transforms = (table_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/table/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const table_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/table",
  title: "表格",
  category: "text",
  description: "在行和列中创建结构化内容以显示信息。",
  textdomain: "default",
  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: {
            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"
            },
            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: "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"
            },
            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: "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"
            },
            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
      }
    },
    __experimentalSelector: ".gc-block-table > table"
  },
  styles: [{
    name: "regular",
    label: "Default",
    isDefault: true
  }, {
    name: "stripes",
    label: "Stripes"
  }],
  editorStyle: "gc-block-table-editor",
  style: "gc-block-table"
};


const {
  name: table_name
} = table_metadata;

const table_settings = {
  icon: block_table,
  example: {
    attributes: {
      head: [{
        cells: [{
          content: (0,external_gc_i18n_namespaceObject.__)('版本'),
          tag: 'th'
        }, {
          content: (0,external_gc_i18n_namespaceObject.__)('爵士音乐家'),
          tag: 'th'
        }, {
          content: (0,external_gc_i18n_namespaceObject.__)('发布日期'),
          tag: 'th'
        }]
      }],
      body: [{
        cells: [{
          content: '5.2',
          tag: 'td'
        }, {
          content: 'Jaco Pastorius',
          tag: 'td'
        }, {
          content: (0,external_gc_i18n_namespaceObject.__)('2019年5月7日'),
          tag: 'td'
        }]
      }, {
        cells: [{
          content: '5.1',
          tag: 'td'
        }, {
          content: 'Betty Carter',
          tag: 'td'
        }, {
          content: (0,external_gc_i18n_namespaceObject.__)('2019年2月21日'),
          tag: 'td'
        }]
      }, {
        cells: [{
          content: '5.0',
          tag: 'td'
        }, {
          content: 'Bebo Valdés',
          tag: 'td'
        }, {
          content: (0,external_gc_i18n_namespaceObject.__)('2018年12月6日'),
          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
});

// EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js
var es6 = __webpack_require__(5619);
var es6_default = /*#__PURE__*/__webpack_require__.n(es6);
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/table-of-contents/icon.js


/**
 * GeChiUI dependencies
 */

/* harmony default export */ var table_of_contents_icon = ((0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  width: "24",
  height: "24",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Path, {
  d: "M15.1 15.8H20v-1.5h-4.9v1.5zm-4-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 3c-.6 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.4 1-1 1zm5-3c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM6 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z",
  fill: "#1e1e1e"
})));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/table-of-contents/list.js


/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */
const ENTRY_CLASS_NAME = 'gc-block-table-of-contents__entry';
function TableOfContentsList({
  nestedHeadingList
}) {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, nestedHeadingList.map((node, index) => {
    const {
      content,
      link
    } = node.heading;
    const entry = link ? (0,external_gc_element_namespaceObject.createElement)("a", {
      className: ENTRY_CLASS_NAME,
      href: link
    }, content) : (0,external_gc_element_namespaceObject.createElement)("span", {
      className: ENTRY_CLASS_NAME
    }, content);
    return (0,external_gc_element_namespaceObject.createElement)("li", {
      key: index
    }, entry, node.children ? (0,external_gc_element_namespaceObject.createElement)("ol", null, (0,external_gc_element_namespaceObject.createElement)(TableOfContentsList, {
      nestedHeadingList: node.children
    })) : null);
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/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;
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/table-of-contents/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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 {GCComponent} The component.
 */

function TableOfContentsEdit({
  attributes: {
    headings = [],
    onlyIncludeCurrentPage
  },
  clientId,
  setAttributes
}) {
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  const canInsertList = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getBlockRootClientId,
      canInsertBlockType
    } = select(external_gc_blockEditor_namespaceObject.store);
    const rootClientId = getBlockRootClientId(clientId);
    return canInsertBlockType('core/list', rootClientId);
  }, [clientId]);
  const {
    __unstableMarkNextChangeAsNotPersistent,
    replaceBlocks
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);
  /**
   * The latest heading data, or null if the new data deeply equals the saved
   * headings attribute.
   *
   * Since useSelect forces a re-render when its return value is shallowly
   * inequal to its prior call, we would be re-rendering this block every time
   * the stores change, even if the latest headings were deeply equal to the
   * ones saved in the block attributes.
   *
   * By returning null when they're equal, we reduce that to 2 renders: one
   * when there are new latest headings (and so it returns them), and one when
   * they haven't changed (so it returns null). As long as the latest heading
   * data remains the same, further calls of the useSelect callback will
   * continue to return null, thus preventing any forced re-renders.
   */

  const latestHeadings = (0,external_gc_data_namespaceObject.useSelect)(select => {
    var _editorSelectors$getP;

    const {
      getBlockAttributes,
      getBlockName,
      getClientIdsWithDescendants,
      __experimentalGetGlobalBlocksByName: getGlobalBlocksByName
    } = select(external_gc_blockEditor_namespaceObject.store); // FIXME: @gechiui/block-library should not depend on @gechiui/editor.
    // Blocks can be loaded into a *non-post* block editor, so to avoid
    // declaring @gechiui/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 @gechiui/data-no-store-string-literals

    const editorSelectors = select('core/editor');
    const pageBreakClientIds = getGlobalBlocksByName('core/nextpage');
    const isPaginated = pageBreakClientIds.length !== 0; // 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;
    /**
     * A permalink to the current post. If the core/editor store is
     * unavailable, this variable will be null.
     */

    const permalink = (_editorSelectors$getP = editorSelectors?.getPermalink()) !== null && _editorSelectors$getP !== void 0 ? _editorSelectors$getP : null;
    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_gc_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_gc_url_namespaceObject.addQueryArgs)((0,external_gc_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_gc_dom_namespaceObject.__unstableStripHTML)(headingAttributes.content.replace(/(<br *\/?>)+/g, ' ')),
            level: headingAttributes.level,
            link: canBeLinked ? `${headingPageLink}#${headingAttributes.anchor}` : null
          });
        }
      }
    }

    if (es6_default()(headings, _latestHeadings)) {
      return null;
    }

    return _latestHeadings;
  }, [clientId, onlyIncludeCurrentPage, headings]);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (latestHeadings !== null) {
      // This is required to keep undo working and not create 2 undo steps
      // for each heading change.
      __unstableMarkNextChangeAsNotPersistent();

      setAttributes({
        headings: latestHeadings
      });
    }
  }, [latestHeadings]);
  const headingTree = linearToNestedHeadingList(headings);
  const toolbarControls = canInsertList && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    onClick: () => replaceBlocks(clientId, (0,external_gc_blocks_namespaceObject.createBlock)('core/list', {
      ordered: true,
      values: (0,external_gc_element_namespaceObject.renderToString)((0,external_gc_element_namespaceObject.createElement)(TableOfContentsList, {
        nestedHeadingList: headingTree
      }))
    }))
  }, (0,external_gc_i18n_namespaceObject.__)('转换为静态列表'))));
  const inspectorControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('仅包含当前页面'),
    checked: onlyIncludeCurrentPage,
    onChange: value => setAttributes({
      onlyIncludeCurrentPage: value
    }),
    help: onlyIncludeCurrentPage ? (0,external_gc_i18n_namespaceObject.__)('仅包括当前页面的标题（如果文章存在分页）。') : (0,external_gc_i18n_namespaceObject.__)('切换至仅包括当前页面的标题（如果文章存在分页）。')
  }))); // If there are no headings or the only heading is empty.
  // Note that the toolbar controls are intentionally omitted since the
  // "转换为静态列表" option is useless to the placeholder state.

  if (headings.length === 0) {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
      icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
        icon: table_of_contents_icon
      }),
      label: (0,external_gc_i18n_namespaceObject.__)('目录'),
      instructions: (0,external_gc_i18n_namespaceObject.__)('添加标题区块来创建目录。带有 HTML 锚点的标题将被链接到这里。')
    })), inspectorControls);
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)("nav", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)("ol", {
    inert: "true"
  }, (0,external_gc_element_namespaceObject.createElement)(TableOfContentsList, {
    nestedHeadingList: headingTree
  }))), toolbarControls, inspectorControls);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/table-of-contents/save.js


/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */



function table_of_contents_save_save({
  attributes: {
    headings = []
  }
}) {
  if (headings.length === 0) {
    return null;
  }

  return (0,external_gc_element_namespaceObject.createElement)("nav", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
  }, (0,external_gc_element_namespaceObject.createElement)("ol", null, (0,external_gc_element_namespaceObject.createElement)(TableOfContentsList, {
    nestedHeadingList: linearToNestedHeadingList(headings)
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/table-of-contents/index.js
/**
 * Internal dependencies
 */

const table_of_contents_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  __experimental: true,
  name: "core/table-of-contents",
  title: "目录",
  category: "layout",
  description: "用章节列表总结你的文章。将HTML锚添加到标题块以将它们链接到此处。",
  keywords: ["document outline", "summary"],
  textdomain: "default",
  attributes: {
    headings: {
      type: "array",
      items: {
        type: "object"
      }
    },
    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
      }
    }
  },
  example: {}
};



const {
  name: table_of_contents_name
} = table_of_contents_metadata;

const table_of_contents_settings = {
  icon: table_of_contents_icon,
  edit: TableOfContentsEdit,
  save: table_of_contents_save_save
};
const table_of_contents_init = () => initBlock({
  name: table_of_contents_name,
  metadata: table_of_contents_metadata,
  settings: table_of_contents_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/tag-cloud/transforms.js
/**
 * GeChiUI dependencies
 */

const tag_cloud_transforms_transforms = {
  from: [{
    type: 'block',
    blocks: ['core/categories'],
    transform: () => (0,external_gc_blocks_namespaceObject.createBlock)('core/tag-cloud')
  }],
  to: [{
    type: 'block',
    blocks: ['core/categories'],
    transform: () => (0,external_gc_blocks_namespaceObject.createBlock)('core/categories')
  }]
};
/* harmony default export */ var tag_cloud_transforms = (tag_cloud_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/tag-cloud/edit.js


/**
 * GeChiUI 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,
  taxonomies
}) {
  const {
    taxonomy,
    showTagCounts,
    numberOfTags,
    smallestFontSize,
    largestFontSize
  } = attributes;
  const units = (0,external_gc_components_namespaceObject.__experimentalUseCustomUnits)({
    availableUnits: (0,external_gc_blockEditor_namespaceObject.useSetting)('spacing.units') || ['%', 'px', 'em', 'rem']
  });

  const getTaxonomyOptions = () => {
    const selectOption = {
      label: (0,external_gc_i18n_namespaceObject.__)('- 选择 -'),
      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 @gechiui/no-unused-vars-before-return
    const [quantity, newUnit] = (0,external_gc_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_gc_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);
  };

  const inspectorControls = (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('分类法'),
    options: getTaxonomyOptions(),
    value: taxonomy,
    onChange: selectedTaxonomy => setAttributes({
      taxonomy: selectedTaxonomy
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('显示文章数目'),
    checked: showTagCounts,
    onChange: () => setAttributes({
      showTagCounts: !showTagCounts
    })
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('页数'),
    value: numberOfTags,
    onChange: value => setAttributes({
      numberOfTags: value
    }),
    min: MIN_TAGS,
    max: MAX_TAGS,
    required: true
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Flex, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FlexItem, {
    isBlock: true
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalUnitControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('最小尺寸'),
    value: smallestFontSize,
    onChange: value => {
      onFontSizeChange('smallestFontSize', value);
    },
    units: units,
    min: MIN_FONT_SIZE,
    max: MAX_FONT_SIZE
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FlexItem, {
    isBlock: true
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalUnitControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('最大尺寸'),
    value: largestFontSize,
    onChange: value => {
      onFontSizeChange('largestFontSize', value);
    },
    units: units,
    min: MIN_FONT_SIZE,
    max: MAX_FONT_SIZE
  })))));
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, inspectorControls, (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)()
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Disabled, null, (0,external_gc_element_namespaceObject.createElement)((external_gc_serverSideRender_default()), {
    skipBlockSupportAttributes: true,
    block: "core/tag-cloud",
    attributes: attributes
  }))));
}

/* harmony default export */ var tag_cloud_edit = ((0,external_gc_data_namespaceObject.withSelect)(select => {
  return {
    taxonomies: select(external_gc_coreData_namespaceObject.store).getTaxonomies({
      per_page: -1
    })
  };
})(TagCloudEdit));

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/tag-cloud/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */



const tag_cloud_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/tag-cloud",
  title: "标签云",
  category: "widgets",
  description: "您最常使用的标签云。",
  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
    }
  },
  editorStyle: "gc-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
});

;// CONCATENATED MODULE: ./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 */

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;
  return g = { next: verb(0), "throw": verb(1), "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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
  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;
};

function __importStar(mod) {
  if (mod && mod.__esModule) return mod;
  var result = {};
  if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  __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") throw new TypeError("Object expected.");
    var dispose;
    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 (typeof dispose !== "function") throw new TypeError("Object not disposable.");
    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;
  }
  function next() {
    while (env.stack.length) {
      var rec = env.stack.pop();
      try {
        var result = rec.dispose && rec.dispose.call(rec.value);
        if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
      }
      catch (e) {
          fail(e);
      }
    }
    if (env.hasError) throw env.error;
  }
  return next();
}

/* harmony default export */ var tslib_es6 = ({
  __extends,
  __assign,
  __rest,
  __decorate,
  __param,
  __metadata,
  __awaiter,
  __generator,
  __createBinding,
  __exportStar,
  __values,
  __read,
  __spread,
  __spreadArrays,
  __spreadArray,
  __await,
  __asyncGenerator,
  __asyncDelegator,
  __asyncValues,
  __makeTemplateObject,
  __importStar,
  __importDefault,
  __classPrivateFieldGet,
  __classPrivateFieldSet,
  __classPrivateFieldIn,
  __addDisposableResource,
  __disposeResources,
});

;// CONCATENATED MODULE: ./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",
            İ: "\u0069",
        },
    },
    az: {
        regexp: /\u0130/g,
        map: {
            İ: "\u0069",
            I: "\u0131",
            İ: "\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();
}

;// CONCATENATED MODULE: ./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);
}

;// CONCATENATED MODULE: ./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);
}

;// CONCATENATED MODULE: ./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));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/symbol-filled.js


/**
 * GeChiUI dependencies
 */

const symbolFilled = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var symbol_filled = (symbolFilled);

;// CONCATENATED MODULE: ./node_modules/dot-case/dist.es2015/index.js


function dotCase(input, options) {
    if (options === void 0) { options = {}; }
    return noCase(input, __assign({ delimiter: "." }, options));
}

;// CONCATENATED MODULE: ./node_modules/param-case/dist.es2015/index.js


function paramCase(input, options) {
    if (options === void 0) { options = {}; }
    return dotCase(input, __assign({ delimiter: "-" }, options));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/template-part/edit/utils/hooks.js
/**
 * External dependencies
 */

/**
 * GeChiUI 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_gc_data_namespaceObject.useSelect)(select => {
    const {
      getEntityRecords,
      isResolving: _isResolving
    } = select(external_gc_coreData_namespaceObject.store);
    const query = {
      per_page: -1
    };
    return {
      templateParts: getEntityRecords('postType', 'gc_template_part', query),
      isResolving: _isResolving('getEntityRecords', ['postType', 'gc_template_part', query])
    };
  }, []);
  const filteredTemplateParts = (0,external_gc_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_gc_data_namespaceObject.useSelect)(select => {
    const blockNameWithArea = area ? `core/template-part/${area}` : 'core/template-part';
    const {
      getBlockRootClientId,
      getPatternsByBlockTypes
    } = select(external_gc_blockEditor_namespaceObject.store);
    const rootClientId = getBlockRootClientId(clientId);
    return getPatternsByBlockTypes(blockNameWithArea, rootClientId);
  }, [area, clientId]);
}
function useCreateTemplatePartFromBlocks(area, setAttributes) {
  const {
    saveEntityRecord
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_coreData_namespaceObject.store);
  return async (blocks = [], title = (0,external_gc_i18n_namespaceObject.__)('未命名的模板组件')) => {
    // Currently template parts only allow latin chars.
    // Fallback slug will receive suffix by default.
    const cleanSlug = paramCase(title).replace(/[^\w-]+/g, '') || 'gc-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_gc_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', 'gc_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_gc_data_namespaceObject.useSelect)(select => {
    var _selectedArea$area_ta;

    // FIXME: @gechiui/block-library should not depend on @gechiui/editor.
    // Blocks can be loaded into a *non-post* block editor.

    /* eslint-disable @gechiui/data-no-store-string-literals */
    const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
    /* eslint-enable @gechiui/data-no-store-string-literals */


    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_gc_i18n_namespaceObject.__)('模版组件'),
      tagName: (_selectedArea$area_ta = selectedArea?.area_tag) !== null && _selectedArea$area_ta !== void 0 ? _selectedArea$area_ta : 'div'
    };
  }, [area]);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/template-part/edit/title-modal.js


/**
 * GeChiUI 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_gc_element_namespaceObject.useState)((0,external_gc_i18n_namespaceObject.__)('未命名的模板组件'));

  const submitForCreation = event => {
    event.preventDefault();
    onSubmit(title);
  };

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Modal, {
    title: (0,external_gc_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
    (0,external_gc_i18n_namespaceObject.__)('命名并创建新%s'), areaLabel.toLowerCase()),
    overlayClassName: "gc-block-template-part__placeholder-create-new__title-form",
    onRequestClose: onClose
  }, (0,external_gc_element_namespaceObject.createElement)("form", {
    onSubmit: submitForCreation
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalVStack, {
    spacing: "5"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('名称'),
    value: title,
    onChange: setTitle
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalHStack, {
    justify: "right"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "primary",
    type: "submit",
    disabled: !title.length,
    "aria-disabled": !title.length
  }, (0,external_gc_i18n_namespaceObject.__)('创建'))))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/template-part/edit/placeholder.js


/**
 * GeChiUI dependencies
 */



/**
 * Internal dependencies
 */



function TemplatePartPlaceholder({
  area,
  clientId,
  templatePartId,
  onOpenSelectionModal,
  setAttributes
}) {
  const {
    templateParts,
    isResolving
  } = useAlternativeTemplateParts(area, templatePartId);
  const blockPatterns = useAlternativeBlockPatterns(area, clientId);
  const [showTitleModal, setShowTitleModal] = (0,external_gc_element_namespaceObject.useState)(false);
  const areaObject = useTemplatePartArea(area);
  const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
    icon: areaObject.icon,
    label: areaObject.label,
    instructions: (0,external_gc_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
    (0,external_gc_i18n_namespaceObject.__)('选择现有的%s或新建。'), areaObject.label.toLowerCase())
  }, isResolving && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null), !isResolving && !!(templateParts.length || blockPatterns.length) && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "primary",
    onClick: onOpenSelectionModal
  }, (0,external_gc_i18n_namespaceObject.__)('选择')), !isResolving && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "secondary",
    onClick: () => {
      setShowTitleModal(true);
    }
  }, (0,external_gc_i18n_namespaceObject.__)('开始空白')), showTitleModal && (0,external_gc_element_namespaceObject.createElement)(TitleModal, {
    areaLabel: areaObject.label,
    onClose: () => setShowTitleModal(false),
    onSubmit: title => {
      createFromBlocks([], title);
    }
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/template-part/edit/selection-modal.js


/**
 * GeChiUI dependencies
 */








/**
 * Internal dependencies
 */




function TemplatePartSelectionModal({
  setAttributes,
  onClose,
  templatePartId = null,
  area,
  clientId
}) {
  const [searchValue, setSearchValue] = (0,external_gc_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_gc_element_namespaceObject.useMemo)(() => {
    const partsAsPatterns = templateParts.map(templatePart => ({
      name: createTemplatePartId(templatePart.theme, templatePart.slug),
      title: templatePart.title.rendered,
      blocks: (0,external_gc_blocks_namespaceObject.parse)(templatePart.content.raw),
      templatePart
    }));
    return searchPatterns(partsAsPatterns, searchValue);
  }, [templateParts, searchValue]);
  const shownTemplateParts = (0,external_gc_compose_namespaceObject.useAsyncList)(filteredTemplateParts);
  const blockPatterns = useAlternativeBlockPatterns(area, clientId);
  const filteredBlockPatterns = (0,external_gc_element_namespaceObject.useMemo)(() => {
    return searchPatterns(blockPatterns, searchValue);
  }, [blockPatterns, searchValue]);
  const shownBlockPatterns = (0,external_gc_compose_namespaceObject.useAsyncList)(filteredBlockPatterns);
  const {
    createSuccessNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);

  const onTemplatePartSelect = templatePart => {
    setAttributes({
      slug: templatePart.slug,
      theme: templatePart.theme,
      area: undefined
    });
    createSuccessNotice((0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: template part title. */
    (0,external_gc_i18n_namespaceObject.__)(''), templatePart.title?.rendered || templatePart.slug), {
      type: 'snackbar'
    });
    onClose();
  };

  const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes);
  const hasTemplateParts = !!filteredTemplateParts.length;
  const hasBlockPatterns = !!filteredBlockPatterns.length;
  return (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "block-library-template-part__selection-content"
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "block-library-template-part__selection-search"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SearchControl, {
    __nextHasNoMarginBottom: true,
    onChange: setSearchValue,
    value: searchValue,
    label: (0,external_gc_i18n_namespaceObject.__)('寻找替代项目'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('搜索')
  })), hasTemplateParts && (0,external_gc_element_namespaceObject.createElement)("div", null, (0,external_gc_element_namespaceObject.createElement)("h2", null, (0,external_gc_i18n_namespaceObject.__)('现有模版组件')), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
    blockPatterns: filteredTemplateParts,
    shownPatterns: shownTemplateParts,
    onClickPattern: pattern => {
      onTemplatePartSelect(pattern.templatePart);
    }
  })), hasBlockPatterns && (0,external_gc_element_namespaceObject.createElement)("div", null, (0,external_gc_element_namespaceObject.createElement)("h2", null, (0,external_gc_i18n_namespaceObject.__)('样板')), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalBlockPatternsList, {
    blockPatterns: filteredBlockPatterns,
    shownPatterns: shownBlockPatterns,
    onClickPattern: (pattern, blocks) => {
      createFromBlocks(blocks, pattern.title);
      onClose();
    }
  })), !hasTemplateParts && !hasBlockPatterns && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalHStack, {
    alignment: "center"
  }, (0,external_gc_element_namespaceObject.createElement)("p", null, (0,external_gc_i18n_namespaceObject.__)('未找到结果。'))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/template-part/edit/utils/transformers.js
/**
 * GeChiUI 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_gc_blocks_namespaceObject.createBlock)('core/legacy-widget', attributes));
  }

  const parsedBlocks = (0,external_gc_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_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getGroupingBlockName)(), undefined, transformInnerBlocks(block.innerBlocks));
  }

  if (block.innerBlocks.length > 0) {
    return (0,external_gc_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_gc_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_gc_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_gc_blocks_namespaceObject.createBlock)(block.name, block.attributes, transformInnerBlocks(block.innerBlocks));
  }).filter(block => !!block);
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/template-part/edit/import-controls.js


/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */



const SIDEBARS_QUERY = {
  per_page: -1,
  _fields: 'id,name,description,status,widgets'
};
function TemplatePartImportControls({
  area,
  setAttributes
}) {
  const [selectedSidebar, setSelectedSidebar] = (0,external_gc_element_namespaceObject.useState)('');
  const [isBusy, setIsBusy] = (0,external_gc_element_namespaceObject.useState)(false);
  const registry = (0,external_gc_data_namespaceObject.useRegistry)();
  const {
    sidebars,
    hasResolved
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSidebars,
      hasFinishedResolution
    } = select(external_gc_coreData_namespaceObject.store);
    return {
      sidebars: getSidebars(SIDEBARS_QUERY),
      hasResolved: hasFinishedResolution('getSidebars', [SIDEBARS_QUERY])
    };
  }, []);
  const {
    createErrorNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);
  const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes);
  const options = (0,external_gc_element_namespaceObject.useMemo)(() => {
    const sidebarOptions = (sidebars !== null && sidebars !== void 0 ? sidebars : []).filter(widgetArea => widgetArea.id !== 'gc_inactive_widgets' && widgetArea.widgets.length > 0).map(widgetArea => {
      return {
        value: widgetArea.id,
        label: widgetArea.name
      };
    });

    if (!sidebarOptions.length) {
      return [];
    }

    return [{
      value: '',
      label: (0,external_gc_i18n_namespaceObject.__)('选择小部件区域')
    }, ...sidebarOptions];
  }, [sidebars]); // Render an empty node while data is loading to avoid SlotFill re-positioning bug.
  // See: https://github.com/GeChiUI/gutenberg/issues/15641.

  if (!hasResolved) {
    return (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_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_gc_i18n_namespaceObject.sprintf)((0,external_gc_i18n_namespaceObject.__)('小部件区域: %s'), sidebar.label));

    if (skippedWidgets.size) {
      createErrorNotice((0,external_gc_i18n_namespaceObject.sprintf)(
      /* translators: %s: the list of widgets */
      (0,external_gc_i18n_namespaceObject.__)('无法导入以下小部件： %s。'), Array.from(skippedWidgets).join(', ')), {
        type: 'snackbar'
      });
    }

    setIsBusy(false);
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalSpacer, {
    marginBottom: "4"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalHStack, {
    as: "form",
    onSubmit: createFromWidgets
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FlexBlock, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    label: (0,external_gc_i18n_namespaceObject.__)('导入小部件区域'),
    value: selectedSidebar,
    options: options,
    onChange: value => setSelectedSidebar(value),
    disabled: !options.length,
    __next36pxDefaultSize: true,
    __nextHasNoMarginBottom: true
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FlexItem, {
    style: {
      marginBottom: '8px',
      marginTop: 'auto'
    }
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "primary",
    type: "submit",
    isBusy: isBusy,
    "aria-disabled": isBusy || !selectedSidebar
  }, (0,external_gc_i18n_namespaceObject._x)('导入', 'button label')))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/template-part/edit/advanced-controls.js


/**
 * GeChiUI dependencies
 */





/**
 * Internal dependencies
 */


function TemplatePartAdvancedControls({
  tagName,
  setAttributes,
  isEntityAvailable,
  templatePartId,
  defaultWrapper,
  hasInnerBlocks
}) {
  const [area, setArea] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', 'gc_template_part', 'area', templatePartId);
  const [title, setTitle] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', 'gc_template_part', 'title', templatePartId);
  const {
    areaOptions
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    // FIXME: @gechiui/block-library should not depend on @gechiui/editor.
    // Blocks can be loaded into a *non-post* block editor.

    /* eslint-disable @gechiui/data-no-store-string-literals */
    const definedAreas = select('core/editor').__experimentalGetDefaultTemplatePartAreas();
    /* eslint-enable @gechiui/data-no-store-string-literals */


    return {
      areaOptions: definedAreas.map(({
        label,
        area: _area
      }) => ({
        label,
        value: _area
      }))
    };
  }, []);
  const htmlElementMessages = {
    header: (0,external_gc_i18n_namespaceObject.__)('<header>元素应表示介绍性内容，通常是一组介绍性或导航辅助工具。'),
    main: (0,external_gc_i18n_namespaceObject.__)('<main>元素应仅用于文档的主要内容。'),
    section: (0,external_gc_i18n_namespaceObject.__)("<section>元素应该代表文档的一个独立部分，不能用另一个元素更好地表示。"),
    article: (0,external_gc_i18n_namespaceObject.__)('<article>元素应该代表文档的一个自包含的、可联合的部分。'),
    aside: (0,external_gc_i18n_namespaceObject.__)("<aside>元素应代表文档的一部分，其内容仅与文档的主要内容间接相关。"),
    footer: (0,external_gc_i18n_namespaceObject.__)('<footer>元素应表示其最近的分段元素的页脚（例如：<section>、<article>、<main>等）。')
  };
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, {
    group: "advanced"
  }, isEntityAvailable && (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('标题'),
    value: title,
    onChange: value => {
      setTitle(value);
    },
    onFocus: event => event.target.select()
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('区域'),
    labelPosition: "top",
    options: areaOptions,
    value: area,
    onChange: setArea
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('HTML 元素'),
    options: [{
      label: (0,external_gc_i18n_namespaceObject.sprintf)(
      /* translators: %s: HTML tag based on area. */
      (0,external_gc_i18n_namespaceObject.__)('基于区域的默认值 （%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 && (0,external_gc_element_namespaceObject.createElement)(TemplatePartImportControls, {
    area: area,
    setAttributes: setAttributes
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/template-part/edit/inner-blocks.js


/**
 * GeChiUI dependencies
 */



function TemplatePartInnerBlocks({
  postId: id,
  hasInnerBlocks,
  layout,
  tagName: TagName,
  blockProps
}) {
  const themeSupportsLayout = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getSettings
    } = select(external_gc_blockEditor_namespaceObject.store);
    return getSettings()?.supportsLayout;
  }, []);
  const defaultLayout = (0,external_gc_blockEditor_namespaceObject.useSetting)('layout') || {};
  const usedLayout = !!layout && layout.inherit ? defaultLayout : layout;
  const [blocks, onInput, onChange] = (0,external_gc_coreData_namespaceObject.useEntityBlockEditor)('postType', 'gc_template_part', {
    id
  });
  const innerBlocksProps = (0,external_gc_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, {
    value: blocks,
    onInput,
    onChange,
    renderAppender: hasInnerBlocks ? undefined : external_gc_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender,
    layout: themeSupportsLayout ? usedLayout : undefined
  });
  return (0,external_gc_element_namespaceObject.createElement)(TagName, { ...innerBlocksProps
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/template-part/edit/index.js


/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */







function TemplatePartEdit({
  attributes,
  setAttributes,
  clientId,
  isSelected
}) {
  const {
    slug,
    theme,
    tagName,
    layout = {}
  } = attributes;
  const templatePartId = createTemplatePartId(theme, slug);
  const hasAlreadyRendered = (0,external_gc_blockEditor_namespaceObject.__experimentalUseHasRecursion)(templatePartId);
  const [isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen] = (0,external_gc_element_namespaceObject.useState)(false); // Set the postId block attribute if it did not exist,
  // but wait until the inner blocks have loaded to allow
  // new edits to trigger this.

  const {
    isResolved,
    innerBlocks,
    isMissing,
    area
  } = (0,external_gc_data_namespaceObject.useSelect)(select => {
    const {
      getEditedEntityRecord,
      hasFinishedResolution
    } = select(external_gc_coreData_namespaceObject.store);
    const {
      getBlocks
    } = select(external_gc_blockEditor_namespaceObject.store);
    const getEntityArgs = ['postType', 'gc_template_part', templatePartId];
    const entityRecord = templatePartId ? getEditedEntityRecord(...getEntityArgs) : null;

    const _area = entityRecord?.area || attributes.area;

    const hasResolvedEntity = templatePartId ? hasFinishedResolution('getEditedEntityRecord', getEntityArgs) : false;
    return {
      innerBlocks: getBlocks(clientId),
      isResolved: hasResolvedEntity,
      isMissing: hasResolvedEntity && (!entityRecord || Object.keys(entityRecord).length === 0),
      area: _area
    };
  }, [templatePartId, clientId]);
  const {
    templateParts
  } = useAlternativeTemplateParts(area, templatePartId);
  const blockPatterns = useAlternativeBlockPatterns(area, clientId);
  const hasReplacements = !!templateParts.length || !!blockPatterns.length;
  const areaObject = useTemplatePartArea(area);
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();
  const isPlaceholder = !slug;
  const isEntityAvailable = !isPlaceholder && !isMissing && isResolved;
  const TagName = tagName || areaObject.tagName; // The `isSelected` check ensures the `BlockSettingsMenuControls` fill
  // doesn't render multiple times. The block controls has similar internal check.

  const canReplace = isSelected && isEntityAvailable && hasReplacements && (area === 'header' || area === 'footer'); // 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 (innerBlocks.length === 0 && (slug && !theme || slug && isMissing)) {
    return (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.sprintf)(
    /* translators: %s: Template part slug */
    (0,external_gc_i18n_namespaceObject.__)('模板组件已被删除或不可用：%s'), slug)));
  }

  if (isEntityAvailable && hasAlreadyRendered) {
    return (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.Warning, null, (0,external_gc_i18n_namespaceObject.__)('区块不能在其内部渲染。')));
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.__experimentalRecursionProvider, {
    uniqueId: templatePartId
  }, (0,external_gc_element_namespaceObject.createElement)(TemplatePartAdvancedControls, {
    tagName: tagName,
    setAttributes: setAttributes,
    isEntityAvailable: isEntityAvailable,
    templatePartId: templatePartId,
    defaultWrapper: areaObject.tagName,
    hasInnerBlocks: innerBlocks.length > 0
  }), isPlaceholder && (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(TemplatePartPlaceholder, {
    area: attributes.area,
    templatePartId: templatePartId,
    clientId: clientId,
    setAttributes: setAttributes,
    onOpenSelectionModal: () => setIsTemplatePartSelectionOpen(true)
  })), canReplace && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockSettingsMenuControls, null, () => (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItem, {
    onClick: () => {
      setIsTemplatePartSelectionOpen(true);
    }
  }, (0,external_gc_element_namespaceObject.createInterpolateElement)((0,external_gc_i18n_namespaceObject.__)('替换 <BlockTitle />'), {
    BlockTitle: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockTitle, {
      clientId: clientId,
      maximumLength: 25
    })
  }))), isEntityAvailable && (0,external_gc_element_namespaceObject.createElement)(TemplatePartInnerBlocks, {
    tagName: TagName,
    blockProps: blockProps,
    postId: templatePartId,
    hasInnerBlocks: innerBlocks.length > 0,
    layout: layout
  }), !isPlaceholder && !isResolved && (0,external_gc_element_namespaceObject.createElement)(TagName, { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null))), isTemplatePartSelectionOpen && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Modal, {
    overlayClassName: "block-editor-template-part__selection-modal",
    title: (0,external_gc_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.).
    (0,external_gc_i18n_namespaceObject.__)('选择%s'), areaObject.label.toLowerCase()),
    onRequestClose: () => setIsTemplatePartSelectionOpen(false),
    isFullScreen: true
  }, (0,external_gc_element_namespaceObject.createElement)(TemplatePartSelectionModal, {
    templatePartId: templatePartId,
    clientId: clientId,
    area: area,
    setAttributes: setAttributes,
    onClose: () => setIsTemplatePartSelectionOpen(false)
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/header.js


/**
 * GeChiUI dependencies
 */

const header = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_header = (header);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/footer.js


/**
 * GeChiUI dependencies
 */

const footer = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_footer = (footer);

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/sidebar.js


/**
 * GeChiUI dependencies
 */

const sidebar = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_sidebar = (sidebar);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/template-part/variations.js
/**
 * GeChiUI dependencies
 */




function 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;
}

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 entity = (0,external_gc_data_namespaceObject.select)(external_gc_coreData_namespaceObject.store).getEntityRecord('postType', 'gc_template_part', `${theme}//${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;
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/template-part/index.js
/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */






/**
 * Internal dependencies
 */


const template_part_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/template-part",
  title: "模版组件",
  category: "theme",
  description: "编辑系统的不同全局区域，如页眉、页脚、侧边栏，或创建自己的区域。",
  textdomain: "default",
  attributes: {
    slug: {
      type: "string"
    },
    theme: {
      type: "string"
    },
    tagName: {
      type: "string"
    },
    area: {
      type: "string"
    }
  },
  supports: {
    align: true,
    html: false,
    reusable: false
  },
  editorStyle: "gc-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 entity = (0,external_gc_data_namespaceObject.select)(external_gc_coreData_namespaceObject.store).getEntityRecord('postType', 'gc_template_part', theme + '//' + slug);

    if (!entity) {
      return;
    }

    return (0,external_gc_htmlEntities_namespaceObject.decodeEntities)(entity.title?.rendered) || capitalCase(entity.slug);
  },
  edit: TemplatePartEdit
};
const template_part_init = () => {
  (0,external_gc_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_gc_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', '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
  });
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/term-description.js


/**
 * GeChiUI dependencies
 */

const term_description_tag = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var term_description = (term_description_tag);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/term-description/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */



function TermDescriptionEdit({
  attributes,
  setAttributes,
  mergedStyle
}) {
  const {
    textAlign
  } = attributes;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    }),
    style: mergedStyle
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentControl, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-term-description__placeholder"
  }, (0,external_gc_element_namespaceObject.createElement)("span", null, (0,external_gc_i18n_namespaceObject.__)('项目描述')))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/term-description/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


const term_description_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/term-description",
  title: "项目描述",
  category: "theme",
  description: "查看归档时显示分类、标签和自定义分类法的描述。",
  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
      }
    }
  }
};

const {
  name: term_description_name
} = term_description_metadata;

const term_description_settings = {
  icon: term_description,
  edit: TermDescriptionEdit
};
const term_description_init = () => initBlock({
  name: term_description_name,
  metadata: term_description_metadata,
  settings: term_description_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/text-columns/edit.js


/**
 * GeChiUI dependencies
 */




function TextColumnsEdit({
  attributes,
  setAttributes
}) {
  const {
    width,
    content,
    columns
  } = attributes;
  external_gc_deprecated_default()('The Text Columns block', {
    since: '5.3',
    alternative: 'the Columns block'
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockAlignmentToolbar, {
    value: width,
    onChange: nextWidth => setAttributes({
      width: nextWidth
    }),
    controls: ['center', 'wide', 'full']
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.RangeControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('栏目'),
    value: columns,
    onChange: value => setAttributes({
      columns: value
    }),
    min: 2,
    max: 4,
    required: true
  }))), (0,external_gc_element_namespaceObject.createElement)("div", { ...(0,external_gc_blockEditor_namespaceObject.useBlockProps)({
      className: `align${width} columns-${columns}`
    })
  }, Array.from({
    length: columns
  }).map((_, index) => {
    return (0,external_gc_element_namespaceObject.createElement)("div", {
      className: "gc-block-column",
      key: `column-${index}`
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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_gc_i18n_namespaceObject.sprintf)( // translators: %d: column index (starting with 1)
      (0,external_gc_i18n_namespaceObject.__)('栏目%d文字'), index + 1),
      placeholder: (0,external_gc_i18n_namespaceObject.__)('新建栏目')
    }));
  })));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/text-columns/save.js


/**
 * GeChiUI dependencies
 */

function text_columns_save_save({
  attributes
}) {
  const {
    width,
    content,
    columns
  } = attributes;
  return (0,external_gc_element_namespaceObject.createElement)("div", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className: `align${width} columns-${columns}`
    })
  }, Array.from({
    length: columns
  }).map((_, index) => (0,external_gc_element_namespaceObject.createElement)("div", {
    className: "gc-block-column",
    key: `column-${index}`
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    tagName: "p",
    value: content?.[index]?.children
  }))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/text-columns/transforms.js
/**
 * GeChiUI dependencies
 */

const text_columns_transforms_transforms = {
  to: [{
    type: 'block',
    blocks: ['core/columns'],
    transform: ({
      className,
      columns,
      content,
      width
    }) => (0,external_gc_blocks_namespaceObject.createBlock)('core/columns', {
      align: 'wide' === width || 'full' === width ? width : undefined,
      className,
      columns
    }, content.map(({
      children
    }) => (0,external_gc_blocks_namespaceObject.createBlock)('core/column', {}, [(0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', {
      content: children
    })])))
  }]
};
/* harmony default export */ var text_columns_transforms = (text_columns_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/text-columns/index.js
/**
 * Internal dependencies
 */


const text_columns_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/text-columns",
  title: "文本栏（已弃用）",
  icon: "columns",
  category: "design",
  description: "此区块已弃用。请改用“栏目”区块。",
  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
  },
  editorStyle: "gc-block-text-columns-editor",
  style: "gc-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
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/verse.js


/**
 * GeChiUI dependencies
 */

const verse = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var library_verse = (verse);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/verse/deprecated.js


/**
 * External dependencies
 */

/**
 * GeChiUI 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 (0,external_gc_element_namespaceObject.createElement)(external_gc_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,
      __experimentalRole: '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 = classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    });
    return (0,external_gc_element_namespaceObject.createElement)("pre", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
        className
      })
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_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 */ var verse_deprecated = ([verse_deprecated_v2, verse_deprecated_v1]);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/verse/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */



function VerseEdit({
  attributes,
  setAttributes,
  mergeBlocks,
  onRemove,
  style
}) {
  const {
    textAlign,
    content
  } = attributes;
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classnames_default()({
      [`has-text-align-${textAlign}`]: textAlign
    }),
    style
  });
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.AlignmentToolbar, {
    value: textAlign,
    onChange: nextAlign => {
      setAttributes({
        textAlign: nextAlign
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    tagName: "pre",
    identifier: "content",
    preserveWhiteSpace: true,
    value: content,
    onChange: nextContent => {
      setAttributes({
        content: nextContent
      });
    },
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('诗篇文字'),
    placeholder: (0,external_gc_i18n_namespaceObject.__)('填写诗篇...' ),
    onRemove: onRemove,
    onMerge: mergeBlocks,
    textAlign: textAlign,
    ...blockProps,
    __unstablePastePlainText: true
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/verse/save.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */


function verse_save_save({
  attributes
}) {
  const {
    textAlign,
    content
  } = attributes;
  const className = classnames_default()({
    [`has-text-align-${textAlign}`]: textAlign
  });
  return (0,external_gc_element_namespaceObject.createElement)("pre", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save({
      className
    })
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    value: content
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/verse/transforms.js
/**
 * GeChiUI dependencies
 */

const verse_transforms_transforms = {
  from: [{
    type: 'block',
    blocks: ['core/paragraph'],
    transform: attributes => (0,external_gc_blocks_namespaceObject.createBlock)('core/verse', attributes)
  }],
  to: [{
    type: 'block',
    blocks: ['core/paragraph'],
    transform: attributes => (0,external_gc_blocks_namespaceObject.createBlock)('core/paragraph', attributes)
  }]
};
/* harmony default export */ var verse_transforms = (verse_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/verse/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const verse_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/verse",
  title: "诗篇",
  category: "text",
  description: "插入诗歌，使用特殊的空白格式，或引用歌词。",
  keywords: ["poetry", "poem"],
  textdomain: "default",
  attributes: {
    content: {
      type: "string",
      source: "html",
      selector: "pre",
      "default": "",
      __unstablePreserveWhiteSpace: true,
      __experimentalRole: "content"
    },
    textAlign: {
      type: "string"
    }
  },
  supports: {
    anchor: true,
    color: {
      gradients: true,
      link: true,
      __experimentalDefaultControls: {
        background: true,
        text: true
      }
    },
    typography: {
      fontSize: true,
      __experimentalFontFamily: true,
      lineHeight: true,
      __experimentalFontStyle: true,
      __experimentalFontWeight: true,
      __experimentalLetterSpacing: true,
      __experimentalTextTransform: true,
      __experimentalTextDecoration: true,
      __experimentalDefaultControls: {
        fontSize: true,
        fontAppearance: true
      }
    },
    spacing: {
      margin: true,
      padding: true,
      __experimentalDefaultControls: {
        margin: false,
        padding: false
      }
    },
    __experimentalBorder: {
      radius: true,
      width: true,
      color: true,
      style: true
    }
  },
  style: "gc-block-verse",
  editorStyle: "gc-block-verse-editor"
};


const {
  name: verse_name
} = verse_metadata;

const verse_settings = {
  icon: library_verse,
  example: {
    attributes: {
      /* eslint-disable @gechiui/i18n-no-collapsible-whitespace */
      // translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work.
      content: (0,external_gc_i18n_namespaceObject.__)('有一万片叶子为你倾倒，我会在其中默默等待，\n有一千片叶子为你歌唱，里面会有一种属于我的声音，\n如果还有一片叶子未曾离去，那一定是我等待的身影。\n我阻止不了生命的流逝，我只能尽量的让自己的生命丰满，\n    而丰满就是有你。')
      /* eslint-enable @gechiui/i18n-no-collapsible-whitespace */

    }
  },
  transforms: verse_transforms,
  deprecated: verse_deprecated,

  merge(attributes, attributesToMerge) {
    return {
      content: attributes.content + attributesToMerge.content
    };
  },

  edit: VerseEdit,
  save: verse_save_save
};
const verse_init = () => initBlock({
  name: verse_name,
  metadata: verse_metadata,
  settings: verse_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/icons/build-module/library/video.js


/**
 * GeChiUI dependencies
 */

const video = (0,external_gc_element_namespaceObject.createElement)(external_gc_primitives_namespaceObject.SVG, {
  viewBox: "0 0 24 24",
  xmlns: "http://www.w3.org/2000/svg"
}, (0,external_gc_element_namespaceObject.createElement)(external_gc_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-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"
}));
/* harmony default export */ var library_video = (video);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/video/tracks.js

function Tracks({
  tracks = []
}) {
  return tracks.map(track => {
    return (0,external_gc_element_namespaceObject.createElement)("track", {
      key: track.src,
      ...track
    });
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/video/deprecated.js


/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */

const video_deprecated_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/video",
  title: "视频",
  category: "media",
  description: "嵌入您媒体库中的视频或上传新的视频。",
  keywords: ["movie"],
  textdomain: "default",
  attributes: {
    autoplay: {
      type: "boolean",
      source: "attribute",
      selector: "video",
      attribute: "autoplay"
    },
    caption: {
      type: "string",
      source: "html",
      selector: "figcaption",
      __experimentalRole: "content"
    },
    controls: {
      type: "boolean",
      source: "attribute",
      selector: "video",
      attribute: "controls",
      "default": true
    },
    id: {
      type: "number",
      __experimentalRole: "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"
    },
    src: {
      type: "string",
      source: "attribute",
      selector: "video",
      attribute: "src",
      __experimentalRole: "content"
    },
    playsInline: {
      type: "boolean",
      source: "attribute",
      selector: "video",
      attribute: "playsinline"
    },
    tracks: {
      __experimentalRole: "content",
      type: "array",
      items: {
        type: "object"
      },
      "default": []
    }
  },
  supports: {
    anchor: true,
    align: true,
    spacing: {
      margin: true,
      padding: true,
      __experimentalDefaultControls: {
        margin: false,
        padding: false
      }
    }
  },
  editorStyle: "gc-block-video-editor",
  style: "gc-block-video"
};

const {
  attributes: video_deprecated_blockAttributes
} = video_deprecated_metadata; // In #41140 support was added to global styles for caption elements which added a `gc-element-caption` classname
// to the video figcaption element.

const video_deprecated_v1 = {
  attributes: video_deprecated_blockAttributes,

  save({
    attributes
  }) {
    const {
      autoplay,
      caption,
      controls,
      loop,
      muted,
      poster,
      preload,
      src,
      playsInline,
      tracks
    } = attributes;
    return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
    }, src && (0,external_gc_element_namespaceObject.createElement)("video", {
      autoPlay: autoplay,
      controls: controls,
      loop: loop,
      muted: muted,
      poster: poster,
      preload: preload !== 'metadata' ? preload : undefined,
      src: src,
      playsInline: playsInline
    }, (0,external_gc_element_namespaceObject.createElement)(Tracks, {
      tracks: tracks
    })), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
      tagName: "figcaption",
      value: caption
    }));
  }

};
const video_deprecated_deprecated = [video_deprecated_v1];
/* harmony default export */ var video_deprecated = (video_deprecated_deprecated);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/video/edit-common-settings.js


/**
 * GeChiUI dependencies
 */



const options = [{
  value: 'auto',
  label: (0,external_gc_i18n_namespaceObject.__)('自动')
}, {
  value: 'metadata',
  label: (0,external_gc_i18n_namespaceObject.__)('元数据')
}, {
  value: 'none',
  label: (0,external_gc_i18n_namespaceObject._x)('无', 'Preload value')
}];

const VideoSettings = ({
  setAttributes,
  attributes
}) => {
  const {
    autoplay,
    controls,
    loop,
    muted,
    playsInline,
    preload
  } = attributes;

  const autoPlayHelpText = (0,external_gc_i18n_namespaceObject.__)('自动播放可能对一些用户造成可用性问题。');

  const getAutoplayHelp = external_gc_element_namespaceObject.Platform.select({
    web: (0,external_gc_element_namespaceObject.useCallback)(checked => {
      return checked ? autoPlayHelpText : null;
    }, []),
    native: autoPlayHelpText
  });
  const toggleFactory = (0,external_gc_element_namespaceObject.useMemo)(() => {
    const toggleAttribute = attribute => {
      return newValue => {
        setAttributes({
          [attribute]: newValue
        });
      };
    };

    return {
      autoplay: toggleAttribute('autoplay'),
      loop: toggleAttribute('loop'),
      muted: toggleAttribute('muted'),
      controls: toggleAttribute('controls'),
      playsInline: toggleAttribute('playsInline')
    };
  }, []);
  const onChangePreload = (0,external_gc_element_namespaceObject.useCallback)(value => {
    setAttributes({
      preload: value
    });
  }, []);
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('自动播放'),
    onChange: toggleFactory.autoplay,
    checked: !!autoplay,
    help: getAutoplayHelp
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('循环'),
    onChange: toggleFactory.loop,
    checked: !!loop
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('静音'),
    onChange: toggleFactory.muted,
    checked: !!muted
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('回放控制'),
    onChange: toggleFactory.controls,
    checked: !!controls
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToggleControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('内联播放'),
    onChange: toggleFactory.playsInline,
    checked: !!playsInline
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    label: (0,external_gc_i18n_namespaceObject.__)('预加载'),
    value: preload,
    onChange: onChangePreload,
    options: options,
    hideCancelButton: true
  }));
};

/* harmony default export */ var edit_common_settings = (VideoSettings);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/video/tracks-editor.js


/**
 * GeChiUI dependencies
 */







const ALLOWED_TYPES = ['text/vtt'];
const DEFAULT_KIND = 'subtitles';
const KIND_OPTIONS = [{
  label: (0,external_gc_i18n_namespaceObject.__)('字幕'),
  value: 'subtitles'
}, {
  label: (0,external_gc_i18n_namespaceObject.__)('说明文字'),
  value: 'captions'
}, {
  label: (0,external_gc_i18n_namespaceObject.__)('描述'),
  value: 'descriptions'
}, {
  label: (0,external_gc_i18n_namespaceObject.__)('章节'),
  value: 'chapters'
}, {
  label: (0,external_gc_i18n_namespaceObject.__)('元数据'),
  value: 'metadata'
}];

function TrackList({
  tracks,
  onEditPress
}) {
  let content;

  if (tracks.length === 0) {
    content = (0,external_gc_element_namespaceObject.createElement)("p", {
      className: "block-library-video-tracks-editor__tracks-informative-message"
    }, (0,external_gc_i18n_namespaceObject.__)('“音轨”元素可以是字幕、说明文字、章节或内容描述，其有助于更多的用户访问您的内容。'));
  } else {
    content = tracks.map((track, index) => {
      return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalHStack, {
        key: index,
        className: "block-library-video-tracks-editor__track-list-track"
      }, (0,external_gc_element_namespaceObject.createElement)("span", null, track.label, " "), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
        variant: "tertiary",
        onClick: () => onEditPress(index),
        "aria-label": (0,external_gc_i18n_namespaceObject.sprintf)(
        /* translators: %s: Label of the video text track e.g: "French subtitles" */
        (0,external_gc_i18n_namespaceObject.__)('编辑 %s'), track.label)
      }, (0,external_gc_i18n_namespaceObject.__)('编辑')));
    });
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuGroup, {
    label: (0,external_gc_i18n_namespaceObject.__)('文字音轨'),
    className: "block-library-video-tracks-editor__track-list"
  }, content);
}

function SingleTrackEditor({
  track,
  onChange,
  onClose,
  onRemove
}) {
  const {
    src = '',
    label = '',
    srcLang = '',
    kind = DEFAULT_KIND
  } = track;
  const fileName = src.startsWith('blob:') ? '' : (0,external_gc_url_namespaceObject.getFilename)(src) || '';
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.NavigableMenu, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalVStack, {
    className: "block-library-video-tracks-editor__single-track-editor",
    spacing: "4"
  }, (0,external_gc_element_namespaceObject.createElement)("span", {
    className: "block-library-video-tracks-editor__single-track-editor-edit-track-label"
  }, (0,external_gc_i18n_namespaceObject.__)('编辑音轨')), (0,external_gc_element_namespaceObject.createElement)("span", null, (0,external_gc_i18n_namespaceObject.__)('文件'), ": ", (0,external_gc_element_namespaceObject.createElement)("b", null, fileName)), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalGrid, {
    columns: 2,
    gap: 4
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true
    /* eslint-disable jsx-a11y/no-autofocus */
    ,
    autoFocus: true
    /* eslint-enable jsx-a11y/no-autofocus */
    ,
    onChange: newLabel => onChange({ ...track,
      label: newLabel
    }),
    label: (0,external_gc_i18n_namespaceObject.__)('标签'),
    value: label,
    help: (0,external_gc_i18n_namespaceObject.__)('音轨标题')
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.TextControl, {
    __nextHasNoMarginBottom: true,
    onChange: newSrcLang => onChange({ ...track,
      srcLang: newSrcLang
    }),
    label: (0,external_gc_i18n_namespaceObject.__)('源语言'),
    value: srcLang,
    help: (0,external_gc_i18n_namespaceObject.__)('语言标签（英语、法语等）')
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalVStack, {
    spacing: "8"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.SelectControl, {
    __nextHasNoMarginBottom: true,
    className: "block-library-video-tracks-editor__single-track-editor-kind-select",
    options: KIND_OPTIONS,
    value: kind,
    label: (0,external_gc_i18n_namespaceObject.__)('属性'),
    onChange: newKind => {
      onChange({ ...track,
        kind: newKind
      });
    }
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.__experimentalHStack, {
    className: "block-library-video-tracks-editor__single-track-editor-buttons-container"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    variant: "secondary",
    onClick: () => {
      const changes = {};
      let hasChanges = false;

      if (label === '') {
        changes.label = (0,external_gc_i18n_namespaceObject.__)('英语');
        hasChanges = true;
      }

      if (srcLang === '') {
        changes.srcLang = 'en';
        hasChanges = true;
      }

      if (track.kind === undefined) {
        changes.kind = DEFAULT_KIND;
        hasChanges = true;
      }

      if (hasChanges) {
        onChange({ ...track,
          ...changes
        });
      }

      onClose();
    }
  }, (0,external_gc_i18n_namespaceObject.__)('关闭')), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    isDestructive: true,
    variant: "link",
    onClick: onRemove
  }, (0,external_gc_i18n_namespaceObject.__)('移除音轨'))))));
}

function TracksEditor({
  tracks = [],
  onChange
}) {
  const mediaUpload = (0,external_gc_data_namespaceObject.useSelect)(select => {
    return select(external_gc_blockEditor_namespaceObject.store).getSettings().mediaUpload;
  }, []);
  const [trackBeingEdited, setTrackBeingEdited] = (0,external_gc_element_namespaceObject.useState)(null);

  if (!mediaUpload) {
    return null;
  }

  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Dropdown, {
    contentClassName: "block-library-video-tracks-editor",
    renderToggle: ({
      isOpen,
      onToggle
    }) => (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarGroup, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
      label: (0,external_gc_i18n_namespaceObject.__)('文字音轨'),
      showTooltip: true,
      "aria-expanded": isOpen,
      "aria-haspopup": "true",
      onClick: onToggle
    }, (0,external_gc_i18n_namespaceObject.__)('文字音轨'))),
    renderContent: () => {
      if (trackBeingEdited !== null) {
        return (0,external_gc_element_namespaceObject.createElement)(SingleTrackEditor, {
          track: tracks[trackBeingEdited],
          onChange: newTrack => {
            const newTracks = [...tracks];
            newTracks[trackBeingEdited] = newTrack;
            onChange(newTracks);
          },
          onClose: () => setTrackBeingEdited(null),
          onRemove: () => {
            onChange(tracks.filter((_track, index) => index !== trackBeingEdited));
            setTrackBeingEdited(null);
          }
        });
      }

      return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.NavigableMenu, null, (0,external_gc_element_namespaceObject.createElement)(TrackList, {
        tracks: tracks,
        onEditPress: setTrackBeingEdited
      }), (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuGroup, {
        className: "block-library-video-tracks-editor__add-tracks-container",
        label: (0,external_gc_i18n_namespaceObject.__)('天家音轨')
      }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaUpload, {
        onSelect: ({
          url
        }) => {
          const trackIndex = tracks.length;
          onChange([...tracks, {
            src: url
          }]);
          setTrackBeingEdited(trackIndex);
        },
        allowedTypes: ALLOWED_TYPES,
        render: ({
          open
        }) => (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItem, {
          icon: library_media,
          onClick: open
        }, (0,external_gc_i18n_namespaceObject.__)('打开媒体库'))
      }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.FormFileUpload, {
        onChange: event => {
          const files = event.target.files;
          const trackIndex = tracks.length;
          mediaUpload({
            allowedTypes: ALLOWED_TYPES,
            filesList: files,
            onFileChange: ([{
              url
            }]) => {
              const newTracks = [...tracks];

              if (!newTracks[trackIndex]) {
                newTracks[trackIndex] = {};
              }

              newTracks[trackIndex] = { ...tracks[trackIndex],
                src: url
              };
              onChange(newTracks);
              setTrackBeingEdited(trackIndex);
            }
          });
        },
        accept: ".vtt,text/vtt",
        render: ({
          openFileDialog
        }) => {
          return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.MenuItem, {
            icon: library_upload,
            onClick: () => {
              openFileDialog();
            }
          }, (0,external_gc_i18n_namespaceObject.__)('上传'));
        }
      })))));
    }
  });
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/video/edit.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */











/**
 * Internal dependencies
 */




 // Much of this description is duplicated from MediaPlaceholder.

const video_edit_placeholder = content => {
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
    className: "block-editor-media-placeholder",
    withIllustration: true,
    icon: library_video,
    label: (0,external_gc_i18n_namespaceObject.__)('视频'),
    instructions: (0,external_gc_i18n_namespaceObject.__)('上传视频文件，从您的媒体库中选择，或通过URL添加。')
  }, content);
};

const video_edit_ALLOWED_MEDIA_TYPES = ['video'];
const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = ['image'];

function VideoEdit({
  isSelected,
  attributes,
  className,
  setAttributes,
  insertBlocksAfter,
  onReplace
}) {
  const instanceId = (0,external_gc_compose_namespaceObject.useInstanceId)(VideoEdit);
  const videoPlayer = (0,external_gc_element_namespaceObject.useRef)();
  const posterImageButton = (0,external_gc_element_namespaceObject.useRef)();
  const {
    id,
    caption,
    controls,
    poster,
    src,
    tracks
  } = attributes;
  const prevCaption = (0,external_gc_compose_namespaceObject.usePrevious)(caption);
  const [showCaption, setShowCaption] = (0,external_gc_element_namespaceObject.useState)(!!caption);
  const isTemporaryVideo = !id && (0,external_gc_blob_namespaceObject.isBlobURL)(src);
  const mediaUpload = (0,external_gc_data_namespaceObject.useSelect)(select => select(external_gc_blockEditor_namespaceObject.store).getSettings().mediaUpload, []);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!id && (0,external_gc_blob_namespaceObject.isBlobURL)(src)) {
      const file = (0,external_gc_blob_namespaceObject.getBlobByURL)(src);

      if (file) {
        mediaUpload({
          filesList: [file],
          onFileChange: ([media]) => onSelectVideo(media),
          onError: onUploadError,
          allowedTypes: video_edit_ALLOWED_MEDIA_TYPES
        });
      }
    }
  }, []);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    // Placeholder may be rendered.
    if (videoPlayer.current) {
      videoPlayer.current.load();
    }
  }, [poster]); // We need to show the caption when changes come from
  // history navigation(undo/redo).

  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (caption && !prevCaption) {
      setShowCaption(true);
    }
  }, [caption, prevCaption]); // Focus the caption when we click to add one.

  const captionRef = (0,external_gc_element_namespaceObject.useCallback)(node => {
    if (node && !caption) {
      node.focus();
    }
  }, [caption]);
  (0,external_gc_element_namespaceObject.useEffect)(() => {
    if (!isSelected && !caption) {
      setShowCaption(false);
    }
  }, [isSelected, caption]);

  function onSelectVideo(media) {
    if (!media || !media.url) {
      // In this case there was an error
      // previous attributes should be removed
      // because they may be temporary blob urls.
      setAttributes({
        src: undefined,
        id: undefined,
        poster: undefined,
        caption: undefined
      });
      return;
    } // Sets the block's attribute and updates the edit component from the
    // selected media.


    setAttributes({
      src: media.url,
      id: media.id,
      poster: media.image?.src !== media.icon ? media.image?.src : undefined,
      caption: media.caption
    });
  }

  function onSelectURL(newSrc) {
    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,
        poster: undefined
      });
    }
  }

  const {
    createErrorNotice
  } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_notices_namespaceObject.store);

  function onUploadError(message) {
    createErrorNotice(message, {
      type: 'snackbar'
    });
  }

  const classes = classnames_default()(className, {
    'is-transient': isTemporaryVideo
  });
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)({
    className: classes
  });

  if (!src) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaPlaceholder, {
      icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
        icon: library_video
      }),
      onSelect: onSelectVideo,
      onSelectURL: onSelectURL,
      accept: "video/*",
      allowedTypes: video_edit_ALLOWED_MEDIA_TYPES,
      value: attributes,
      onError: onUploadError,
      placeholder: video_edit_placeholder
    }));
  }

  function onSelectPoster(image) {
    setAttributes({
      poster: image.url
    });
  }

  function onRemovePoster() {
    setAttributes({
      poster: undefined
    }); // Move focus back to the Media Upload button.

    posterImageButton.current.focus();
  }

  const videoPosterDescription = `video-block__poster-image-description-${instanceId}`;
  return (0,external_gc_element_namespaceObject.createElement)(external_gc_element_namespaceObject.Fragment, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "block"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.ToolbarButton, {
    onClick: () => {
      setShowCaption(!showCaption);

      if (showCaption && caption) {
        setAttributes({
          caption: undefined
        });
      }
    },
    icon: library_caption,
    isPressed: showCaption,
    label: showCaption ? (0,external_gc_i18n_namespaceObject.__)('移除说明文字') : (0,external_gc_i18n_namespaceObject.__)('添加说明文字')
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, null, (0,external_gc_element_namespaceObject.createElement)(TracksEditor, {
    tracks: tracks,
    onChange: newTracks => {
      setAttributes({
        tracks: newTracks
      });
    }
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockControls, {
    group: "other"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaReplaceFlow, {
    mediaId: id,
    mediaURL: src,
    allowedTypes: video_edit_ALLOWED_MEDIA_TYPES,
    accept: "video/*",
    onSelect: onSelectVideo,
    onSelectURL: onSelectURL,
    onError: onUploadError
  })), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.InspectorControls, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.PanelBody, {
    title: (0,external_gc_i18n_namespaceObject.__)('设置')
  }, (0,external_gc_element_namespaceObject.createElement)(edit_common_settings, {
    setAttributes: setAttributes,
    attributes: attributes
  }), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaUploadCheck, null, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.BaseControl, {
    className: "editor-video-poster-control"
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.BaseControl.VisualLabel, null, (0,external_gc_i18n_namespaceObject.__)('海报图片')), (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.MediaUpload, {
    title: (0,external_gc_i18n_namespaceObject.__)('选择海报图片'),
    onSelect: onSelectPoster,
    allowedTypes: VIDEO_POSTER_ALLOWED_MEDIA_TYPES,
    render: ({
      open
    }) => (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
      variant: "primary",
      onClick: open,
      ref: posterImageButton,
      "aria-describedby": videoPosterDescription
    }, !poster ? (0,external_gc_i18n_namespaceObject.__)('选择') : (0,external_gc_i18n_namespaceObject.__)('替换'))
  }), (0,external_gc_element_namespaceObject.createElement)("p", {
    id: videoPosterDescription,
    hidden: true
  }, poster ? (0,external_gc_i18n_namespaceObject.sprintf)(
  /* translators: %s: poster image URL. */
  (0,external_gc_i18n_namespaceObject.__)('当前海报图片的URL为%s'), poster) : (0,external_gc_i18n_namespaceObject.__)('当前没有选择海报图片')), !!poster && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Button, {
    onClick: onRemovePoster,
    variant: "tertiary"
  }, (0,external_gc_i18n_namespaceObject.__)('移除')))))), (0,external_gc_element_namespaceObject.createElement)("figure", { ...blockProps
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Disabled, {
    isDisabled: !isSelected
  }, (0,external_gc_element_namespaceObject.createElement)("video", {
    controls: controls,
    poster: poster,
    src: src,
    ref: videoPlayer
  }, (0,external_gc_element_namespaceObject.createElement)(Tracks, {
    tracks: tracks
  }))), isTemporaryVideo && (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Spinner, null), showCaption && (!external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    identifier: "caption",
    tagName: "figcaption",
    className: (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
    "aria-label": (0,external_gc_i18n_namespaceObject.__)('视频说明文字'),
    ref: captionRef,
    placeholder: (0,external_gc_i18n_namespaceObject.__)('添加说明文字'),
    value: caption,
    onChange: value => setAttributes({
      caption: value
    }),
    inlineToolbar: true,
    __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_gc_blocks_namespaceObject.createBlock)((0,external_gc_blocks_namespaceObject.getDefaultBlockName)()))
  })));
}

/* harmony default export */ var video_edit = (VideoEdit);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/video/save.js


/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */


function video_save_save({
  attributes
}) {
  const {
    autoplay,
    caption,
    controls,
    loop,
    muted,
    poster,
    preload,
    src,
    playsInline,
    tracks
  } = attributes;
  return (0,external_gc_element_namespaceObject.createElement)("figure", { ...external_gc_blockEditor_namespaceObject.useBlockProps.save()
  }, src && (0,external_gc_element_namespaceObject.createElement)("video", {
    autoPlay: autoplay,
    controls: controls,
    loop: loop,
    muted: muted,
    poster: poster,
    preload: preload !== 'metadata' ? preload : undefined,
    src: src,
    playsInline: playsInline
  }, (0,external_gc_element_namespaceObject.createElement)(Tracks, {
    tracks: tracks
  })), !external_gc_blockEditor_namespaceObject.RichText.isEmpty(caption) && (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText.Content, {
    className: (0,external_gc_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
    tagName: "figcaption",
    value: caption
  }));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/video/transforms.js
/**
 * GeChiUI dependencies
 */


const video_transforms_transforms = {
  from: [{
    type: 'files',

    isMatch(files) {
      return files.length === 1 && files[0].type.indexOf('video/') === 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 video block

      const block = (0,external_gc_blocks_namespaceObject.createBlock)('core/video', {
        src: (0,external_gc_blob_namespaceObject.createBlobURL)(file)
      });
      return block;
    }

  }, {
    type: 'shortcode',
    tag: 'video',
    attributes: {
      src: {
        type: 'string',
        shortcode: ({
          named: {
            src,
            mp4,
            m4v,
            webm,
            ogv,
            flv
          }
        }) => {
          return src || mp4 || m4v || webm || ogv || flv;
        }
      },
      poster: {
        type: 'string',
        shortcode: ({
          named: {
            poster
          }
        }) => {
          return poster;
        }
      },
      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 */ var video_transforms = (video_transforms_transforms);

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/video/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */




const video_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/video",
  title: "视频",
  category: "media",
  description: "嵌入您媒体库中的视频或上传新的视频。",
  keywords: ["movie"],
  textdomain: "default",
  attributes: {
    autoplay: {
      type: "boolean",
      source: "attribute",
      selector: "video",
      attribute: "autoplay"
    },
    caption: {
      type: "string",
      source: "html",
      selector: "figcaption",
      __experimentalRole: "content"
    },
    controls: {
      type: "boolean",
      source: "attribute",
      selector: "video",
      attribute: "controls",
      "default": true
    },
    id: {
      type: "number",
      __experimentalRole: "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"
    },
    src: {
      type: "string",
      source: "attribute",
      selector: "video",
      attribute: "src",
      __experimentalRole: "content"
    },
    playsInline: {
      type: "boolean",
      source: "attribute",
      selector: "video",
      attribute: "playsinline"
    },
    tracks: {
      __experimentalRole: "content",
      type: "array",
      items: {
        type: "object"
      },
      "default": []
    }
  },
  supports: {
    anchor: true,
    align: true,
    spacing: {
      margin: true,
      padding: true,
      __experimentalDefaultControls: {
        margin: false,
        padding: false
      }
    }
  },
  editorStyle: "gc-block-video-editor",
  style: "gc-block-video"
};


const {
  name: video_name
} = video_metadata;

const video_settings = {
  icon: library_video,
  example: {
    attributes: {
      src: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm',
      // translators: Caption accompanying a video of the wood thrush singing, which serves as an example for the Video block.
      caption: (0,external_gc_i18n_namespaceObject.__)('在纽约市中央公园唱歌的木鸫。')
    }
  },
  transforms: video_transforms,
  deprecated: video_deprecated,
  edit: video_edit,
  save: video_save_save
};
const video_init = () => initBlock({
  name: video_name,
  metadata: video_metadata,
  settings: video_settings
});

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/footnotes/edit.js


/**
 * GeChiUI dependencies
 */





function FootnotesEdit({
  context: {
    postType,
    postId
  }
}) {
  const [meta, updateMeta] = (0,external_gc_coreData_namespaceObject.useEntityProp)('postType', postType, 'meta', postId);
  const footnotes = meta?.footnotes ? JSON.parse(meta.footnotes) : [];
  const blockProps = (0,external_gc_blockEditor_namespaceObject.useBlockProps)();

  if (postType !== 'post' && postType !== 'page') {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
      icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
        icon: format_list_numbered
      }),
      label: (0,external_gc_i18n_namespaceObject.__)('脚注') // To do: add instructions. We can't add new string in RC.

    }));
  }

  if (!footnotes.length) {
    return (0,external_gc_element_namespaceObject.createElement)("div", { ...blockProps
    }, (0,external_gc_element_namespaceObject.createElement)(external_gc_components_namespaceObject.Placeholder, {
      icon: (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.BlockIcon, {
        icon: format_list_numbered
      }),
      label: (0,external_gc_i18n_namespaceObject.__)('脚注'),
      instructions: (0,external_gc_i18n_namespaceObject.__)('在此文档块中找到脚注将显示在此处。')
    }));
  }

  return (0,external_gc_element_namespaceObject.createElement)("ol", { ...blockProps
  }, footnotes.map(({
    id,
    content
  }) => (0,external_gc_element_namespaceObject.createElement)("li", {
    key: id
  }, (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichText, {
    id: id,
    tagName: "span",
    value: content,
    identifier: id // To do: figure out why the browser is not scrolling
    // into view when it receives focus.
    ,
    onFocus: event => {
      if (!event.target.textContent.trim()) {
        event.target.scrollIntoView();
      }
    },
    onChange: nextFootnote => {
      updateMeta({ ...meta,
        footnotes: JSON.stringify(footnotes.map(footnote => {
          return footnote.id === id ? {
            content: nextFootnote,
            id
          } : footnote;
        }))
      });
    }
  }), ' ', (0,external_gc_element_namespaceObject.createElement)("a", {
    href: `#${id}-link`
  }, "\u21A9\uFE0E"))));
}

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/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()).
var getRandomValues;
var 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. Also,
    // find the complete implementation of crypto (msCrypto) on IE11.
    getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);

    if (!getRandomValues) {
      throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
    }
  }

  return getRandomValues(rnds8);
}
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/node_modules/uuid/dist/esm-browser/regex.js
/* harmony default export */ var regex = (/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i);
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/node_modules/uuid/dist/esm-browser/validate.js


function validate(uuid) {
  return typeof uuid === 'string' && regex.test(uuid);
}

/* harmony default export */ var esm_browser_validate = (validate);
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/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
 */

var byteToHex = [];

for (var stringify_i = 0; stringify_i < 256; ++stringify_i) {
  byteToHex.push((stringify_i + 0x100).toString(16).substr(1));
}

function stringify(arr) {
  var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 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
  var uuid = (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]]).toLowerCase(); // 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 (!esm_browser_validate(uuid)) {
    throw TypeError('Stringified UUID is invalid');
  }

  return uuid;
}

/* harmony default export */ var esm_browser_stringify = (stringify);
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/node_modules/uuid/dist/esm-browser/v4.js



function v4_v4(options, buf, offset) {
  options = options || {};
  var 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 (var i = 0; i < 16; ++i) {
      buf[offset + i] = rnds[i];
    }

    return buf;
  }

  return esm_browser_stringify(rnds);
}

/* harmony default export */ var esm_browser_v4 = (v4_v4);
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/footnotes/format.js


/**
 * External dependencies
 */

/**
 * GeChiUI dependencies
 */







/**
 * Internal dependencies
 */

const {
  name: format_name
} = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/footnotes",
  title: "脚注",
  category: "text",
  description: "",
  keywords: ["references"],
  textdomain: "default",
  usesContext: ["postId", "postType"],
  supports: {
    html: false,
    multiple: false,
    reusable: false
  },
  style: "gc-block-footnotes"
};

const {
  usesContextKey
} = unlock(external_gc_blockEditor_namespaceObject.privateApis);
const formatName = 'core/footnote';
const POST_CONTENT_BLOCK_NAME = 'core/post-content';
const SYNCED_PATTERN_BLOCK_NAME = 'core/block';
const format = {
  title: (0,external_gc_i18n_namespaceObject.__)('脚注'),
  tagName: 'sup',
  className: 'fn',
  attributes: {
    'data-fn': 'data-fn'
  },
  contentEditable: false,
  [usesContextKey]: ['postType'],
  edit: function Edit({
    value,
    onChange,
    isObjectActive,
    context: {
      postType
    }
  }) {
    const registry = (0,external_gc_data_namespaceObject.useRegistry)();
    const {
      getSelectedBlockClientId,
      getBlocks,
      getBlockRootClientId,
      getBlockName,
      getBlockParentsByBlockName
    } = (0,external_gc_data_namespaceObject.useSelect)(external_gc_blockEditor_namespaceObject.store);
    const footnotesBlockType = (0,external_gc_data_namespaceObject.useSelect)(select => select(external_gc_blocks_namespaceObject.store).getBlockType(format_name));
    /*
     * This useSelect exists because we need to use its return value
     * outside the event callback.
     */

    const isBlockWithinPattern = (0,external_gc_data_namespaceObject.useSelect)(select => {
      const {
        getBlockParentsByBlockName: _getBlockParentsByBlockName,
        getSelectedBlockClientId: _getSelectedBlockClientId
      } = select(external_gc_blockEditor_namespaceObject.store);

      const parentCoreBlocks = _getBlockParentsByBlockName(_getSelectedBlockClientId(), SYNCED_PATTERN_BLOCK_NAME);

      return parentCoreBlocks && parentCoreBlocks.length > 0;
    }, []);
    const {
      selectionChange,
      insertBlock
    } = (0,external_gc_data_namespaceObject.useDispatch)(external_gc_blockEditor_namespaceObject.store);

    if (!footnotesBlockType) {
      return null;
    }

    if (postType !== 'post' && postType !== 'page') {
      return null;
    } // Checks if the selected block lives within a pattern.


    if (isBlockWithinPattern) {
      return null;
    }

    function onClick() {
      registry.batch(() => {
        let id;

        if (isObjectActive) {
          const object = value.replacements[value.start];
          id = object?.attributes?.['data-fn'];
        } else {
          id = esm_browser_v4();
          const newValue = (0,external_gc_richText_namespaceObject.insertObject)(value, {
            type: formatName,
            attributes: {
              'data-fn': id
            },
            innerHTML: `<a href="#${id}" id="${id}-link">*</a>`
          }, value.end, value.end);
          newValue.start = newValue.end - 1;
          onChange(newValue);
        }

        const selectedClientId = getSelectedBlockClientId();
        /*
         * Attempts to find a common parent post content block.
         * This allows for locating blocks within a page edited in the site editor.
         */

        const parentPostContent = getBlockParentsByBlockName(selectedClientId, POST_CONTENT_BLOCK_NAME); // When called with a post content block, getBlocks will return
        // the block with controlled inner blocks included.

        const blocks = parentPostContent.length ? getBlocks(parentPostContent[0]) : getBlocks(); // BFS search to find the first footnote block.

        let fnBlock = null;
        {
          const queue = [...blocks];

          while (queue.length) {
            const block = queue.shift();

            if (block.name === format_name) {
              fnBlock = block;
              break;
            }

            queue.push(...block.innerBlocks);
          }
        } // Maybe this should all also be moved to the entity provider.
        // When there is no footnotes block in the post, create one and
        // insert it at the bottom.

        if (!fnBlock) {
          let rootClientId = getBlockRootClientId(selectedClientId);

          while (rootClientId && getBlockName(rootClientId) !== POST_CONTENT_BLOCK_NAME) {
            rootClientId = getBlockRootClientId(rootClientId);
          }

          fnBlock = (0,external_gc_blocks_namespaceObject.createBlock)(format_name);
          insertBlock(fnBlock, undefined, rootClientId);
        }

        selectionChange(fnBlock.clientId, id, 0, 0);
      });
    }

    return (0,external_gc_element_namespaceObject.createElement)(external_gc_blockEditor_namespaceObject.RichTextToolbarButton, {
      icon: format_list_numbered,
      title: (0,external_gc_i18n_namespaceObject.__)('脚注'),
      onClick: onClick,
      isActive: isObjectActive
    });
  }
};

;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/footnotes/index.js
/**
 * GeChiUI dependencies
 */


/**
 * Internal dependencies
 */



const footnotes_metadata = {
  $schema: "https://schemas.gc.org/trunk/block.json",
  apiVersion: 3,
  name: "core/footnotes",
  title: "脚注",
  category: "text",
  description: "",
  keywords: ["references"],
  textdomain: "default",
  usesContext: ["postId", "postType"],
  supports: {
    html: false,
    multiple: false,
    reusable: false
  },
  style: "gc-block-footnotes"
};

const {
  name: footnotes_name
} = footnotes_metadata;

const footnotes_settings = {
  icon: format_list_numbered,
  edit: FootnotesEdit
};
(0,external_gc_richText_namespaceObject.registerFormatType)(formatName, format);
const footnotes_init = () => {
  initBlock({
    name: footnotes_name,
    metadata: footnotes_metadata,
    settings: footnotes_settings
  });
};

// EXTERNAL MODULE: ./node_modules/@gechiui/block-library/build-module/utils/is-block-metadata-experimental.js
var is_block_metadata_experimental = __webpack_require__(5202);
var is_block_metadata_experimental_default = /*#__PURE__*/__webpack_require__.n(is_block_metadata_experimental);
;// CONCATENATED MODULE: ./node_modules/@gechiui/block-library/build-module/index.js
/**
 * GeChiUI dependencies
 */

/**
 * Internal dependencies
 */
// When IS_GUTENBERG_PLUGIN is set to false, imports of experimental blocks
// are transformed by packages/block-library/src/index.js as follows:
//    import * as experimentalBlock from './experimental-block'
// becomes
//    const experimentalBlock = null;
// This enables webpack to eliminate the experimental blocks code from the
// production build to make the final bundle smaller.
//
// See https://github.com/GeChiUI/gutenberg/pull/40655 for more context.



































































































/**
 * Function to get all the block-library blocks in an array
 */

const getAllBlocks = () => {
  const blocks = [// Common blocks are grouped at the top to prioritize their display
  // in various contexts — like the inserter and auto-complete components.
  build_module_paragraph_namespaceObject, build_module_image_namespaceObject, build_module_heading_namespaceObject, build_module_gallery_namespaceObject, build_module_list_namespaceObject, build_module_list_item_namespaceObject, build_module_quote_namespaceObject, // Register all remaining core blocks.
  archives_namespaceObject, build_module_audio_namespaceObject, build_module_button_namespaceObject, build_module_buttons_namespaceObject, build_module_calendar_namespaceObject, categories_namespaceObject, ...(window.gc && window.gc.oldEditor ? [freeform_namespaceObject] : []), // Only add the classic block in GC Context.
  build_module_code_namespaceObject, build_module_column_namespaceObject, build_module_columns_namespaceObject, build_module_comment_author_avatar_namespaceObject, build_module_cover_namespaceObject, build_module_details_namespaceObject, embed_namespaceObject, build_module_file_namespaceObject, build_module_group_namespaceObject, build_module_html_namespaceObject, latest_comments_namespaceObject, latest_posts_namespaceObject, media_text_namespaceObject, missing_namespaceObject, build_module_more_namespaceObject, nextpage_namespaceObject, page_list_namespaceObject, page_list_item_namespaceObject, pattern_namespaceObject, build_module_preformatted_namespaceObject, build_module_pullquote_namespaceObject, block_namespaceObject, build_module_rss_namespaceObject, build_module_search_namespaceObject, build_module_separator_namespaceObject, build_module_shortcode_namespaceObject, social_link_namespaceObject, social_links_namespaceObject, spacer_namespaceObject, build_module_table_namespaceObject, tag_cloud_namespaceObject, text_columns_namespaceObject, build_module_verse_namespaceObject, build_module_video_namespaceObject, footnotes_namespaceObject, // theme blocks
  build_module_navigation_namespaceObject, navigation_link_namespaceObject, navigation_submenu_namespaceObject, build_module_site_logo_namespaceObject, site_title_namespaceObject, site_tagline_namespaceObject, query_namespaceObject, template_part_namespaceObject, avatar_namespaceObject, post_title_namespaceObject, build_module_post_excerpt_namespaceObject, build_module_post_featured_image_namespaceObject, build_module_post_content_namespaceObject, build_module_post_author_namespaceObject, post_author_name_namespaceObject, post_comment_namespaceObject, build_module_post_comments_count_namespaceObject, post_comments_link_namespaceObject, build_module_post_date_namespaceObject, build_module_post_terms_namespaceObject, post_navigation_link_namespaceObject, post_template_namespaceObject, post_time_to_read_namespaceObject, build_module_query_pagination_namespaceObject, build_module_query_pagination_next_namespaceObject, build_module_query_pagination_numbers_namespaceObject, build_module_query_pagination_previous_namespaceObject, query_no_results_namespaceObject, read_more_namespaceObject, comments_namespaceObject, build_module_comment_author_name_namespaceObject, build_module_comment_content_namespaceObject, comment_date_namespaceObject, build_module_comment_edit_link_namespaceObject, build_module_comment_reply_link_namespaceObject, comment_template_namespaceObject, comments_title_namespaceObject, comments_pagination_namespaceObject, comments_pagination_next_namespaceObject, comments_pagination_numbers_namespaceObject, comments_pagination_previous_namespaceObject, build_module_post_comments_form_namespaceObject, table_of_contents_namespaceObject, home_link_namespaceObject, loginout_namespaceObject, build_module_term_description_namespaceObject, query_title_namespaceObject, post_author_biography_namespaceObject];
  return blocks.filter(Boolean);
};
/**
 * Function to get all the core blocks in an array.
 *
 * @example
 * ```js
 * import { __experimentalGetCoreBlocks } from '@gechiui/block-library';
 *
 * const coreBlocks = __experimentalGetCoreBlocks();
 * ```
 */


const __experimentalGetCoreBlocks = () => getAllBlocks().filter(({
  metadata
}) => !is_block_metadata_experimental_default()(metadata));
/**
 * Function to register core blocks provided by the block editor.
 *
 * @param {Array} blocks An optional array of the core blocks being registered.
 *
 * @example
 * ```js
 * import { registerCoreBlocks } from '@gechiui/block-library';
 *
 * registerCoreBlocks();
 * ```
 */

const registerCoreBlocks = (blocks = __experimentalGetCoreBlocks()) => {
  blocks.forEach(({
    init
  }) => init());
  (0,external_gc_blocks_namespaceObject.setDefaultBlockName)(paragraph_name);

  if (window.gc && window.gc.oldEditor) {
    (0,external_gc_blocks_namespaceObject.setFreeformContentHandlerName)(freeform_name);
  }

  (0,external_gc_blocks_namespaceObject.setUnregisteredTypeHandlerName)(missing_name);
  (0,external_gc_blocks_namespaceObject.setGroupingBlockName)(group_name);
};
/**
 * Function to register experimental core blocks depending on editor settings.
 *
 * @param {boolean} enableFSEBlocks Whether to enable the full site editing blocks.
 * @example
 * ```js
 * import { __experimentalRegisterExperimentalCoreBlocks } from '@gechiui/block-library';
 *
 * __experimentalRegisterExperimentalCoreBlocks( settings );
 * ```
 */

const __experimentalRegisterExperimentalCoreBlocks =  false ? 0 : undefined;

}();
(window.gc = window.gc || {}).blockLibrary = __webpack_exports__;
/******/ })()
;