Files
williammiceli.me/static/admin/vendor/sveltia-cms.js
T
Hermes 0341edc73d
build / build (push) Successful in 35s
Add Hugo link page with Sveltia CMS admin
Content lives in data/profile.yaml and is edited as structured fields through Sveltia at /admin/, so the page is never hand-written HTML. The CMS bundle is vendored at a pinned version instead of loaded from unpkg, and the admin assets ship with the built site, so hosting and builds stay self-contained. PKCE sign-in activates once a Gitea OAuth application client ID is added to static/admin/config.yml.
2026-10-24 03:53:31 +00:00

3753 lines
2.5 MiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),d=s((e=>{
/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function re(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ie(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ae=/\/+/g;function oe(e,t){return typeof e==`object`&&e&&e.key!=null?ie(``+e.key):t.toString(36)}function se(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ce(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ce(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+oe(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ae,`$&/`)+`/`),ce(o,r,i,``,function(e){return e})):o!=null&&(re(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ae,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+oe(a,u),c+=ce(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+oe(a,u++),c+=ce(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ce(se(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function le(e,t,n){if(e==null)return e;var r=[],i=0;return ce(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ue(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var de=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function fe(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,de)}catch(e){de(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function pe(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else fe(pe.bind(null,e))}var me={map:le,forEach:function(e,t,n){le(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return le(e,function(){t++}),t},toArray:function(e){return le(e,function(e){return e})||[]},only:function(e){if(!re(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=me,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=pe,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return te(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ee.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return te(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=re,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ue}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=fe,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),f=s(((e,t)=>{t.exports=d()})),p=s(((e,t)=>{
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var n=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(e==null)throw TypeError(`Object.assign cannot be called with null or undefined`);return Object(e)}function o(){try{if(!Object.assign)return!1;var e=new String(`abc`);if(e[5]=`de`,Object.getOwnPropertyNames(e)[0]===`5`)return!1;for(var t={},n=0;n<10;n++)t[`_`+String.fromCharCode(n)]=n;if(Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(``)!==`0123456789`)return!1;var r={};return`abcdefghijklmnopqrst`.split(``).forEach(function(e){r[e]=e}),Object.keys(Object.assign({},r)).join(``)===`abcdefghijklmnopqrst`}catch{return!1}}t.exports=o()?Object.assign:function(e,t){for(var o,s=a(e),c,l=1;l<arguments.length;l++){for(var u in o=Object(arguments[l]),o)r.call(o,u)&&(s[u]=o[u]);if(n){c=n(o);for(var d=0;d<c.length;d++)i.call(o,c[d])&&(s[c[d]]=o[c[d]])}}return s}})),m=s(((e,t)=>{var n=p(),r={};function i(e,t,n,r,i,a,o,s){if(!e){var c;if(t===void 0)c=Error(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var l=[n,r,i,a,o,s],u=0;c=Error(t.replace(/%s/g,function(){return l[u++]})),c.name=`Invariant Violation`}throw c.framesToPop=1,c}}var a=`mixins`;function o(e){return e}function s(e,t,s){var c=[],l={mixins:`DEFINE_MANY`,statics:`DEFINE_MANY`,propTypes:`DEFINE_MANY`,contextTypes:`DEFINE_MANY`,childContextTypes:`DEFINE_MANY`,getDefaultProps:`DEFINE_MANY_MERGED`,getInitialState:`DEFINE_MANY_MERGED`,getChildContext:`DEFINE_MANY_MERGED`,render:`DEFINE_ONCE`,componentWillMount:`DEFINE_MANY`,componentDidMount:`DEFINE_MANY`,componentWillReceiveProps:`DEFINE_MANY`,shouldComponentUpdate:`DEFINE_ONCE`,componentWillUpdate:`DEFINE_MANY`,componentDidUpdate:`DEFINE_MANY`,componentWillUnmount:`DEFINE_MANY`,UNSAFE_componentWillMount:`DEFINE_MANY`,UNSAFE_componentWillReceiveProps:`DEFINE_MANY`,UNSAFE_componentWillUpdate:`DEFINE_MANY`,updateComponent:`OVERRIDE_BASE`},u={getDerivedStateFromProps:`DEFINE_MANY_MERGED`},d={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)p(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=n({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=n({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps=e.getDefaultProps?g(e.getDefaultProps,t):t},propTypes:function(e,t){e.propTypes=n({},e.propTypes,t)},statics:function(e,t){m(e,t)},autobind:function(){}};function f(e,t){var n=l.hasOwnProperty(t)?l[t]:null;S.hasOwnProperty(t)&&i(n===`OVERRIDE_BASE`,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&i(n===`DEFINE_MANY`||n===`DEFINE_MANY_MERGED`,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function p(e,n){if(n){i(typeof n!=`function`,`ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object.`),i(!t(n),`ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.`);var r=e.prototype,o=r.__reactAutoBindPairs;for(var s in n.hasOwnProperty(a)&&d.mixins(e,n.mixins),n)if(n.hasOwnProperty(s)&&s!==a){var c=n[s],u=r.hasOwnProperty(s);if(f(u,s),d.hasOwnProperty(s))d[s](e,c);else{var p=l.hasOwnProperty(s);if(typeof c==`function`&&!p&&!u&&n.autobind!==!1)o.push(s,c),r[s]=c;else if(u){var m=l[s];i(p&&(m===`DEFINE_MANY_MERGED`||m===`DEFINE_MANY`),`ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.`,m,s),m===`DEFINE_MANY_MERGED`?r[s]=g(r[s],c):m===`DEFINE_MANY`&&(r[s]=_(r[s],c))}else r[s]=c}}}}function m(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){if(i(!(n in d),'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n),n in e){i((u.hasOwnProperty(n)?u[n]:null)===`DEFINE_MANY_MERGED`,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=g(e[n],r);return}e[n]=r}}}function h(e,t){for(var n in i(e&&t&&typeof e==`object`&&typeof t==`object`,`mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.`),t)t.hasOwnProperty(n)&&(i(e[n]===void 0,"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function g(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(n==null)return r;if(r==null)return n;var i={};return h(i,n),h(i,r),i}}function _(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function v(e,t){return t.bind(e)}function y(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],i=t[n+1];e[r]=v(e,i)}}var b={componentDidMount:function(){this.__isMounted=!0}},x={componentWillUnmount:function(){this.__isMounted=!1}},S={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},C=function(){};n(C.prototype,e.prototype,S);function w(e){var t=o(function(e,n,a){this.__reactAutoBindPairs.length&&y(this),this.props=e,this.context=n,this.refs=r,this.updater=a||s,this.state=null;var o=this.getInitialState?this.getInitialState():null;i(typeof o==`object`&&!Array.isArray(o),`%s.getInitialState(): must return an object or null`,t.displayName||`ReactCompositeComponent`),this.state=o});for(var n in t.prototype=new C,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],c.forEach(p.bind(null,t)),p(t,b),p(t,e),p(t,x),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),i(t.prototype.render,"createClass(...): Class specification must implement a `render` method."),l)t.prototype[n]||(t.prototype[n]=null);return t}return w}t.exports=s})),h=u(s(((e,t)=>{var n=f(),r=m();if(n===void 0)throw Error(`create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.`);var i=new n.Component().updater;t.exports=r(n.Component,n.isValidElement,i)}))(),1);
/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */
function g(e,t){this.v=e,this.k=t}function _(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function v(e){if(Array.isArray(e))return e}function y(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function b(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
function x(e,t){return v(e)||y(e,t)||S(e,t)||b()}function S(e,t){if(e){if(typeof e==`string`)return _(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function C(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof g;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}C.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},C.prototype.next=function(e){return this._invoke(`next`,e)},C.prototype.throw=function(e){return this._invoke(`throw`,e)},C.prototype.return=function(e){return this._invoke(`return`,e)};var w=Object.entries,T=Object.setPrototypeOf,ee=Object.isFrozen,te=Object.getPrototypeOf,ne=Object.getOwnPropertyDescriptor,re=Object.freeze,ie=Object.seal,ae=Object.create,oe=typeof Reflect<`u`&&Reflect,se=oe.apply,ce=oe.construct;re||=function(e){return e},ie||=function(e){return e},se||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},ce||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var le=Ne(Array.prototype.forEach);Array.prototype.indexOf;var ue=Ne(Array.prototype.lastIndexOf),de=Ne(Array.prototype.pop),fe=Ne(Array.prototype.push),pe=Ne(Array.prototype.slice),me=Ne(Array.prototype.splice),he=Array.isArray,ge=Pe(Set),_e=Ne(Set.prototype.add),ve=Ne(Set.prototype.has),ye=Ne(String.prototype.toLowerCase),be=Ne(String.prototype.toString),xe=Ne(String.prototype.match),Se=Ne(String.prototype.replace),Ce=Ne(String.prototype.indexOf),we=Ne(String.prototype.trim),Te=Ne(Number.prototype.toString),Ee=Ne(Boolean.prototype.toString),De=typeof BigInt>`u`?null:Ne(BigInt.prototype.toString),Oe=typeof Symbol>`u`?null:Ne(Symbol.prototype.toString),ke=Ne(Object.prototype.hasOwnProperty),Ae=Ne(Object.prototype.toString),je=Ne(RegExp.prototype.test),Me=Pe(TypeError);function Ne(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return se(e,t,r)}}function Pe(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return ce(e,n)}}function Fe(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ye;if(T&&T(e,null),!he(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ee(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Ie(e){for(let t=0;t<e.length;t++)ke(e,t)||(e[t]=null);return e}function Le(e){let t=ae(null);for(let r of w(e)){var n=x(r,2);let i=n[0],a=n[1];ke(e,i)&&(t[i]=he(a)?Ie(a):a&&typeof a==`object`&&a.constructor===Object?Le(a):a)}return t}function Re(e){switch(typeof e){case`string`:return e;case`number`:return Te(e);case`boolean`:return Ee(e);case`bigint`:return De?De(e):`0`;case`symbol`:return Oe?Oe(e):`Symbol()`;case`undefined`:return Ae(e);case`function`:case`object`:{if(e===null)return Ae(e);let t=e,n=ze(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Ae(e)}return Ae(e)}default:return Ae(e)}}function ze(e,t){for(;e!==null;){let n=ne(e,t);if(n){if(n.get)return Ne(n.get);if(typeof n.value==`function`)return Ne(n.value)}e=te(e)}function n(){return null}return n}function Be(e,t){for(;e!==null;){let n=ne(e,t);if(n)return n.get?Ne(n.get):null;e=te(e)}return null}function Ve(e){try{return je(e,``),!0}catch{return!1}}var He=re(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Ue=re(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),We=re([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ge=re([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Ke=re(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),qe=re([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Je=re([`#text`]),Ye=re(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Xe=re(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Ze=re(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Qe=re([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),$e=ie(/{{[\w\W]*|^[\w\W]*}}/g),et=ie(/<%[\w\W]*|^[\w\W]*%>/g),tt=ie(/\${[\w\W]*/g),nt=ie(/^data-[\-\w.\u00B7-\uFFFF]+$/),rt=ie(/^aria-[\-\w]+$/),it=ie(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),at=ie(/^(?:\w+script|data):/i),eee=ie(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),tee=ie(/^html$/i),ot=ie(/^[a-z][.\w]*(-[.\w]+)+$/i),st=ie(/<[/\w!]/g),ct=ie(/<[/\w]/g),nee=ie(/<\/no(script|embed|frames)/i),lt=ie(/\/>/i),ut={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ree=re(Fe({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),iee=function(){return typeof window>`u`?null:window},aee=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},dt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ft=function(e,t,n,r){return ke(e,t)&&he(e[t])?Fe(r.base?Le(r.base):{},e[t],r.transform):n},pt=function(e,t,n){let r=ke(e,t)?e[t]:void 0;return r&&typeof r==`object`?Le(r):n()};function mt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:iee(),t=e=>mt(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==ut.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=ze(d,`cloneNode`),p=ze(d,`remove`),m=ze(d,`removeAttributeNode`),h=ze(d,`nextSibling`),g=ze(d,`childNodes`),_=ze(d,`parentNode`),v=ze(d,`shadowRoot`),y=ze(d,`attributes`),b=o&&o.prototype?ze(o.prototype,`nodeType`):null,x=o&&o.prototype?ze(o.prototype,`nodeName`):null,S=o&&o.prototype?ze(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},T=function(e){return x?x(e):e.nodeName},ee=Be(d,`namespaceURI`),te=function(e){return ee?ee(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let ne,oe=``,se,ce=!1,Te=0,Ee=function(){if(Te>0)throw Me(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},De=function(e){Ee(),Te++;try{return ne.createHTML(e)}finally{Te--}},Oe=function(e){Ee(),Te++;try{return ne.createScriptURL(e)}finally{Te--}},Ae=function(){return ce||=(se=aee(u,i),!0),se},Ne=n,Pe=Ne.implementation,Ie=Ne.createNodeIterator,ht=Ne.createDocumentFragment,gt=Ne.getElementsByTagName,_t=r.importNode,vt=dt();t.isSupported=typeof w==`function`&&typeof _==`function`&&Pe&&Pe.createHTMLDocument!==void 0;let yt=$e,bt=et,xt=tt,St=nt,Ct=rt,wt=at,Tt=eee,Et=ot,Dt=it,Ot=null,kt=Fe({},[...He,...Ue,...We,...Ke,...Je]),At=null,jt=Fe({},[...Ye,...Xe,...Ze,...Qe]),Mt=Object.seal(ae(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Nt=null,Pt=null,Ft=Object.seal(ae(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),It=!0,Lt=!0,Rt=!1,zt=!0,Bt=!1,Vt=!0,Ht=!1,Ut=!1,Wt=null,Gt=null,Kt=!1,qt=!1,Jt=!1,Yt=!1,Xt=!0,Zt=!1,Qt=`user-content-`,$t=!0,en=!1,tn=null,nn={},rn=null,an=Fe({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),on=null,sn=Fe({},[`audio`,`video`,`img`,`source`,`image`,`track`]),cn=null,ln=Fe({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),un=`http://www.w3.org/1998/Math/MathML`,dn=`http://www.w3.org/2000/svg`,fn=`http://www.w3.org/1999/xhtml`,pn=fn,mn=!1,hn=null,gn=Fe({},[un,dn,fn],be),_n=re([`mi`,`mo`,`mn`,`ms`,`mtext`]),vn=Fe({},_n),yn=re([`annotation-xml`]),bn=Fe({},yn),xn=Fe({},[`title`,`style`,`font`,`a`,`script`]),Sn=null,Cn=[`application/xhtml+xml`,`text/html`],wn=null,Tn=null,oee=n.createElement(`form`),En=function(e){return e instanceof RegExp||e instanceof Function},Dn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Tn&&Tn===e)return;e&&typeof e==`object`||(e={}),e=Le(e),Sn=Cn.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,wn=Sn===`application/xhtml+xml`?be:ye,Ot=ft(e,`ALLOWED_TAGS`,kt,{transform:wn}),At=ft(e,`ALLOWED_ATTR`,jt,{transform:wn}),hn=ft(e,`ALLOWED_NAMESPACES`,gn,{transform:be}),cn=ft(e,`ADD_URI_SAFE_ATTR`,ln,{transform:wn,base:ln}),on=ft(e,`ADD_DATA_URI_TAGS`,sn,{transform:wn,base:sn}),rn=ft(e,`FORBID_CONTENTS`,an,{transform:wn}),Nt=ft(e,`FORBID_TAGS`,Le({}),{transform:wn}),Pt=ft(e,`FORBID_ATTR`,Le({}),{transform:wn}),nn=ke(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Le(e.USE_PROFILES):e.USE_PROFILES:!1,It=e.ALLOW_ARIA_ATTR!==!1,Lt=e.ALLOW_DATA_ATTR!==!1,Rt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,zt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Bt=e.SAFE_FOR_TEMPLATES||!1,Vt=e.SAFE_FOR_XML!==!1,Ht=e.WHOLE_DOCUMENT||!1,qt=e.RETURN_DOM||!1,Jt=e.RETURN_DOM_FRAGMENT||!1,Yt=e.RETURN_TRUSTED_TYPE||!1,Kt=e.FORCE_BODY||!1,Xt=e.SANITIZE_DOM!==!1,Zt=e.SANITIZE_NAMED_PROPS||!1,$t=e.KEEP_CONTENT!==!1,en=e.IN_PLACE||!1,Dt=Ve(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:it,pn=typeof e.NAMESPACE==`string`?e.NAMESPACE:fn,vn=pt(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>Fe({},_n)),bn=pt(e,`HTML_INTEGRATION_POINTS`,()=>Fe({},yn));let t=pt(e,`CUSTOM_ELEMENT_HANDLING`,()=>ae(null));if(Mt=ae(null),ke(t,`tagNameCheck`)&&En(t.tagNameCheck)&&(Mt.tagNameCheck=t.tagNameCheck),ke(t,`attributeNameCheck`)&&En(t.attributeNameCheck)&&(Mt.attributeNameCheck=t.attributeNameCheck),ke(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Mt.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),ie(Mt),Bt&&(Lt=!1),Jt&&(qt=!0),nn&&(Ot=Fe({},Je),At=ae(null),nn.html===!0&&(Fe(Ot,He),Fe(At,Ye)),nn.svg===!0&&(Fe(Ot,Ue),Fe(At,Xe),Fe(At,Qe)),nn.svgFilters===!0&&(Fe(Ot,We),Fe(At,Xe),Fe(At,Qe)),nn.mathMl===!0&&(Fe(Ot,Ke),Fe(At,Ze),Fe(At,Qe))),Ft.tagCheck=null,Ft.attributeCheck=null,ke(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Ft.tagCheck=e.ADD_TAGS:he(e.ADD_TAGS)&&(Ot===kt&&(Ot=Le(Ot)),Fe(Ot,e.ADD_TAGS,wn))),ke(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Ft.attributeCheck=e.ADD_ATTR:he(e.ADD_ATTR)&&(At===jt&&(At=Le(At)),Fe(At,e.ADD_ATTR,wn))),ke(e,`ADD_FORBID_CONTENTS`)&&he(e.ADD_FORBID_CONTENTS)&&(rn===an&&(rn=Le(rn)),Fe(rn,e.ADD_FORBID_CONTENTS,wn)),$t&&(Ot[`#text`]=!0),Ht&&Fe(Ot,[`html`,`head`,`body`]),Ot.table&&(Fe(Ot,[`tbody`]),delete Nt.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Me(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Me(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=ne;ne=e.TRUSTED_TYPES_POLICY;try{oe=De(``)}catch(e){throw ne=t,e}}else e.TRUSTED_TYPES_POLICY===null?(ne=void 0,oe=``):(ne===void 0&&(ne=Ae()),ne&&typeof oe==`string`&&(oe=De(``)));re&&re(e),Tn=e},On=Fe({},[...Ue,...We,...Ge]),kn=Fe({},[...Ke,...qe]),An=function(e,t,n){return t.namespaceURI===fn?e===`svg`:t.namespaceURI===un?e===`svg`&&(n===`annotation-xml`||vn[n]):!!On[e]},jn=function(e,t,n){return t.namespaceURI===fn?e===`math`:t.namespaceURI===dn?e===`math`&&bn[n]:!!kn[e]},Mn=function(e,t,n){return t.namespaceURI===dn&&!bn[n]||t.namespaceURI===un&&!vn[n]?!1:!kn[e]&&(xn[e]||!On[e])},Nn=function(e){let t=te(e),n=ye(T(e)),r=_(e),i,a;return r&&C(r)===ut.element?(i={namespaceURI:te(r)},a=ye(T(r))):(i={namespaceURI:pn},a=`template`),hn[t]?t===dn?An(n,i,a):t===un?jn(n,i,a):t===fn?Mn(n,i,a):!!(Sn===`application/xhtml+xml`&&hn[t]):!1},Pn=function(e){fe(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw Me(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Fn=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},In=function(e){Bn(e);let t=g(e);t&&le(pe(t),e=>{try{p(e)}catch{}});let n=C(e)===ut.element?y(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&Fn(e,r,i)}},Ln=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}fe(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(qt||Jt)try{Pn(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Rn=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||At[wn(i)]||Fn(e,r,i)}},zn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&C(e)===ut.element){let t=v(e);tr(t)&&r.push(t)}let i=g(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},Bn=function(e){zn(e,e=>{C(e)===ut.element&&Rn(e)})},Vn=function(e){let t=[];return zn(e,e=>{t.push(e)},!0),t},Hn=function(e,t){let n=ge();le(Vn(e),e=>{C(e)===ut.element&&_e(n,e)}),le(t,e=>{C(e)===ut.element&&!ve(n,e)&&Rn(e)})},Un=function(e,n){let r=!1;return le(t.removed,t=>{t.element&&(r||=t.element===e,Bn(t.element))}),Hn(e,n),r},Wn=function(e,t){let n=tn,r=null,i=()=>(r||(r=ge(),le(t,e=>{_e(r,e)})),r);for(let t=0;;t++){let r=Vn(e),a=[e],o=!1;if(le(r,e=>{C(e)===ut.documentFragment?fe(a,e):!o&&!ve(n,e)&&(o=ve(i(),e))}),!o)return;if(t>=8)throw Me(`the tree kept changing during in-place sanitization; refusing to return it`);le(a,(t,n)=>{Gn(t,n>0,e,i())})}},Gn=function(e,t,n,r){let i=Xn(e),a;for(;a=i.nextNode();)ve(r,a)&&!ve(tn,a)&&(t&&rr(vt.uponSanitizeShadowNode,a,null),lr(a,n),gr(a,n),tr(a.content)&&_r(a.content))},Kn=function(e){tn&&_e(tn,e)},qn=function(e,t){return Vt?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Jn=function(e){Vt&&zn(e,e=>{let t=C(e);if(t===ut.processingInstruction||t===ut.comment&&je(ct,e.data)){try{p(e)}catch{}return!1}if(t===ut.element){let t=e,n=wn(T(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&qn(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},Yn=function(e){let t=null,r=null;if(Kt)e=`<remove></remove>`+e;else{let t=xe(e,/^[\r\n\t ]+/);r=t&&t[0]}Sn===`application/xhtml+xml`&&pn===fn&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=ne?De(e):e;if(pn===fn)try{t=new l().parseFromString(i,Sn)}catch{}if(!t||!t.documentElement){t=Pe.createDocument(pn,`template`,null);try{t.documentElement.innerHTML=mn?oe:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),pn===fn?gt.call(t,Ht?`html`:`body`)[0]:Ht?t.documentElement:a},Xn=function(e){let t=S?S(e):e.ownerDocument;return Ie.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Zn=function(e){return e=Se(e,yt,` `),e=Se(e,bt,` `),e=Se(e,xt,` `),e},Qn=function(e){$n(e);let t=e.querySelectorAll?.call(e,`template`);t&&le(t,e=>{tr(e.content)&&Qn(e.content)})},$n=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=Ie.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Zn(r.data),r=n.nextNode()},er=function(e){let t=x?x(e):null;return typeof t!=`string`||wn(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},tr=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===ut.documentFragment}catch{return!1}},nr=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function rr(e,n,r){e.length!==0&&le(e,e=>{e.call(t,n,r,Tn)})}let ir=function(e,t){return!!(Vt&&e.hasChildNodes()&&!nr(e.firstElementChild)&&je(st,e.textContent)&&je(st,e.innerHTML)||Vt&&ree[t]&&C(e)===ut.element&&te(e)===fn&&(nr(e.firstElementChild)||typeof e.textContent==`string`&&je(st,e.textContent))||e.nodeType===ut.processingInstruction||Vt&&e.nodeType===ut.comment&&je(ct,e.data))},ar=function(e,t){if(e instanceof RegExp)return je(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return!!e(t,...r)}return!1},or=function(e,t,n){if(!Nt[t]&&fr(t)&&ar(Mt.tagNameCheck,t))return!1;if($t&&!rn[t]&&!rn[ye(t)]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Pn(e),!0},sr=function(e,t,n,r){return e.length===0?t:t===n||t===r?Le(t):t},cr=function(e,t){return e===t||_(e)!==null?!1:(en&&Bn(e),!0)},lr=function(e,n){if(Kn(e),rr(vt.beforeSanitizeElements,e,null),cr(e,n))return!0;if(er(e))return Pn(e),!0;let r=wn(T(e));if(Ot=sr(vt.uponSanitizeElement,Ot,kt,Wt),rr(vt.uponSanitizeElement,e,{tagName:r,allowedTags:Ot}),cr(e,n))return!0;if(ir(e,r))return Pn(e),!0;if(Nt[r]||!(Ft.tagCheck instanceof Function&&Ft.tagCheck(r))&&!Ot[r]){let t=or(e,r,n);return t===!1&&(rr(vt.afterSanitizeElements,e,null),cr(e,n))?!0:t}if(C(e)===ut.element&&!Nn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&je(nee,e.innerHTML))return Pn(e),!0;if(Bt&&e.nodeType===ut.text){let n=Zn(e.textContent);e.textContent!==n&&(fe(t.removed,{element:e.cloneNode()}),e.textContent=n)}return rr(vt.afterSanitizeElements,e,null),cr(e,n)},ur=function(e,t,r){if(Pt[t]||qn(t,e)||Xt&&(t===`id`||t===`name`)&&(r in n||r in oee))return!1;let i=At[t]||Ft.attributeCheck instanceof Function&&Ft.attributeCheck(t,e);return Lt&&je(St,t)||It&&je(Ct,t)?!0:i?cn[t]||je(Dt,Se(r,Tt,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Ce(r,`data:`)===0&&on[e]||Rt&&!je(wt,Se(r,Tt,``))?!0:!r:fr(e)&&ar(Mt.tagNameCheck,e)&&ar(Mt.attributeNameCheck,t,e)||t===`is`&&Mt.allowCustomizedBuiltInElements&&ar(Mt.tagNameCheck,r)},dr=Fe({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),fr=function(e){return!dr[ye(e)]&&je(Et,e)},pr=function(e,t,n,r){if(ne&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return De(r);case`TrustedScriptURL`:return Oe(r)}return r},mr=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!er(e)||(Pn(e),!1)}catch{return Ln(t,e),!1}},hr=function(e,t){return Vt&&je(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:ye(e)===`attributename`&&xe(t,`href`)!==null},gr=function(e,n){if(rr(vt.beforeSanitizeAttributes,e,null),cr(e,n))return;let r=e.attributes;if(!r||er(e))return;At=sr(vt.uponSanitizeAttribute,At,jt,Gt);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:At,forceKeepAttr:void 0},a=r.length,o=wn(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=wn(s),d=l,f=s===`value`?d:we(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,rr(vt.uponSanitizeAttribute,e,i),f=i.attrValue,Zt&&(u===`id`||u===`name`)&&Ce(f,Qt)!==0&&(Ln(s,e,n),f=Qt+f,p=!0),hr(s,f)?Ln(s,e,n):i.forceKeepAttr||(i.keepAttr?!zt&&je(lt,f)?Ln(s,e,n):(Bt&&(f=Zn(f)),ur(o,u,f)?(f=pr(o,u,c,f),f!==d&&mr(e,s,c,f)&&p&&de(t.removed)):Ln(s,e,n)):Ln(s,e,n))}rr(vt.afterSanitizeAttributes,e,null),cr(e,n)},_r=function(e){let t=null,n=Xn(e);for(rr(vt.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(rr(vt.uponSanitizeShadowNode,t,null),lr(t,e),gr(t,e),tr(t.content)&&_r(t.content),C(t)===ut.element){let e=v(t);tr(e)&&(E(e),_r(e))}Bt&&$n(e),rr(vt.afterSanitizeShadowDOM,e,null)},E=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){_r(e.shadow);continue}let n=e.node,r=C(n)===ut.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&wn(e)===`template`){let e=n.content;tr(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);tr(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(mn=!e,mn&&(e=`<!-->`),typeof e!=`string`&&!nr(e)&&(e=Re(e),typeof e!=`string`))throw Me(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ut?(Ot=Wt,At=Gt):Dn(n),(vt.uponSanitizeElement.length>0||vt.uponSanitizeAttribute.length>0)&&(Ot=Le(Ot)),vt.uponSanitizeAttribute.length>0&&(At=Le(At)),t.removed=[];let c=en&&typeof e!=`string`&&nr(e),l=[],u=tn;if(c){Jn(e);let t=T(e);if(typeof t==`string`){let n=wn(t);if(!Ot[n]||Nt[n])throw In(e),Me(`root node is forbidden and cannot be sanitized in-place`)}if(er(e))throw In(e),Me(`root node is clobbered and cannot be sanitized in-place`);l=Vn(e),tn=ge()}else if(nr(e))i=Yn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===ut.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),E(i);else{if(!qt&&!Bt&&!Ht&&e.indexOf(`<`)===-1)return ne&&Yt?De(e):e;if(i=Yn(e),!i)return qt?null:Yt?oe:``}i&&Kt&&Pn(i.firstChild);let d=c?e:i;try{c&&E(e);let t=Xn(d);for(;o=t.nextNode();)lr(o,d),gr(o,d),tr(o.content)&&_r(o.content);c&&Wn(e,l)}catch(t){throw c&&(In(e),Un(e,l)),t}finally{tn=u}if(c){if(Un(e,l))throw Me(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Bt&&Qn(e),e}if(qt){if(Bt&&Qn(i),Jt)for(s=ht.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(At.shadowroot||At.shadowrootmode)&&(s=_t.call(r,s,!0)),s}let f=Ht?i.outerHTML:i.innerHTML;return Ht&&Ot[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&je(tee,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
`+f),Bt&&(f=Zn(f)),ne&&Yt?De(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Dn(e),Ut=!0,Wt=Ot,Gt=At},t.clearConfig=function(){Tn=null,Ut=!1,Wt=null,Gt=null,ne=se,oe=``},t.isValidAttribute=function(e,t,n){Tn||Dn({});let r=wn(e),i=wn(t);return typeof n==`string`&&(hr(t,n)||!zt&&je(lt,n))?!1:ur(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&ke(vt,e)&&fe(vt[e],t)},t.removeHook=function(e,t){if(ke(vt,e)){if(t!==void 0){let n=ue(vt[e],t);return n===-1?void 0:me(vt[e],n,1)[0]}return de(vt[e])}},t.removeHooks=function(e){ke(vt,e)&&(vt[e]=[])},t.removeAllHooks=function(){vt=dt()},t}var ht=mt(),gt=ht,_t=ht.sanitize.bind(ht);ht.isSupported,ht.addHook.bind(ht),ht.removeHook.bind(ht),ht.removeHooks.bind(ht),ht.removeAllHooks.bind(ht),ht.setConfig.bind(ht),ht.clearConfig.bind(ht),ht.isValidAttribute.bind(ht),ht.version,ht.removed;function vt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yt=vt();function bt(e){yt=e}var xt={exec:()=>null};function St(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function Ct(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Tt.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var wt=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),Tt={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:St(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:St(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:St(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:St(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:St(e=>RegExp(`^ {0,${e}}(?:</?(?:${Bt})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:St(e=>RegExp(`^ {0,${e}}>`))},Et=/^(?:[ \t]*(?:\n|$))+/,Dt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ot=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,kt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,At=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jt=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Mt=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Nt=Ct(Mt).replace(/bull/g,jt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Pt=Ct(Mt).replace(/bull/g,jt).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ft=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,It=/^[^\n]+/,Lt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Rt=Ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Lt).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),zt=Ct(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,jt).getRegex(),Bt=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Vt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ht=Ct(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Vt).replace(`tag`,Bt).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ut=e=>Ct(Ft).replace(`hr`,kt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Bt).getRegex(),Wt=Ut(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),Gt=Ut(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),Kt={blockquote:Ct(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Gt).getRegex(),code:Dt,def:Rt,fences:Ot,heading:At,hr:kt,html:Ht,lheading:Nt,list:zt,newline:Et,paragraph:Wt,table:xt,text:It},qt=Ct(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,kt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Bt).getRegex(),Jt={...Kt,lheading:Pt,table:qt,paragraph:Ct(Ft).replace(`hr`,kt).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,qt).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,Bt).getRegex()},Yt={...Kt,html:Ct(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Vt).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:xt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ct(Ft).replace(`hr`,kt).replace(`heading`,` *#{1,6} *[^
]`).replace(`lheading`,Nt).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},Xt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Zt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Qt=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,$t=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,en=/[\p{P}\p{S}]/u,tn=/[\s\p{P}\p{S}]/u,nn=/[^\s\p{P}\p{S}]/u,rn=Ct(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,tn).getRegex(),an=/[\p{Pi}\p{Ps}"']/u,on=/(?!~)[\p{P}\p{S}]/u,sn=/(?!~)[\s\p{P}\p{S}]/u,cn=/(?:[^\s\p{P}\p{S}]|~)/u,ln=Ct(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,wt?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),un=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,dn=Ct(un,`u`).replace(/punct/g,en).getRegex(),fn=Ct(un,`u`).replace(/punct/g,on).getRegex(),pn=Ct(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,an).replace(/punct/g,en).getRegex(),mn=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,hn=Ct(mn,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),gn=Ct(mn,`gu`).replace(/notPunctSpace/g,cn).replace(/punctSpace/g,sn).replace(/punct/g,on).getRegex(),_n=Ct(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),vn=Ct(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),yn=Ct(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),bn=Ct(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,en).getRegex(),xn=Ct(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,nn).replace(/punctSpace/g,tn).replace(/punct/g,en).getRegex(),Sn=Ct(/\\(punct)/,`gu`).replace(/punct/g,en).getRegex(),Cn=Ct(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,en).getRegex(),wn=Ct(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Tn=Ct(Vt).replace(`(?:-->|$)`,`-->`).getRegex(),oee=Ct(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Tn).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),En=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,Dn=Ct(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,En).getRegex(),On=Ct(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,Dn).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),kn=Ct(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Dn).replace(`ref`,Lt).getRegex(),An=Ct(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Lt).getRegex(),jn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Mn=Ct(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,En).getRegex(),Nn=Ct(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Ct(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Mn).replace(`ref`,jn).getRegex()).replace(`nolink`,Ct(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,jn).getRegex()).getRegex(),Pn=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Fn=Ct(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),In={_backpedal:xt,anyPunctuation:Sn,anyPunctuationOutsideCode:Cn,autolink:wn,blockSkip:ln,br:Qt,code:Zt,del:xt,delLDelim:xt,delRDelim:xt,emStrongLDelim:dn,emStrongRDelimAst:hn,emStrongRDelimUnd:vn,escape:Xt,link:On,nolink:An,punctuation:rn,reflink:kn,reflinkSearch:Nn,tag:oee,text:$t,url:xt},Ln={...In,emStrongLDelim:pn,emStrongRDelimAst:_n,emStrongRDelimUnd:yn,link:Ct(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Dn).getRegex(),reflink:Ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Dn).getRegex()},Rn={...In,emStrongRDelimAst:gn,emStrongLDelim:fn,delLDelim:bn,delRDelim:xn,url:Ct(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Fn).replace(`protocol`,Pn).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ct(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,Pn).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},zn={...Rn,br:Ct(Qt).replace(`{2,}`,`*`).getRegex(),text:Ct(Rn.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Bn={normal:Kt,gfm:Jt,pedantic:Yt},Vn={normal:In,gfm:Rn,breaks:zn,pedantic:Ln},Hn={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Un=e=>Hn[e];function Wn(e,t){if(t){if(Tt.escapeTest.test(e))return e.replace(Tt.escapeReplace,Un)}else if(Tt.escapeTestNoEncode.test(e))return e.replace(Tt.escapeReplaceNoEncode,Un);return e}function Gn(e){return Tt.numericCharacterReference.test(e)?e.replace(Tt.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&amp;`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&amp;`:String.fromCodePoint(r)}):e}function Kn(e){try{e=encodeURI(e).replace(Tt.percentDecode,`%`)}catch{return null}return e}function qn(e,t){let n=e.replace(Tt.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Tt.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(Tt.slashPipe,`|`);return n}function Jn(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Yn(e){let t=e.split(`
`),n=t.length-1;for(;n>=0&&Tt.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
`)}function Xn(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function Zn(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Qn(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function $n(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function er(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
`)}function tr(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var nr=class{options;rules;lexer;constructor(e){this.options=e||yt}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:Yn(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=er(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Jn(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:Jn(t[0],`
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Jn(t[0],`
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Jn(t[0],`
`).split(`
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
${s}`:s,r=r?`${r}
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
`),o=t.raw+`
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
`).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
${d.join(`
`)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
`+e.join(`
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
`)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
`,1)[0],d=t[1].length,f=this.options.pedantic?Qn(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>Qn(e,d)),p=e.split(`
`,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h);for(;e;){let c=e.split(`
`,1)[0],l;if(p=c,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),l=p):l=p.replace(this.rules.other.leadingSpaceTab,e=>Qn(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(l.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
`+l.slice(h);else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||n.test(f))break;a+=`
`+p}m=!p.trim(),e=e.substring(c.length+1),f=l.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=Yn(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&Zn(t[2],`()`)!==-1)return;let e=Xn(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:Jn(t[0],`
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=qn(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
`):[],a={type:`table`,raw:Jn(t[0],`
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(qn(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:Jn(t[0],`
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&tr(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=Jn(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=Zn(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),$n(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&tr(e,n[1],r,this.rules))return;let i=t[Xn((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return $n(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:Gn(t[0]),escaped:e}}}},rr=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yt,this.options.tokenizer=this.options.tokenizer||new nr,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:Tt,block:Bn.normal,inline:Vn.normal};this.options.pedantic?(t.block=Bn.pedantic,t.inline=Vn.pedantic):this.options.gfm&&(t.block=Bn.gfm,t.inline=this.options.breaks?Vn.breaks:Vn.gfm),this.tokenizer.rules=t}static get rules(){return{block:Bn,inline:Vn}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Tt.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Tt.tabCharGlobal,` `).replace(Tt.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
`)?``:`
`)+i.raw,n.text+=`
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
`)?``:`
`)+i.raw,n.text+=`
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
`)?``:`
`)+i.raw,r.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
`)?``:`
`)+i.raw,n.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,Xn(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,Xn(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},ir=class{options;parser;constructor(e){this.options=e||yt}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Tt.notSpaceStart)?.[0],i=e?e.replace(Tt.endingNewline,``)+`
`:``;return r?`<pre><code class="language-`+Wn(r)+`">`+(n?i:Wn(i,!0))+`</code></pre>
`:`<pre><code>`+(n?i:Wn(i,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
`}hr(e){return`<hr>
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
`+r+`</`+i+`>
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
<thead>
`+t+`</thead>
`+r+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Wn(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Wn(n,!0):this.parser.parseInline(r),o=Kn(e);if(o===null)return a;e=Wn(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+Wn(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Kn(e);if(i===null)return Wn(n);e=i;let a=`<img src="${Wn(e)}" alt="${Wn(n)}"`;return t&&(a+=` title="${Wn(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Wn(e.text)}},ar=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},or=class e{options;renderer;textRenderer;constructor(e){this.options=e||yt,this.options.renderer=this.options.renderer||new ir,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ar}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},sr=class{options;block;constructor(e){this.options=e||yt}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?rr.lex:rr.lexInline}provideParser(e=this.block){return e?or.parse:or.parseInline}};function cr(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var lr=class{defaults=vt();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=or;Renderer=ir;TextRenderer=ar;Lexer=rr;Tokenizer=nr;Hooks=sr;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(cr(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)cr(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)cr(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;cr(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);cr(n,this.walkTokens(i,t))}):e.tokens&&cr(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new ir(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new nr(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new sr;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=sr.passThroughHooks.has(n)?e=>{if(this.defaults.async&&sr.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&cr(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return rr.lex(e,t??this.defaults)}parser(e,t){return or.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?rr.lex:rr.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?or.parse:or.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?rr.lex:rr.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?or.parse:or.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Wn(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},ur=new lr;function dr(e,t){return ur.parse(e,t)}dr.options=dr.setOptions=function(e){return ur.setOptions(e),dr.defaults=ur.defaults,bt(dr.defaults),dr},dr.getDefaults=vt,dr.defaults=yt;function fr(...e){return ur.use(...e),dr.defaults=ur.defaults,bt(dr.defaults),dr}dr.use=fr,dr.walkTokens=function(e,t){return ur.walkTokens(e,t)},dr.parseInline=ur.parseInline,dr.Parser=or,dr.parser=or.parse,dr.Renderer=ir,dr.TextRenderer=ar,dr.Lexer=rr,dr.lexer=rr.lex,dr.Tokenizer=nr,dr.Hooks=sr,dr.parse=dr,dr.options,dr.setOptions,dr.walkTokens;var pr=dr.parseInline,mr=dr;or.parse;var hr=rr.lex,gr=u(f(),1),_r=[`getBackend`,`getCustomFormats`,`getCustomFormatsExtensions`,`getCustomFormatsFormatters`,`getEditorComponents`,`getEventListeners`,`getLocale`,`getMediaLibrary`,`getPreviewStyles`,`getPreviewTemplate`,`getRemarkPlugins`,`getWidgetValueSerializer`,`getWidgets`,`invokeEvent`,`moment`,`registerBackend`,`registerMediaLibrary`,`registerWidgetValueSerializer`,`removeEventListener`,`resolveWidget`,`registerLocale`,`registerRemarkPlugin`],E=e=>typeof e==`object`&&!!e&&!Array.isArray(e),vr=e=>JSON.parse(JSON.stringify(e)),yr=u(s(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}}))(),1),br=Array.isArray,see=Array.prototype.indexOf,xr=Array.prototype.includes,Sr=Array.from,Cr=Object.defineProperty,wr=Object.getOwnPropertyDescriptor,cee=Object.getOwnPropertyDescriptors,Tr=Object.prototype,lee=Array.prototype,Er=Object.getPrototypeOf,Dr=Object.isExtensible;function Or(e){return typeof e==`function`}var kr=()=>{};function Ar(e){return typeof e?.then==`function`}function uee(e){for(var t=0;t<e.length;t++)e[t]()}function jr(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Mr(e,t,n=!1){return e===void 0?n?t():t:e}function Nr(e,t){if(Array.isArray(e))return e;if(t===void 0||!(Symbol.iterator in e))return Array.from(e);let n=[];for(let r of e)if(n.push(r),n.length===t)break;return n}var Pr=Symbol(`$state`),Fr=Symbol(`component`),Ir=Symbol(`legacy props`),dee=Symbol(``),Lr=Symbol(`attributes`),Rr=Symbol(`class`),zr=Symbol(`style`),Br=Symbol(`text`),Vr=Symbol(`form reset`),Hr=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Ur=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),Wr={},Gr=Symbol(`uninitialized`);function fee(){console.warn(`https://svelte.dev/e/derived_inert`)}function Kr(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function pee(){console.warn(`https://svelte.dev/e/select_multiple_invalid_value`)}function mee(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var qr=!1;function Jr(e){qr=e}var Yr;function Xr(e){if(e===null)throw Kr(),Wr;return Yr=e}function Zr(){return Xr(da(Yr))}function D(e){if(qr){if(da(Yr)!==null)throw Kr(),Wr;Yr=e}}function Qr(e=1){if(qr){for(var t=e,n=Yr;t--;)n=da(n);Yr=n}}function $r(e=!0){for(var t=0,n=Yr;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=da(n);e&&n.remove(),n=i}}function ei(e){if(!e||e.nodeType!==8)throw Kr(),Wr;return e.data}function hee(e){return e===this.v}function gee(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function _ee(e){return!gee(e,this.v)}function ti(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function vee(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function yee(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function bee(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function xee(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function See(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Cee(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function wee(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function Tee(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Eee(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Dee(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Oee(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var kee=[];function ni(e,t=!1,n=!1){return ri(e,new Map,``,kee,null,n)}function ri(e,t,n,r,i=null,a=!1){if(typeof e==`object`&&e){var o=t.get(e);if(o!==void 0)return o;if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);if(br(e)){var s=Array(e.length);t.set(e,s),i!==null&&t.set(i,s);for(var c=0;c<e.length;c+=1){var l=e[c];c in e&&(s[c]=ri(l,t,n,r,null,a))}return s}if(Er(e)===Tr){s={},t.set(e,s),i!==null&&t.set(i,s);for(var u of Object.keys(e))s[u]=ri(e[u],t,n,r,null,a);return s}if(e instanceof Date)return e.getTime(),structuredClone(e);if(typeof e.toJSON==`function`&&!a)return ri(e.toJSON(),t,n,r,e)}if(e instanceof EventTarget)return e;try{return structuredClone(e)}catch{return e}}function Aee(e){let t=e.p;for(;t!==null&&t.c===null;)t=t.p;return t?.c??null}function ii(e,t){return e===null&&ti(t),e.c??=new Map(Aee(e)||void 0)}var ai=null;function oi(e){ai=e}function si(e){return ii(ai,`getContext`).get(e)}function ci(e,t){return ii(ai,`setContext`).set(e,t),t}function jee(){return ii(ai,`getAllContexts`)}function O(e,t=!1,n){ai={p:ai,i:!1,c:null,e:null,s:e,x:null,r:Wa,l:null}}function k(e){var t=ai,n=t.e;if(n!==null){t.e=null;for(var r of n)xa(r)}return e!==void 0&&(t.x=e),t.i=!0,ai=t.p,li(e)}function li(e={}){return Cr(e,Fr,{value:!0}),e}function ui(){return!0}var di=[];function fi(){var e=di;di=[],uee(e)}function pi(e){if(di.length===0&&!Fi){var t=di;queueMicrotask(()=>{t===di&&fi()})}di.push(e)}function Mee(){for(;di.length>0;)fi()}var Nee=-7169;function mi(e,t){e.f=e.f&Nee|t}function hi(e){e.f&512||e.deps===null?mi(e,1024):mi(e,4096)}function gi(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),mi(e,1024)}function Pee(e,t){if(t){let t=document.body;e.autofocus=!0,pi(()=>{document.activeElement===t&&e.focus()})}}function Fee(e){qr&&ua(e)!==null&&fa(e)}var _i=!1;function vi(){_i||(_i=!0,document.addEventListener(`reset`,e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(let t of e.target.elements)t[Vr]?.()})},{capture:!0}))}function yi(e){var t=Va,n=Wa;Ua(null),Ga(null);try{return e()}finally{Ua(t),Ga(n)}}function Iee(e,t,n,r=n){e.addEventListener(t,()=>yi(n));let i=e[Vr];e[Vr]=i?()=>{i(),r(!0)}:()=>r(!0),vi()}function bi(e,t,n,r){let i=ui()?wi:Ei;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=Wa,c=xi(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){ga(e,s)}Si()}}var d=Ci();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>Lee(e))).then(u).catch(e=>ga(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),Si())}):f()}function xi(){var e=Wa,t=Va,n=ai,r=ji;return function(i=!0){Ga(e),Ua(t),oi(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Si(e=!0){Ga(null),Ua(null),oi(null),e&&ji?.deactivate()}function Ci(){var e=Wa,t=e.b,n=ji,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function wi(e){return Wa!==null&&(Wa.f|=524288),{ctx:ai,deps:null,effects:null,equals:hee,f:2050,fn:e,reactions:null,rv:0,v:Gr,wv:0,parent:Wa,ac:null}}var Ti=Symbol(`obsolete`);function Lee(e,t,n){let r=Wa;r===null&&vee();var i=void 0,a=Yi(Gr),o=!Va,s=new Set;return Yee(()=>{var t=Wa,n=jr();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==Hr&&n.reject(e)}).finally(Si)}catch(e){n.reject(e),Si()}var c=ji;if(o){if(t.f&32768)var l=Ci();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Ti);else for(let e of s.values())e.reject(Ti);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Ti&&(c.activate(),t?(a.f|=8388608,$i(a,t)):(a.f&8388608&&(a.f^=8388608),$i(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),ba(()=>{for(let e of s)e.reject(Ti)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function A(e){let t=wi(e);return qa(t),t}function Ei(e){let t=wi(e);return t.equals=_ee,t}function Ree(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)ja(t[n])}}function Di(e){var t,n=Wa,r=e.parent;if(!za&&r!==null&&e.v!==Gr&&r.f&24576)return fee(),e.v;Ga(r);try{Ree(e),t=io(e)}finally{Ga(n)}return t}function Oi(e){var t=Di(e);!e.equals(t)&&(e.wv=to(),(!ji?.is_fork||e.deps===null)&&(ji===null?e.v=t:(ji.capture(e,t,!0),Mi?.capture(e,t,!0)),e.deps===null))?mi(e,1024):za||(Ni===null?hi(e):(ya()||ji?.is_fork)&&Ni.set(e,t))}function zee(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&yi(()=>{t.ac.abort(Hr),t.ac=null}),t.fn!==null&&(t.teardown=kr),oo(t,0),Aa(t))}function ki(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&so(t)}var Ai=null,ji=null,Mi=null,Ni=null,Pi=null,Fi=!1,Ii=!1,Li=null,Ri=null,zi=0,Bee=1,Bi=class e{id=Bee++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){Ai===null?Ai=this:(Ai.#n=this,this.#t=Ai),Ai=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)mi(r,2048),t(r);for(r of n.m)mi(r,4096),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=1024}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),mi(e,2048),this.schedule(e);for(let e of this.#d)mi(e,4096),this.schedule(e);this.apply();for(var t=Li=[],n=[],r=Ri=[];this.#c.length>0;){zi++>1e3&&(this.#S(),Vee());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw Ki(e),this.#h()||this.discard(),t}}if(ji=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(Li=null,Ri=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)Gi(e,t);r.length>0&&ji.#_();return}let a=this.#y();if(a)this.#x(n),this.#x(t),a.#b(this);else{this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),Mi=this,Ui(n),Ui(t),Mi=null,this.#s?.resolve();var o=ji;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(Ji.clear(),o.#_())}}#v(e,t,n){e.f^=1024;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=1024:i&4?t.push(r):no(r)&&(i&16&&this.#d.add(r),so(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),mi(i,2048),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),ji=this,this.#_()}#x(e){for(var t=0;t<e.length;t+=1)gi(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==Gr&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),Ni?.set(e,t)),this.is_fork||(e.v=t)}activate(){ji=this}deactivate(){ji=null,Ni=null}flush(){try{Ii=!0,ji=this,this.#_()}finally{zi=0,Pi=null,Li=null,Ri=null,Ii=!1,ji=null,Ni=null,Ji.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(Ti);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,pi(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=jr()).promise}static ensure(){if(ji===null){let t=ji=new e;!Ii&&!Fi&&pi(()=>{t.#e||t.flush()})}return ji}apply(){Ni=null}schedule(e){Pi=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?Ai=e:t.#t=e,this.linked=!1}}};function Vi(e){var t=Fi,n=Mi;Mi=null,Fi=!0;try{var r;for(e&&(Vi(),r=e());;){if(Mee(),ji===null)return r;ji.flush()}}finally{Fi=t,Mi=n}}function Vee(){try{Cee()}catch(e){ga(e,Pi)}}var Hi=null;function Ui(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&no(r)&&(Hi=new Set,so(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Na(r),Hi?.size>0)){Ji.clear();for(let e of Hi){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Hi.has(n)&&(Hi.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||so(n)}}Hi.clear()}}Hi=null}}function Wi(e){ji.schedule(e)}function Gi(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),mi(e,1024);for(var n=e.first;n!==null;)Gi(n,t),n=n.next}}function Ki(e){mi(e,1024);for(var t=e.first;t!==null;)Ki(t),t=t.next}var qi=new Set,Ji=new Map,Hee=!1;function Yi(e,t){return{f:0,v:e,reactions:null,equals:hee,rv:0,wv:0}}function j(e,t){let n=Yi(e,t);return qa(n),n}function Xi(e,t=!1,n=!0){let r=Yi(e);return t||(r.equals=_ee),r}function M(e,t,n=!1){return Va!==null&&(!Ha||Va.f&131072)&&ui()&&Va.f&4325394&&(Ka===null||!Ka.has(e))&&Dee(),$i(e,n?ta(t):t,Ri)}var Zi=null,Qi=0;function $i(e,t,n=null){if(!e.equals(t)){za?Ji.set(e,t):Ji.has(e)||Ji.set(e,e.v);var r=Bi.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&Di(t),Ni===null&&hi(t)}e.wv=to(),Zi=null,Qi=0,Wee(e,2048,n),Zi=null,ui()&&Wa!==null&&Wa.f&1024&&!(Wa.f&96)&&(Xa===null?$ee([e]):Xa.push(e)),!r.is_fork&&qi.size>0&&!Hee&&Uee()}return t}function Uee(){Hee=!1;for(let e of qi){e.f&1024&&mi(e,4096);let t;try{t=no(e)}catch{t=!0}t&&so(e)}qi.clear()}function ea(e){M(e,e.v+1)}function Wee(e,t,n){var r=e.reactions;if(r!==null){var i=ui(),a=r.length;if(Qi+=a,Qi>1e5&&Zi===null&&(Zi=new Set),Zi!==null){if(Zi.has(e))return;Zi.add(e)}for(var o=0;o<a;o++){var s=r[o],c=s.f;if(i||s!==Wa){var l=!(c&2048);if(l&&mi(s,t),c&131072)qi.add(s);else if(c&2){var u=s;Ni?.delete(u),Wee(u,4096,n)}else if(l){var d=s;c&16&&Hi!==null&&Hi.add(d),n===null?Wi(d):n.push(d)}}}}}function ta(e){if(typeof e!=`object`||!e||Pr in e||Fr in e)return e;let t=Er(e);if(t!==Tr&&t!==lee)return e;var n=new Map,r=br(e),i=j(0),a=null,o=$a,s=e=>{if($a===o)return e();var t=Va,n=$a;Ua(null),eo(o);var r=e();return Ua(t),eo(n),r};return r&&n.set(`length`,j(e.length,a)),new Proxy(e,{defineProperty(e,t,r){`value`in r&&r.configurable!==!1&&r.enumerable!==!1&&r.writable!==!1||Tee();var i=n.get(t);return i===void 0?s(()=>{var e=j(r.value,a);return n.set(t,e),e}):M(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>j(Gr,a));n.set(t,e),ea(i)}}else M(r,Gr),ea(i);return!0},get(t,r,i){if(r===Pr)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||wr(t,r)?.writable)&&(o=s(()=>j(ta(c?t[r]:Gr),a)),n.set(r,o)),o!==void 0){var l=z(o);return l===Gr?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var r=Reflect.getOwnPropertyDescriptor(e,t),i=n.get(t);if(i!==void 0){var a=z(i);if(a===Gr)return;if(r&&`value`in r)r.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return r},has(e,t){if(t===Pr)return!0;var r=n.get(t),i=r!==void 0&&r.v!==Gr||Reflect.has(e,t);return(r!==void 0||Wa!==null&&(!i||wr(e,t)?.writable))&&(r===void 0&&(r=s(()=>j(i?ta(e[t]):Gr,a)),n.set(t,r)),z(r)===Gr)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;d<l.v;d+=1){var f=n.get(d+``);f===void 0?d in e&&(f=s(()=>j(Gr,a)),n.set(d+``,f)):M(f,Gr)}if(l===void 0)(!u||wr(e,t)?.writable)&&(l=s(()=>j(void 0,a)),M(l,ta(o)),n.set(t,l));else{u=l.v!==Gr;var p=s(()=>ta(o));M(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&M(h,g+1)}ea(i)}return!0},ownKeys(e){z(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==Gr});for(var[r,a]of n)a.v!==Gr&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Eee()}})}function na(e){try{if(typeof e==`object`&&e&&Pr in e)return e[Pr]}catch{}return e}function ra(e,t){return Object.is(na(e),na(t))}var ia,aa,oa,sa,ca;function Gee(){if(ia===void 0){ia=window,aa=document,oa=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;sa=wr(t,`firstChild`).get,ca=wr(t,`nextSibling`).get,Dr(e)&&(e[Rr]=void 0,e[Lr]=null,e[zr]=void 0,e.__e=void 0),Dr(n)&&(n[Br]=void 0)}}function la(e=``){return document.createTextNode(e)}function ua(e){return sa.call(e)}function da(e){return ca.call(e)}function N(e,t){if(!qr)return ua(e);var n=ua(Yr);if(n===null)n=Yr.appendChild(la());else if(t&&n.nodeType!==3){var r=la();return n?.before(r),Xr(r),r}return t&&ha(n),Xr(n),n}function P(e,t=!1){if(!qr){var n=ua(e);return n instanceof Comment&&n.data===``?da(n):n}if(t){if(Yr?.nodeType!==3){var r=la();return Yr?.before(r),Xr(r),r}ha(Yr)}return Yr}function F(e,t=!1){if(!qr)return ua(e);var n=N(e,t);return D(e),n}function I(e,t=1,n=!1){let r=qr?Yr:e;for(var i;t--;)i=r,r=da(r);if(!qr)return r;if(n){if(r?.nodeType!==3){var a=la();return r===null?i?.after(a):r.before(a),Xr(a),a}ha(r)}return Xr(r),r}function fa(e){e.textContent=``}function pa(){return!1}function ma(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function ha(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function Kee(e){var t=Wa;if(t===null)return Va.f|=8388608,e;if(!(t.f&32768)&&!(t.f&4))throw e;ga(e,t)}function ga(e,t){if(e===Wr)throw e;if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function _a(e){Wa===null&&(Va===null&&See(e),xee()),za&&bee(e)}function qee(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function va(e,t){var n=Wa;n!==null&&n.f&8192&&(e|=8192);var r={ctx:ai,deps:null,nodes:null,f:e|2560,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};ji?.register_created_effect(r);var i=r;if(e&4)Li===null?Bi.ensure().schedule(r):Li.push(r);else if(t!==null){try{so(r)}catch(e){throw ja(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=65536))}if(i!==null&&(i.parent=n,n!==null&&qee(i,n),Va!==null&&Va.f&2&&!(e&64))){var a=Va;(a.effects??=[]).push(i)}return r}function ya(){return Va!==null&&!Ha}function ba(e){let t=va(8,null);return mi(t,1024),t.teardown=e,t}function L(e){_a(`$effect`);var t=Wa.f;if(!Va&&t&32&&ai!==null&&!ai.i){var n=ai;(n.e??=[]).push(e)}else return xa(e)}function xa(e){return va(1048580,e)}function Sa(e){return _a(`$effect.pre`),va(1048584,e)}function Ca(e){Bi.ensure();let t=va(524352,e);return()=>{ja(t)}}function Jee(e){Bi.ensure();let t=va(524352,e);return(e={})=>new Promise(n=>{e.outro?Pa(t,()=>{ja(t),n(void 0)}):(ja(t),n(void 0))})}function wa(e){return va(4,e)}function Yee(e){return va(4718592,e)}function Ta(e,t=0){return va(8|t,e)}function R(e,t=[],n=[],r=[]){bi(r,t,n,t=>{va(8,()=>{e(...t.map(z))})})}function Xee(e,t=[],n=[],r=[]){bi(r,t,n,t=>{va(4,()=>e(...t.map(z)))})}function Ea(e,t=0){return va(16|t,e)}function Da(e,t=0){return va(16777216|t,e)}function Oa(e){return va(524320,e)}function ka(e){var t=e.teardown;if(t!==null){let n=za,r=Va;Ba(!0),Ua(null);try{t.call(null)}catch(t){ga(t,e.parent)}finally{Ba(n),Ua(r)}}}function Aa(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&yi(()=>{e.abort(Hr)});var r=n.next;n.f&64?n.parent=null:ja(n,t),n=r}}function Zee(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||ja(t),t=n}}function ja(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Ma(e.nodes.start,e.nodes.end),n=!0),e.f|=33554432,Aa(e,t&&!n),oo(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();ka(e),e.f^=33554432,e.f|=16384;var i=e.parent;i!==null&&i.first!==null&&Na(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Ma(e,t){for(;e!==null;){var n=e===t?null:da(e);e.remove(),e=n}}function Na(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function Pa(e,t,n=!0){var r=[];e.f|=256,Fa(e,r,!0);var i=()=>{n&&ja(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Fa(e,t,n){if(!(e.f&8192)){e.f^=8192;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Fa(i,t,o?n:!1)}i=a}}}function Ia(e){e.f&=-257,La(e,!0)}function La(e,t){if(!(e.f&256)&&e.f&8192){e.f^=8192,e.f&1024||(mi(e,2048),Bi.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);La(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Ra(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:da(n);t.append(n),n=i}}var Qee=null,za=!1;function Ba(e){za=e}var Va=null,Ha=!1;function Ua(e){Va=e}var Wa=null;function Ga(e){Wa=e}var Ka=null;function qa(e){Va!==null&&(Va.f&2097152||Va.f&2)&&(Ka??=new Set).add(e)}var Ja=null,Ya=0,Xa=null;function $ee(e){Xa=e}var Za=1,Qa=0,$a=Qa;function eo(e){$a=e}function to(){return++Za}function no(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(no(a)&&Oi(a),a.wv>e.wv)return!0}t&512&&Ni===null&&mi(e,1024)}return!1}function ro(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Ka!==null&&Ka.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?ro(a,t,!1):t===a&&(n?mi(a,2048):a.f&1024&&mi(a,4096),Wi(a))}}function io(e){var t=Ja,n=Ya,r=Xa,i=Va,a=Ka,o=ai,s=Ha,c=$a,l=e.f;Ja=null,Ya=0,Xa=null,Va=l&96?null:e,Ka=null,oi(e.ctx),Ha=!1,$a=++Qa,e.ac!==null&&(yi(()=>{e.ac.abort(Hr)}),e.ac=null);try{e.f|=2097152;var u=e.fn,d=u();e.f|=32768;var f=ao(e);if(ui()&&Xa!==null&&!Ha&&f!==null&&!(e.f&6146))for(var p=0;p<Xa.length;p++)ro(Xa[p],e);if(i!==null&&i!==e){if(Qa++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=Qa;if(t!==null)for(let e of t)e.rv=Qa;Xa!==null&&(r===null?r=Xa:r.push(...Xa))}return e.f&8388608&&(e.f^=8388608),d}catch(t){return ao(e),Kee(t)}finally{e.f^=2097152,Ja=t,Ya=n,Xa=r,Va=i,Ka=a,oi(o),Ha=s,$a=c}}function ao(e){var t=e.deps,n=ji?.is_fork;if(Ja!==null){var r;if(n||oo(e,Ya),t!==null&&Ya>0)for(t.length=Ya+Ja.length,r=0;r<Ja.length;r++)t[Ya+r]=Ja[r];else e.deps=t=Ja;if(ya()&&e.f&512)for(r=Ya;r<t.length;r++)(t[r].reactions??=[]).push(e)}else!n&&t!==null&&Ya<t.length&&(oo(e,Ya),t.length=Ya);return t}function ete(e,t){let n=t.reactions;if(n!==null){var r=see.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(Ja===null||!xr.call(Ja,t))){var a=t;a.f&512&&(a.f^=512),a.v!==Gr&&hi(a),a.ac!==null&&yi(()=>{a.ac.abort(Hr),a.ac=null,mi(a,2048)}),zee(a),oo(a,0)}}function oo(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)ete(e,n[r])}function so(e){var t=e.f;if(!(t&16384)){mi(e,1024);var n=Wa;Wa=e;try{t&16777232?Zee(e):Aa(e),ka(e);var r=io(e);e.teardown=typeof r==`function`?r:null,e.wv=Za}finally{Wa=n}}}async function co(){await Promise.resolve(),Vi()}function z(e){var t=!!(e.f&2);if(Qee?.add(e),Va!==null&&!Ha&&!(Wa!==null&&Wa.f&16384)&&(Ka===null||!Ka.has(e))){var n=Va.deps;if(Va.f&2097152)e.rv<Qa&&(e.rv=Qa,Ja===null&&n!==null&&n[Ya]===e?Ya++:Ja===null?Ja=[e]:Ja.push(e));else{Va.deps??=[],xr.call(Va.deps,e)||Va.deps.push(e);var r=e.reactions;r===null?e.reactions=[Va]:xr.call(r,Va)||r.push(Va)}}if(za&&Ji.has(e))return Ji.get(e);if(t){var i=e;if(za){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||uo(i))&&(a=Di(i)),Ji.set(i,a),a}var o=!(i.f&512)&&!Ha&&Va!==null&&!!(Va.f&512),s=!(i.f&32768);no(i)&&(o&&(i.f|=512),Oi(i)),o&&!s&&(ki(i),lo(i))}if(Ni?.has(e))return Ni.get(e);if(e.f&8388608)throw e.v;return e.v}function lo(e){if(e.f|=512,e.deps!==null)for(let n of e.deps){var t=n.reactions;t===null?n.reactions=[e]:xr.call(t,e)||t.push(e),n.f&2&&!(n.f&512)&&(ki(n),lo(n))}}function uo(e){if(e.v===Gr)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Ji.has(t)||t.f&2&&uo(t))return!0;return!1}function fo(e){var t=Ha;try{return Ha=!0,e()}finally{Ha=t}}function po(){return Symbol(`@attach`)}function tte(e){return e.endsWith(`capture`)&&e!==`gotpointercapture`&&e!==`lostpointercapture`}var nte=[`beforeinput`,`click`,`change`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`];function rte(e){return nte.includes(e)}var ite=`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`),ate={formnovalidate:`formNoValidate`,ismap:`isMap`,nomodule:`noModule`,playsinline:`playsInline`,readonly:`readOnly`,defaultvalue:`defaultValue`,defaultchecked:`defaultChecked`,srcobject:`srcObject`,novalidate:`noValidate`,allowfullscreen:`allowFullscreen`,disablepictureinpicture:`disablePictureInPicture`,disableremoteplayback:`disableRemotePlayback`};function ote(e){return e=e.toLowerCase(),ate[e]??e}[...ite];var ste=[`touchstart`,`touchmove`];function cte(e){return ste.includes(e)}var lte=[`textarea`,`script`,`style`,`title`];function ute(e){return lte.includes(e)}var mo=Symbol(`events`),ho=new Set,go=new Set;function dte(e){if(!qr)return;e.removeAttribute(`onload`),e.removeAttribute(`onerror`);let t=e.__e;t!==void 0&&(e.__e=void 0,queueMicrotask(()=>{e.isConnected&&e.dispatchEvent(t)}))}function _o(e,t,n,r={}){function i(e){if(r.capture||wo.call(t,e),!e.cancelBubble)return yi(()=>n?.call(this,e))}return e.startsWith(`pointer`)||e.startsWith(`touch`)||e===`wheel`?(i.__removed=!1,pi(()=>{i.__removed||t.addEventListener(e,i,r)})):t.addEventListener(e,i,r),i}function vo(e,t,n,r={}){var i=_o(t,e,n,r);return()=>{i.__removed=!0,e.removeEventListener(t,i,r)}}function yo(e,t,n,r,i){var a={capture:r,passive:i},o=_o(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&ba(()=>{o.__removed=!0,t.removeEventListener(e,o,a)})}function bo(e,t,n){(t[mo]??={})[e]=n}function xo(e){for(var t=0;t<e.length;t++)ho.add(e[t]);for(var n of go)n(e)}var So=null,Co=!1;function wo(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;So=e,Co||(Co=!0,setTimeout(()=>{Co=!1,So=null}));var o=0,s=So===e&&e[mo];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[mo]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){Cr(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=Va,d=Wa;Ua(null),Ga(null);try{for(var f,p=[];a!==null&&a!==t;){try{var m=a[mo]?.[r];m==null||a.disabled&&e.target!==a||m.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e[mo]=t,delete e.currentTarget,Ua(u),Ga(d)}}}var fte=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function pte(e){return fte?.createHTML(e)??e}function mte(e){var t=ma(`template`);return t.innerHTML=pte(e.replaceAll(`<!>`,`<!---->`)),t.content}function To(e,t){var n=Wa;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function B(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(`<!>`);return()=>{if(qr)return To(Yr,null),Yr;i===void 0&&(i=mte(a?e:`<!>`+e),n||(i=ua(i)));var t=r||oa?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=ua(t),s=t.lastChild;To(o,s)}else To(t,t);return t}}function V(e=``){if(!qr){var t=la(e+``);return To(t,t),t}var n=Yr;return n.nodeType===3?ha(n):(n.before(n=la()),Xr(n)),To(n,n),n}function H(){if(qr)return To(Yr,null),Yr;var e=document.createDocumentFragment(),t=document.createComment(``),n=la();return e.append(t,n),To(t,n),e}function U(e,t){if(qr){var n=Wa;n.f&32768&&n.nodes.end!==null||(n.nodes.end=Yr),Zr()}else e!==null&&e.before(t)}function Eo(){if(qr&&Yr&&Yr.nodeType===8&&Yr.textContent?.startsWith(`$`)){let e=Yr.textContent.substring(1);return Zr(),e}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function hte(e){let t=0,n=Yi(0),r;return()=>{ya()&&(z(n),Ta(()=>(t===0&&(r=fo(()=>e(()=>ea(n)))),t+=1,()=>{pi(()=>{--t,t===0&&(r?.(),r=void 0,ea(n))})})))}}var gte=589824;function Do(e,t,n,r){new _te(e,t,n,r)}var _te=class{parent;is_pending=!1;transform_error;#e;#t=qr?Yr:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=hte(()=>(this.#m=Yi(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=Wa;t.b=this,t.f|=128,n(e)},this.parent=Wa.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=Ea(()=>{if(qr){let e=ei(this.#t);Zr();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#_(t)}else t?this.#b():this.#g()}else this.#x()},gte),qr&&(this.#e=Yr)}#g(){try{this.#a=Oa(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);pi(r),t&&(this.#s=Oa(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{this.#y()||(t?mee():(t=!0,n&&Oee(),this.#s!==null&&Pa(this.#s,()=>{this.#s=null}),this.#C(()=>{this.#x()})))};return{reset:r,invoke_onerror:()=>{if(!this.#y())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){ga(e,this.#i&&this.#i.parent)}}}}#y(){return!!(this.#i.f&33570816)}#b(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Oa(()=>e(this.#e)),pi(()=>{if(!this.#y()){var e=this.#c=document.createDocumentFragment(),t=la(),n=!1;e.append(t),this.#a=this.#C(()=>{try{return Oa(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){ga(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#S(ji)):this.#u===0&&(this.#e.before(e),this.#c=null,Pa(this.#o,()=>{this.#o=null}),this.#S(ji))}}))}#x(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Oa(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Ra(this.#a,e);let t=this.#n.pending;this.#o=Oa(()=>t(this.#e))}else this.#S(ji)}catch(e){this.error(e)}}#S(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){gi(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#C(e){var t=Wa,n=Va,r=ai;Ga(this.#i),Ua(this.#i),oi(this.#i.ctx);try{return Bi.ensure(),e()}finally{Ga(t),Ua(n),oi(r)}}#w(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#S(t),this.#o&&Pa(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#w(e,t)}update_pending_count(e,t){this.#w(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,pi(()=>{this.#d=!1,this.#m&&$i(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),z(this.#m)}error(e){if(e===Wr||!this.#n.onerror&&!this.#n.failed)throw e;ji?.is_fork?(this.#a&&ji.skip_effect(this.#a),this.#o&&ji.skip_effect(this.#o),this.#s&&ji.skip_effect(this.#s),ji.oncommit(()=>{this.#y()||this.#T(e)})):this.#T(e)}#T(e){this.#a&&=(ja(this.#a),null),this.#o&&=(ja(this.#o),null),this.#s&&=(ja(this.#s),null),qr&&(Xr(this.#t),Qr(),Xr($r()));let t=this.#n.failed,n=e=>{if(this.#y())return;let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&!this.#y()&&(this.#s=this.#C(()=>{try{return Oa(()=>{var r=Wa;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return ga(e,this.#i.parent),null}}))};pi(()=>{if(!this.#y()){var t;try{t=this.transform_error(e)}catch(e){ga(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>ga(e,this.#i&&this.#i.parent)):n(t)}})}};function W(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[Br]??=e.nodeValue)&&(e[Br]=n,e.nodeValue=`${n}`)}function Oo(e,t){return vte(e,t)}var ko=new Map;function vte(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){Gee();var c=void 0,l=Jee(()=>{var o=n??t.appendChild(la());Do(o,{pending:()=>{}},t=>{O({});var n=ai;if(a&&(n.c=a),i&&(r.$$events=i),qr&&To(t,null),c=e(t,r)||li(),qr&&(Wa.nodes.end=Yr,Yr===null||Yr.nodeType!==8||Yr.data!==`]`))throw Kr(),Wr;k()},s);var l=new Set,u=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!l.has(r)){l.add(r);var i=cte(r);for(let e of[t,document]){var a=ko.get(e);a===void 0&&(a=new Map,ko.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,wo,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return u(Sr(ho)),go.add(u),()=>{for(var e of l)for(let n of[t,document]){var r=ko.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,wo),r.delete(e),r.size===0&&ko.delete(n)):r.set(e,i)}go.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return Ao.set(c,l),c}var Ao=new WeakMap;function jo(e,t){let n=Ao.get(e);return n?(Ao.delete(e),n(t)):Promise.resolve()}var Mo=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Ia(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Ia(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(ja(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Ra(r,t),t.append(la()),this.#n.set(e,{effect:r,fragment:t})}else ja(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),Pa(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(ja(n.effect),this.#n.delete(e))};ensure(e,t){var n=ji,r=pa();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=la();i.append(a),this.#n.set(e,{effect:Oa(()=>t(a)),fragment:i})}else this.#t.set(e,Oa(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else qr&&(this.anchor=Yr),this.#a(n)}},No=0,Po=1,yte=2;function Fo(e,t,n,r,i){qr&&Zr();var a=ui(),o=Gr,s=a?Yi(o):Xi(o,!1,!1),c=a?Yi(o):Xi(o,!1,!1),l=new Mo(e);Ea(()=>{var a=ji,o=t(),u=!1;let d=qr&&Ar(o)===(e.data===`[!`);if(d&&(Xr($r()),Jr(!1)),Ar(o)){var f=xi(),p=!1;let e=e=>{if(!u){p=!0,f(!1),ji===a&&a.deactivate(),Bi.ensure();try{e()}finally{Si(!1),Fi||Vi()}}};o.then(t=>{e(()=>{$i(s,t),l.ensure(Po,r&&(e=>r(e,s)))})},t=>{e(()=>{if($i(c,t),l.ensure(yte,i&&(e=>i(e,c))),!i)throw c.v})}),qr?l.ensure(No,n):pi(()=>{p||e(()=>{l.ensure(No,n)})})}else $i(s,o),l.ensure(Po,r&&(e=>r(e,s)));return d&&Jr(!0),()=>{u=!0}})}function G(e,t,n=!1){var r;qr&&(r=Yr,Zr());var i=new Mo(e),a=n?65536:0;function o(e,t){if(qr){var n=ei(r);if(e!==parseInt(n.substring(1))){var a=$r();Xr(a),i.anchor=a,Jr(!1),i.ensure(e,t),Jr(!0);return}}i.ensure(e,t)}Ea(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}var bte=Symbol(`NaN`);function Io(e,t,n){qr&&Zr();var r=new Mo(e),i=!ui();Ea(()=>{var e=t();e!==e&&(e=bte),i&&typeof e==`object`&&e&&(e={}),r.ensure(e,n)})}function Lo(e,t){qr&&Xr(ua(e)),Ta(()=>{var n=t();for(var r in n){var i=n[r];i==null||i===``?e.style.removeProperty(r):e.style.setProperty(r,i)}})}function Ro(e,t){return t}function xte(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];Pa(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;zo(e,Sr(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var c=r.length===0&&n!==null&&e.pending.size===0;if(c){var l=n,u=l.parentNode;fa(u),u.append(l),e.items.clear()}zo(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function zo(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=33554432,Ra(a,document.createDocumentFragment())):ja(t[i],n)}}var Ste;function Bo(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var c=e;o=qr?Xr(ua(c)):c.appendChild(la())}qr&&Zr();var l=null,u=Ei(()=>{var e=n();return br(e)?e:e==null?[]:Sr(e)}),d=new Map,f=!0;function p(e){if(!(h.effect.f&16384)){h.pending.delete(e);var n=z(u);h.fallback=l,Cte(h,n,o,t,r),l!==null&&(n.length===0?l.f&33554432?(l.f^=33554432,Ho(l,null,o)):Ia(l):Pa(l,()=>{l=null}))}}function m(e){h.pending.delete(e)}var h={effect:Ea(()=>{var e=z(u),c=e.length;let h=!1;qr&&ei(o)===`[!`!=(c===0)&&(o=$r(),Xr(o),Jr(!1),h=!0);for(var g=new Set,_=ji,v=pa(),y=0;y<c;y+=1){qr&&Yr.nodeType===8&&Yr.data===`]`&&(o=Yr,h=!0,Jr(!1));var b=e[y],x=r(b,y),S=f?null:s.get(x);S?(S.v&&$i(S.v,b),S.i&&$i(S.i,y),v&&_.unskip_effect(S.e)):(S=wte(s,f?o:Ste??=la(),b,x,y,i,t,n),f||(S.e.f|=33554432),s.set(x,S)),g.add(x)}if(c===0&&a&&!l&&(f?l=Oa(()=>a(o)):(l=Oa(()=>a(Ste??=la())),l.f|=33554432)),c>g.size&&yee(``,``,``),qr&&c>0&&Xr($r()),!f){if(d.set(_,g),v){for(let[e,t]of s)g.has(e)||_.skip_effect(t.e);_.oncommit(p),_.ondiscard(m)}else p(_)}h&&Jr(!0),z(u)}),flags:t,items:s,pending:d,outrogroups:null,fallback:l};f=!1,qr&&(o=Yr)}function Vo(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Cte(e,t,n,r,i){var a=!!(r&8),o=t.length,s=e.items,c=Vo(e.effect.first),l,u=null,d,f=[],p=[],m,h,g,_;if(a)for(_=0;_<o;_+=1)m=t[_],h=i(m,_),g=s.get(h).e,g.f&33554432||(g.nodes?.a?.measure(),(d??=new Set).add(g));for(_=0;_<o;_+=1){if(m=t[_],h=i(m,_),g=s.get(h).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(g),t.done.delete(g);if(g.f&8192&&(Ia(g),a&&(g.nodes?.a?.unfix(),(d??=new Set).delete(g))),g.f&33554432){if(g.f^=33554432,g===c)Ho(g,null,n);else{var v=u?u.next:c;g===e.effect.last&&(e.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),Uo(e,u,g),Uo(e,g,v),Ho(g,v,n),u=g,f=[],p=[],c=Vo(u.next);continue}}if(g!==c){if(l!==void 0&&l.has(g)){if(f.length<p.length){var y=p[0],b;u=y.prev;var x=f[0],S=f[f.length-1];for(b=0;b<f.length;b+=1)Ho(f[b],y,n);for(b=0;b<p.length;b+=1)l.delete(p[b]);Uo(e,x.prev,S.next),Uo(e,u,x),Uo(e,S,y),c=y,u=S,--_,f=[],p=[]}else l.delete(g),Ho(g,c,n),Uo(e,g.prev,g.next),Uo(e,g,u===null?e.effect.first:u.next),Uo(e,u,g),u=g;continue}for(f=[],p=[];c!==null&&c!==g;)(l??=new Set).add(c),p.push(c),c=Vo(c.next);if(c===null)continue}g.f&33554432||f.push(g),u=g,c=Vo(g.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(zo(e,Sr(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var C=[];if(l!==void 0)for(g of l)g.f&8192||C.push(g);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&C.push(c),c=Vo(c.next);var w=C.length;if(w>0){var T=r&4&&o===0?n:null;if(a){for(_=0;_<w;_+=1)C[_].nodes?.a?.measure();for(_=0;_<w;_+=1)C[_].nodes?.a?.fix()}xte(e,C,T)}}a&&pi(()=>{if(d!==void 0)for(g of d)g.nodes?.a?.apply()})}function wte(e,t,n,r,i,a,o,s){var c=o&1?o&16?Yi(n):Xi(n,!1,!1):null,l=o&2?Yi(i):null;return{v:c,i:l,e:Oa(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Ho(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=da(r);if(a.before(r),r===i)return;r=o}}function Uo(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function Wo(e,t,n=!1,r=!1,i=!1,a=!1){var o=e,s=``;if(n){var c=e;qr&&(o=Xr(ua(c)))}R(()=>{var e=Wa;if(s===(s=t()??``))qr&&Zr();else if(n&&!qr)e.nodes=null,c.innerHTML=s,s!==``&&To(ua(c),c.lastChild);else if(e.nodes!==null&&(Ma(e.nodes.start,e.nodes.end),e.nodes=null),s!==``){if(qr){for(var a=Yr.data,l=Zr(),u=l;l!==null&&(l.nodeType!==8||l.data!==``);)u=l,l=da(l);if(l===null)throw Kr(),Wr;To(Yr,u),o=Xr(l)}else{var d=ma(r?`svg`:i?`math`:`template`,r?`http://www.w3.org/2000/svg`:i?`http://www.w3.org/1998/Math/MathML`:void 0);d.innerHTML=s;var f=r||i?d:d.content;if(To(ua(f),f.lastChild),r||i)for(;ua(f);)o.before(ua(f));else o.before(f)}}})}function Go(e,t,...n){var r=new Mo(e);Ea(()=>{let e=t()??null;r.ensure(e,e&&(t=>e(t,...n)))},65536)}function Ko(e,t,n){var r;qr&&(r=Yr,Zr());var i=new Mo(e);Ea(()=>{var e=t()??null;if(qr&&ei(r)===`[`!=(e!==null)){var a=$r();Xr(a),i.anchor=a,Jr(!1),i.ensure(e,e&&(t=>n(t,e))),Jr(!0)}else i.ensure(e,e&&(t=>n(t,e)))},65536)}var Tte=()=>performance.now(),qo={tick:e=>requestAnimationFrame(e),now:()=>Tte(),tasks:new Set};function Ete(){let e=qo.now();qo.tasks.forEach(t=>{t.c(e)||(qo.tasks.delete(t),t.f())}),qo.tasks.size!==0&&qo.tick(Ete)}function Dte(e){let t;return qo.tasks.size===0&&qo.tick(Ete),{promise:new Promise(n=>{qo.tasks.add(t={c:e,f:n})}),abort(){qo.tasks.delete(t)}}}function Ote(e){if(e===`float`)return`cssFloat`;if(e===`offset`)return`cssOffset`;if(e.startsWith(`--`))return e;let t=e.split(`-`);return t.length===1?t[0]:t[0]+t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join(``)}function Jo(e){let t={},n=e.split(`;`);for(let e of n){let[n,r]=e.split(`:`);if(!n||r===void 0)break;let i=Ote(n.trim());t[i]=r.trim()}return t}var kte=e=>e,Yo=null;function Xo(e){Yo=e}function Zo(e,t,n){var r=(Yo??Wa).nodes,i,a,o,s=null;r.a??={element:e,measure(){i=this.element.getBoundingClientRect()},apply(){if(o?.abort(),a=this.element.getBoundingClientRect(),i.left!==a.left||i.right!==a.right||i.top!==a.top||i.bottom!==a.bottom){let e=t()(this.element,{from:i,to:a},n?.());o=Qo(this.element,e,void 0,1,()=>{},()=>{o?.abort(),o=void 0})}},fix(){if(!e.getAnimations().length){var{position:t,width:n,height:r}=getComputedStyle(e);if(t!==`absolute`&&t!==`fixed`){var a=e.style;s={position:a.position,width:a.width,height:a.height,transform:a.transform},a.position=`absolute`,a.width=n,a.height=r;var o=e.getBoundingClientRect();if(i.left!==o.left||i.top!==o.top){var c=`translate(${i.left-o.left}px, ${i.top-o.top}px)`;a.transform=a.transform?`${a.transform} ${c}`:c}}}},unfix(){if(s){var t=e.style;t.position=s.position,t.width=s.width,t.height=s.height,t.transform=s.transform}}},r.a.element=e}function Qo(e,t,n,r,i,a){var o=r===1,s=!1;if(Or(t)){var c;return pi(()=>{s||(c=Qo(e,t({direction:o?`in`:`out`}),n,r,i,a))}),{abort:()=>{s=!0,c?.abort()},deactivate:()=>c?.deactivate(),reset:()=>c?.reset(),t:()=>c?.t()??1-r}}if(n?.deactivate(),!t?.duration&&!t?.delay)return i(),a(),{abort:kr,deactivate:kr,reset:kr,t:()=>r};let{delay:l=0,css:u,tick:d,easing:f=kte}=t;var p,m=()=>1-r;return pi(()=>{if(!s){var c=[];if(o&&n===void 0&&(d&&d(0,1),u)){var h=Jo(u(0,1));c.push(h,h)}p=e.animate(c,{duration:l,fill:`forwards`}),p.onfinish=()=>{p.cancel(),i();var o=n?.t()??1-r;n?.abort();var s=r-o,c=t.duration*Math.abs(s),l=[];if(c>0){var h=!1;if(u)for(var g=Math.ceil(c/(1e3/60)),_=0;_<=g;_+=1){var v=o+s*f(_/g),y=Jo(u(v,1-v));l.push(y),h||=y.overflow===`hidden`}h&&(e.style.overflow=`hidden`),m=()=>{var e=p.currentTime;return o+s*f(e/c)},d&&Dte(()=>{if(p.playState!==`running`)return!1;var e=m();return d(e,1-e),!0})}p=e.animate(l,{duration:c,fill:`forwards`}),p.onfinish=()=>{m=()=>r,d?.(r,1-r),a()}}}}),{abort:()=>{s=!0,p&&(p.cancel(),p.effect=null,p.onfinish=kr)},deactivate:()=>{a=kr},reset:()=>{r===0&&d?.(1,0)},t:()=>m()}}function Ate(e,t,n,r,i,a){let o=qr;qr&&Zr();var s=null;qr&&Yr.nodeType===1&&(s=Yr,Zr());var c=qr?Yr:e,l=Wa,u=new Mo(c,!1);Ea(()=>{let e=t()||null;var a=i?i():n||e===`svg`?`http://www.w3.org/2000/svg`:void 0;if(e===null)u.ensure(null,null);else return u.ensure(e,t=>{if(e){var n=qr;if(s=qr?s:ma(e,a),To(s,s),r){var i=null;qr&&ute(e)&&s.append(i=document.createComment(``));var o=qr?ua(s):s.appendChild(la());qr&&(o===null?Jr(!1):Xr(o)),Xo(l),r(s,o),i?.remove(),Xo(null)}Wa.nodes.end=s,n||t.before(s)}qr&&Xr(t)}),()=>{}},65536),ba(()=>{}),o&&(Jr(!0),Xr(c))}function $o(e,t){let n=null,r=qr;var i;if(qr){n=Yr;for(var a=ua(document.head);a!==null&&(a.nodeType!==8||a.data!==e);)a=da(a);if(a===null)Jr(!1);else{var o=da(a);a.remove(),Xr(o)}}qr||(i=document.head.appendChild(la()));try{Ea(()=>{var e=Oa(()=>t(i));e.f|=262144,qr||(e.nodes===null?e.nodes={start:i,end:i,a:null,t:null}:e.nodes.end=i)})}finally{r&&(Jr(!0),Xr(n))}}function K(e,t){wa(()=>{e=Wa?.parent?.nodes?.start??e;var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=ma(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}function es(e,t){var n=void 0,r;Da(()=>{n!==(n=t())&&(r&&=(ja(r),null),n&&(r=Oa(()=>{wa(()=>n(e))})))})}function ts(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ts(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function jte(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ts(e))&&(r&&(r+=` `),r+=t);return r}function ns(e){return typeof e==`object`?jte(e):e??``}var rs=[...`
\r\f\xA0\v`];function Mte(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||rs.includes(r[o-1]))&&(s===r.length||rs.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function is(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function as(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function Nte(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(as)),i&&c.push(...Object.keys(i).map(as));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=as(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=is(r)),i&&(n+=is(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function os(e,t,n,r,i,a){var o=e[Rr];if(qr||o!==n||o===void 0){var s=Mte(n,r,a);qr&&s===e.getAttribute(`class`)||(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[Rr]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function ss(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function cs(e,t,n,r){var i=e[zr];if(qr||i!==t){var a=Nte(t,r);qr&&a===e.getAttribute(`style`)||(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[zr]=t}else r&&(Array.isArray(r)?(ss(e,n?.[0],r[0]),ss(e,n?.[1],r[1],`important`)):ss(e,n,r));return r}function ls(e,t){t?e.hasAttribute(`selected`)||e.setAttribute(`selected`,``):e.removeAttribute(`selected`)}function us(e,t){var n=!(`__defaultValue`in e);(n||e.__defaultValue!==t)&&(e.__defaultValue=t,ds(e,!n||`__value`in e))}function ds(e,t){var n=e.__defaultValue,r=e.multiple,i=r?n??[]:null;if(!r||br(i)){var a=e.selectedIndex,o=t&&r?new Set(e.selectedOptions):null;for(var s of e.options){var c=ps(s);ls(s,r?i.includes(c):ra(c,n))}if(t){if(o!==null)for(s of e.options){var l=o.has(s);s.selected!==l&&(s.selected=l)}else e.selectedIndex!==a&&(e.selectedIndex=a)}}}function fs(e,t,n=!1){if(e.multiple){if(t==null)return;if(!br(t))return pee();for(var r of e.options)r.selected=t.includes(ps(r))}else{for(r of e.options)if(ra(ps(r),t)){r.selected=!0;return}n&&t===void 0||(e.selectedIndex=-1)}}function Pte(e){var t=new MutationObserver(t=>{t.every(Fte)||(`__defaultValue`in e&&ds(e,!1),`__value`in e&&fs(e,e.__value))});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`value`]}),ba(()=>{t.disconnect()})}function ps(e){return`__value`in e?e.__value:e.value}function Fte(e){if(e.target.closest(`selectedcontent`)!==null)return!0;if(e.type===`childList`){var t=[...e.addedNodes,...e.removedNodes];return t.length>0&&t.every(e=>e.nodeName===`SELECTEDCONTENT`)}return!1}var ms=Symbol(`class`),hs=Symbol(`style`),gs=Symbol(`is custom element`),_s=Symbol(`is html`),Ite=Ur?`link`:`LINK`,vs=Ur?`input`:`INPUT`,Lte=Ur?`option`:`OPTION`,ys=Ur?`select`:`SELECT`,Rte=Ur?`progress`:`PROGRESS`;function zte(e){if(qr){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute(`value`)){var n=e.value;q(e,`value`,null),e.value=n}if(e.hasAttribute(`checked`)){var r=e.checked;q(e,`checked`,null),e.checked=r}}};e[Vr]=n,pi(n),vi()}}function q(e,t,n,r){var i=xs(e);qr&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Ite)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[dee]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Cs(e).has(t)?e[t]=n:e.setAttribute(t,n))}function Bte(e,t,n,r,i=!1,a=!1){qr&&i&&e.nodeName===vs&&(`defaultValue`in n||`defaultChecked`in n||zte(e));var o=xs(e),s=o[gs],c=!o[_s];let l=qr&&s;l&&Jr(!1);var u=t||{},d=e.nodeName===Lte,f=e.nodeName===ys;try{for(var p in t)!(p in n)&&p[0]+p[1]!==`$$`&&(n[p]=null);n.class?n.class=ns(n.class):(r||n[ms])&&(n.class=null),n[hs]&&(n.style??=null);var m=Cs(e);if(e.nodeName===vs&&`type`in n&&(`value`in n||`__value`in n)){var h=n.type;(h!==u.type||h===void 0&&e.hasAttribute(`type`))&&(u.type=h,q(e,`type`,h,a))}for(let i in n){let l=n[i];if(d&&i===`value`&&l==null)e.value=e.__value=``,u[i]=l;else if(i===`class`)os(e,e.namespaceURI===`http://www.w3.org/1999/xhtml`,l,r,t?.[ms],n[ms]),u[i]=l,u[ms]=n[ms];else if(i===`style`)cs(e,l,t?.[hs],n[hs]),u[i]=l,u[hs]=n[hs];else{var g=u[i];if(l!==g||l===void 0&&e.hasAttribute(i)){u[i]=l;var _=i[0]+i[1];if(_!==`$$`){if(_===`on`){let t={},n=`$$`+i,r=i.slice(2);var v=rte(r);if(tte(r)&&(r=r.slice(0,-7),t.capture=!0),!v&&g){if(l!=null)continue;e.removeEventListener(r,u[n],t),u[n]=null}if(v)bo(r,e,l),xo([r]);else if(l!=null){function y(e){u[i].call(this,e)}u[n]=_o(r,e,y,t)}}else if(i===`style`)q(e,i,l);else if(i===`autofocus`)Pee(e,!!l);else if(!s&&(i===`__value`||i===`value`&&l!=null))e.__value=l,(g==null||e.value!==l||l===0&&e.nodeName===Rte)&&(e.value=l);else if(i===`selected`&&d)ls(e,l);else{var b=i;c||(b=ote(b));var x=b===`defaultValue`||b===`defaultChecked`;if(f&&b===`defaultValue`)continue;if(l==null&&!s&&!x){if(o[i]=null,b===`value`||b===`checked`){let n=e,r=t===void 0;if(b===`value`){let e=n.defaultValue;n.removeAttribute(b),n.defaultValue=e,n.value=n.__value=r?e:null}else{let e=n.defaultChecked;n.removeAttribute(b),n.defaultChecked=e,n.checked=r?e:!1}}else e.removeAttribute(i)}else x||(s||typeof l!=`string`)&&m.has(b)?(e[b]=l,b in o&&(o[b]=Gr)):typeof l!=`function`&&q(e,b,l,a)}}}}}}finally{l&&Jr(!0)}return u}function bs(e,t,n=[],r=[],i=[],a,o=!1,s=!1){bi(i,n,r,n=>{var r=void 0,i={},c=e.nodeName===ys,l=!1;if(Da(()=>{var u=t(...n.map(z)),d=Bte(e,r,u,a,o,s);if(l&&c){var f=e;`defaultValue`in u&&us(f,u.defaultValue),`value`in u&&fs(f,u.value)}for(let e of Object.getOwnPropertySymbols(i))u[e]||ja(i[e]);for(let t of Object.getOwnPropertySymbols(u)){var p=u[t];t.description!==`@attach`||r&&p===r[t]||(i[t]&&ja(i[t]),i[t]=Oa(()=>es(e,()=>p))),d[t]=p}r=d}),c){var u=e;wa(()=>{var e=r;`defaultValue`in e&&us(u,e.defaultValue),fs(u,e.value,!0),Pte(u)})}l=!0})}function xs(e){return e[Lr]??={[gs]:e.nodeName.includes(`-`),[_s]:e.namespaceURI===`http://www.w3.org/1999/xhtml`}}var Ss=new Map;function Cs(e){var t=e.getAttribute(`is`)||e.nodeName,n=Ss.get(t);if(n)return n;Ss.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=cee(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=Er(i)}return n}function Vte(e,t,n=t){var r=new WeakSet;Iee(e,`input`,async i=>{var a=i?e.defaultValue:e.value;if(a=ws(e)?Ts(a):a,n(a),ji!==null&&r.add(ji),await co(),a!==(a=t())){var o=e.selectionStart,s=e.selectionEnd,c=e.value.length;if(e.value=a??``,s!==null){var l=e.value.length;o===s&&s===c&&l>c?(e.selectionStart=l,e.selectionEnd=l):(e.selectionStart=o,e.selectionEnd=Math.min(s,l))}}}),(qr&&e.defaultValue!==e.value||fo(t)==null&&e.value)&&(n(ws(e)?Ts(e.value):e.value),ji!==null&&r.add(ji)),Ta(()=>{var n=t();if(e===document.activeElement){var i=ji;if(r.has(i))return}ws(e)&&n===Ts(e.value)||(e.type!==`date`||n||e.value)&&n!==e.value&&(e.value=n??``)})}function ws(e){var t=e.type;return t===`number`||t===`range`}function Ts(e){return e===``?null:+e}var Hte=new class e{#e=new WeakMap;#t;#n;static entries=new WeakMap;constructor(e){this.#n=e}observe(e,t){var n=this.#e.get(e)||new Set;return n.add(t),this.#e.set(e,n),this.#r().observe(e,this.#n),()=>{var n=this.#e.get(e);n.delete(t),n.size===0&&(this.#e.delete(e),this.#t.unobserve(e))}}#r(){return this.#t??=new ResizeObserver(t=>{for(var n of t){e.entries.set(n.target,n);for(var r of this.#e.get(n.target)||[])r(n)}})}}({box:`border-box`});function Ute(e,t,n){var r=Hte.observe(e,()=>n(e[t]));wa(()=>(fo(()=>n(e[t])),r))}function Es(e,t){return e===t||e?.[Pr]===t}function Ds(e=li(),t,n,r){var i=ai.r,a=Wa;return wa(()=>{var o,s;return Ta(()=>{o=s,s=r?.()||[],fo(()=>{Es(n(...s),e)||(t(e,...s),o&&Es(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&Es(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}var Os=!1;function Wte(e){var t=Os;try{return Os=!1,[e(),Os]}finally{Os=t}}var Gte={get(e,t){if(!e.exclude.has(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.has(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return!e.exclude.has(t)&&t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.has(t))}};function ks(e,t,n){return new Proxy({props:e,exclude:t},Gte)}var Kte={get(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Or(r)&&(r=r()),typeof r==`object`&&r&&t in r)return r[t]}},set(e,t,n){let r=e.props.length;for(;r--;){let i=e.props[r];Or(i)&&(i=i());let a=wr(i,t);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(e,t){let n=e.props.length;for(;n--;){let r=e.props[n];if(Or(r)&&(r=r()),typeof r==`object`&&r&&t in r){let e=wr(r,t);return e&&!e.configurable&&(e.configurable=!0),e}}},has(e,t){if(t===Pr||t===Ir)return!1;for(let n of e.props)if(Or(n)&&(n=n()),n!=null&&t in n)return!0;return!1},ownKeys(e){let t=[];for(let n of e.props)if(Or(n)&&(n=n()),n){for(let e in n)t.includes(e)||t.push(e);for(let e of Object.getOwnPropertySymbols(n))t.includes(e)||t.push(e)}return t}};function As(...e){return new Proxy({props:e},Kte)}function J(e,t,n,r){var i=!0,a=!!(n&8),o=!!(n&16),s=r,c=!0,l=void 0,u=()=>o&&i?(l??=wi(r),z(l)):(c&&(c=!1,s=o?fo(r):r),s);let d;if(a){var f=Pr in e||Ir in e;d=wr(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=Wte(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&wee(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?wi:Ei)(()=>(_=!1,h()));a&&z(v);var y=Wa;return(function(e,t){if(arguments.length>0){let n=t?z(v):i&&a?ta(e):e;return M(v,n),_=!0,s!==void 0&&(s=n),e}return za&&_||y.f&16384?v.v:z(v)})}function js(e){ai===null&&ti(`onMount`),L(()=>{let t=fo(e);if(typeof t==`function`)return t})}function Ms(e){ai===null&&ti(`onDestroy`),js(()=>()=>fo(e))}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var Ns=/^[\u061c\u200e\u200f\u2066-\u2069]+/,Ps=/^[-.+0-9A-Z_a-z\u{a1}-\u{61b}\u{61d}-\u{167f}\u{1681}-\u{1fff}\u{200b}-\u{200d}\u{2010}-\u{2027}\u{2030}-\u{205e}\u{2060}-\u{2065}\u{206a}-\u{2fff}\u{3001}-\u{d7ff}\u{e000}-\u{fdcf}\u{fdf0}-\u{fffd}\u{10000}-\u{1fffd}\u{20000}-\u{2fffd}\u{30000}-\u{3fffd}\u{40000}-\u{4fffd}\u{50000}-\u{5fffd}\u{60000}-\u{6fffd}\u{70000}-\u{7fffd}\u{80000}-\u{8fffd}\u{90000}-\u{9fffd}\u{a0000}-\u{afffd}\u{b0000}-\u{bfffd}\u{c0000}-\u{cfffd}\u{d0000}-\u{dfffd}\u{e0000}-\u{efffd}\u{f0000}-\u{ffffd}\u{100000}-\u{10fffd}]+/u,qte=/^[-.0-9]/;function Jte(e,t){let n=t,r=e.slice(n).match(Ns);r&&(n+=r[0].length);let i=e.slice(n).match(Ps);if(!i)return null;let a=i[0];if(qte.test(a))return null;n+=a.length;let o=e.slice(n).match(Ns);return o&&(n+=o[0].length),{value:a.normalize(),end:n}}var Yte=(e,t)=>e.slice(t).match(Ps)?.[0]??``,Xte=Symbol.for(`CST`),Fs=class extends Error{type;constructor(e,t){super(t),this.type=e}},Is=class extends Fs{start;end;constructor(e,t,n,r){let i=r?`Missing ${r}`:e;t>=0&&(i+=` at ${t}`),super(e,i),this.start=t,this.end=n??t+1}},Zte=class extends Is{constructor(e,t){let{start:n,end:r}=t[Xte]??{start:-1,end:-1};super(e,n,r)}},Ls=class extends Fs{source;cause;constructor(e,t,n,r){super(e,t),this.source=n,r!==void 0&&(this.cause=r)}},Rs=class extends Fs{source;cause;constructor(e,t){super(e,t),this.source=`�`}},zs=new Set(`؜‎‏⁦⁧⁨⁩`),Bs=new Set(`
\r  `),Vs,Hs,Us=(e,t)=>new Is(`missing-syntax`,e,e+t.length,t),Ws=(...e)=>new Is(...e);function Gs(e,t){if(Hs.startsWith(e,Vs))t&&(Vs+=e.length);else throw Us(Vs,e)}function Qte(e){Vs=0,Hs=e;let t=tne();if(Hs.startsWith(`.match`,Vs))return $te(t);let n=t.length>0||Hs.startsWith(`{{`,Vs);!n&&Vs>0&&(Vs=0);let r=Ks(n);if(n&&(ec(),Vs<Hs.length))throw Ws(`extra-content`,Vs,Hs.length);return{type:`message`,declarations:t,pattern:r}}function $te(e){Vs+=6,ec(!0);let t=[];for(;Hs[Vs]===`$`;)t.push(Xs()),ec(!0);if(t.length===0)throw Ws(`empty-token`,Vs);let n=[];for(;Vs<Hs.length;)n.push(ene()),ec();return{type:`select`,declarations:e,selectors:t,variants:n}}function ene(){let e=[];for(;Vs<Hs.length;){ec(e.length?`{`:!1);let t=Hs[Vs];if(t===`{`)break;if(t===`*`)e.push({type:`*`}),Vs+=1;else{let t=Zs(!0);t.value=t.value.normalize(),e.push(t)}}return{keys:e,value:Ks(!0)}}function Ks(e){if(e){if(Hs.startsWith(`{{`,Vs))Vs+=2;else throw Us(Vs,`{{`)}let t=[];loop:for(;Vs<Hs.length;)switch(Hs[Vs]){case`{`:t.push(qs(!0));break;case`}`:if(!e)throw Ws(`parse-error`,Vs);break loop;default:t.push(ane())}if(e){if(Hs.startsWith(`}}`,Vs))Vs+=2;else throw Us(Vs,`}}`)}return t}function tne(){let e=[];ec();loop:for(;Hs[Vs]===`.`;){switch(Hs.substr(Vs,6)){case`.input`:e.push(nne());break;case`.local`:e.push(rne());break;case`.match`:break loop;default:throw Ws(`parse-error`,Vs)}ec()}return e}function nne(){Vs+=6,ec(),Gs(`{`,!1);let e=Vs,t=qs(!1);if(t.type===`expression`&&t.arg?.type===`variable`)return{type:`input`,name:t.arg.name,value:t};throw Ws(`bad-input-expression`,e,Vs)}function rne(){Vs+=6,ec(!0),Gs(`$`,!0);let e=$s();return ec(),Gs(`=`,!0),ec(),Gs(`{`,!1),{type:`local`,name:e,value:qs(!1)}}function qs(e){let t=Vs;Vs+=1,ec();let n=Ys(!1);n&&ec(`}`);let r=Hs[Vs],i,a;switch(r){case`@`:case`}`:break;case`:`:{Vs+=1,i={type:`function`,name:Qs()};let e=Js();e&&(i.options=e);break}case`#`:case`/`:{if(n||!e)throw Ws(`parse-error`,Vs);Vs+=1,a={type:`markup`,kind:r===`#`?`open`:`close`,name:Qs()};let t=Js();t&&(a.options=t);break}default:throw Ws(`parse-error`,Vs)}let o=ine();if(a?.kind===`open`&&Hs[Vs]===`/`&&(a.kind=`standalone`,Vs+=1),Gs(`}`,!0),i){let e=n?{type:`expression`,arg:n,functionRef:i}:{type:`expression`,functionRef:i};return o&&(e.attributes=o),e}if(a)return o&&(a.attributes=o),a;if(!n)throw Ws(`empty-token`,t,Vs);return o?{type:`expression`,arg:n,attributes:o}:{type:`expression`,arg:n}}function Js(){ec(`/}`);let e={},t=!0;for(;Vs<Hs.length;){let n=Hs[Vs];if(n===`@`||n===`/`||n===`}`)break;let r=Vs,i=Qs();if(Object.hasOwn(e,i))throw Ws(`duplicate-option-name`,r,Vs);ec(),Gs(`=`,!0),ec(),e[i]=Ys(!0),t=!1,ec(`/}`)}return t?null:e}function ine(){let e={},t=!0;for(;Hs[Vs]===`@`;){let n=Vs;Vs+=1;let r=Qs();if(Object.hasOwn(e,r))throw Ws(`duplicate-attribute`,n,Vs);ec(`=/}`),Hs[Vs]===`=`?(Vs+=1,ec(),e[r]=Zs(!0),ec(`/}`)):e[r]=!0,t=!1}return t?null:e}function ane(){let e=``,t=Vs;loop:for(;t<Hs.length;++t)switch(Hs[t]){case`\\`:{let n=Hs[t+1];if(!`\\{|}`.includes(n))throw Ws(`bad-escape`,t,t+2);e+=Hs.substring(Vs,t)+n,t+=1,Vs=t+1;break}case`{`:case`}`:break loop}return e+=Hs.substring(Vs,t),Vs=t,e}function Ys(e){return Hs[Vs]===`$`?Xs():Zs(e)}function Xs(){return Vs+=1,{type:`variable`,name:$s()}}function Zs(e){if(Hs[Vs]===`|`)return one();let t=Yte(Hs,Vs);if(t)return Vs+=t.length,{type:`literal`,value:t};if(e)throw Ws(`empty-token`,Vs)}function one(){Vs+=1;let e=``;for(let t=Vs;t<Hs.length;++t)switch(Hs[t]){case`\\`:{let n=Hs[t+1];if(!`\\{|}`.includes(n))throw Ws(`bad-escape`,t,t+2);e+=Hs.substring(Vs,t)+n,t+=1,Vs=t+1;break}case`|`:return e+=Hs.substring(Vs,t),Vs=t+1,{type:`literal`,value:e}}throw Us(Hs.length,`|`)}function Qs(){let e=$s();return Hs[Vs]===`:`?(Vs+=1,e+`:`+$s()):e}function $s(){let e=Jte(Hs,Vs);if(!e)throw Ws(`empty-token`,Vs);return Vs=e.end,e.value}function ec(e=!1){let t=Hs[Vs],n=!1;if(e){for(;zs.has(t);)t=Hs[++Vs];for(;Bs.has(t);)t=Hs[++Vs],n=!0}for(;zs.has(t)||Bs.has(t);)t=Hs[++Vs];if(e&&!n&&(e===!0||!e.includes(Hs[Vs])))throw Us(Vs,`' '`)}function sne(e,t){let{node:n,pattern:r}=t,{functionRef:i=n,attributes:a=null,declaration:o=n,expression:s=n,key:c=n,markup:l=n,options:u=null,value:d=n,variant:f=n}=t,p=(e,t)=>{if(e){let n=u?.(e,t);if(d)for(let n of Object.values(e))d(n,t,`option`);n?.()}},m=(e,t)=>{if(e){let n=a?.(e,t);if(d)for(let n of Object.values(e))n!==!0&&d(n,t,`attribute`);n?.()}},h=(e,t)=>{if(typeof e==`object`){let n;switch(e.type){case`expression`:if(n=s?.(e,t),e.arg&&d?.(e.arg,t,`arg`),e.functionRef){let n=i?.(e.functionRef,t,e.arg);p(e.functionRef.options,t),n?.()}m(e.attributes,t);break;case`markup`:n=l?.(e,t),p(e.options,t),m(e.attributes,t)}n?.()}},g=e=>{let t=r?.(e);for(let t of e)h(t,`placeholder`);t?.()};for(let t of e.declarations){let e=o?.(t);t.value&&h(t.value,`declaration`),e?.()}if(e.type===`message`)g(e.pattern);else{if(d)for(let t of e.selectors)d(t,`selector`,`arg`);for(let t of e.variants){let e=f?.(t);c&&t.keys.forEach(c),g(t.value),e?.()}}}function cne(e,t=(e,t)=>{throw new Zte(e,t)}){let n=0,r=null,i=new Set,a=new Set,o=new Set,s=new Set,c=new Set,l=new Set,u=!0;sne(e,{declaration(e){if(e.name)return(e.value.functionRef||e.type===`local`&&e.value.arg?.type===`variable`&&i.has(e.value.arg.name))&&i.add(e.name),e.type===`local`&&s.add(e.name),u=e.type===`local`,()=>{a.has(e.name)?t(`duplicate-declaration`,e):a.add(e.name)}},expression({functionRef:e}){e&&o.add(e.name)},value(e,o,s){if(e.type===`variable`)switch(c.add(e.name),o){case`declaration`:(s!==`arg`||u)&&a.add(e.name);break;case`selector`:n+=1,r=e,i.has(e.name)||t(`missing-selector-annotation`,e)}},variant(e){let{keys:i}=e;i.length!==n&&t(`key-mismatch`,e);let a=JSON.stringify(i.map(e=>e.type===`literal`?e.value:0));l.has(a)?t(`duplicate-variant`,e):l.add(a),r&&=i.every(e=>e.type===`*`)?null:e}}),r&&t(`missing-fallback`,r);for(let e of s)c.delete(e);return{functions:o,variables:c}}var lne=`Adlm,Arab,Hebr,Mand,Nkoo,Rohg,Syrc,Thaa`;function tc(e){if(e)try{typeof e==`string`&&(e=new Intl.Locale(e));let t=e.getTextInfo?.()??e.textInfo;if(t?.direction)return t.direction;let n=e.maximize().script;if(n)return lne.includes(n)?`rtl`:`ltr`}catch{}return`auto`}function une(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`boolean`)return e;if(e&&typeof e==`object`&&(e=String(e)),e===`true`)return!0;if(e===`false`)return!1;throw RangeError(`Not a boolean`)}function nc(e){if(e&&typeof e==`object`&&(e=e.valueOf()),e&&typeof e==`object`&&(e=String(e)),typeof e==`string`&&/^(0|[1-9][0-9]*)$/.test(e)&&(e=Number(e)),typeof e==`number`&&e>=0&&Number.isInteger(e))return e;throw RangeError(`Not a positive integer`)}function rc(e){if(e&&typeof e==`object`&&(e=e.valueOf()),typeof e==`string`)return e;if(e&&typeof e==`object`)return String(e);throw RangeError(`Not a string`)}function ic(e){let t;if(typeof e==`object`){let n=e?.valueOf;typeof n==`function`&&(t=e.options,e=n.call(e))}if(typeof e==`string`)try{e=JSON.parse(e)}catch{}if(typeof e!=`bigint`&&typeof e!=`number`)throw new Rs(`bad-operand`,`Input is not numeric`);return{value:e,options:t}}function ac(e,t,n,r){let{dir:i,locales:a}=e;n.useGrouping===`never`&&(n.useGrouping=!1),r&&`select`in n&&!e.literalOptionKeys.has(`select`)&&(e.onError(`bad-option`,`The option select may only be set by a literal value`),r=!1);let o,s,c,l;return{type:`number`,get dir(){return i??=(o??=Intl.NumberFormat.supportedLocalesOf(a,n)[0],tc(o)),i},get options(){return{...n}},selectKey:r?e=>{let r=t;n.style===`percent`&&(r*=typeof r==`bigint`?100n:100);let i=String(r);if(e.has(i))return i;if(n.select===`exact`)return null;let o=n.select?{...n,select:void 0,type:n.select}:n;return c??=new Intl.PluralRules(a,o).select(Number(r)),e.has(c)?c:null}:void 0,toParts(){s??=new Intl.NumberFormat(a,n);let e=s.formatToParts(t);return o??=s.resolvedOptions().locale,i??=tc(o),i===`ltr`||i===`rtl`?[{type:`number`,dir:i,locale:o,parts:e}]:[{type:`number`,locale:o,parts:e}]},toString(){return s??=new Intl.NumberFormat(a,n),l??=s.format(t),l},valueOf:()=>t}}function oc(e,t,n){let r=ic(n),i=r.value,a=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:a[n]=nc(r);break;case`roundingMode`:case`roundingPriority`:case`select`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:a[n]=rc(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :number option ${n}`)}return ac(e,i,a,!0)}function dne(e,t,n){let r=ic(n),i=Number.isFinite(r.value)?Math.round(r.value):r.value,a=Object.assign({},r.options,{maximumFractionDigits:0,minimumFractionDigits:void 0,minimumSignificantDigits:void 0,style:`decimal`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`minimumIntegerDigits`:case`maximumSignificantDigits`:a[n]=nc(r);break;case`select`:case`signDisplay`:case`useGrouping`:a[n]=rc(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :integer option ${n}`)}return ac(e,i,a,!0)}function fne(e,t,n){let r=ic(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`currency`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`currency`:case`currencySign`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=rc(r);break;case`minimumIntegerDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=nc(r);break;case`currencyDisplay`:{let t=rc(r);t===`never`?e.onError(`unsupported-operation`,`Currency display "never" is not yet supported`):i[n]=t;break}case`fractionDigits`:{let e=rc(r);if(e===`auto`)i.minimumFractionDigits=void 0,i.maximumFractionDigits=void 0;else{let t=nc(e);i.minimumFractionDigits=t,i.maximumFractionDigits=t}break}}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.currency)throw new Rs(`bad-operand`,`A currency code is required for :currency`);return ac(e,r.value,i,!1)}var pne=new Set([`weekday`,`day-weekday`,`month-day`,`month-day-weekday`,`year-month-day`,`year-month-day-weekday`]),mne=new Set([`long`,`medium`,`short`]),hne=new Set([`hour`,`minute`,`second`]),gne=new Set([`long`,`short`]),_ne=(e,t,n)=>sc(`datetime`,e,t,n),vne=(e,t,n)=>sc(`date`,e,t,n),yne=(e,t,n)=>sc(`time`,e,t,n);function sc(e,t,n,r){let i={localeMatcher:t.localeMatcher},a=r;if(typeof a==`object`&&a){let t=a.options;t&&(i.calendar=t.calendar,e!==`date`&&(i.hour12=t.hour12),i.timeZone=t.timeZone),typeof a.valueOf==`function`&&(a=a.valueOf())}switch(typeof a){case`number`:case`string`:a=new Date(a)}if(!(a instanceof Date)||isNaN(a.getTime()))throw new Rs(`bad-operand`,`Input is not a valid date`);if(n.calendar!==void 0)try{i.calendar=rc(n.calendar)}catch{t.onError(`bad-option`,`Invalid :${e} calendar option value`)}if(n.hour12!==void 0&&e!==`date`)try{i.hour12=une(n.hour12)}catch{t.onError(`bad-option`,`Invalid :${e} hour12 option value`)}if(n.timeZone!==void 0){let r;try{r=rc(n.timeZone)}catch{t.onError(`bad-option`,`Invalid :${e} timeZone option value`)}if(r===`input`)i.timeZone===void 0&&t.onError(`bad-operand`,`Missing input timeZone value for :${e}`);else if(r!==void 0){if(i.timeZone!==void 0&&r!==i.timeZone)throw new Rs(`bad-option`,`Time zone conversion is not supported`);i.timeZone=r}}if(e!==`time`){let r=e===`date`?`fields`:`dateFields`,a=e===`date`?`length`:`dateLength`,o=cc(t,n,r,pne)??`year-month-day`,s=cc(t,n,a,mne),c=new Set(o.split(`-`));c.has(`year`)&&(i.year=`numeric`),c.has(`month`)&&(i.month=s===`long`?`long`:s===`short`?`numeric`:`short`),c.has(`day`)&&(i.day=`numeric`),c.has(`weekday`)&&(i.weekday=s===`long`?`long`:`short`)}if(e!==`date`){switch(cc(t,n,e===`time`?`precision`:`timePrecision`,hne)){case`hour`:i.hour=`numeric`;break;case`second`:i.hour=`numeric`,i.minute=`numeric`,i.second=`numeric`;break;default:i.hour=`numeric`,i.minute=`numeric`}i.timeZoneName=cc(t,n,`timeZoneStyle`,gne)}let o=new Intl.DateTimeFormat(t.locales,i),s=t.dir,c,l;return{type:`datetime`,get dir(){return s??=(c??=o.resolvedOptions().locale,tc(c)),s},get options(){return{...i}},toParts(){let e=o.formatToParts(a);return c??=o.resolvedOptions().locale,s??=tc(c),s===`ltr`||s===`rtl`?[{type:`datetime`,dir:s,locale:c,parts:e}]:[{type:`datetime`,locale:c,parts:e}]},toString(){return l??=o.format(a),l},valueOf:()=>a}}function cc(e,t,n,r){let i=t[n];if(i!==void 0)try{let e=rc(i);if(r&&!r.has(e))throw Error();return e}catch{e.onError(`bad-option`,`Invalid value for ${n} option`)}}function bne(e,t,n){let{value:r,options:i}=ic(n),a;try{a=`add`in t?nc(t.add):-1}catch{throw new Rs(`bad-option`,`Value ${t.add} is not valid for :offset option add`)}let o;try{o=`subtract`in t?nc(t.subtract):-1}catch{throw new Rs(`bad-option`,`Value ${t.subtract} is not valid for :offset option subtract`)}if(a<0==o<0)throw new Rs(`bad-option`,`Exactly one of "add" or "subtract" is required as an :offset option`);let s=a<0?-o:a;return r+=typeof r==`number`?s:BigInt(s),oc(e,{},{valueOf:()=>r,options:i})}function xne(e,t,n){let r=ic(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`percent`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`roundingMode`:case`roundingPriority`:case`signDisplay`:case`trailingZeroDisplay`:case`useGrouping`:i[n]=rc(r);break;case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:i[n]=nc(r)}}catch{e.onError(`bad-option`,`Value ${r} is not valid for :percent option ${n}`)}return ac(e,r.value,i,!0)}function lc(e,t,n){let r=n===void 0?``:String(n),i=r.normalize();return{type:`string`,dir:e.dir??`auto`,selectKey:e=>e.has(i)?i:null,toParts(){let{dir:t}=e,n=e.locales[0];return t===`ltr`||t===`rtl`?[{type:`string`,dir:t,locale:n,value:r}]:[{type:`string`,locale:n,value:r}]},toString:()=>r,valueOf:()=>r}}function Sne(e,t,n){let r=ic(n),i=Object.assign({},r.options,{localeMatcher:e.localeMatcher,style:`unit`});for(let[n,r]of Object.entries(t))if(r!==void 0)try{switch(n){case`signDisplay`:case`roundingMode`:case`roundingPriority`:case`trailingZeroDisplay`:case`unit`:case`unitDisplay`:case`useGrouping`:i[n]=rc(r);break;case`minimumIntegerDigits`:case`minimumFractionDigits`:case`maximumFractionDigits`:case`minimumSignificantDigits`:case`maximumSignificantDigits`:case`roundingIncrement`:i[n]=nc(r)}}catch(t){t instanceof Fs?e.onError(t):e.onError(`bad-option`,`Value ${r} is not valid for :currency option ${n}`)}if(!i.unit)throw new Rs(`bad-operand`,`A unit identifier is required for :unit`);return ac(e,r.value,i,!1)}var uc={currency:fne,integer:dne,number:oc,offset:bne,percent:xne,string:lc};uc=Object.freeze(Object.assign(Object.create(null),uc));var dc={date:vne,datetime:_ne,time:yne,unit:Sne};dc=Object.freeze(Object.assign(Object.create(null),dc));var fc=Symbol(`bidi-isolate`),pc=(e=`�`)=>({type:`fallback`,source:e,toParts:()=>[{type:`fallback`,source:e}],toString:()=>`{${e}}`}),Cne=(e,t)=>({type:`unknown`,source:e,dir:`auto`,toParts:()=>[{type:`unknown`,value:t}],toString:()=>String(t),valueOf:()=>t}),mc=class{#e;#t;#n;dir;id;constructor(e,t,n){this.#e=e,this.#n=t,this.dir=void 0;let r=n&&Object.hasOwn(n,`u:dir`)?n[`u:dir`]:void 0;if(r){let t=String(bc(e,r));if(t===`ltr`||t===`rtl`||t===`auto`)this.dir=t;else if(t!==`inherit`){let t=new Rs(`bad-option`,`Unsupported value for u:dir option`);t.source=xc(r),e.onError(t)}}let i=n&&Object.hasOwn(n,`u:id`)?n[`u:id`]:void 0;if(this.id=i?String(bc(e,i)):void 0,n){this.#t=new Set;for(let[e,t]of Object.entries(n))t.type===`literal`&&this.#t.add(e)}}get literalOptionKeys(){return new Set(this.#t)}get localeMatcher(){return this.#e.localeMatcher}get locales(){return this.#e.locales.map(String)}onError(e,t){let n;e instanceof Rs?n=e:typeof e==`string`&&typeof t==`string`?n=new Rs(e,t):(n=new Rs(`function-error`,String(e)),n.cause=e),n.source=this.#n,this.#e.onError(n)}};function wne(e,t,{name:n,options:r}){let i=`:${n}`,a=xc(t)??i;try{let o=t?[bc(e,t)]:[],s=e.functions[n];if(!s)throw new Ls(`unknown-function`,`Unknown function ${i}`,a);let c=new mc(e,a,r),l=s(c,Tne(e,r),...o);if(typeof l!=`object`||!l||typeof l.type!=`string`)throw new Ls(`bad-function-result`,`Function ${i} did not return a MessageValue`,a);let u={source:a};return c.dir&&(u.dir=c.dir,u[fc]=!0),c.id&&typeof l.toParts==`function`&&(u.toParts=()=>{let e=l.toParts();for(let t of e)t.id=c.id;return e}),{...l,...u}}catch(t){return e.onError(t instanceof Fs?t:new Ls(`bad-function-result`,String(t),a,t)),pc(a)}}function Tne(e,t){let n=Object.create(null);if(t)for(let[r,i]of Object.entries(t))r.startsWith(`u:`)||(n[r]=bc(e,i));return n}function hc(e,{arg:t,functionRef:n}){if(n)return wne(e,t,n);switch(t?.type){case`literal`:{let n=`|${t.value}|`,r=lc(new mc(e,n),{},t.value);return r.source=n,r}case`variable`:return yc(e,t);default:throw Error(`Unsupported expression: ${t?.type}`)}}var gc=class{expression;scope;constructor(e,t){this.expression=e,this.scope=t}},Ene=e=>e!==null&&(typeof e==`object`||typeof e==`function`);function _c(e,t){if(Ene(e)){if(t in e)return e[t];let n=t.split(`.`);for(let t=n.length-1;t>0;--t){let r=n.slice(0,t).join(`.`);if(r in e){let i=n.slice(t).join(`.`);return _c(e[r],i)}}for(let[n,r]of Object.entries(e))if(n.normalize()===t)return r}}function vc(e,{name:t}){let n=_c(e.scope,t);if(n===void 0){let n=`$`+t,r=`Variable not available: ${n}`;e.onError(new Ls(`unresolved-variable`,r,n))}else if(n instanceof gc){let r=hc(n.scope?{...e,scope:n.scope}:e,n.expression);return e.scope[t]=r,e.localVars.add(r),r}return n}function yc(e,t){let n=`$`+t.name,r=vc(e,t);if(r===void 0)return pc(n);let i=typeof r;if(i===`object`){let t=r;if(t.type===`fallback`)return pc(n);if(e.localVars.has(t))return t.source=n,t;r instanceof Number?i=`number`:r instanceof String&&(i=`string`)}let a;switch(i){case`bigint`:case`number`:a=e.functions.number;break;case`string`:a=e.functions.string;break;default:return Cne(n,r)}let o=new mc(e,n),s=a(o,{},r);return s.source=n,s}function bc(e,t){switch(t.type){case`literal`:return t.value;case`variable`:return vc(e,t);default:throw Error(`Unsupported value: ${t.type}`)}}function xc(e){switch(e?.type){case`literal`:return`|`+e.value.replaceAll(`\\`,`\\\\`).replaceAll(`|`,`\\|`)+`|`;case`variable`:return`$`+e.name;default:return}}function Sc(e,{kind:t,name:n,options:r}){let i={type:`markup`,kind:t,name:n},a=r?Object.entries(r):null;if(a?.length){i.options={};for(let[t,n]of a)if(t===`u:dir`){let r=new Rs(`bad-option`,`The option ${t} is not valid for markup`);r.source=xc(n),e.onError(r)}else{let r=bc(e,n);typeof r==`object`&&typeof r?.valueOf==`function`&&(r=r.valueOf()),t===`u:id`?i.id=String(r):i.options[t]=r}}return i}function Cc(e,t){if(t.type===`message`)return t.pattern;let n=t.selectors.map(t=>{let n=yc(e,t),r;return typeof n.selectKey==`function`?r=n.selectKey.bind(n):(e.onError(new Ls(`bad-selector`,`Selector does not support selection`,n.source)),r=()=>null),{selectKey:r,source:n.source,best:null,keys:null}}),r=t.variants;loop:for(let i=0;i<n.length;++i){let a=n[i];if(!a.keys){a.keys=new Set;for(let{keys:e}of r){let t=e[i];if(!t)break loop;t.type!==`*`&&a.keys.add(t.value)}}try{a.best=a.keys.size?a.selectKey(a.keys):null}catch(t){e.onError(new Ls(`bad-selector`,`Selection failed`,a.source,t)),a.selectKey=()=>null,a.best=null}if(r=r.filter(e=>{let t=e.keys[i];return t.type===`*`?a.best==null:a.best===t.value}),r.length===0){if(i===0)break;let e=n[i-1];e.best==null?e.keys?.clear():e.keys?.delete(e.best);for(let e=i;e<n.length;++e)n[e].keys=null;r=t.variants,i=-1}}let i=r[0];return i?i.value:(e.onError(new Ls(`no-match`,`No variant was selected!?`,`.match`)),[])}Intl.MessageFormat??=class{#e;#t;#n;#r;#i;#a;constructor(e,t,n){this.#e=n?.bidiIsolation!==`none`,this.#n=n?.localeMatcher??`best fit`,this.#r=Array.isArray(e)?e.map(e=>new Intl.Locale(e)):e?[new Intl.Locale(e)]:[],this.#t=n?.dir??tc(this.#r[0]),this.#i=typeof t==`string`?Qte(t):t,cne(this.#i),this.#a=n?.functions?Object.assign(Object.create(null),uc,n.functions):uc}format(e,t){let n=this.#o(e,t),r=``;for(let e of Cc(n,this.#i))if(typeof e==`string`)r+=e;else if(e.type===`markup`)Sc(n,e);else{let t;try{if(t=hc(n,e),typeof t.toString==`function`){if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[fc])){let e=t.dir===`ltr`?`⁦`:t.dir===`rtl`?`⁧`:`⁨`;r+=e+t.toString()+`⁩`}else r+=t.toString()}else{let e=new Rs(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i=`{${t?.source??`�`}}`;r+=this.#e?`⁨`+i+`⁩`:i}}return r}formatToParts(e,t){let n=this.#o(e,t),r=[];for(let e of Cc(n,this.#i))if(typeof e==`string`)r.push({type:`text`,value:e});else if(e.type===`markup`)r.push(Sc(n,e));else{let t;try{if(t=hc(n,e),typeof t.toParts==`function`){let e=t.toParts();if(this.#e&&(this.#t!==`ltr`||t.dir!==`ltr`||t[fc])){let n=t.dir===`ltr`?`⁦`:t.dir===`rtl`?`⁧`:`⁨`;r.push({type:`bidiIsolation`,value:n},...e,{type:`bidiIsolation`,value:`⁩`})}else r.push(...e)}else{let e=new Rs(`not-formattable`,`Message part is not formattable`);throw e.source=t.source,e}}catch(e){n.onError(e);let i={type:`fallback`,source:t?.source??`�`};this.#e?r.push({type:`bidiIsolation`,value:`⁨`},i,{type:`bidiIsolation`,value:`⁩`}):r.push(i)}}return r}#o(e,t=e=>{try{process.emitWarning(e)}catch{console.warn(e)}}){let n={...e};for(let t of this.#i.declarations)n[t.name]=new gc(t.value,t.type===`input`?e??{}:void 0);return{onError:t,localeMatcher:this.#n,locales:this.#r,localVars:new WeakSet,functions:this.#a,scope:n}}};var wc=j(``),Tc=``,Ec=ta([]),Dc=ta({}),Oc=``,kc=``,Ac,jc={},Dne={},Mc,Nc=(e,t)=>{if(typeof t!=`string`||!t)throw TypeError(`${e} must be a non-empty string (got ${JSON.stringify(t)})`)},Pc=(e,t)=>{if(typeof t!=`string`)throw TypeError(`${e} must be a string (got ${typeof t})`)},Fc=(e,t)=>{if(typeof t!=`function`)throw TypeError(`${e} must be a function (got ${typeof t})`)},Ic=new Map,Lc=e=>{if(!Ic.has(e))try{let t=new Intl.Locale(e),{language:n,script:r,region:i}=t,a=r&&i?void 0:t.maximize();Ic.set(e,{language:n,script:r??a?.script,region:i,preferredRegion:i??a?.region,anyScript:!r&&!i})}catch{Ic.set(e,void 0)}return Ic.get(e)},Rc=(e,t)=>{if(!e||!t.length||t.includes(e))return e;let n=Lc(e);if(!n)return e;let{language:r,script:i,anyScript:a,preferredRegion:o}=n,s=t.filter(e=>{let t=Lc(e);return!!t&&t.language===r&&(a||t.script===i)});if(s.length<2)return s[0]??e;let c=e=>e?s.find(t=>Lc(t)?.region===e):void 0;return c(o)??c(Lc(r)?.preferredRegion)??s[0]},zc=(e,t=``)=>Object.entries(e).reduce((e,[n,r])=>{let i=t?`${t}.${n}`:n;return typeof r==`object`&&r&&!Array.isArray(r)?Object.assign(e,zc(r,i)):e[i]=r,e},Object.create(null)),Bc=e=>{Ec.includes(e)||(Ec.push(e),kc=Rc(Oc,Ec))},Vc=e=>{if(!e||!Ec.length)return e;let t=Rc(e,Ec);return!Ec.includes(t)&&kc&&Ec.includes(kc)?kc:t},Hc=()=>{Tc&&Vc(Tc)!==z(wc)&&Jc.set(Tc)},Uc=(e,...t)=>{Nc(`addMessages: localeCode`,e),t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`addMessages: maps[${t}] must be a plain object (got ${Array.isArray(e)?`array`:typeof e})`)}),Bc(e),Dc[e]??={};let n=Dc[e],r={...zne,...Dne};t.forEach(t=>{Object.entries(zc(t)).forEach(([t,i])=>{n[t]=new Intl.MessageFormat(e,String(i),{functions:r})})}),Hc()},Wc=new Map,Gc=new Map,Kc=(e=z(wc))=>{if(Pc(`waitLocale: localeCode`,e),!e)return Promise.resolve();let t=Gc.get(e);if(!t){let n=Wc.get(e);t=n?Promise.resolve(n()).then(t=>{Uc(e,t)},()=>{if(Gc.delete(e),z(wc)===e&&!Dc[e]&&kc&&kc!==e)return Jc.set(kc)}):Promise.resolve(),Gc.set(e,t)}return t},qc=(e=z(wc))=>tc(e)===`rtl`,Jc={get current(){return z(wc)},set(e){Pc(`locale.set: value`,e),Tc=e;let t=Vc(e);if(M(wc,t,!0),typeof document<`u`&&t){document.documentElement.lang=t;let e=tc(t);e!==`auto`&&(document.documentElement.dir=e)}return Kc(t)}},One=(e,t)=>{Nc(`register: localeCode`,e),Fc(`register: loader`,t),Wc.set(e,t),Gc.delete(e),Bc(e),Hc()},kne=()=>{if(typeof navigator>`u`)return;let e=navigator.languages?.length?navigator.languages:[navigator.language];return e.map(e=>Rc(e,Ec)).find(e=>Ec.includes(e))??e[0]},Ane=e=>{if(!e||typeof e.fallbackLocale!=`string`)throw TypeError(`init: fallbackLocale must be a string (got ${JSON.stringify(e?.fallbackLocale)})`);e.initialLocale!==void 0&&Pc(`init: initialLocale`,e.initialLocale),e.handleMissingMessage!==void 0&&Fc(`init: handleMissingMessage`,e.handleMissingMessage),Oc=e.fallbackLocale,kc=Rc(Oc,Ec),Ac=e.handleMissingMessage,jc=e.formats??{},e.initialLocale&&Jc.set(e.initialLocale)},jne=(e,t)=>{let n=Dc[e];return n&&Object.hasOwn(n,t)?n[t]:void 0},Mne=e=>{let t=e??z(wc);return t===kc?[t]:[t,kc]},Y=(e,{values:t={},locale:n,default:r,formats:i}={})=>{if(e==null)throw TypeError(`format: key must be a string or message object (got ${JSON.stringify(e)})`);if(typeof e==`object`){let{id:t,...n}=e;return Y(t,n)}let a=Mne(n),[o]=a,s=a.reduce((t,n)=>t??jne(n,e),void 0);Mc=i;let c;try{c=s?.format(t)}finally{Mc=void 0}if(c!==void 0)return c;if(Ac){let t=Ac(e,o,r);if(t!==void 0)return t}return r??e},Nne=`_default`,Pne={date:{short:{month:`numeric`,day:`numeric`,year:`2-digit`},medium:{month:`short`,day:`numeric`,year:`numeric`},long:{month:`long`,day:`numeric`,year:`numeric`},full:{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}},time:{short:{hour:`numeric`,minute:`numeric`},medium:{hour:`numeric`,minute:`numeric`,second:`numeric`},long:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`},full:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`}},number:{currency:{style:`currency`},percent:{style:`percent`},scientific:{notation:`scientific`},engineering:{notation:`engineering`},compactLong:{notation:`compact`,compactDisplay:`long`},compactShort:{notation:`compact`,compactDisplay:`short`}}},Fne=(e,t)=>jc[e]?.[t]??Pne[e]?.[t],Ine=e=>jc[e]?.[Nne],Lne=e=>{let t=Mc?.[e];return(typeof t==`string`?Fne(e,t):t)??Ine(e)},Rne=(e,t,n)=>{let r=e.valueOf();return{...e,dir:n?tc(n):e.dir,toString:()=>t.format(r)}},Yc=(e,t,n)=>(r,i,a)=>{let o=e(r,i,a),s=Lne(t);if(!s)return o;let{locale:c,...l}=s;return Rne(o,new n(c??r.locales,l),c)},zne={...dc,date:Yc(dc.date,`date`,Intl.DateTimeFormat),time:Yc(dc.time,`time`,Intl.DateTimeFormat),datetime:Yc(dc.datetime,`datetime`,Intl.DateTimeFormat),number:Yc(uc.number,`number`,Intl.NumberFormat),integer:Yc(uc.integer,`number`,Intl.NumberFormat)},Bne=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`name`]),Vne=B(`<span> </span>`),Hne={hash:`svelte-tawm7e`,code:`.icon.small-arrow.svelte-tawm7e {overflow:hidden;width:12px;text-indent:-6px;}`};function Xc(e,t){K(e,Hne);let n=ks(t,Bne);var r=Vne();bs(r,()=>({...n,class:`sui icon material-symbols-outlined ${t.class??``}`,"aria-hidden":!(`aria-label`in n)}),void 0,void 0,void 0,`svelte-tawm7e`);var i=F(r,!0);R(()=>W(i,t.name)),U(e,r)}var Une=B(`<!> <span class="status-label svelte-13rggru"> </span> <!>`,1),Wne={hash:`svelte-13rggru`,code:`.status-label.svelte-13rggru {position:absolute;overflow:hidden;clip-path:inset(50%);width:1px;height:1px;white-space:nowrap;}`};function Zc(e,t){O(t,!0),K(e,Wne);let n=J(t,`children`,3,void 0),r=J(t,`icon`,3,void 0);var i=Une(),a=P(i),o=e=>{var t=H();Go(P(t),r),U(e,t)},s=e=>{{let n=A(()=>t.status===`success`?`check_circle`:t.status);Xc(e,{get name(){return z(n)}})}};G(a,e=>{r()?e(o):e(s,-1)});var c=I(a,2),l=F(c,!0);Go(I(c,2),()=>n()??kr),R(e=>W(l,e),[()=>Y(`_sui.alert.${t.status}`)]),U(e,i),k()}var Qc=e=>e===`error`||e===`warning`?`alert`:`status`,$c=(e,t)=>t??(e===`alert`?`assertive`:`polite`),Gne=new Set([`$$slots`,`$$events`,`$$legacy`,`status`,`ariaLive`,`children`,`icon`]),Kne=B(`<div><!></div>`),qne={hash:`svelte-1og5kyy`,code:`.alert.svelte-1og5kyy {display:flex;align-items:center;gap:var(--gap, 8px);padding:var(--padding, 8px);border-width:var(--border-width, var(--sui-control-medium-border-width));border-style:var(--border-style, solid);border-radius:var(--border-radius, var(--sui-control-medium-border-radius));font-size:var(--font-size, var(--sui-font-size-default));}.alert.error.svelte-1og5kyy {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);background-color:var(--sui-error-background-color);}.alert.warning.svelte-1og5kyy {border-color:var(--sui-warning-border-color);color:var(--sui-warning-foreground-color);background-color:var(--sui-warning-background-color);}.alert.info.svelte-1og5kyy {border-color:var(--sui-info-border-color);color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);}.alert.success.svelte-1og5kyy {border-color:var(--sui-success-border-color);color:var(--sui-success-foreground-color);background-color:var(--sui-success-background-color);}`};function el(e,t){O(t,!0),K(e,qne);let n=J(t,`ariaLive`,3,void 0),r=ks(t,Gne),i=A(()=>Qc(t.status));var a=Kne();bs(a,e=>({...r,role:z(i),class:`sui alert ${t.status??``}`,"aria-live":e}),[()=>$c(z(i),n())],void 0,void 0,`svelte-1og5kyy`),Zc(N(a),{get status(){return t.status},get children(){return t.children},get icon(){return t.icon}}),D(a),U(e,a),k()}var tl,nl=()=>(tl??=navigator.userAgentData?.platform===`macOS`||navigator.platform.startsWith(`Mac`),tl),Jne=new Set([`Ctrl`,`Meta`,`Alt`,`Shift`]),Yne=new Set([`Control`,`Meta`,`Alt`,`Shift`]),Xne=new Set([`Space`,`Enter`,`Escape`,`Tab`,`Backspace`,`Delete`,`Insert`,`Home`,`End`,`PageUp`,`PageDown`,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,...Array.from({length:24},(e,t)=>`F${t+1}`)]),Zne=e=>{if(/^\d$/.test(e)){let t=`Digit${e}`;return({code:e})=>e===t}if(Xne.has(e))return({code:t})=>t===e;let t=e.toLowerCase();if(/^[a-z]$/i.test(e)){let n=`Key${e.toUpperCase()}`;return e=>{let{key:r,code:i}=e;return(r===`Dead`||r.length===1&&r.charCodeAt(0)>127)&&!e.getModifierState?.(`AltGraph`)?i===n:t===r.toLowerCase()}}return({key:e})=>t===e.toLowerCase()},rl=e=>e.replace(/\bAccel\b/g,nl()?`Meta`:`Ctrl`),il=new Map,al=e=>{let t=il.get(e);return t||(t=rl(e).trim().split(/\s+/).filter(Boolean).map(e=>{let t=e.split(`+`);return{ctrl:t.includes(`Ctrl`),meta:t.includes(`Meta`),alt:t.includes(`Alt`),shift:t.includes(`Shift`),matchers:t.filter(e=>!Jne.has(e)).map(Zne)}}),il.set(e,t)),t},ol=(e,t)=>{let{ctrlKey:n,metaKey:r,altKey:i,shiftKey:a,key:o,code:s}=e;return!o&&!s||e.isComposing||e.keyCode===229?!1:t.some(({ctrl:t,meta:s,alt:c,shift:l,matchers:u})=>t===n&&s===r&&c===i&&l===a&&(u.length?u.every(t=>t(e)):Yne.has(o)))},sl=(e,t)=>ol(e,al(t)),cl=new Map,Qne=(e,t)=>{let{disabled:n}=e;if(!e.getClientRects().length)return;let{top:r,left:i}=e.getBoundingClientRect();n&&e.style.setProperty(`pointer-events`,`auto`);let a=document.elementsFromPoint(i+4,r+4).includes(e);n&&e.style.removeProperty(`pointer-events`),a&&(t.preventDefault(),n||(e.focus(),e.click()))},$ne=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`]),ere=e=>e instanceof HTMLElement&&(e.isContentEditable||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&!$ne.has(e.type)),tre=e=>nl()&&e.altKey&&!e.ctrlKey&&!e.metaKey&&ere(e.composedPath()[0]),ll=e=>{tre(e)||cl.forEach((t,n)=>{ol(e,t)&&Qne(n,e)})},ul=(e=``)=>{let t=rl(e).trim().replace(/\s+/g,` `);if(!t)return()=>()=>{};let n=al(e);return e=>(cl.size||globalThis.addEventListener(`keydown`,ll,{capture:!0}),cl.set(e,n),e.setAttribute(`aria-keyshortcuts`,t),()=>{cl.delete(e),e.removeAttribute(`aria-keyshortcuts`),cl.size||globalThis.removeEventListener(`keydown`,ll,{capture:!0})})},dl=e=>e===null?`null`:typeof e,nre=(e,t)=>{if(t===`number`){let t=Number(e);return Number.isNaN(t)?null:t}return t===`boolean`?e===`true`:t===`null`?null:t===`string`?e?String(e):``:e},rre=B(`<span role="none" class="sui truncated-text svelte-g9unr9"><!></span>`),ire={hash:`svelte-g9unr9`,code:`.truncated-text.svelte-g9unr9 {display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden;white-space:normal;overflow-wrap:anywhere;}`};function fl(e,t){K(e,ire);let n=J(t,`lines`,3,1),r=J(t,`children`,3,void 0);var i=rre();let a;Go(N(i),()=>r()??kr),D(i),R(()=>a=cs(i,``,a,{"-webkit-line-clamp":n(),"line-clamp":n()})),U(e,i)}var pl=(e=0)=>new Promise(t=>{globalThis.setTimeout(()=>{t(void 0)},e)}),are=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,ml=e=>{let t=globalThis.crypto.randomUUID();return e===`short`?t.split(`-`).pop():e===`shorter`?t.split(`-`).shift():typeof e==`number`?t.split(`-`).join(``).slice(0,e):t},hl=`abcdefghijklmnopqrstuvwxyz234567`,ore=e=>{let t=``,n=0,r=0;return e.forEach(e=>{for(n=n<<8|e,r+=8;r>=5;)r-=5,t+=hl[n>>>r&31]}),r>0&&(t+=hl[n<<5-r&31]),t},gl=()=>ore(Uint8Array.fromHex(ml().replaceAll(`-`,``))),_l=async(e,{algorithm:t=`SHA-1`,format:n=`hex`}={})=>{let r;if(typeof e==`string`)r=new TextEncoder().encode(e);else if(e instanceof ArrayBuffer||ArrayBuffer.isView(e))r=e;else if(e&&typeof e.arrayBuffer==`function`)r=await e.arrayBuffer();else throw Error(`Unsupported input type for getHash`);let i=await globalThis.crypto.subtle.digest(t,r);return n===`binary`?Array.from(new Uint8Array(i),e=>String.fromCharCode(e)).join(``):new Uint8Array(i).toHex()},vl=new WeakMap,yl,bl=(e=`e`,t=7)=>[e,ml(t)].join(`-`),xl=e=>{vl.delete(e),yl?.unobserve(e)},sre=()=>{if(`IntersectionObserver`in globalThis)return yl||(yl=new IntersectionObserver(e=>{e.forEach(({isIntersecting:e,target:t})=>{if(!e||!(t instanceof HTMLElement))return;let n=vl.get(t);n&&(n(),xl(t))})}),yl)},cre=e=>{let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=globalThis;return r>0&&i>0&&t<a&&n<o},lre=e=>{`requestAnimationFrame`in globalThis?globalThis.requestAnimationFrame(e):globalThis.setTimeout(e,16)},Sl=e=>{let t=sre();if(t)return cre(e)?Promise.resolve(void 0):new Promise(n=>{let r=vl.get(e);vl.set(e,r?()=>{r(),n()}:n),lre(()=>{vl.has(e)&&t.observe(e)})})},ure=e=>{let t=e;return t.endsWith(`-left`)?t=t.replace(`-left`,`-right`):t.endsWith(`-right`)&&(t=t.replace(`-right`,`-left`)),t.startsWith(`left-`)?t=t.replace(`left-`,`right-`):t.startsWith(`right-`)&&(t=t.replace(`right-`,`left-`)),t},dre=(e,t)=>{let n=Math.max(e.top,0),r=Math.max(e.left,0),i=Math.min(e.right,t.width),a=Math.min(e.bottom,t.height);return{top:n,left:r,right:i,bottom:a,width:Math.max(0,i-r),height:Math.max(0,a-n)}},Cl=({position:e,from:t,to:n,size:r,room:i,otherRoom:a})=>r<=i?{position:e,cap:void 0}:a>i?{position:e.replace(t,n),cap:a}:{position:e,cap:i},fre=({position:e,anchorRect:t,viewport:n,contentWidth:r,contentHeight:i})=>{let a=dre(t,n),o=a.top-8,s=n.height-a.bottom-8,c=a.left-8,l=n.width-a.right-8,u=n.height-a.top-8,d=a.bottom-8,f=e,p,m=(e,t,n,r)=>{let a=Cl({position:f,from:e,to:t,size:i,room:n,otherRoom:r});f=a.position,p=a.cap??p};return f.startsWith(`bottom-`)?m(`bottom-`,`top-`,s,o):f.startsWith(`top-`)&&m(`top-`,`bottom-`,o,s),f.endsWith(`-top`)?m(`-top`,`-bottom`,u,d):f.endsWith(`-bottom`)&&m(`-bottom`,`-top`,d,u),f.endsWith(`-left`)&&a.left+r>n.width-8&&(f=f.replace(`-left`,`-right`)),f.endsWith(`-right`)&&a.right-r<8&&(f=f.replace(`-right`,`-left`)),f.startsWith(`right-`)?{position:f}=Cl({position:f,from:`right-`,to:`left-`,size:r,room:l,otherRoom:c}):f.startsWith(`left-`)&&({position:f}=Cl({position:f,from:`left-`,to:`right-`,size:r,room:c,otherRoom:l})),{inset:[f.startsWith(`bottom-`)?`${Math.round(a.bottom)}px`:f.endsWith(`-top`)?`${Math.round(a.top)}px`:`auto`,f.startsWith(`left-`)?`${Math.round(n.width-a.left)}px`:f.endsWith(`-right`)?`${Math.round(n.width-a.right)}px`:`auto`,f.startsWith(`top-`)?`${Math.round(n.height-a.top)}px`:f.endsWith(`-bottom`)?`${Math.round(n.height-a.bottom)}px`:`auto`,f.startsWith(`right-`)?`${Math.round(a.right)}px`:f.endsWith(`-left`)?`${Math.round(a.left)}px`:`auto`].join(` `),zIndex:1e3,minWidth:`${Math.round(a.width)}px`,maxWidth:f.startsWith(`right-`)?`${Math.round(l)}px`:f.startsWith(`left-`)?`${Math.round(c)}px`:f.endsWith(`-left`)?`${Math.round(n.width-a.left-8)}px`:`${Math.round(a.right-8)}px`,height:p?`${Math.round(p)}px`:void 0}},pre=(e,t)=>{let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.hasOwn(t,n)&&e[n]===t[n])},mre=class{#e=j(!1);get open(){return z(this.#e)}set open(e){M(this.#e,e,!0),e?this.checkPosition():this.anchorElement.getAttribute(`aria-expanded`)===`true`&&window.requestAnimationFrame(()=>{let{activeElement:e}=document;(!e||e===document.body||this.popupElement?.contains(e))&&this.anchorElement.focus()}),this.anchorElement.setAttribute(`aria-expanded`,String(e))}#t=j(ta({inset:void 0,zIndex:void 0,minWidth:void 0,maxWidth:void 0,height:void 0}));get style(){return z(this.#t)}set style(e){M(this.#t,e,!0)}popupElement=void 0;contentElement=void 0;#n=void 0;#r=[];_rafId=0;constructor(e,t,n,r){this.anchorElement=e,this.position=n,this.positionBaseElement=r??e,this.id=bl(`popup`),this.anchorElement.setAttribute(`aria-expanded`,`false`);let i=vo(e,`click`,t=>{!this.isDisabled&&!this.isReadOnly&&(this.open=t.detail&&e.matches(`[role="menuitem"]`)?!0:!this.open)}),a=vo(e,`keydown`,t=>{let{key:n,ctrlKey:r,metaKey:i,shiftKey:a,altKey:o}=t,s=a||o||r||i;this.isDisabled||this.isReadOnly||([`Enter`,` `].includes(n)&&!s?(t.preventDefault(),t.stopPropagation(),this.open=!this.open):![`ArrowDown`,`ArrowUp`].includes(n)||a||r||i||o&&n!==`ArrowDown`||![`listbox`,`menu`].includes(e.getAttribute(`aria-haspopup`)??``)||e.matches(`[role^="menuitem"]`)||this.open||(t.preventDefault(),t.stopPropagation(),this.open=!0))}),o=vo(e,`transitionstart`,()=>{this.anchorElement.closest(`.hiding, .hidden, [hidden]`)&&this.hideImmediately()});this.#r=[i,a,o],this.intersectionObserver=new IntersectionObserver(e=>{!e.at(-1)?.isIntersecting&&this.open&&this.hideImmediately()}),this.intersectionObserver.observe(this.anchorElement),this.resizeObserver=new ResizeObserver(()=>{cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>this.checkPosition())}),this.resizeObserver.observe(this.positionBaseElement),this.viewportResizeObserver=new ResizeObserver(()=>{this.open&&this.checkPosition()}),t&&this.attachPopupElement(t)}attachPopupElement(e,t){if(this.popupElement===e&&this.contentElement===t)return;this.detachPopupElement(),this.popupElement=e,this.contentElement=t,this.viewportResizeObserver.observe(e);let n=t??e;n.id=this.id,this.anchorElement.setAttribute(`aria-controls`,this.id);let r=vo(e,`click`,e=>{e.stopPropagation();let t=e.target;this.open&&(t===this.popupElement||t.matches(`[role^="menuitem"], [role="option"]`))&&(this.open=!1)}),i=vo(e,`keydown`,e=>{let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e;t===`Escape`&&!(i||a||n||r)&&(e.preventDefault(),e.stopPropagation(),this.open=!1)});this.#n=()=>{r(),i()}}detachPopupElement(){this.#n?.(),this.#n=void 0,this.popupElement&&this.viewportResizeObserver.unobserve(this.popupElement),this.anchorElement.getAttribute(`aria-controls`)===this.id&&this.anchorElement.removeAttribute(`aria-controls`),this.popupElement=void 0,this.contentElement=void 0}get isDisabled(){return this.anchorElement.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.anchorElement.matches(`[aria-readonly="true"]`)}checkPosition(){if(!this.popupElement)return;let e=this.contentElement??this.popupElement?.querySelector(`.content`)??null;if(!e)return;let t=this.positionBaseElement.getBoundingClientRect(),{maxHeight:n,maxWidth:r}=e.style;e.style.maxHeight=``,e.style.maxWidth=``;let{scrollHeight:i,scrollWidth:a}=e;e.style.maxHeight=n,e.style.maxWidth=r;let o=fre({position:qc()?ure(this.position):this.position,anchorRect:t,viewport:{width:window.innerWidth,height:window.innerHeight},contentWidth:a,contentHeight:i});pre(o,this.style)||(this.style=o)}async hideImmediately(){this.popupElement&&(this.popupElement.hidden=!0),this.open=!1,await pl(50),this.popupElement&&(this.popupElement.hidden=!1)}destroy(){this.detachPopupElement(),this.#r.forEach(e=>e()),this.#r=[],this.intersectionObserver?.disconnect(),this.resizeObserver?.disconnect(),this.viewportResizeObserver?.disconnect(),this._rafId&&cancelAnimationFrame(this._rafId)}},hre=(...e)=>new mre(...e),wl=e=>Math.max(0,...e.split(`,`).map(e=>Number.parseFloat(e)||0))*1e3,gre=({transitionDuration:e,transitionDelay:t})=>wl(e)+wl(t)+100;function Tl(e,t){var n=H();Go(P(n),()=>t.children??kr),U(e,n)}var El=Symbol(`sui-modal-retainer`),_re=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`dialog`,`class`,`role`,`showBackdrop`,`lightDismiss`,`escapeDismiss`,`keepContent`,`restoreFocus`,`children`,`extraContent`,`onOpening`,`onOpen`,`onClosing`,`onOk`,`onCancel`,`onClose`]),vre=B(`<dialog><!> <!></dialog>`),yre={hash:`svelte-c9ra7f`,code:`dialog.svelte-c9ra7f {position:fixed;inset:0;z-index:9999999;display:flex;justify-content:center;align-items:center;overflow:hidden;outline:0;margin:0;border:0;padding:0;width:100dvw;max-width:100dvw;height:100dvh;max-height:100dvh;color:var(--sui-primary-foreground-color);background:transparent;-webkit-user-select:none;user-select:none;touch-action:none;pointer-events:all;cursor:default;}dialog.svelte-c9ra7f::backdrop {background:transparent;}dialog.backdrop.svelte-c9ra7f {background-color:var(--sui-popup-backdrop-color);}dialog.open.svelte-c9ra7f {transition-duration:50ms;opacity:1;}dialog.svelte-c9ra7f:not(.open) {transition-duration:400ms;opacity:0;}dialog[hidden].svelte-c9ra7f {transition-duration:1ms !important;}dialog.svelte-c9ra7f:not(.active) {pointer-events:none !important;}dialog.svelte-c9ra7f:not(.active) * {transition-duration:0ms !important;pointer-events:none !important;}`};function Dl(e,t){O(t,!0),K(e,yre);let n=e=>{var n=H(),l=P(n),u=e=>{var n=vre(),l=({target:e})=>{C=e},u=({target:e})=>{let t=C;C=void 0,!(t&&t!==i())&&i()&&s()&&e?.matches(`dialog`)&&(i(i().returnValue=`cancel`,!0),r(!1))},f=e=>{e.preventDefault(),i()&&c()&&(i(i().returnValue=`cancel`,!0),r(!1))},p=()=>{b&&i()?.isConnected&&!i().open&&(c()?r(!1):i().showModal())};bs(n,()=>({tabindex:`-1`,...d,inert:!z(m),role:a(),class:`sui modal ${t.class??``}`,onpointerdown:l,onclick:u,oncancel:f,onclose:p,[ms]:{backdrop:o(),open:z(m),active:z(h)}}),void 0,void 0,void 0,`svelte-c9ra7f`);var g=N(n);Go(g,()=>t.extraContent??kr),Go(I(g,2),()=>t.children??kr),D(n),Ds(n,e=>i(e),()=>i()),U(e,n)};G(l,e=>{z(y)&&e(u)}),U(e,n)},r=J(t,`open`,15,!1),i=J(t,`dialog`,15),a=J(t,`role`,3,`dialog`),o=J(t,`showBackdrop`,3,!1),s=J(t,`lightDismiss`,3,!1),c=J(t,`escapeDismiss`,3,!0),l=J(t,`keepContent`,3,!1),u=J(t,`restoreFocus`,3,!0),d=ks(t,_re),f=()=>{i()?.focus()},p=e=>{i()&&(i(i().returnValue=e,!0),r(!1))},m=j(!1),h=j(!1),g=j(!1),_=j(0),v=si(El);ci(El,{retain:()=>{fo(()=>{M(_,z(_)+1)})},release:()=>{fo(()=>{M(_,z(_)-1)})}});let y=A(()=>l()||z(g)||z(_)>0),b=!1,x=0,S,C,w,T=()=>{let e=S;S=void 0,u()&&e&&(w=window.setTimeout(()=>{let{activeElement:t}=document;e.isConnected&&(!t||t===document.body||i()?.contains(t))&&e.focus()}))},ee=async()=>{if(await co(),!i())return;let e=gre(getComputedStyle(i())),t=new AbortController,{signal:n}=t;i().addEventListener(`transitionend`,e=>{e.target===i()&&t.abort()},{signal:n});let r=window.setTimeout(()=>t.abort(),e);await new Promise(e=>{n.addEventListener(`abort`,()=>e(void 0))}),window.clearTimeout(r)},te=async()=>{if(b)return;b=!0,x+=1;let e=x,{activeElement:n}=document;window.clearTimeout(w),S=n instanceof HTMLElement?n:void 0,t.onOpening?.(new CustomEvent(`Opening`)),M(g,!0),await co(),e===x&&i()&&!i().open&&(i().showModal(),t.onOpen?.(new CustomEvent(`Open`)),i().getBoundingClientRect(),M(m,!0),await co(),e===x&&i()&&(i().contains(document.activeElement)||f(),await ee(),e===x&&M(h,!0)))},ne=async()=>{if(!b)return;b=!1,x+=1;let e=x,n=z(m),r=i()?.returnValue??``;t.onClosing?.(new CustomEvent(`Closing`)),i()?.open&&(document.body.inert=!0,i().close(),document.body.inert=!1),T(),M(h,!1),M(m,!1),n&&await ee(),e===x&&(M(g,!1),r===`ok`&&t.onOk?.(new CustomEvent(`Ok`)),r===`cancel`&&t.onCancel?.(new CustomEvent(`Cancel`)),t.onClose?.(new CustomEvent(`Close`,{detail:{returnValue:r}})),i()&&i(i().returnValue=``,!0))},re=jee();return js(()=>{let e=Oo(Tl,{target:document.querySelector(`.sui.app-shell`)??document.body,props:{children:n},context:re});return()=>{window.clearTimeout(w),i()?.close(),jo(e)}}),L(()=>{r()?te():ne()}),L(()=>{if(z(g))return v?.retain(),()=>{v?.release()}}),k({focus:f,close:p})}var bre=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`hovered`,`content`,`class`,`showBackdrop`,`anchor`,`position`,`positionBaseElement`,`parentDialogElement`,`touchOptimized`,`children`,`onOpen`]),xre=B(`<div role="none"><!></div>`),Sre={hash:`svelte-j8glqq`,code:`.content.svelte-j8glqq {position:absolute;overflow-y:auto;outline-width:0 !important;width:auto;color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);transition-property:opacity, transform;}.content.menu.svelte-j8glqq {border-width:var(--sui-menu-border-width, 1px);border-style:var(--sui-menu-border-style, solid);border-color:var(--sui-menu-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-menu-border-radius, 4px);padding:var(--sui-menu-padding, 4px);}.content.menu.svelte-j8glqq .sui.menu {border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.listbox.svelte-j8glqq {border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);}.content.listbox.svelte-j8glqq .sui.listbox {border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.tree.svelte-j8glqq {border-width:var(--sui-tree-border-width, 1px);border-style:var(--sui-tree-border-style, solid);border-color:var(--sui-tree-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-tree-border-radius, 4px);padding:var(--sui-tree-padding, 4px);}.content.tree.svelte-j8glqq .sui.tree {margin:0;border-width:0;border-radius:0;padding:0;background-color:transparent;}.content.combobox.svelte-j8glqq {display:flex;flex-direction:column;overflow:hidden;}.content.touch.svelte-j8glqq {position:static;border-width:0 !important;border-radius:4px !important;padding:8px;min-width:320px !important;max-width:calc(100dvw - 32px) !important;max-height:calc(100dvh - 32px) !important;}dialog.open .content.touch.svelte-j8glqq {transform:scale(100%) !important;}dialog:not(.open) .content.touch.svelte-j8glqq {transform:scale(90%);}.content.touch.combobox.svelte-j8glqq .sui.listbox {gap:4px;padding:8px 4px !important;}dialog.open .content.svelte-j8glqq {transition-duration:50ms;opacity:1;transform:translateY(2px);}dialog:not(.open) .content.svelte-j8glqq {transition-duration:300ms;opacity:0;transform:translateY(-8px);}.content.nested.menu.svelte-j8glqq {margin-block:calc(-1 * (var(--sui-menu-border-width, 1px) + var(--sui-menu-padding, 4px)));}dialog.open .content.nested.menu.svelte-j8glqq {transform:none;}`};function Ol(e,t){O(t,!0),K(e,Sre);let n=e=>{var n=xre();let o,s;Go(N(n),()=>t.children??kr),D(n),Ds(n,e=>a(e),()=>a()),R(()=>{q(n,`hidden`,!r()),o=os(n,1,`content ${t.class??``} ${z(m)??``}`,`svelte-j8glqq`,o,{touch:z(v),nested:!!l()}),s=cs(n,``,s,{inset:z(h)?.style.inset,"z-index":z(h)?.style.zIndex,"min-width":z(h)?.style.minWidth,"max-width":z(h)?.style.maxWidth,"max-height":z(h)?.style.height,visibility:z(h)?.style.inset?void 0:`hidden`})}),yo(`mouseenter`,n,()=>{i(!0),l()&&window.clearTimeout(g)}),yo(`mouseleave`,n,()=>{i(!1),l()&&(g=window.setTimeout(()=>{r(!1)},200))}),U(e,n)},r=J(t,`open`,15,!1),i=J(t,`hovered`,15,!1),a=J(t,`content`,15,void 0),o=J(t,`showBackdrop`,3,void 0),s=J(t,`position`,3,`bottom-left`),c=J(t,`positionBaseElement`,3,void 0),l=J(t,`parentDialogElement`,3,void 0),u=J(t,`touchOptimized`,3,!1),d=ks(t,bre),f=j(void 0),p=j(!1),m=j(void 0),h=j(void 0),g=0,_=({tabStopOnly:e=!1}={})=>{if(!a())return!1;let t=[...a().querySelectorAll(`[tabindex="0"]:not([aria-disabled="true"])`),...e?[]:a().querySelectorAll(`[tabindex]:not([aria-disabled="true"])`)].some(e=>(e.focus(),document.activeElement===e));return!t&&!e&&(a(a().tabIndex=-1,!0),a().focus()),t};L(()=>{z(h)&&r(z(h).open)}),L(()=>{z(h)&&z(h).open!==r()&&(z(h).open=r())}),L(()=>{l()&&!z(f)&&a()&&(M(f,l()),z(f).append(a()))}),L(()=>{t.anchor&&!z(h)&&(M(h,hre(t.anchor,void 0,s(),c()),!0),M(m,t.anchor.getAttribute(`aria-haspopup`)??void 0,!0))}),L(()=>{if(z(h)&&z(f)&&a())return z(h).attachPopupElement(z(f),a()),()=>{z(h)?.detachPopupElement()}}),L(()=>{r()&&z(f)&&z(h)?.checkPosition()});let v=A(()=>u()&&z(p));js(()=>(M(p,globalThis.matchMedia(`(pointer: coarse)`).matches,!0),()=>{z(h)?.destroy?.(),globalThis.clearTimeout(g)}));var y=H(),b=P(y),x=e=>{n(e)},S=e=>{{let i=A(()=>o()??z(v));Dl(e,As(()=>d,{role:`none`,class:`popup`,get showBackdrop(){return z(i)},lightDismiss:!0,onOpen:async e=>{t.onOpen?.(e),await co(),a()&&!_({tabStopOnly:!0})&&(await pl(100),a()&&!a().contains(document.activeElement)&&_())},get dialog(){return z(f)},set dialog(e){M(f,e,!0)},get open(){return r()},set open(e){r(e)},children:(e,t)=>{n(e)},$$slots:{default:!0}}))}};G(b,e=>{l()?e(x):e(S,-1)}),U(e,y),k()}var Cre=new Set(`$$slots.$$events.$$legacy.element.class.type.role.name.value.valueType.hidden.disabled.readonly.pressed.keyShortcuts.label.labelDir.lines.variant.size.iconic.pill.flex.popupPosition.showPopupBackdrop.children.startIcon.endIcon.popup`.split(`.`)),kl=B(`<span role="none" class="label svelte-1g8bcs"><!></span>`),wre=B(`<!> <!>`,1),Tre=B(`<button><!> <!> <!></button> <!>`,1),Ere={hash:`svelte-1g8bcs`,code:`button.svelte-1g8bcs {flex:none;display:inline-flex;align-items:center;gap:4px;margin:var(--sui-focus-ring-width);border-width:0;border-style:solid;border-color:transparent;padding:0;color:var(--sui-control-foreground-color, inherit);background-color:transparent;box-shadow:none;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);font-weight:var(--sui-font-weight-normal, normal);text-align:start;cursor:pointer;transition:all 200ms;}button[hidden].svelte-1g8bcs {display:none !important;}button.svelte-1g8bcs:not(:disabled):focus-visible {z-index:1;}button.svelte-1g8bcs:is(.primary:where(.svelte-1g8bcs), .secondary:where(.svelte-1g8bcs), .tertiary:where(.svelte-1g8bcs), .ghost:where(.svelte-1g8bcs)) {justify-content:center;border-width:1px;}button.svelte-1g8bcs:is(.primary:where(.svelte-1g8bcs), .secondary:where(.svelte-1g8bcs), .tertiary:where(.svelte-1g8bcs), .ghost:where(.svelte-1g8bcs)) .label:where(.svelte-1g8bcs):only-child {padding:0 4px;}button.primary.svelte-1g8bcs {border-width:var(--sui-button-primary-border-width, 1px);border-style:var(--sui-button-primary-border-style, solid);border-color:var(--sui-button-primary-border-color, var(--sui-primary-accent-color));color:var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted));background-color:var(--sui-button-primary-background-color, var(--sui-primary-accent-color));font-weight:var(--sui-button-primary-font-weight, var(--sui-font-weight-normal, normal));}button.primary.svelte-1g8bcs:is(:where(.svelte-1g8bcs):hover, :where(.svelte-1g8bcs):focus-visible, [aria-expanded=true]:where(.svelte-1g8bcs)) {color:var(--sui-button-primary-foreground-color-focus, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));background-color:var(--sui-button-primary-background-color-focus, var(--sui-primary-accent-color-light));}button.primary.svelte-1g8bcs:active {color:var(--sui-button-primary-foreground-color-active, var(--sui-button-primary-foreground-color, var(--sui-primary-accent-color-inverted)));background-color:var(--sui-button-primary-background-color-active, var(--sui-primary-accent-color-dark));}button.secondary.svelte-1g8bcs {border-width:var(--sui-button-secondary-border-width, 1px);border-style:var(--sui-button-secondary-border-style, solid);border-color:var(--sui-button-secondary-border-color, var(--sui-primary-accent-color));color:var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text));background-color:var(--sui-button-secondary-background-color, var(--sui-button-background-color));font-weight:var(--sui-button-secondary-font-weight, var(--sui-font-weight-normal, normal));}button.secondary.svelte-1g8bcs:is(:where(.svelte-1g8bcs):hover, :where(.svelte-1g8bcs):focus-visible, [aria-expanded=true]:where(.svelte-1g8bcs)) {color:var(--sui-button-secondary-foreground-color-focus, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));background-color:var(--sui-button-secondary-background-color-focus, var(--sui-hover-background-color));}button.secondary.svelte-1g8bcs:active {color:var(--sui-button-secondary-foreground-color-active, var(--sui-button-secondary-foreground-color, var(--sui-primary-accent-color-text)));background-color:var(--sui-button-secondary-background-color-active, var(--sui-active-background-color));}button.secondary[aria-pressed=true].svelte-1g8bcs {color:var(--sui-button-secondary-foreground-color-pressed);background-color:var(--sui-button-secondary-background-color-pressed, var(--sui-primary-accent-color));}button.tertiary.svelte-1g8bcs {border-width:var(--sui-button-tertiary-border-width, 1px);border-style:var(--sui-button-tertiary-border-style, solid);border-color:var(--sui-button-tertiary-border-color, var(--sui-button-border-color));color:var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color));background-color:var(--sui-button-tertiary-background-color, var(--sui-button-background-color));font-weight:var(--sui-button-tertiary-font-weight, var(--sui-font-weight-normal, normal));}button.tertiary.svelte-1g8bcs:is(:where(.svelte-1g8bcs):hover, :where(.svelte-1g8bcs):focus-visible, [aria-expanded=true]:where(.svelte-1g8bcs)) {color:var(--sui-button-tertiary-foreground-color-focus, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));background-color:var(--sui-button-tertiary-background-color-focus, var(--sui-hover-background-color));}button.tertiary.svelte-1g8bcs:active {color:var(--sui-button-tertiary-foreground-color-active, var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color)));background-color:var(--sui-button-tertiary-background-color-active, var(--sui-active-background-color));}button.tertiary[aria-pressed=true].svelte-1g8bcs {color:var(--sui-button-tertiary-foreground-color-pressed);background-color:var(--sui-button-tertiary-background-color-pressed, var(--sui-selected-background-color));}button.ghost.svelte-1g8bcs {font-weight:var(--sui-button-ghost-font-weight, var(--sui-font-weight-normal, normal));}button.ghost.svelte-1g8bcs:is(:where(.svelte-1g8bcs):hover, :where(.svelte-1g8bcs):focus-visible, [aria-expanded=true]:where(.svelte-1g8bcs)) {color:var(--sui-button-ghost-foreground-color-focus);background-color:var(--sui-button-ghost-background-color-focus, var(--sui-hover-background-color));}button.ghost.svelte-1g8bcs:active {color:var(--sui-button-ghost-foreground-color-active);background-color:var(--sui-button-ghost-background-color-active, var(--sui-active-background-color));}button.ghost[aria-pressed=true].svelte-1g8bcs {color:var(--sui-button-ghost-foreground-color-pressed);background-color:var(--sui-button-ghost-background-color-pressed, var(--sui-selected-background-color));}button.link.svelte-1g8bcs {margin:0;padding:0 !important;height:auto !important;color:var(--sui-button-link-foreground-color, var(--sui-primary-accent-color-text));}button.link.svelte-1g8bcs:hover .label:where(.svelte-1g8bcs) {outline:none !important;text-decoration:underline;}button.link.svelte-1g8bcs .label:where(.svelte-1g8bcs) {padding:0;line-height:var(--sui-line-height-compact);text-decoration:var(--sui-button-link-text-decoration, none);text-underline-offset:2px;white-space:normal;}:is(:root, :host)[data-underline-links='true'] button.link.svelte-1g8bcs .label:where(.svelte-1g8bcs) {text-decoration:underline;}button.small.svelte-1g8bcs {border-radius:var(--sui-button-small-border-radius);padding:var(--sui-button-small-padding);height:var(--sui-button-small-height);font-size:var(--sui-button-small-font-size, var(--sui-font-size-small));}button.small.svelte-1g8bcs .icon {font-size:var(--sui-font-size-large);}button.medium.svelte-1g8bcs {border-radius:var(--sui-button-medium-border-radius);padding:var(--sui-button-medium-padding);height:var(--sui-button-medium-height);font-size:var(--sui-button-medium-font-size, var(--sui-font-size-default));}button.large.svelte-1g8bcs {border-radius:var(--sui-button-large-border-radius);padding:var(--sui-button-large-padding);height:var(--sui-button-large-height);font-size:var(--sui-button-large-font-size, var(--sui-font-size-large));}button.pill.svelte-1g8bcs {border-radius:80px;padding:var(--sui-button-medium-pill-padding, 0 12px);}button.flex.svelte-1g8bcs:not([hidden]) {display:inline-flex;flex:auto;width:-moz-available;width:-webkit-fill-available;width:stretch;}button.iconic.svelte-1g8bcs {justify-content:center;padding:0;aspect-ratio:1/1;}button.danger.svelte-1g8bcs {background-color:var(--sui-error-background-color);}button.svelte-1g8bcs .label:where(.svelte-1g8bcs) {padding:0 4px;}button.svelte-1g8bcs > * {pointer-events:none;}`};function Al(e,t){O(t,!0),K(e,Ere);let n=e=>{var t=kl();fl(N(t),{get lines(){return _()},children:(e,t)=>{Qr();var n=V();R(()=>W(n,h())),U(e,n)},$$slots:{default:!0}}),D(t),R(()=>{q(t,`dir`,g()),t.dir=t.dir}),U(e,t)},r=J(t,`element`,15),i=J(t,`class`,3,``),a=J(t,`type`,3,`button`),o=J(t,`role`,3,`button`),s=J(t,`name`,3,void 0),c=J(t,`value`,3,void 0),l=J(t,`valueType`,19,()=>dl(c())),u=J(t,`hidden`,3,!1),d=J(t,`disabled`,3,!1),f=J(t,`readonly`,3,!1),p=J(t,`pressed`,3,void 0),m=J(t,`keyShortcuts`,3,void 0),h=J(t,`label`,3,``),g=J(t,`labelDir`,3,void 0),_=J(t,`lines`,3,1),v=J(t,`variant`,3,void 0),y=J(t,`size`,3,`medium`),b=J(t,`iconic`,3,!1),x=J(t,`pill`,3,!1),S=J(t,`flex`,3,!1),C=J(t,`popupPosition`,3,`bottom-left`),w=J(t,`showPopupBackdrop`,3,!1),T=ks(t,Cre);var ee=Tre(),te=P(ee);bs(te,()=>({...T,class:[`sui`,`button`,v(),y(),i()],type:a(),name:s(),value:c(),hidden:u(),disabled:d(),role:o(),"aria-hidden":u(),"aria-disabled":d(),"aria-readonly":f()||void 0,"aria-pressed":p(),"data-type":l(),"data-name":s(),"data-label":h(),"data-value":c(),[ms]:{iconic:b(),pill:x(),flex:S()}}),void 0,void 0,void 0,`svelte-1g8bcs`);var ne=N(te);Go(ne,()=>t.startIcon??kr);var re=I(ne,2),ie=e=>{var r=H(),i=P(r),a=e=>{n(e)},o=e=>{var n=kl();Go(N(n),()=>t.children??kr),D(n),U(e,n)};G(i,e=>{h()?e(a):e(o,-1)}),U(e,r)},ae=e=>{var r=wre(),i=P(r),a=e=>{n(e)};G(i,e=>{h()&&e(a)}),Go(I(i,2),()=>t.children??kr),U(e,r)};G(re,e=>{v()===`link`?e(ie):e(ae,-1)}),Go(I(re,2),()=>t.endIcon??kr),D(te),Ds(te,e=>r(e),()=>r()),es(te,()=>m()&&ul(m()));var oe=I(te,2),se=e=>{Ol(e,{get anchor(){return r()},get position(){return C()},get showBackdrop(){return w()},touchOptimized:!0,children:(e,n)=>{var r=H();Go(P(r),()=>t.popup),U(e,r)},$$slots:{default:!0}})};G(oe,e=>{t.popup&&e(se)}),U(e,ee),k()}var Dre=B(`<div role="none"><!></div>`),Ore=B(`<div role="none"><div class="message svelte-cn03xx"><!></div> <!></div>`),kre={hash:`svelte-cn03xx`,code:`.infobar.svelte-cn03xx {flex:none;display:flex;align-items:center;gap:var(--sui-infobar-gap, 8px);border-width:var(--sui-infobar-border-width, 0 0 1px);border-style:var(--sui-infobar-border-style, solid);padding:var(--sui-infobar-padding, 0);min-height:var(--sui-infobar-min-height, 32px);font-size:var(--sui-infobar-font-size, var(--sui-font-size-small));}.infobar.info.svelte-cn03xx {border-color:var(--sui-info-border-color);color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);}.infobar.warning.svelte-cn03xx {border-color:var(--sui-warning-border-color);color:var(--sui-warning-foreground-color);background-color:var(--sui-warning-background-color);}.infobar.error.svelte-cn03xx {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);background-color:var(--sui-error-background-color);}.infobar.success.svelte-cn03xx {border-color:var(--sui-success-border-color);color:var(--sui-success-foreground-color);background-color:var(--sui-success-background-color);}.message.svelte-cn03xx {flex:auto;display:flex;align-items:center;justify-content:var(--sui-infobar-message-justify-content, start);gap:var(--sui-infobar-message-gap, 6px);padding:var(--sui-infobar-message-padding, 6px);}.message.svelte-cn03xx button {font-size:inherit !important;}.message.svelte-cn03xx .icon {font-size:16px; /* !hardcoded */}`};function jl(e,t){O(t,!0),K(e,kre);let n=J(t,`show`,15,!0),r=J(t,`dismissible`,3,!0),i=J(t,`status`,3,`info`),a=J(t,`ariaLive`,3,void 0),o=J(t,`children`,3,void 0),s=J(t,`icon`,3,void 0),c=A(()=>Qc(i()));var l=H(),u=P(l),d=e=>{var l=Ore(),u=N(l);Zc(N(u),{get status(){return i()},get children(){return o()},get icon(){return s()}}),D(u);var d=I(u,2),f=e=>{var r=Dre(),i=N(r);{let e=A(()=>Y(`_sui.dismiss`));Al(i,{iconic:!0,size:`small`,variant:`ghost`,get"aria-label"(){return z(e)},onclick:()=>{n(!1),t.onDismiss?.()},children:(e,t)=>{Xc(e,{name:`close`})},$$slots:{default:!0}})}D(r),U(e,r)};G(d,e=>{r()&&e(f)}),D(l),R(e=>{os(l,1,ns([`infobar`,i()]),`svelte-cn03xx`),q(u,`role`,z(c)),q(u,`aria-live`,e)},[()=>$c(z(c),a())]),U(e,l)};G(u,e=>{n()&&e(d)}),U(e,l),k()}var Are=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),jre=B(`<div><!></div>`),Mre={hash:`svelte-opt0i6`,code:`.bottom-navigation.svelte-opt0i6 {height:var(--sui-bottom-navigation-height, var(--sui-primary-toolbar-size));border-top-width:var(--sui-bottom-navigation-border-color, 1px);border-top-style:var(--sui-bottom-navigation-border-style, solid);border-top-color:var(--sui-bottom-navigation-border-color, var(--sui-secondary-border-color));}.bottom-navigation.svelte-opt0i6:is([inert]:where(.svelte-opt0i6), [hidden]:where(.svelte-opt0i6)) {display:none;}.bottom-navigation.svelte-opt0i6 .buttons {flex:auto;display:flex;align-items:center;justify-content:space-evenly;}`};function Nre(e,t){K(e,Mre);let n=ks(t,Are);var r=jre();bs(r,()=>({role:`none`,class:`sui bottom-navigation ${t.class??``}`,...n}),void 0,void 0,void 0,`svelte-opt0i6`),Go(N(r),()=>t.children??kr),D(r),U(e,r)}var Pre=B(`<div role="none" class="sui floating-action-button-wrapper svelte-1j6mor0"><!></div>`),Fre={hash:`svelte-1j6mor0`,code:`.floating-action-button-wrapper.svelte-1j6mor0 {display:contents;}
@media (width < 768px) {.floating-action-button-wrapper.svelte-1j6mor0 {display:block;position:fixed;inset-inline-end:16px;inset-block-end:72px;z-index:100;}.floating-action-button-wrapper.svelte-1j6mor0 button {border-radius:50%;height:56px;box-shadow:0 4px 8px rgba(0, 0, 0, 0.4);}.floating-action-button-wrapper.svelte-1j6mor0 button .icon {font-size:32px;}
}`};function Ml(e,t){K(e,Fre);let n=J(t,`children`,3,void 0);var r=Pre();Go(N(r),()=>n()??kr),D(r),U(e,r)}var Nl=e=>{try{e.scrollIntoView({block:`nearest`,inline:`nearest`,behavior:`auto`})}catch{e.scrollIntoView(!0)}},Pl=Symbol(`sui-option-registry`),Ire=class{#e=j(!1);get expanded(){return z(this.#e)}set expanded(e){M(this.#e,e,!0)}#t=new Set;#n=j(0);#r=[];#i=-1;get#a(){return this.#i!==z(this.#n)&&(this.#r=[...this.#t],this.#i=z(this.#n)),this.#r}get count(){return this.#a.length}get entries(){return this.#a}get selectedEntry(){return this.#a.find(e=>e.selected)}register(e){return this.#t.add(e),M(this.#n,z(this.#n)+1),()=>{this.#t.delete(e),M(this.#n,z(this.#n)+1)}}find(e){return this.#a.find(t=>t.value===e)}selectOnly(e){this.#a.forEach(t=>{let n=t.value===e;t.selected!==n&&(t.selected=n)})}},Lre=()=>ci(Pl,new Ire),Rre=()=>si(Pl),Fl=e=>{let{type:t=`string`,name:n,label:r}=e.dataset;return{target:e,type:t,name:n,label:r,value:nre(e.dataset.value,t)}},zre=/\p{Diacritic}/gu,Il=e=>e.normalize(`NFD`).replace(zre,``).toLocaleLowerCase(),Ll=e=>Il(e.trim()),Rl=(e,t)=>e===`horizontal`?t?{prevKey:`ArrowRight`,nextKey:`ArrowLeft`}:{prevKey:`ArrowLeft`,nextKey:`ArrowRight`}:{prevKey:`ArrowUp`,nextKey:`ArrowDown`},Bre=({key:e,index:t,count:n,prevKey:r,nextKey:i})=>e===r?t>0?t-1:n-1:e===i?t<n-1?t+1:0:-1,Vre=({key:e,index:t,count:n,columnCount:r,prevKey:i,nextKey:a})=>{let o=n-1,s=e===`ArrowUp`||e===i,c=e===`ArrowDown`||e===a;return t===-1?c?0:s?o:-1:s&&t>0?e===`ArrowUp`?Math.max(t-r,0):t-1:c&&t<o?e===`ArrowDown`?Math.min(t+r,o):t+1:-1},zl=class{#e=``;#t=0;push(e){return globalThis.clearTimeout(this.#t),this.#e+=Il(e),this.#t=globalThis.setTimeout(()=>{this.#e=``},500),this.#e}reset(){globalThis.clearTimeout(this.#t),this.#e=``}},Bl=(e,t,n)=>{if(!t)return-1;let r=t.length>1&&[...t].every(e=>e===t[0]),i=r?t[0]:t,a=t.length===1||r?n+1:Math.max(n,0),{length:o}=e;for(let t=0;t<o;t+=1){let n=(a+t)%o;if(e[n].startsWith(i))return n}return-1},Vl=(e,t)=>n=>{e.activate(),t(n)},Hl=async(e,t)=>{await pl(100),t()||e.activate()},Ul=`[aria-disabled="true"], [aria-hidden="true"]`,Wl=(e,t)=>{e.getAttribute(`tabindex`)!==String(t)&&(e.tabIndex=t)},Hre={grid:{orientation:`vertical`,childRoles:[`row`],childSelectedAttr:`aria-selected`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},listbox:{orientation:`vertical`,childRoles:[`option`],childSelectedAttr:`aria-selected`,focusChild:!1,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},menu:{orientation:`vertical`,childRoles:[`menuitem`,`menuitemcheckbox`,`menuitemradio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`first`},menubar:{orientation:`horizontal`,childRoles:[`menuitem`,`menuitemcheckbox`,`menuitemradio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`first`},radiogroup:{orientation:`horizontal`,childRoles:[`radio`],childSelectedAttr:`aria-checked`,focusChild:!0,selectFirst:!1,controlsPanel:!1,rovingTabStop:`selected`},tablist:{orientation:`horizontal`,childRoles:[`tab`],childSelectedAttr:`aria-selected`,focusChild:!0,selectFirst:!0,controlsPanel:!0,rovingTabStop:`selected`}},Ure=`a[href], button, input, select, textarea, summary, [tabindex]`,Wre=(e,t)=>{let n=[...document.querySelectorAll(Ure)].filter(t=>t===e||t.tabIndex>=0&&!t.matches(`:disabled, [aria-disabled="true"], [hidden], [inert], [inert] *`)),r=n.indexOf(e);if(r===-1)return;let i=t?-1:1;for(let e=r+i;e>=0&&e<n.length;e+=i)if(n[e].getClientRects().length){n[e].focus();return}},Gl=e=>{let t=e;for(;t;){if(t.id){let e=document.querySelector(`[aria-haspopup="menu"][aria-controls="${CSS.escape(t.id)}"]`);if(e)return e}t=t.parentElement}return null},Kl=(e,t=e.getAttribute(`role`))=>t!==`menuitem`&&e.dataset.selectable!==`false`,Gre=class{activated=!1;selectionObserver=void 0;#e=!1;#t=void 0;#n=void 0;#r=new WeakMap;#i=new WeakMap;#a=new zl;#o=!1;#s(e){let t=e.dataset.searchValue??e.dataset.label??e.querySelector(`.label`)?.textContent??e.textContent,n=this.#r.get(e);if(n?.raw===t)return n.normalized;let r=Ll(t);return this.#r.set(e,{raw:t,normalized:r}),r}#c(e){let t=this.controlsPanel?e.getAttribute(`aria-controls`):null;return t?document.getElementById(t):null}#l(e,t){e.inert=!t,e.setAttribute(`aria-hidden`,String(!t))}constructor(e,{clickToSelect:t=!0}={}){e.dispatchEvent(new CustomEvent(`Initializing`)),this.parent=e,this.role=e.getAttribute(`role`),this.multi=this.parent.getAttribute(`aria-multiselectable`)===`true`,this.id=bl(this.role),this.parentGroupSelector=`[role="group"], [role="${this.role}"]`,this.clickToSelect=t,this._onClick=Vl(this,e=>this.onClick(e)),this._onKeyDown=Vl(this,e=>this.onKeyDown(e));let{orientation:n,childRoles:r,childSelectedAttr:i,focusChild:a,selectFirst:o,controlsPanel:s,rovingTabStop:c}=Hre[this.role];this.orientation=this.grid?`horizontal`:this.parent.getAttribute(`aria-orientation`)??n,this.childRoles=r,this.childSelectedAttr=i,this.childSelectedProp=i.replace(`aria-`,``),this.focusChild=a,this.selectFirst=o,this.controlsPanel=s,this.rovingTabStop=c,this.parent.tabIndex=a?-1:0,this.observer=new globalThis.MutationObserver(e=>{this.#n=void 0,this.activated&&e.some(({type:e})=>e===`childList`)&&this.updateTabStop()}),this.observer.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`aria-disabled`,`aria-hidden`]}),(s||a&&c===`selected`)&&(this.selectionObserver=new globalThis.MutationObserver(()=>{this.activated&&this.syncSelection()}),this.selectionObserver.observe(e,{subtree:!0,attributes:!0,attributeFilter:[i]})),e.addEventListener(`click`,this._onClick),e.addEventListener(`keydown`,this._onKeyDown),Hl(this,()=>this.#e)}activate(){if(this.activated)return;let{parent:e,allMembers:t,selected:n}=this;this.activated=!0,t.forEach((e,t)=>{let r=e.getAttribute(this.childSelectedAttr)===`true`||(n?e===n:this.selectFirst&&t===0),i=this.#c(e);e.id||=`${this.id}-item-${t+1}`,Kl(e)&&e.setAttribute(this.childSelectedAttr,String(r)),i&&(i.setAttribute(`aria-labelledby`,e.id),this.#l(i,r),r&&globalThis.setTimeout(()=>{Nl(i)},300))}),this.updateTabStop(),e.dispatchEvent(new CustomEvent(`Initialized`))}updateTabStop(){let{allMembers:e,activeMembers:t}=this;if(!this.focusChild){e.forEach(e=>{e.tabIndex=-1});return}let{activeElement:n}=document,r=t.find(e=>e===n||e.contains(n)),i=t.filter(e=>e.getAttribute(`tabindex`)===`0`),a=r??(i.length===1?i[0]:(this.rovingTabStop===`selected`?this.selected:void 0)??t.find(e=>e.dataset.selectable!==`false`)??t[0]);e.forEach(e=>{Wl(e,e===a?0:-1)})}syncSelection(){let{allMembers:e,parent:t}=this;if(this.controlsPanel&&e.forEach(e=>{let t=this.#c(e);t&&this.#l(t,e.getAttribute(this.childSelectedAttr)===`true`)}),this.focusChild&&!t.contains(document.activeElement)){let{selected:t}=this;t&&e.forEach(e=>{Wl(e,e===t?0:-1)})}}get columnCount(){let e=this.allMembers.filter(e=>e.getClientRects().length),t=e[0]?.getBoundingClientRect().top,n=e.findIndex(e=>Math.abs(e.getBoundingClientRect().top-t)>1);return Math.max(1,n===-1?e.length:n)}get selector(){return this.childRoles.map(e=>`[role="${e}"]`).join(`,`)}get#u(){if(this.observer.takeRecords().length&&(this.#n=void 0),!this.#n){let e=[...this.parent.querySelectorAll(this.selector)];this.#n={all:e,active:e.filter(e=>!e.matches(Ul))}}return this.#n}get allMembers(){return this.#u.all}get activeMembers(){return this.#u.active}get opener(){return Gl(this.parent)}get parentMenuItem(){let{opener:e}=this;return e?.matches(`[role^="menuitem"]`)?e:null}closeMenuChain(){let{opener:e}=this,t=e,n=null;for(let e=0;e<10&&t;e+=1){n=t,t.getAttribute(`aria-expanded`)===`true`&&t.click();let e=t.closest(`[role="menu"], [role="menubar"]`);t=e?Gl(e):null}return n}async leaveMenu(e){let t=this.closeMenuChain();t&&(t.focus(),await pl(50),Wre(t,e))}async enterSubmenu(e){let t=e.getAttribute(`aria-controls`);if(!t)return;e.getAttribute(`aria-expanded`)!==`true`&&e.click();let n=document.getElementById(t);for(let e=0;e<20;e+=1){let e=[...n?.querySelectorAll(this.selector)??[]].find(e=>!e.matches(Ul));if(e?.focus(),e&&document.activeElement===e)return;await pl(20)}}leaveSubmenu(e){e.getAttribute(`aria-expanded`)===`true`&&e.click(),e.focus()}get selected(){return this.activeMembers.find(e=>e.getAttribute(this.childSelectedAttr)===`true`)}get isDisabled(){return this.parent.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.parent.matches(`[aria-readonly="true"]`)}get grid(){return this.role===`grid`||this.role===`listbox`&&this.parent.matches(`.grid`)}#d(e,t){e.setAttribute(this.childSelectedAttr,String(t)),e.dispatchEvent(new CustomEvent(`Change`,{detail:{[this.childSelectedProp]:t}}))}#f(e){this.#o=!0;try{e.click()}finally{this.#o=!1}}#p(e,t,{role:n,isTarget:r,targetSelectable:i,selecting:a}){let o=n===`menuitemradio`,s=Kl(t,n),c=s&&(n===`menuitemcheckbox`||this.multi),l=s&&i&&(o||!c),u=t.getAttribute(this.childSelectedAttr)===`true`,d=!1;return n===`menuitem`&&r&&a&&(d=!0,t.dispatchEvent(new CustomEvent(`Select`))),c&&r&&a&&(d=!0,this.#d(t,!u),u||t.dispatchEvent(new CustomEvent(`Select`))),l&&u!==r&&(!o||a)&&(d=!0,this.#d(t,r),r&&(e.type===`keydown`&&n===`radio`&&this.#f(t),t.dispatchEvent(new CustomEvent(`Select`)))),d}#m(e,t,n){let r=this.#c(e);this.focusChild||(e.classList.toggle(`focused`,t),t&&e.dispatchEvent(new CustomEvent(`Focus`))),r&&(this.#l(r,t),t&&n.push(r)),t&&(this.parent.setAttribute(`aria-activedescendant`,e.id),n.push(e))}#h(e,t,n){e.forEach(e=>{Wl(e,e===t?0:-1)}),n&&(t.focus(),t.dispatchEvent(new CustomEvent(`Focus`)))}selectTarget(e,t){if(this.isDisabled||this.isReadOnly){e.preventDefault();return}let n=t.getAttribute(`role`),r=t.closest(this.parentGroupSelector),i=Kl(t,n),a=e.type===`click`||e.type===`keydown`&&e.key===` `,o=[],s=!1,c=[],l=!1;this.activeMembers.forEach(u=>{let d=u.getAttribute(`role`);if((d===`menuitemcheckbox`||d===`menuitemradio`)&&(d!==n||u.closest(this.parentGroupSelector)!==r))return;let f=u===t;o.push(u),s||=f,this.#p(e,u,{role:d,isTarget:f,targetSelectable:i,selecting:a})&&(l=!0),this.#m(u,f,c)}),c.length&&this.scrollIntoViewLater(c),this.focusChild&&this.#h(o,t,s),l&&this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:Fl(t)}))}scrollIntoViewLater(e){globalThis.clearTimeout(this.#t),this.#t=globalThis.setTimeout(()=>{this.#t=void 0,e.forEach(Nl)},300)}onClick(e){let t=e.target,n=t.matches(this.selector)?t:t.closest(this.selector);!n||e.button!==0||!this.clickToSelect||this.#o||(this.selectTarget(e,n),!this.focusChild&&document.activeElement!==this.parent&&n.contains(document.activeElement)&&this.parent.focus({preventScroll:!0}))}onKeyDown(e){let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e,o=i||a||n||r,s=this.childRoles.includes(`menuitem`);if(t===`Tab`&&s&&!n&&!r&&!a){e.preventDefault(),this.leaveMenu(i);return}if(o)return;let c=e.target,{activeMembers:l}=this;if(c!==this.parent&&c.matches(`input, textarea, select, [contenteditable]:not([contenteditable="false"])`)&&t!==`Escape`&&t!==`Tab`)return;let u=this.#g(c);[`Enter`,` `,`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`].includes(t)&&e.preventDefault();let d=c===this.parent||c.matches(this.selector);if(t===`Home`||t===`End`){if(!d)return;e.preventDefault();let n=l[t===`Home`?0:l.length-1];n&&n!==u&&this.selectTarget(e,n);return}if(t.length===1&&t!==` `&&d&&(this.role===`listbox`||s)){e.preventDefault();let n=this.#_(t,u);n&&n!==u&&this.selectTarget(e,n);return}if(t===`Enter`){u?.click();return}if(t===` `){u&&this.selectTarget(e,u);return}if(t===`Escape`&&s){let{parentMenuItem:t}=this;if(t){e.preventDefault(),e.stopPropagation(),this.leaveSubmenu(t);return}}let f=qc();if(this.orientation===`vertical`&&s){let{prevKey:e,nextKey:n}=Rl(`horizontal`,f);if(t===n&&u?.getAttribute(`aria-haspopup`)===`menu`){this.enterSubmenu(u);return}if(t===e){let{parentMenuItem:e}=this;if(e){this.leaveSubmenu(e);return}}}let p=this.#v(t,u,f);p&&p!==u&&this.selectTarget(e,p)}#g(e){if(!this.focusChild)return this.activeMembers.find(e=>e.matches(`.focused`));let t=e.closest(this.selector);return t&&this.parent.contains(t)?t:void 0}#_(e,t){let{activeMembers:n}=this,r=Bl(n.map(e=>Ll(e.dataset.label??e.querySelector(`.label`)?.textContent??e.textContent??``)),this.#a.push(e),t?n.indexOf(t):-1);return r===-1?void 0:n[r]}#v(e,t,n){let{allMembers:r,activeMembers:i}=this;if(!this.grid){let r=t?i.indexOf(t):-1,a=Rl(this.orientation,n);return i[Bre({key:e,index:r,count:i.length,...a})]}let{columnCount:a}=this,o=r.filter(e=>e.getAttribute(`aria-hidden`)!==`true`),s=t?o.indexOf(t):-1,c=s===-1?i:o,l=Rl(`horizontal`,n),u=c[Vre({key:e,index:s,count:c.length,columnCount:a,...l})];return u?.matches(`[aria-disabled="true"]`)?void 0:u}destroy(){this.#e=!0,globalThis.clearTimeout(this.#t),this.#a.reset(),this.observer.disconnect(),this.selectionObserver?.disconnect(),this.parent.removeEventListener(`click`,this._onClick),this.parent.removeEventListener(`keydown`,this._onKeyDown)}onUpdate({searchTerms:e}){let t=Ll(e),n=t?t.split(/\s+/):[],{allMembers:r,parent:i}=this,a=r.map(e=>{let t=this.#s(e),r=!n.every(e=>t.includes(e));return this.#i.get(e)!==r&&(this.#i.set(e,r),e.dispatchEvent(new CustomEvent(`Toggle`,{detail:{hidden:r}}))),r}).filter(e=>!e).length;i.dispatchEvent(new CustomEvent(`Filter`,{detail:{matched:a,total:r.length}}))}},ql=e=>t=>{let n=typeof e==`function`,r=new Gre(t,n?fo(()=>e()):e);return n&&L(()=>{r.onUpdate(e())}),()=>{r.destroy()}},Kre=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`]),qre=B(`<div><div role="none" class="inner svelte-a5o3tz"><!></div></div>`),Jre={hash:`svelte-a5o3tz`,code:`.select-button-group.svelte-a5o3tz {flex:none;display:inline-flex;align-items:center;margin:var(--sui-focus-ring-width);}.select-button-group.svelte-a5o3tz:focus-visible {outline-width:0 !important;}.select-button-group.svelte-a5o3tz button {margin:0 !important;border-radius:0 !important;color:var(--sui-primary-foreground-color);}.select-button-group.svelte-a5o3tz button:first-child {border-start-start-radius:4px !important;border-end-start-radius:4px !important;}.select-button-group.svelte-a5o3tz button:not(:first-child) {border-inline-start-width:0;}.select-button-group.svelte-a5o3tz button:last-child {border-start-end-radius:4px !important;border-end-end-radius:4px !important;}.select-button-group.svelte-a5o3tz button[aria-checked=true] {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}.select-button-group[aria-invalid=true].svelte-a5o3tz button {border-color:var(--sui-error-border-color);}.select-button-group[aria-disabled=false].svelte-a5o3tz button[aria-disabled='true'] {filter:grayscale(0) opacity(1);}.select-button-group[aria-disabled=false].svelte-a5o3tz button[aria-disabled='true'] * {filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}.select-button-group[aria-readonly=true].svelte-a5o3tz button {pointer-events:none;}.inner.svelte-a5o3tz {display:contents;}`};function Jl(e,t){O(t,!0),K(e,Jre);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`readonly`,3,!1),a=J(t,`required`,3,!1),o=J(t,`invalid`,3,!1),s=J(t,`ariaLabel`,3,void 0),c=ks(t,Kre);var l=qre();bs(l,()=>({...c,role:`radiogroup`,class:`sui select-button-group ${t.class??``}`,hidden:n(),tabindex:`-1`,"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-label":s()}),void 0,void 0,void 0,`svelte-a5o3tz`);var u=N(l);Go(N(u),()=>t.children??kr),D(u),D(l),es(l,ql),R(()=>u.inert=r()),U(e,l),k()}var Yre=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`class`,`onChange`]);function Yl(e,t){O(t,!0);let n=J(t,`selected`,15,!1),r=ks(t,Yre);Al(e,As(()=>r,{role:`radio`,get class(){return`sui select-button ${t.class??``}`},get"aria-checked"(){return n()},onChange:e=>{n(e.detail.checked),t.onChange?.(e)}})),k()}var Xre=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`popupPosition`,`popupPositionBaseElement`,`showPopupBackdrop`,`label`,`variant`,`size`,`iconic`,`children`,`startIcon`,`endIcon`,`popup`]),Zre=B(`<!> <!>`,1);function Xl(e,t){O(t,!0);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`popupPosition`,3,`bottom-left`),a=J(t,`popupPositionBaseElement`,3,void 0),o=J(t,`showPopupBackdrop`,3,!1),s=J(t,`label`,3,``),c=J(t,`variant`,3,void 0),l=J(t,`size`,3,`medium`),u=J(t,`iconic`,3,!1),d=ks(t,Xre),f=j(void 0);var p={focus:()=>{z(f)?.focus()}},m=Zre(),h=P(m);return Al(h,As(()=>d,{get class(){return`sui menu-button ${t.class??``}`},get hidden(){return n()},get disabled(){return r()},get label(){return s()},get variant(){return c()},get size(){return l()},get iconic(){return u()},"aria-haspopup":`menu`,get element(){return z(f)},set element(e){M(f,e,!0)},startIcon:e=>{var n=H();Go(P(n),()=>t.startIcon??kr),U(e,n)},children:e=>{var n=H();Go(P(n),()=>t.children??kr),U(e,n)},endIcon:e=>{var n=H(),r=P(n),i=e=>{var n=H();Go(P(n),()=>t.endIcon),U(e,n)},a=e=>{Xc(e,{name:`more_vert`})},o=e=>{Xc(e,{name:`arrow_drop_down`,class:`small-arrow`})};G(r,e=>{t.endIcon?e(i):u()?e(a,1):e(o,-1)}),U(e,n)},$$slots:{startIcon:!0,default:!0,endIcon:!0}})),Ol(I(h,2),{get anchor(){return z(f)},get position(){return i()},get positionBaseElement(){return a()},get showBackdrop(){return o()},children:(e,n)=>{var r=H();Go(P(r),()=>t.popup??kr),U(e,r)},$$slots:{default:!0}}),U(e,m),k(p)}var Qre=new Set([`$$slots`,`$$events`,`$$legacy`,`hidden`,`disabled`,`label`,`variant`,`size`,`popupPosition`,`showPopupBackdrop`,`chevronIcon`,`popup`]),$re=B(`<div role="group" class="sui split-button svelte-kq8f8b"><!> <!></div>`),eie={hash:`svelte-kq8f8b`,code:`.split-button.svelte-kq8f8b {flex:none;display:inline-flex;margin:var(--sui-focus-ring-width);}.split-button.svelte-kq8f8b button {margin:0;}.split-button.svelte-kq8f8b button.menu-button {border-inline-start-width:0;border-start-start-radius:0;border-end-start-radius:0;aspect-ratio:3/4;}.split-button.svelte-kq8f8b button:not(.menu-button) {border-start-end-radius:0;border-end-end-radius:0;}`};function Zl(e,t){O(t,!0),K(e,eie);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`label`,3,``),a=J(t,`variant`,3,void 0),o=J(t,`size`,3,`medium`),s=J(t,`popupPosition`,3,`bottom-left`),c=J(t,`showPopupBackdrop`,3,!1),l=ks(t,Qre),u=j(void 0);var d=$re(),f=N(d);Al(f,As(()=>l,{get hidden(){return n()},get disabled(){return r()},get label(){return i()},get variant(){return a()},get size(){return o()}}));var p=I(f,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Go(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{Xc(e,{name:`arrow_drop_down`,class:`small-arrow`})};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),U(e,n)},i=e=>{var n=H();Go(P(n),()=>t.popup??kr),U(e,n)},l=A(()=>Y(`_sui.split_button.more_options`));Xl(p,{iconic:!0,get hidden(){return n()},get disabled(){return r()},get variant(){return a()},get size(){return o()},get"aria-label"(){return z(l)},get popupPosition(){return s()},get popupPositionBaseElement(){return z(u)},get showPopupBackdrop(){return c()},endIcon:e,popup:i,$$slots:{endIcon:!0,popup:!0}})}D(d),Ds(d,e=>M(u,e),()=>z(u)),R(e=>{q(d,`hidden`,n()),q(d,`aria-hidden`,n()),q(d,`aria-disabled`,r()),q(d,`aria-label`,e)},[()=>Y(`_sui.split_button.x_options`,{values:{name:i()}})]),U(e,d),k()}var tie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`ariaLabel`,`children`]),nie=B(`<div><div role="none" class="inner svelte-1q3i654"><!></div></div>`),rie={hash:`svelte-1q3i654`,code:`.checkbox-group.svelte-1q3i654 {display:inline-flex;}.checkbox-group.horizontal.svelte-1q3i654 {gap:8px;align-items:center;flex-wrap:wrap;}.checkbox-group.vertical.svelte-1q3i654 {gap:4px;flex-direction:column;}
@media (pointer: coarse) {.checkbox-group.vertical.svelte-1q3i654 {gap:8px;}
}.inner.svelte-1q3i654 {display:contents;}`};function iie(e,t){O(t,!0),K(e,rie);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`orientation`,3,`horizontal`),a=J(t,`ariaLabel`,3,void 0),o=ks(t,tie);var s=nie();bs(s,e=>({...o,role:`group`,class:[`sui`,`checkbox-group`,t.class,i()],hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-roledescription":e,"aria-label":a()}),[()=>Y(`_sui.role_descriptions.checkbox_group`)],void 0,void 0,`svelte-1q3i654`);var c=N(s);Go(N(c),()=>t.children??kr),D(c),D(s),R(()=>c.inert=r()),U(e,s),k()}var aie=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`class`,`name`,`value`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`label`,`ariaLabel`,`group`,`onChange`,`children`,`checkIcon`]),oie=B(`<label class="svelte-12hva16"><!></label>`),sie=B(`<div role="none"><div role="none" class="inner svelte-12hva16"><!> <!></div></div>`),cie={hash:`svelte-12hva16`,code:`.checkbox.svelte-12hva16 {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);min-width:24px;min-height:24px;color:var(--sui-control-foreground-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);cursor:pointer;-webkit-user-select:none;user-select:none;}.checkbox.svelte-12hva16:hover button {background-color:var(--sui-hover-background-color);}.checkbox.svelte-12hva16:hover button[aria-checked=true] {background-color:var(--sui-primary-accent-color-light);}.checkbox.svelte-12hva16:active button {background-color:var(--sui-active-background-color);}.checkbox.svelte-12hva16:active button[aria-checked=true] {background-color:var(--sui-primary-accent-color-dark);}.checkbox.svelte-12hva16 button {flex:none;align-items:center;justify-content:center;overflow:hidden;margin:0 !important;border-width:var(--sui-checkbox-border-width, 1.5px);border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-border-radius);padding:0;width:var(--sui-checkbox-height);height:var(--sui-checkbox-height);color:var(--sui-primary-accent-text-color);background-color:var(--sui-checkbox-background-color);transition:all 200ms;}.checkbox.svelte-12hva16 button[aria-checked=true] {border-color:var(--sui-checkbox-border-color-checked, var(--sui-primary-accent-color));color:var(--sui-checkbox-foreground-color-checked, var(--sui-primary-accent-color-inverted));background-color:var(--sui-checkbox-background-color-checked, var(--sui-primary-accent-color));}.checkbox.svelte-12hva16 button[aria-invalid=true] {border-color:var(--sui-error-border-color);color:var(--sui-error-foreground-color);}.checkbox.svelte-12hva16 button[aria-checked=true][aria-invalid=true] {background-color:var(--sui-checkbox-background-color);}.checkbox.svelte-12hva16 button .icon {font-size:calc(var(--sui-checkbox-height) - 2px);}.checkbox.svelte-12hva16 label:where(.svelte-12hva16) {cursor:inherit;}.checkbox.readonly.svelte-12hva16 {cursor:default;}.checkbox.readonly.svelte-12hva16 button, .checkbox.readonly.svelte-12hva16:is(:where(.svelte-12hva16):hover, :where(.svelte-12hva16):active) button {background-color:var(--sui-checkbox-background-color);}.checkbox.readonly.svelte-12hva16 button[aria-checked='true']:not([aria-invalid='true']), .checkbox.readonly.svelte-12hva16:is(:where(.svelte-12hva16):hover, :where(.svelte-12hva16):active) button[aria-checked='true']:not([aria-invalid='true']) {border-color:var(--sui-readonly-accent-color);color:var(--sui-readonly-accent-color-inverted);background-color:var(--sui-readonly-accent-color);}.inner.svelte-12hva16 {display:contents;}`};function Ql(e,t){let n=Eo();O(t,!0),K(e,cie);let r=J(t,`checked`,15,!1),i=J(t,`name`,3,void 0),a=J(t,`value`,3,void 0),o=J(t,`hidden`,3,!1),s=J(t,`disabled`,3,!1),c=J(t,`readonly`,3,!1),l=J(t,`required`,3,!1),u=J(t,`invalid`,3,!1),d=J(t,`label`,3,void 0),f=J(t,`ariaLabel`,3,void 0),p=J(t,`group`,15),m=ks(t,aie),h=j(void 0),g=A(()=>f()??m[`aria-label`]),_=A(()=>!!(t.children||d())),v=A(()=>r()===`mixed`);L(()=>{Array.isArray(p())&&(p().includes(a())?r()!==!0&&r(!0):r()!==!1&&r(!1))});var y=sie();let b;var x=N(y),S=N(x);{let e=e=>{var n=H(),i=P(n),a=e=>{var n=H();Go(P(n),()=>t.checkIcon),U(e,n)},o=e=>{Xc(e,{name:`remove`})},s=e=>{Xc(e,{name:`check`})};G(i,e=>{t.checkIcon?e(a):z(v)?e(o,1):r()&&e(s,2)}),U(e,n)},d=A(()=>z(g)||void 0),f=A(()=>!z(g)&&z(_)?`${n}-label`:void 0);Al(S,As(()=>m,{role:`checkbox`,get id(){return n},get name(){return i()},get value(){return a()},get hidden(){return o()},get disabled(){return s()},get readonly(){return c()},get"aria-required"(){return l()},get"aria-invalid"(){return u()},get"aria-checked"(){return r()},get"aria-label"(){return z(d)},get"aria-labelledby"(){return z(f)},onclick:e=>{e.preventDefault(),e.stopPropagation(),!(s()||c())&&(r(z(v)?!0:!r()),Array.isArray(p())&&(r()?p().includes(a())||p([...p(),a()]):p().includes(a())&&p(p().filter(e=>e!==a()))),t.onChange?.(new CustomEvent(`Change`,{detail:{checked:r()}})))},get element(){return z(h)},set element(e){M(h,e,!0)},startIcon:e,$$slots:{startIcon:!0}}))}var C=I(S,2),w=e=>{var r=oie(),i=N(r),a=e=>{var n=H();Go(P(n),()=>t.children),U(e,n)},o=e=>{var t=V();R(()=>W(t,d())),U(e,t)};G(i,e=>{t.children?e(a):e(o,-1)}),D(r),R(()=>q(r,`id`,`${n}-label`)),U(e,r)};G(C,e=>{z(_)&&e(w)}),D(x),D(y),R(()=>{b=os(y,1,`sui checkbox ${t.class??``}`,`svelte-12hva16`,b,{checked:r(),indeterminate:z(v),disabled:s(),readonly:c()}),q(y,`hidden`,o()),x.inert=s()}),bo(`click`,y,e=>{e.preventDefault(),e.stopPropagation(),e.target.matches(`button`)||z(h)?.click()}),U(e,y),k()}xo([`click`]);var lie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`flex`]),uie=B(`<div></div>`),die={hash:`svelte-1fh461f`,code:`.spacer.flex.svelte-1fh461f:not([hidden]) {display:block;flex:auto;}.spacer.svelte-1fh461f:not(.flex) {width:8px;height:8px;}`};function $l(e,t){K(e,die);let n=J(t,`flex`,3,!1),r=ks(t,lie);var i=uie();bs(i,()=>({...r,role:`none`,class:`sui spacer ${t.class??``}`,[ms]:{flex:n()}}),void 0,void 0,void 0,`svelte-1fh461f`),U(e,i)}function eu(e,t){O(t,!0);let n=J(t,`class`,3,void 0),r=J(t,`closeIcon`,3,void 0);{let i=e=>{var t=H(),n=P(t),i=e=>{var t=H();Go(P(t),r),U(e,t)},a=e=>{Xc(e,{name:`close`})};G(n,e=>{r()?e(i):e(a,-1)}),U(e,t)},a=A(()=>Y(`_sui.close`));Al(e,{variant:`ghost`,iconic:!0,get class(){return n()},get"aria-label"(){return z(a)},get"aria-controls"(){return t.controls},onclick:()=>{t.onClose()},startIcon:i,$$slots:{startIcon:!0}})}k()}var fie=new Set(`$$slots.$$events.$$legacy.open.value.title.ariaLabelledby.role.size.class.showClose.showOk.showCancel.okLabel.okShortcuts.okDisabled.cancelLabel.cancelShortcuts.cancelDisabled.focusInput.children.header.headerExtra.footer.footerExtra.closeIcon.input`.split(`.`)),pie=B(`<div role="none" class="title svelte-ad3i0k"> </div> <!> <!> <!>`,1),mie=B(`<div role="none" class="header svelte-ad3i0k"><!></div>`),hie=B(`<!> <!> <!> <!>`,1),gie=B(`<div role="none" class="footer svelte-ad3i0k"><!></div>`),_ie=B(`<div role="none"><!> <div role="none" class="body svelte-ad3i0k"><!></div> <!></div>`),vie={hash:`svelte-ad3i0k`,code:`.content.svelte-ad3i0k {position:relative;display:flex;flex-direction:column;overflow:hidden;border-width:var(--sui-dialog-content-border-width, var(--sui-modal-border-width, 0));border-style:solid;border-color:var(--sui-dialog-content-border-color, var(--sui-primary-border-color));border-radius:var(--sui-dialog-content-border-radius, 4px);max-width:calc(100dvw - var(--sui-dialog-content-margin, 16px) * 2);background-color:var(--sui-dialog-content-background-color, var(--sui-secondary-background-color-translucent));box-shadow:var(--sui-dialog-content-box-shadow, 0 8px 16px var(--sui-popup-shadow-color));-webkit-backdrop-filter:var(--sui-dialog-content-backdrop-filter, blur(16px));backdrop-filter:var(--sui-dialog-content-backdrop-filter, blur(16px));transition-property:transform;}dialog.open .content.svelte-ad3i0k {transition-duration:150ms;transform:scale(100%);}dialog:not(.open) .content.svelte-ad3i0k {transition-duration:300ms;transform:scale(90%);}.content.x-small.svelte-ad3i0k {width:var(--sui-dialog-x-small-content-width, var(--sui-dialog-content-width, 300px));max-height:var(--sui-dialog-x-small-content-max-height, var(--sui-dialog-content-max-height, 300px));--sui-textbox-singleline-min-width: 0;}
@media (max-height: 300px) {.content.x-small.svelte-ad3i0k {max-height:calc(100dvh - 32px);}
}.content.small.svelte-ad3i0k {width:var(--sui-dialog-small-content-width, var(--sui-dialog-content-width, 400px));max-height:var(--sui-dialog-small-content-max-height, var(--sui-dialog-content-max-height, 400px));}
@media (max-height: 400px) {.content.small.svelte-ad3i0k {max-height:calc(100dvh - 32px);}
}.content.medium.svelte-ad3i0k {width:var(--sui-dialog-medium-content-width, var(--sui-dialog-content-width, 600px));max-height:var(--sui-dialog-medium-content-max-height, var(--sui-dialog-content-max-height, 600px));}
@media (max-height: 600px) {.content.medium.svelte-ad3i0k {max-height:calc(100dvh - 32px);}
}.content.large.svelte-ad3i0k {width:var(--sui-dialog-large-content-width, var(--sui-dialog-content-width, 800px));max-height:var(--sui-dialog-large-content-max-height, var(--sui-dialog-content-max-height, 800px));}
@media (max-height: 800px) {.content.large.svelte-ad3i0k {max-height:calc(100dvh - 32px);}
}.content.x-large.svelte-ad3i0k {width:var(--sui-dialog-x-large-content-width, var(--sui-dialog-content-width, 1000px));max-height:var(--sui-dialog-x-large-content-max-height, var(--sui-dialog-content-max-height, 1000px));}
@media (max-height: 1000px) {.content.x-large.svelte-ad3i0k {max-height:calc(100dvh - 32px);}
}:is(.header.svelte-ad3i0k, .footer.svelte-ad3i0k) {display:flex;align-items:center;gap:4px;}.header.svelte-ad3i0k {box-sizing:content-box;margin:var(--sui-dialog-header-margin, 0 16px);border-width:var(--sui-dialog-header-border-width, 0 0 1px);border-color:var(--sui-dialog-header-border-color, var(--sui-secondary-border-color));padding:var(--sui-dialog-header-padding, 16px 8px);height:var(--sui-dialog-header-height, 32px);}.header.svelte-ad3i0k .title:where(.svelte-ad3i0k) {font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-bold);}.footer.svelte-ad3i0k {margin:var(--sui-dialog-footer-margin, 0 24px 24px);}
@media (width < 768px) {.footer.svelte-ad3i0k {margin:var(--sui-dialog-footer-margin, 0 16px 16px);}
}.body.svelte-ad3i0k {overflow:auto;margin:var(--sui-dialog-body-margin, 24px 24px);white-space:normal;line-height:var(--sui-line-height-compact);}
@media (width < 768px) {.body.svelte-ad3i0k {margin:var(--sui-dialog-body-margin, 16px 16px);}
}`};function tu(e,t){let n=Eo();O(t,!0),K(e,vie);let r=J(t,`open`,15,!1);J(t,`value`,11,``);let i=J(t,`ariaLabelledby`,3,void 0),a=J(t,`role`,3,`dialog`),o=J(t,`size`,3,`medium`),s=J(t,`showClose`,3,!1),c=J(t,`showOk`,3,!0),l=J(t,`showCancel`,3,!0),u=J(t,`okLabel`,3,``),d=J(t,`okShortcuts`,3,void 0),f=J(t,`okDisabled`,3,!1),p=J(t,`cancelLabel`,3,``),m=J(t,`cancelShortcuts`,3,void 0),h=J(t,`cancelDisabled`,3,!1),g=J(t,`focusInput`,3,!0),_=ks(t,fie),v=A(()=>i()??(!t.header&&t.title?`${n}-title`:void 0)),y=A(()=>z(v)?void 0:t.title||void 0),b=j(void 0),x=j(void 0);L(()=>{if(r()&&z(x)){let e=!1;return(async()=>{if(await pl(50),e||z(x)?.contains(document.activeElement))return;let t=g()?z(x)?.querySelector(`input, button.primary`):null;t?(t.focus(),t instanceof HTMLInputElement&&t.select()):z(b)?.focus()})(),()=>{e=!0}}}),Ds(Dl(e,As(()=>_,{get role(){return a()},get id(){return n},class:`dialog`,get"aria-label"(){return z(y)},get"aria-labelledby"(){return z(v)},get"aria-describedby"(){return`${n}-body`},showBackdrop:!0,get open(){return r()},set open(e){r(e)},children:(e,r)=>{var i=_ie(),a=N(i),g=e=>{var r=mie(),i=N(r),a=e=>{var n=H();Go(P(n),()=>t.header),U(e,n)},o=e=>{var r=pie(),i=P(r),a=F(i,!0),o=I(i,2);$l(o,{flex:!0});var c=I(o,2);Go(c,()=>t.headerExtra??kr);var l=I(c,2),u=e=>{eu(e,{get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{z(b)?.close(`close`)}})};G(l,e=>{s()&&e(u)}),R(()=>{q(i,`id`,`${n}-title`),W(a,t.title)}),U(e,r)};G(i,e=>{t.header?e(a):e(o,-1)}),D(r),U(e,r)};G(a,e=>{(t.title||s()||t.header||t.headerExtra)&&e(g)});var _=I(a,2);Go(N(_),()=>t.children??kr),D(_);var v=I(_,2),y=e=>{var n=gie(),r=N(n),i=e=>{var n=H();Go(P(n),()=>t.footer??kr),U(e,n)},a=e=>{var n=hie(),r=P(n);Go(r,()=>t.footerExtra??kr);var i=I(r,2);$l(i,{flex:!0});var a=I(i,2),o=e=>{{let t=A(()=>u()||Y(`_sui.ok`));Al(e,{variant:`primary`,get label(){return z(t)},get keyShortcuts(){return d()},get disabled(){return f()},onclick:()=>{z(b)?.close(`ok`)}})}};G(a,e=>{c()&&e(o)});var s=I(a,2),g=e=>{{let t=A(()=>p()||Y(`_sui.cancel`));Al(e,{variant:`secondary`,get label(){return z(t)},get keyShortcuts(){return m()},get disabled(){return h()},onclick:()=>{z(b)?.close(`cancel`)}})}};G(s,e=>{l()&&e(g)}),U(e,n)};G(r,e=>{t.footer?e(i):e(a,-1)}),D(n),U(e,n)};G(v,e=>{(c()||l()||t.footer||t.footerExtra)&&e(y)}),D(i),Ds(i,e=>M(x,e),()=>z(x)),R(()=>{os(i,1,ns([`content`,t.class,o()]),`svelte-ad3i0k`),q(_,`id`,`${n}-body`)}),U(e,i)},$$slots:{default:!0}})),e=>M(b,e,!0),()=>z(b)),k()}var yie=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function nu(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=ks(t,yie);tu(e,As(()=>r,{role:`alertdialog`,showCancel:!1,get open(){return n()},set open(e){n(e)}})),k()}var bie=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function ru(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=ks(t,bie);tu(e,As(()=>r,{role:`alertdialog`,get open(){return n()},set open(e){n(e)}})),k()}var xie=`boxSizing.width.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.paddingTop.paddingRight.paddingBottom.paddingLeft.fontFamily.fontSize.fontStretch.fontStyle.fontVariant.fontWeight.letterSpacing.lineHeight.tabSize.textAlign.textIndent.textTransform.wordBreak.wordSpacing.overflowWrap.direction`.split(`.`),Sie=(e,t,n)=>{let r=e.getBoundingClientRect();if(!r.width&&!r.height)return;let i=globalThis.getComputedStyle(e),a=e.tagName===`INPUT`,o=document.createElement(`div`),s=document.createElement(`span`);xie.forEach(e=>{o.style[e]=i[e]}),Object.assign(o.style,{position:`absolute`,top:`0`,left:`0`,height:`auto`,minHeight:`0`,maxHeight:`none`,overflow:`hidden`,visibility:`hidden`,pointerEvents:`none`,whiteSpace:a?`pre`:`pre-wrap`}),o.setAttribute(`aria-hidden`,`true`),o.textContent=e.value.slice(0,t),s.textContent=e.value.slice(t,n)||`​`,o.append(s),document.body.append(o);let c=o.getBoundingClientRect(),l=s.getClientRects(),u=l[l.length-1]??s.getBoundingClientRect(),d=u.top-c.top,f=u.left-c.left,p=u.right-c.left,m=u.height||Number.parseFloat(i.lineHeight)||0;o.remove();let h=r.top+d-e.scrollTop,g=r.left+f-e.scrollLeft,_=r.left+p-e.scrollLeft;return{top:h,bottom:h+m,left:g,right:_}},Cie=/(?<=^|[\s([{"'«])(?::)(?<query>[a-zA-Z0-9_+-]{1,64})$/,iu=/[-_]/,au,wie=e=>e.split(`
`).map(e=>{let[t,n,r=``]=e.split(` `),[i,...a]=n.split(` `);return{emoji:t,name:i,aliases:[...a,...r?r.split(` `):[]]}}),ou=(e,t)=>{let n=e.split(iu);return e===t?0:e.startsWith(t)&&iu.test(e.charAt(t.length))?1:n.includes(t)?2:e.startsWith(t)||n.some(e=>e.startsWith(t))?4:9},Tie=(e,t)=>e.includes(t)?3:e.some(e=>e.startsWith(t))?5:9,Eie=({name:e,aliases:t},n)=>{let r=ou(e,n),i=Tie(t,n);return{rank:Math.min(r,i),nameRank:r}},Die=({name:e,aliases:t},n)=>{if(ou(e,n)<9)return e.split(iu).length;let r=t.findIndex(e=>e===n||e.startsWith(n));return(r>-1?r:t.length)*100+t.length},Oie=e=>{let t=e.toLowerCase();return t?(au??=wie(`😀 grinning face
😃 smiley smiling face open mouth
😄 smile smiling face open mouth eyes
😁 grin grinning face smiling eyes
😆 laughing satisfied smiling face open mouth tightly-closed eyes
😅 sweat_smile smiling face open mouth cold
🤣 rolling_on_the_floor_laughing
😂 joy face tears
🙂 slightly_smiling_face
🙃 upside_down_face upside-down
🫠 melting_face
😉 wink winking face
😊 blush smiling face eyes
😇 innocent smiling face halo
🥰 smiling_face_with_3_hearts eyes three
😍 heart_eyes smiling face heart-shaped
🤩 star-struck grinning_face_with_star_eyes
😘 kissing_heart face throwing kiss
😗 kissing face
☺️ relaxed white smiling face
😚 kissing_closed_eyes face
😙 kissing_smiling_eyes face
🥲 smiling_face_with_tear
😋 yum face savouring delicious food
😛 stuck_out_tongue face stuck-out
😜 stuck_out_tongue_winking_eye face stuck-out
🤪 zany_face grinning_face_with_one_large_and_one_small_eye
😝 stuck_out_tongue_closed_eyes face stuck-out tightly-closed
🤑 money_mouth_face money-mouth
🤗 hugging_face
🤭 face_with_hand_over_mouth smiling_face_with_smiling_eyes_and_hand_covering_mouth
🫢 face_with_open_eyes_and_hand_over_mouth
🫣 face_with_peeking_eye
🤫 shushing_face face_with_finger_covering_closed_lips
🤔 thinking_face
🫡 saluting_face
🤐 zipper_mouth_face zipper-mouth
🤨 face_with_raised_eyebrow face_with_one_eyebrow_raised
😐 neutral_face
😑 expressionless face
😶 no_mouth face without
🫥 dotted_line_face
😶‍🌫️ face_in_clouds
😏 smirk smirking face
😒 unamused face
🙄 face_with_rolling_eyes
😬 grimacing face
😮‍💨 face_exhaling
🤥 lying_face
🫨 shaking_face
🙂‍↔️ head_shaking_horizontally
🙂‍↕️ head_shaking_vertically
😌 relieved face
😔 pensive face
😪 sleepy face
🤤 drooling_face
😴 sleeping face
🫩 face_with_bags_under_eyes
😷 mask face medical
🤒 face_with_thermometer
🤕 face_with_head_bandage head-bandage
🤢 nauseated_face
🤮 face_vomiting face_with_open_mouth_vomiting
🤧 sneezing_face
🥵 hot_face overheated
🥶 cold_face freezing
🥴 woozy_face uneven eyes wavy mouth
😵 dizzy_face
😵‍💫 face_with_spiral_eyes
🤯 exploding_head shocked_face_with_exploding_head
🤠 face_with_cowboy_hat
🥳 partying_face party horn hat
🥸 disguised_face
😎 sunglasses smiling face
🤓 nerd_face
🧐 face_with_monocle
😕 confused face
🫤 face_with_diagonal_mouth
😟 worried face
🙁 slightly_frowning_face
☹️ white_frowning_face
😮 open_mouth face
😯 hushed face
😲 astonished face
😳 flushed face
🥺 pleading_face eyes
🥹 face_holding_back_tears
😦 frowning face open mouth
😧 anguished face
😨 fearful face
😰 cold_sweat face open mouth
😥 disappointed_relieved but face
😢 cry crying face
😭 sob loudly crying face
😱 scream face screaming fear
😖 confounded face
😣 persevere persevering face
😞 disappointed face
😓 sweat face cold
😩 weary face
😫 tired_face
🥱 yawning_face
😤 triumph face look
😡 rage pouting face
😠 angry face
🤬 face_with_symbols_on_mouth serious_face_with_symbols_covering_mouth
😈 smiling_imp face horns
👿 imp
💀 skull
☠️ skull_and_crossbones
💩 hankey poop shit pile poo
🤡 clown_face
👹 japanese_ogre
👺 japanese_goblin
👻 ghost
👽 alien extraterrestrial
👾 space_invader alien monster
🤖 robot_face
😺 smiley_cat smiling face open mouth
😸 smile_cat grinning face smiling eyes
😹 joy_cat face tears
😻 heart_eyes_cat smiling face heart-shaped
😼 smirk_cat face wry smile
😽 kissing_cat face closed eyes
🙀 scream_cat weary face
😿 crying_cat_face
😾 pouting_cat face
🙈 see_no_evil see-no-evil monkey
🙉 hear_no_evil hear-no-evil monkey
🙊 speak_no_evil speak-no-evil monkey
💌 love_letter
💘 cupid heart arrow
💝 gift_heart ribbon
💖 sparkling_heart
💗 heartpulse growing heart
💓 heartbeat beating heart
💞 revolving_hearts
💕 two_hearts
💟 heart_decoration
❣️ heavy_heart_exclamation_mark_ornament
💔 broken_heart
❤️‍🔥 heart_on_fire
❤️‍🩹 mending_heart
❤️ heart heavy black
🩷 pink_heart
🧡 orange_heart
💛 yellow_heart
💚 green_heart
💙 blue_heart
🩵 light_blue_heart
💜 purple_heart
🤎 brown_heart
🖤 black_heart
🩶 grey_heart
🤍 white_heart
💋 kiss mark
💯 100 hundred points symbol
💢 anger symbol
💥 boom collision symbol
💫 dizzy symbol
💦 sweat_drops splashing symbol
💨 dash symbol
🕳️ hole
💬 speech_balloon
👁️‍🗨️ eye-in-speech-bubble
🗨️ left_speech_bubble
🗯️ right_anger_bubble
💭 thought_balloon
💤 zzz sleeping symbol
👋 wave waving hand sign
🤚 raised_back_of_hand
🖐️ raised_hand_with_fingers_splayed
✋ hand raised_hand
🖖 spock-hand raised part between middle ring fingers
🫱 rightwards_hand
🫲 leftwards_hand
🫳 palm_down_hand
🫴 palm_up_hand
🫷 leftwards_pushing_hand
🫸 rightwards_pushing_hand
👌 ok_hand sign
🤌 pinched_fingers
🤏 pinching_hand
✌️ v victory hand
🤞 crossed_fingers hand_with_index_and_middle_fingers_crossed
🫰 hand_with_index_finger_and_thumb_crossed
🤟 i_love_you_hand_sign
🤘 the_horns sign_of_the_horns
🤙 call_me_hand
👈 point_left white pointing backhand index
👉 point_right white pointing backhand index
👆 point_up_2 white pointing backhand index
🖕 middle_finger reversed_hand_with_middle_finger_extended
👇 point_down white pointing backhand index
☝️ point_up white pointing index
🫵 index_pointing_at_the_viewer
👍 +1 thumbsup thumbs up sign
👎 -1 thumbsdown thumbs down sign
✊ fist raised
👊 facepunch punch fisted hand sign
🤛 left-facing_fist left-facing
🤜 right-facing_fist right-facing
👏 clap clapping hands sign
🙌 raised_hands person raising both celebration
🫶 heart_hands
👐 open_hands sign
🤲 palms_up_together
🤝 handshake
🙏 pray person folded hands
✍️ writing_hand
💅 nail_care polish
🤳 selfie
💪 muscle flexed biceps
🦾 mechanical_arm
🦿 mechanical_leg
🦵 leg
🦶 foot
👂 ear
🦻 ear_with_hearing_aid
👃 nose
🧠 brain
🫀 anatomical_heart
🫁 lungs
🦷 tooth
🦴 bone
👀 eyes
👁️ eye
👅 tongue
👄 lips mouth
🫦 biting_lip
👶 baby
🧒 child
👦 boy
👧 girl
🧑 adult
👱 person_with_blond_hair
👨 man
🧔 bearded_person
🧔‍♂️ man_with_beard
🧔‍♀️ woman_with_beard
👨‍🦰 red_haired_man hair
👨‍🦱 curly_haired_man hair
👨‍🦳 white_haired_man hair
👨‍🦲 bald_man
👩 woman
👩‍🦰 red_haired_woman hair
🧑‍🦰 red_haired_person hair
👩‍🦱 curly_haired_woman hair
🧑‍🦱 curly_haired_person hair
👩‍🦳 white_haired_woman hair
🧑‍🦳 white_haired_person hair
👩‍🦲 bald_woman
🧑‍🦲 bald_person
👱‍♀️ blond-haired-woman hair
👱‍♂️ blond-haired-man hair
🧓 older_adult
👴 older_man
👵 older_woman
🙍 person_frowning
🙍‍♂️ man-frowning
🙍‍♀️ woman-frowning
🙎 person_with_pouting_face
🙎‍♂️ man-pouting
🙎‍♀️ woman-pouting
🙅 no_good face gesture
🙅‍♂️ man-gesturing-no
🙅‍♀️ woman-gesturing-no
🙆 ok_woman face gesture
🙆‍♂️ man-gesturing-ok
🙆‍♀️ woman-gesturing-ok
💁 information_desk_person
💁‍♂️ man-tipping-hand
💁‍♀️ woman-tipping-hand
🙋 raising_hand happy person one
🙋‍♂️ man-raising-hand
🙋‍♀️ woman-raising-hand
🧏 deaf_person
🧏‍♂️ deaf_man
🧏‍♀️ deaf_woman
🙇 bow person bowing deeply
🙇‍♂️ man-bowing
🙇‍♀️ woman-bowing
🤦 face_palm
🤦‍♂️ man-facepalming
🤦‍♀️ woman-facepalming
🤷 shrug
🤷‍♂️ man-shrugging
🤷‍♀️ woman-shrugging
🧑‍⚕️ health_worker
👨‍⚕️ male-doctor man health worker
👩‍⚕️ female-doctor woman health worker
🧑‍🎓 student
👨‍🎓 male-student man
👩‍🎓 female-student woman
🧑‍🏫 teacher
👨‍🏫 male-teacher man
👩‍🏫 female-teacher woman
🧑‍⚖️ judge
👨‍⚖️ male-judge man
👩‍⚖️ female-judge woman
🧑‍🌾 farmer
👨‍🌾 male-farmer man
👩‍🌾 female-farmer woman
🧑‍🍳 cook
👨‍🍳 male-cook man
👩‍🍳 female-cook woman
🧑‍🔧 mechanic
👨‍🔧 male-mechanic man
👩‍🔧 female-mechanic woman
🧑‍🏭 factory_worker
👨‍🏭 male-factory-worker man
👩‍🏭 female-factory-worker woman
🧑‍💼 office_worker
👨‍💼 male-office-worker man
👩‍💼 female-office-worker woman
🧑‍🔬 scientist
👨‍🔬 male-scientist man
👩‍🔬 female-scientist woman
🧑‍💻 technologist
👨‍💻 male-technologist man
👩‍💻 female-technologist woman
🧑‍🎤 singer
👨‍🎤 male-singer man
👩‍🎤 female-singer woman
🧑‍🎨 artist
👨‍🎨 male-artist man
👩‍🎨 female-artist woman
🧑‍✈️ pilot
👨‍✈️ male-pilot man
👩‍✈️ female-pilot woman
🧑‍🚀 astronaut
👨‍🚀 male-astronaut man
👩‍🚀 female-astronaut woman
🧑‍🚒 firefighter
👨‍🚒 male-firefighter man
👩‍🚒 female-firefighter woman
👮 cop police officer
👮‍♂️ male-police-officer man
👮‍♀️ female-police-officer woman
🕵️ sleuth_or_spy detective
🕵️‍♂️ male-detective man
🕵️‍♀️ female-detective woman
💂 guardsman
💂‍♂️ male-guard man
💂‍♀️ female-guard woman
🥷 ninja
👷 construction_worker
👷‍♂️ male-construction-worker man
👷‍♀️ female-construction-worker woman
🫅 person_with_crown
🤴 prince
👸 princess
👳 man_with_turban
👳‍♂️ man-wearing-turban
👳‍♀️ woman-wearing-turban
👲 man_with_gua_pi_mao
🧕 person_with_headscarf
🤵 person_in_tuxedo man
🤵‍♂️ man_in_tuxedo
🤵‍♀️ woman_in_tuxedo
👰 bride_with_veil
👰‍♂️ man_with_veil
👰‍♀️ woman_with_veil
🤰 pregnant_woman
🫃 pregnant_man
🫄 pregnant_person
🤱 breast-feeding
👩‍🍼 woman_feeding_baby
👨‍🍼 man_feeding_baby
🧑‍🍼 person_feeding_baby
👼 angel baby
🎅 santa father christmas
🤶 mrs_claus mother_christmas
🧑‍🎄 mx_claus
🦸 superhero
🦸‍♂️ male_superhero man
🦸‍♀️ female_superhero woman
🦹 supervillain
🦹‍♂️ male_supervillain man
🦹‍♀️ female_supervillain woman
🧙 mage
🧙‍♂️ male_mage man
🧙‍♀️ female_mage woman
🧚 fairy
🧚‍♂️ male_fairy man
🧚‍♀️ female_fairy woman
🧛 vampire
🧛‍♂️ male_vampire man
🧛‍♀️ female_vampire woman
🧜 merperson
🧜‍♂️ merman
🧜‍♀️ mermaid
🧝 elf
🧝‍♂️ male_elf man
🧝‍♀️ female_elf woman
🧞 genie
🧞‍♂️ male_genie man
🧞‍♀️ female_genie woman
🧟 zombie
🧟‍♂️ male_zombie man
🧟‍♀️ female_zombie woman
🧌 troll
💆 massage face
💆‍♂️ man-getting-massage
💆‍♀️ woman-getting-massage
💇 haircut
💇‍♂️ man-getting-haircut
💇‍♀️ woman-getting-haircut
🚶 walking pedestrian
🚶‍♂️ man-walking
🚶‍♀️ woman-walking
🚶‍➡️ person_walking_facing_right
🚶‍♀️‍➡️ woman_walking_facing_right
🚶‍♂️‍➡️ man_walking_facing_right
🧍 standing_person
🧍‍♂️ man_standing
🧍‍♀️ woman_standing
🧎 kneeling_person
🧎‍♂️ man_kneeling
🧎‍♀️ woman_kneeling
🧎‍➡️ person_kneeling_facing_right
🧎‍♀️‍➡️ woman_kneeling_facing_right
🧎‍♂️‍➡️ man_kneeling_facing_right
🧑‍🦯 person_with_probing_cane white
🧑‍🦯‍➡️ person_with_white_cane_facing_right
👨‍🦯 man_with_probing_cane white
👨‍🦯‍➡️ man_with_white_cane_facing_right
👩‍🦯 woman_with_probing_cane white
👩‍🦯‍➡️ woman_with_white_cane_facing_right
🧑‍🦼 person_in_motorized_wheelchair
🧑‍🦼‍➡️ person_in_motorized_wheelchair_facing_right
👨‍🦼 man_in_motorized_wheelchair
👨‍🦼‍➡️ man_in_motorized_wheelchair_facing_right
👩‍🦼 woman_in_motorized_wheelchair
👩‍🦼‍➡️ woman_in_motorized_wheelchair_facing_right
🧑‍🦽 person_in_manual_wheelchair
🧑‍🦽‍➡️ person_in_manual_wheelchair_facing_right
👨‍🦽 man_in_manual_wheelchair
👨‍🦽‍➡️ man_in_manual_wheelchair_facing_right
👩‍🦽 woman_in_manual_wheelchair
👩‍🦽‍➡️ woman_in_manual_wheelchair_facing_right
🏃 runner running
🏃‍♂️ man-running
🏃‍♀️ woman-running
🏃‍➡️ person_running_facing_right
🏃‍♀️‍➡️ woman_running_facing_right
🏃‍♂️‍➡️ man_running_facing_right
💃 dancer
🕺 man_dancing
🕴️ man_in_business_suit_levitating person
👯 dancers woman bunny ears
👯‍♂️ men-with-bunny-ears-partying man-with-bunny-ears-partying
👯‍♀️ women-with-bunny-ears-partying woman-with-bunny-ears-partying
🧖 person_in_steamy_room
🧖‍♂️ man_in_steamy_room
🧖‍♀️ woman_in_steamy_room
🧗 person_climbing
🧗‍♂️ man_climbing
🧗‍♀️ woman_climbing
🤺 fencer
🏇 horse_racing
⛷️ skier
🏂 snowboarder
🏌️ golfer person golfing
🏌️‍♂️ man-golfing
🏌️‍♀️ woman-golfing
🏄 surfer
🏄‍♂️ man-surfing
🏄‍♀️ woman-surfing
🚣 rowboat
🚣‍♂️ man-rowing-boat
🚣‍♀️ woman-rowing-boat
🏊 swimmer
🏊‍♂️ man-swimming
🏊‍♀️ woman-swimming
⛹️ person_with_ball bouncing
⛹️‍♂️ man-bouncing-ball
⛹️‍♀️ woman-bouncing-ball
🏋️ weight_lifter person lifting weights
🏋️‍♂️ man-lifting-weights
🏋️‍♀️ woman-lifting-weights
🚴 bicyclist
🚴‍♂️ man-biking
🚴‍♀️ woman-biking
🚵 mountain_bicyclist
🚵‍♂️ man-mountain-biking
🚵‍♀️ woman-mountain-biking
🤸 person_doing_cartwheel
🤸‍♂️ man-cartwheeling
🤸‍♀️ woman-cartwheeling
🤼 wrestlers
🤼‍♂️ man-wrestling men
🤼‍♀️ woman-wrestling women
🤽 water_polo
🤽‍♂️ man-playing-water-polo
🤽‍♀️ woman-playing-water-polo
🤾 handball
🤾‍♂️ man-playing-handball
🤾‍♀️ woman-playing-handball
🤹 juggling
🤹‍♂️ man-juggling
🤹‍♀️ woman-juggling
🧘 person_in_lotus_position
🧘‍♂️ man_in_lotus_position
🧘‍♀️ woman_in_lotus_position
🛀 bath
🛌 sleeping_accommodation
🧑‍🤝‍🧑 people_holding_hands
👭 two_women_holding_hands women_holding_hands
👫 man_and_woman_holding_hands woman_and_man_holding_hands couple
👬 two_men_holding_hands men_holding_hands
💏 couplekiss kiss
👩‍❤️‍💋‍👨 woman-kiss-man
👨‍❤️‍💋‍👨 man-kiss-man
👩‍❤️‍💋‍👩 woman-kiss-woman
💑 couple_with_heart
👩‍❤️‍👨 woman-heart-man couple
👨‍❤️‍👨 man-heart-man couple
👩‍❤️‍👩 woman-heart-woman couple
👨‍👩‍👦 man-woman-boy family
👨‍👩‍👧 man-woman-girl family
👨‍👩‍👧‍👦 man-woman-girl-boy family
👨‍👩‍👦‍👦 man-woman-boy-boy family
👨‍👩‍👧‍👧 man-woman-girl-girl family
👨‍👨‍👦 man-man-boy family
👨‍👨‍👧 man-man-girl family
👨‍👨‍👧‍👦 man-man-girl-boy family
👨‍👨‍👦‍👦 man-man-boy-boy family
👨‍👨‍👧‍👧 man-man-girl-girl family
👩‍👩‍👦 woman-woman-boy family
👩‍👩‍👧 woman-woman-girl family
👩‍👩‍👧‍👦 woman-woman-girl-boy family
👩‍👩‍👦‍👦 woman-woman-boy-boy family
👩‍👩‍👧‍👧 woman-woman-girl-girl family
👨‍👦 man-boy family
👨‍👦‍👦 man-boy-boy family
👨‍👧 man-girl family
👨‍👧‍👦 man-girl-boy family
👨‍👧‍👧 man-girl-girl family
👩‍👦 woman-boy family
👩‍👦‍👦 woman-boy-boy family
👩‍👧 woman-girl family
👩‍👧‍👦 woman-girl-boy family
👩‍👧‍👧 woman-girl-girl family
🗣️ speaking_head_in_silhouette
👤 bust_in_silhouette
👥 busts_in_silhouette
🫂 people_hugging
👪 family
🧑‍🧑‍🧒 family_adult_adult_child
🧑‍🧑‍🧒‍🧒 family_adult_adult_child_child
🧑‍🧒 family_adult_child
🧑‍🧒‍🧒 family_adult_child_child
👣 footprints
🫆 fingerprint
🐵 monkey_face
🐒 monkey
🦍 gorilla
🦧 orangutan
🐶 dog face
🐕 dog2 dog
🦮 guide_dog
🐕‍🦺 service_dog
🐩 poodle
🐺 wolf face
🦊 fox_face
🦝 raccoon
🐱 cat face
🐈 cat2 cat
🐈‍⬛ black_cat
🦁 lion_face
🐯 tiger face
🐅 tiger2 tiger
🐆 leopard
🐴 horse face
🫎 moose
🫏 donkey
🐎 racehorse horse
🦄 unicorn_face
🦓 zebra_face
🦌 deer
🦬 bison
🐮 cow face
🐂 ox
🐃 water_buffalo
🐄 cow2 cow
🐷 pig face
🐖 pig2 pig
🐗 boar
🐽 pig_nose
🐏 ram
🐑 sheep
🐐 goat
🐪 dromedary_camel
🐫 camel bactrian
🦙 llama
🦒 giraffe_face
🐘 elephant
🦣 mammoth
🦏 rhinoceros
🦛 hippopotamus
🐭 mouse face
🐁 mouse2 mouse
🐀 rat
🐹 hamster face
🐰 rabbit face
🐇 rabbit2 rabbit
🐿️ chipmunk
🦫 beaver
🦔 hedgehog
🦇 bat
🐻 bear face
🐻‍❄️ polar_bear
🐨 koala
🐼 panda_face
🦥 sloth
🦦 otter
🦨 skunk
🦘 kangaroo
🦡 badger
🐾 feet paw_prints
🦃 turkey
🐔 chicken
🐓 rooster
🐣 hatching_chick
🐤 baby_chick
🐥 hatched_chick front-facing baby
🐦 bird
🐧 penguin
🕊️ dove_of_peace
🦅 eagle
🦆 duck
🦢 swan
🦉 owl
🦤 dodo
🪶 feather
🦩 flamingo
🦚 peacock
🦜 parrot
🪽 wing
🐦‍⬛ black_bird
🪿 goose
🐦‍🔥 phoenix
🐸 frog face
🐊 crocodile
🐢 turtle
🦎 lizard
🐍 snake
🐲 dragon_face
🐉 dragon
🦕 sauropod
🦖 t-rex
🐳 whale spouting
🐋 whale2 whale
🐬 dolphin flipper
🦭 seal
🐟 fish
🐠 tropical_fish
🐡 blowfish
🦈 shark
🐙 octopus
🐚 shell spiral
🪸 coral
🪼 jellyfish
🦀 crab
🦞 lobster
🦐 shrimp
🦑 squid
🦪 oyster
🐌 snail
🦋 butterfly
🐛 bug
🐜 ant
🐝 bee honeybee
🪲 beetle
🐞 ladybug lady_beetle
🦗 cricket
🪳 cockroach
🕷️ spider
🕸️ spider_web
🦂 scorpion
🦟 mosquito
🪰 fly
🪱 worm
🦠 microbe
💐 bouquet
🌸 cherry_blossom
💮 white_flower
🪷 lotus
🏵️ rosette
🌹 rose
🥀 wilted_flower
🌺 hibiscus
🌻 sunflower
🌼 blossom
🌷 tulip
🪻 hyacinth
🌱 seedling
🪴 potted_plant
🌲 evergreen_tree
🌳 deciduous_tree
🌴 palm_tree
🌵 cactus
🌾 ear_of_rice
🌿 herb
☘️ shamrock
🍀 four_leaf_clover
🍁 maple_leaf
🍂 fallen_leaf
🍃 leaves leaf fluttering wind
🪹 empty_nest
🪺 nest_with_eggs
🍄 mushroom
🪾 leafless_tree
🍇 grapes
🍈 melon
🍉 watermelon
🍊 tangerine
🍋 lemon
🍋‍🟩 lime
🍌 banana
🍍 pineapple
🥭 mango
🍎 apple red
🍏 green_apple
🍐 pear
🍑 peach
🍒 cherries
🍓 strawberry
🫐 blueberries
🥝 kiwifruit
🍅 tomato
🫒 olive
🥥 coconut
🥑 avocado
🍆 eggplant aubergine
🥔 potato
🥕 carrot
🌽 corn ear maize
🌶️ hot_pepper
🫑 bell_pepper
🥒 cucumber
🥬 leafy_green
🥦 broccoli
🧄 garlic
🧅 onion
🥜 peanuts
🫘 beans
🌰 chestnut
🫚 ginger_root
🫛 pea_pod
🍄‍🟫 brown_mushroom
🫜 root_vegetable
🍞 bread
🥐 croissant
🥖 baguette_bread
🫓 flatbread
🥨 pretzel
🥯 bagel
🥞 pancakes
🧇 waffle
🧀 cheese_wedge
🍖 meat_on_bone
🍗 poultry_leg
🥩 cut_of_meat
🥓 bacon
🍔 hamburger
🍟 fries french
🍕 pizza slice
🌭 hotdog hot dog
🥪 sandwich
🌮 taco
🌯 burrito
🫔 tamale
🥙 stuffed_flatbread
🧆 falafel
🥚 egg
🍳 fried_egg cooking
🥘 shallow_pan_of_food
🍲 stew pot food
🫕 fondue
🥣 bowl_with_spoon
🥗 green_salad
🍿 popcorn
🧈 butter
🧂 salt shaker
🥫 canned_food
🍱 bento box
🍘 rice_cracker
🍙 rice_ball
🍚 rice cooked
🍛 curry rice
🍜 ramen steaming bowl
🍝 spaghetti
🍠 sweet_potato roasted
🍢 oden
🍣 sushi
🍤 fried_shrimp
🍥 fish_cake swirl design
🥮 moon_cake
🍡 dango
🥟 dumpling
🥠 fortune_cookie
🥡 takeout_box
🍦 icecream soft ice cream
🍧 shaved_ice
🍨 ice_cream
🍩 doughnut
🍪 cookie
🎂 birthday cake
🍰 cake shortcake
🧁 cupcake
🥧 pie
🍫 chocolate_bar
🍬 candy
🍭 lollipop
🍮 custard
🍯 honey_pot
🍼 baby_bottle
🥛 glass_of_milk
☕ coffee hot beverage
🫖 teapot
🍵 tea teacup without handle
🍶 sake bottle cup
🍾 champagne bottle popping cork
🍷 wine_glass
🍸 cocktail glass
🍹 tropical_drink
🍺 beer mug
🍻 beers clinking beer mugs
🥂 clinking_glasses
🥃 tumbler_glass
🫗 pouring_liquid
🥤 cup_with_straw
🧋 bubble_tea
🧃 beverage_box
🧉 mate_drink
🧊 ice_cube
🥢 chopsticks
🍽️ knife_fork_plate
🍴 fork_and_knife
🥄 spoon
🔪 hocho knife
🫙 jar
🏺 amphora
🌍 earth_africa globe europe-africa
🌎 earth_americas globe
🌏 earth_asia globe asia-australia
🌐 globe_with_meridians
🗺️ world_map
🗾 japan silhouette
🧭 compass
🏔️ snow_capped_mountain snow-capped
⛰️ mountain
🌋 volcano
🗻 mount_fuji
🏕️ camping
🏖️ beach_with_umbrella
🏜️ desert
🏝️ desert_island
🏞️ national_park
🏟️ stadium
🏛️ classical_building
🏗️ building_construction
🧱 bricks brick
🪨 rock
🪵 wood
🛖 hut
🏘️ house_buildings houses
🏚️ derelict_house_building
🏠 house building
🏡 house_with_garden
🏢 office building
🏣 post_office japanese
🏤 european_post_office
🏥 hospital
🏦 bank
🏨 hotel
🏩 love_hotel
🏪 convenience_store
🏫 school
🏬 department_store
🏭 factory
🏯 japanese_castle
🏰 european_castle
💒 wedding
🗼 tokyo_tower
🗽 statue_of_liberty
⛪ church
🕌 mosque
🛕 hindu_temple
🕍 synagogue
⛩️ shinto_shrine
🕋 kaaba
⛲ fountain
⛺ tent
🌁 foggy
🌃 night_with_stars
🏙️ cityscape
🌄 sunrise_over_mountains
🌅 sunrise
🌆 city_sunset cityscape at dusk
🌇 city_sunrise sunset over buildings
🌉 bridge_at_night
♨️ hotsprings hot springs
🎠 carousel_horse
🛝 playground_slide
🎡 ferris_wheel
🎢 roller_coaster
💈 barber pole
🎪 circus_tent
🚂 steam_locomotive
🚃 railway_car
🚄 bullettrain_side high-speed train
🚅 bullettrain_front high-speed train bullet nose
🚆 train2 train
🚇 metro
🚈 light_rail
🚉 station
🚊 tram
🚝 monorail
🚞 mountain_railway
🚋 train tram car
🚌 bus
🚍 oncoming_bus
🚎 trolleybus
🚐 minibus
🚑 ambulance
🚒 fire_engine
🚓 police_car
🚔 oncoming_police_car
🚕 taxi
🚖 oncoming_taxi
🚗 car red_car automobile
🚘 oncoming_automobile
🚙 blue_car recreational vehicle
🛻 pickup_truck
🚚 truck delivery
🚛 articulated_lorry
🚜 tractor
🏎️ racing_car
🏍️ racing_motorcycle
🛵 motor_scooter
🦽 manual_wheelchair
🦼 motorized_wheelchair
🛺 auto_rickshaw
🚲 bike bicycle
🛴 scooter
🛹 skateboard
🛼 roller_skate
🚏 busstop bus stop
🛣️ motorway
🛤️ railway_track
🛢️ oil_drum
⛽ fuelpump fuel pump
🛞 wheel
🚨 rotating_light police cars revolving
🚥 traffic_light horizontal
🚦 vertical_traffic_light
🛑 octagonal_sign
🚧 construction sign
⚓ anchor
🛟 ring_buoy
⛵ boat sailboat
🛶 canoe
🚤 speedboat
🛳️ passenger_ship
⛴️ ferry
🛥️ motor_boat
🚢 ship
✈️ airplane
🛩️ small_airplane
🛫 airplane_departure
🛬 airplane_arriving
🪂 parachute
💺 seat
🚁 helicopter
🚟 suspension_railway
🚠 mountain_cableway
🚡 aerial_tramway
🛰️ satellite
🚀 rocket
🛸 flying_saucer
🛎️ bellhop_bell
🧳 luggage
⌛ hourglass
⏳ hourglass_flowing_sand
⌚ watch
⏰ alarm_clock
⏱️ stopwatch
⏲️ timer_clock
🕰️ mantelpiece_clock
🕛 clock12 clock face twelve oclock
🕧 clock1230 clock face twelve-thirty
🕐 clock1 clock face one oclock
🕜 clock130 clock face one-thirty
🕑 clock2 clock face two oclock
🕝 clock230 clock face two-thirty
🕒 clock3 clock face three oclock
🕞 clock330 clock face three-thirty
🕓 clock4 clock face four oclock
🕟 clock430 clock face four-thirty
🕔 clock5 clock face five oclock
🕠 clock530 clock face five-thirty
🕕 clock6 clock face six oclock
🕡 clock630 clock face six-thirty
🕖 clock7 clock face seven oclock
🕢 clock730 clock face seven-thirty
🕗 clock8 clock face eight oclock
🕣 clock830 clock face eight-thirty
🕘 clock9 clock face nine oclock
🕤 clock930 clock face nine-thirty
🕙 clock10 clock face ten oclock
🕥 clock1030 clock face ten-thirty
🕚 clock11 clock face eleven oclock
🕦 clock1130 clock face eleven-thirty
🌑 new_moon symbol
🌒 waxing_crescent_moon symbol
🌓 first_quarter_moon symbol
🌔 moon waxing_gibbous_moon symbol
🌕 full_moon symbol
🌖 waning_gibbous_moon symbol
🌗 last_quarter_moon symbol
🌘 waning_crescent_moon symbol
🌙 crescent_moon
🌚 new_moon_with_face
🌛 first_quarter_moon_with_face
🌜 last_quarter_moon_with_face
🌡️ thermometer
☀️ sunny black sun rays
🌝 full_moon_with_face
🌞 sun_with_face
🪐 ringed_planet
⭐ star white medium
🌟 star2 glowing star
🌠 stars shooting star
🌌 milky_way
☁️ cloud
⛅ partly_sunny sun behind cloud
⛈️ thunder_cloud_and_rain lightning
🌤️ mostly_sunny sun_small_cloud behind
🌥️ barely_sunny sun_behind_cloud large
🌦️ partly_sunny_rain sun_behind_rain_cloud
🌧️ rain_cloud
🌨️ snow_cloud
🌩️ lightning lightning_cloud
🌪️ tornado tornado_cloud
🌫️ fog
🌬️ wind_blowing_face
🌀 cyclone
🌈 rainbow
🌂 closed_umbrella
☂️ umbrella
☔ umbrella_with_rain_drops
⛱️ umbrella_on_ground
⚡ zap high voltage sign
❄️ snowflake
☃️ snowman
⛄ snowman_without_snow
☄️ comet
🔥 fire
💧 droplet
🌊 ocean water wave
🎃 jack_o_lantern jack-o-lantern
🎄 christmas_tree
🎆 fireworks
🎇 sparkler firework
🧨 firecracker
✨ sparkles
🎈 balloon
🎉 tada party popper
🎊 confetti_ball
🎋 tanabata_tree
🎍 bamboo pine decoration
🎎 dolls japanese
🎏 flags carp streamer
🎐 wind_chime
🎑 rice_scene moon viewing ceremony
🧧 red_envelope gift
🎀 ribbon
🎁 gift wrapped present
🎗️ reminder_ribbon
🎟️ admission_tickets
🎫 ticket
🎖️ medal military
🏆 trophy
🏅 sports_medal
🥇 first_place_medal
🥈 second_place_medal
🥉 third_place_medal
⚽ soccer ball
⚾ baseball
🥎 softball
🏀 basketball hoop
🏐 volleyball
🏈 football american
🏉 rugby_football
🎾 tennis racquet ball
🥏 flying_disc
🎳 bowling
🏏 cricket_bat_and_ball
🏑 field_hockey_stick_and_ball
🏒 ice_hockey_stick_and_puck
🥍 lacrosse stick ball
🏓 table_tennis_paddle_and_ball
🏸 badminton_racquet_and_shuttlecock
🥊 boxing_glove
🥋 martial_arts_uniform
🥅 goal_net
⛳ golf flag hole
⛸️ ice_skate
🎣 fishing_pole_and_fish
🤿 diving_mask
🎽 running_shirt_with_sash
🎿 ski boot
🛷 sled
🥌 curling_stone
🎯 dart direct hit
🪀 yo-yo
🪁 kite
🔫 gun pistol
🎱 8ball billiards
🔮 crystal_ball
🪄 magic_wand
🎮 video_game
🕹️ joystick
🎰 slot_machine
🎲 game_die
🧩 jigsaw puzzle piece
🧸 teddy_bear
🪅 pinata
🪩 mirror_ball
🪆 nesting_dolls
♠️ spades black spade suit
♥️ hearts black heart suit
♦️ diamonds black diamond suit
♣️ clubs black club suit
♟️ chess_pawn
🃏 black_joker playing card
🀄 mahjong tile red dragon
🎴 flower_playing_cards
🎭 performing_arts
🖼️ frame_with_picture framed
🎨 art artist palette
🧵 thread spool
🪡 sewing_needle
🧶 yarn ball
🪢 knot
👓 eyeglasses
🕶️ dark_sunglasses
🥽 goggles
🥼 lab_coat
🦺 safety_vest
👔 necktie
👕 shirt tshirt t-shirt
👖 jeans
🧣 scarf
🧤 gloves
🧥 coat
🧦 socks
👗 dress
👘 kimono
🥻 sari
🩱 one-piece_swimsuit one-piece
🩲 briefs
🩳 shorts
👙 bikini
👚 womans_clothes
🪭 folding_hand_fan
👛 purse
👜 handbag
👝 pouch
🛍️ shopping_bags
🎒 school_satchel
🩴 thong_sandal
👞 mans_shoe shoe
👟 athletic_shoe
🥾 hiking_boot
🥿 womans_flat_shoe
👠 high_heel high-heeled shoe
👡 sandal womans
🩰 ballet_shoes
👢 boot womans boots
🪮 hair_pick
👑 crown
👒 womans_hat
🎩 tophat top hat
🎓 mortar_board graduation cap
🧢 billed_cap
🪖 military_helmet
⛑️ helmet_with_white_cross rescue worker s
📿 prayer_beads
💄 lipstick
💍 ring
💎 gem stone
🔇 mute speaker cancellation stroke
🔈 speaker
🔉 sound speaker one wave
🔊 loud_sound speaker three waves
📢 loudspeaker public address
📣 mega cheering megaphone
📯 postal_horn
🔔 bell
🔕 no_bell cancellation stroke
🎼 musical_score
🎵 musical_note
🎶 notes multiple musical
🎙️ studio_microphone
🎚️ level_slider
🎛️ control_knobs
🎤 microphone
🎧 headphones headphone
📻 radio
🎷 saxophone
🪗 accordion
🎸 guitar
🎹 musical_keyboard
🎺 trumpet
🎻 violin
🪕 banjo
🥁 drum_with_drumsticks
🪘 long_drum
🪇 maracas
🪈 flute
🪉 harp
📱 iphone mobile phone
📲 calling mobile phone rightwards arrow at left
☎️ phone telephone black
📞 telephone_receiver
📟 pager
📠 fax machine
🔋 battery
🪫 low_battery
🔌 electric_plug
💻 computer personal
🖥️ desktop_computer
🖨️ printer
⌨️ keyboard
🖱️ three_button_mouse computer
🖲️ trackball
💽 minidisc
💾 floppy_disk
💿 cd optical disc
📀 dvd
🧮 abacus
🎥 movie_camera
🎞️ film_frames
📽️ film_projector
🎬 clapper board
📺 tv television
📷 camera
📸 camera_with_flash
📹 video_camera
📼 vhs videocassette
🔍 mag left-pointing magnifying glass
🔎 mag_right right-pointing magnifying glass
🕯️ candle
💡 bulb electric light
🔦 flashlight electric torch
🏮 izakaya_lantern lantern
🪔 diya_lamp
📔 notebook_with_decorative_cover
📕 closed_book
📖 book open_book
📗 green_book
📘 blue_book
📙 orange_book
📚 books
📓 notebook
📒 ledger
📃 page_with_curl
📜 scroll
📄 page_facing_up
📰 newspaper
🗞️ rolled_up_newspaper rolled-up
📑 bookmark_tabs
🔖 bookmark
🏷️ label
💰 moneybag money bag
🪙 coin
💴 yen banknote sign
💵 dollar banknote sign
💶 euro banknote sign
💷 pound banknote sign
💸 money_with_wings
💳 credit_card
🧾 receipt
💹 chart upwards trend yen sign
✉️ email envelope
📧 e-mail symbol
📨 incoming_envelope
📩 envelope_with_arrow downwards above
📤 outbox_tray
📥 inbox_tray
📦 package
📫 mailbox closed raised flag
📪 mailbox_closed lowered flag
📬 mailbox_with_mail open raised flag
📭 mailbox_with_no_mail open lowered flag
📮 postbox
🗳️ ballot_box_with_ballot
✏️ pencil2 pencil
✒️ black_nib
🖋️ lower_left_fountain_pen
🖊️ lower_left_ballpoint_pen
🖌️ lower_left_paintbrush
🖍️ lower_left_crayon
📝 memo pencil
💼 briefcase
📁 file_folder
📂 open_file_folder
🗂️ card_index_dividers
📅 date calendar
📆 calendar tear-off
🗒️ spiral_note_pad notepad
🗓️ spiral_calendar_pad
📇 card_index
📈 chart_with_upwards_trend
📉 chart_with_downwards_trend
📊 bar_chart
📋 clipboard
📌 pushpin
📍 round_pushpin
📎 paperclip
🖇️ linked_paperclips
📏 straight_ruler
📐 triangular_ruler
✂️ scissors black
🗃️ card_file_box
🗄️ file_cabinet
🗑️ wastebasket
🔒 lock
🔓 unlock open lock
🔏 lock_with_ink_pen
🔐 closed_lock_with_key
🔑 key
🗝️ old_key
🔨 hammer
🪓 axe
⛏️ pick
⚒️ hammer_and_pick
🛠️ hammer_and_wrench
🗡️ dagger_knife
⚔️ crossed_swords
💣 bomb
🪃 boomerang
🏹 bow_and_arrow
🛡️ shield
🪚 carpentry_saw
🔧 wrench
🪛 screwdriver
🔩 nut_and_bolt
⚙️ gear
🗜️ compression clamp
⚖️ scales balance scale
🦯 probing_cane
🔗 link symbol
⛓️‍💥 broken_chain
⛓️ chains
🪝 hook
🧰 toolbox
🧲 magnet
🪜 ladder
🪏 shovel
⚗️ alembic
🧪 test_tube
🧫 petri_dish
🧬 dna double helix
🔬 microscope
🔭 telescope
📡 satellite_antenna
💉 syringe
🩸 drop_of_blood
💊 pill
🩹 adhesive_bandage
🩼 crutch
🩺 stethoscope
🩻 x-ray
🚪 door
🛗 elevator
🪞 mirror
🪟 window
🛏️ bed
🛋️ couch_and_lamp
🪑 chair
🚽 toilet
🪠 plunger
🚿 shower
🛁 bathtub
🪤 mouse_trap
🪒 razor
🧴 lotion_bottle
🧷 safety_pin
🧹 broom
🧺 basket
🧻 roll_of_paper
🪣 bucket
🧼 soap bar
🫧 bubbles
🪥 toothbrush
🧽 sponge
🧯 fire_extinguisher
🛒 shopping_trolley
🚬 smoking symbol
⚰️ coffin
🪦 headstone
⚱️ funeral_urn
🧿 nazar_amulet
🪬 hamsa
🗿 moyai
🪧 placard
🪪 identification_card
🏧 atm automated teller machine
🚮 put_litter_in_its_place symbol
🚰 potable_water symbol
♿ wheelchair symbol
🚹 mens symbol
🚺 womens symbol
🚻 restroom
🚼 baby_symbol
🚾 wc water closet
🛂 passport_control
🛃 customs
🛄 baggage_claim
🛅 left_luggage
⚠️ warning sign
🚸 children_crossing
⛔ no_entry
🚫 no_entry_sign
🚳 no_bicycles
🚭 no_smoking symbol
🚯 do_not_litter symbol
🚱 non-potable_water non-potable symbol
🚷 no_pedestrians
📵 no_mobile_phones
🔞 underage no one under eighteen symbol
☢️ radioactive_sign
☣️ biohazard_sign
⬆️ arrow_up upwards black
↗️ arrow_upper_right north east
➡️ arrow_right black rightwards
↘️ arrow_lower_right south east
⬇️ arrow_down downwards black
↙️ arrow_lower_left south west
⬅️ arrow_left leftwards black
↖️ arrow_upper_left north west
↕️ arrow_up_down
↔️ left_right_arrow
↩️ leftwards_arrow_with_hook
↪️ arrow_right_hook rightwards
⤴️ arrow_heading_up pointing rightwards then curving upwards
⤵️ arrow_heading_down pointing rightwards then curving downwards
🔃 arrows_clockwise downwards upwards open circle
🔄 arrows_counterclockwise anticlockwise downwards upwards open circle
🔙 back leftwards arrow above
🔚 end leftwards arrow above
🔛 on exclamation mark left right arrow above
🔜 soon rightwards arrow above
🔝 top upwards arrow above
🛐 place_of_worship
⚛️ atom_symbol
🕉️ om_symbol
✡️ star_of_david
☸️ wheel_of_dharma
☯️ yin_yang
✝️ latin_cross
☦️ orthodox_cross
☪️ star_and_crescent
☮️ peace_symbol
🕎 menorah_with_nine_branches
🔯 six_pointed_star middle dot
🪯 khanda
♈ aries
♉ taurus
♊ gemini
♋ cancer
♌ leo
♍ virgo
♎ libra
♏ scorpius
♐ sagittarius
♑ capricorn
♒ aquarius
♓ pisces
⛎ ophiuchus
🔀 twisted_rightwards_arrows
🔁 repeat clockwise rightwards leftwards open circle arrows
🔂 repeat_one clockwise rightwards leftwards open circle arrows circled overlay
▶️ arrow_forward black right-pointing triangle
⏩ fast_forward black right-pointing double triangle
⏭️ black_right_pointing_double_triangle_with_vertical_bar next track button
⏯️ black_right_pointing_triangle_with_double_vertical_bar play pause button
◀️ arrow_backward black left-pointing triangle
⏪ rewind black left-pointing double triangle
⏮️ black_left_pointing_double_triangle_with_vertical_bar last track button
🔼 arrow_up_small up-pointing red triangle
⏫ arrow_double_up black up-pointing triangle
🔽 arrow_down_small down-pointing red triangle
⏬ arrow_double_down black down-pointing triangle
⏸️ double_vertical_bar pause button
⏹️ black_square_for_stop button
⏺️ black_circle_for_record button
⏏️ eject button
🎦 cinema
🔅 low_brightness symbol
🔆 high_brightness symbol
📶 signal_strength antenna bars
🛜 wireless
📳 vibration_mode
📴 mobile_phone_off
♀️ female_sign
♂️ male_sign
⚧️ transgender_symbol
✖️ heavy_multiplication_x
➕ heavy_plus_sign
➖ heavy_minus_sign
➗ heavy_division_sign
🟰 heavy_equals_sign
♾️ infinity
‼️ bangbang double exclamation mark
⁉️ interrobang exclamation question mark
❓ question black mark ornament
❔ grey_question white mark ornament
❕ grey_exclamation white mark ornament
❗ exclamation heavy_exclamation_mark symbol
〰️ wavy_dash
💱 currency_exchange
💲 heavy_dollar_sign
⚕️ medical_symbol staff_of_aesculapius
♻️ recycle black universal recycling symbol
⚜️ fleur_de_lis fleur-de-lis
🔱 trident emblem
📛 name_badge
🔰 beginner japanese symbol
⭕ o heavy large circle
✅ white_check_mark heavy
☑️ ballot_box_with_check
✔️ heavy_check_mark
❌ x cross mark
❎ negative_squared_cross_mark
➰ curly_loop
➿ loop double curly
〽️ part_alternation_mark
✳️ eight_spoked_asterisk
✴️ eight_pointed_black_star
❇️ sparkle
©️ copyright sign
®️ registered sign
™️ tm trade mark sign
🫟 splatter
#️⃣ hash key
*️⃣ keycap_star
0️⃣ zero keycap 0
1️⃣ one keycap 1
2️⃣ two keycap 2
3️⃣ three keycap 3
4️⃣ four keycap 4
5️⃣ five keycap 5
6️⃣ six keycap 6
7️⃣ seven keycap 7
8️⃣ eight keycap 8
9️⃣ nine keycap 9
🔟 keycap_ten
🔠 capital_abcd input symbol latin letters
🔡 abcd input symbol latin small letters
🔢 1234 input symbol numbers
🔣 symbols input symbol
🔤 abc input symbol latin letters
🅰️ a negative squared latin capital letter
🆎 ab negative squared
🅱️ b negative squared latin capital letter
🆑 cl squared
🆒 cool squared
🆓 free squared
ℹ️ information_source
🆔 id squared
Ⓜ️ m circled latin capital letter
🆕 new squared
🆖 ng squared
🅾️ o2 negative squared latin capital letter o
🆗 ok squared
🅿️ parking negative squared latin capital letter p
🆘 sos squared
🆙 up squared exclamation mark
🆚 vs squared
🈁 koko squared katakana
🈂️ sa squared katakana
🈷️ u6708 squared cjk unified ideograph-6708
🈶 u6709 squared cjk unified ideograph-6709
🈯 u6307 squared cjk unified ideograph-6307
🉐 ideograph_advantage circled
🈹 u5272 squared cjk unified ideograph-5272
🈚 u7121 squared cjk unified ideograph-7121
🈲 u7981 squared cjk unified ideograph-7981
🉑 accept circled ideograph
🈸 u7533 squared cjk unified ideograph-7533
🈴 u5408 squared cjk unified ideograph-5408
🈳 u7a7a squared cjk unified ideograph-7a7a
㊗️ congratulations circled ideograph congratulation
㊙️ secret circled ideograph
🈺 u55b6 squared cjk unified ideograph-55b6
🈵 u6e80 squared cjk unified ideograph-6e80
🔴 red_circle large
🟠 large_orange_circle
🟡 large_yellow_circle
🟢 large_green_circle
🔵 large_blue_circle
🟣 large_purple_circle
🟤 large_brown_circle
⚫ black_circle medium
⚪ white_circle medium
🟥 large_red_square
🟧 large_orange_square
🟨 large_yellow_square
🟩 large_green_square
🟦 large_blue_square
🟪 large_purple_square
🟫 large_brown_square
⬛ black_large_square
⬜ white_large_square
◼️ black_medium_square
◻️ white_medium_square
◾ black_medium_small_square
◽ white_medium_small_square
▪️ black_small_square
▫️ white_small_square
🔶 large_orange_diamond
🔷 large_blue_diamond
🔸 small_orange_diamond
🔹 small_blue_diamond
🔺 small_red_triangle up-pointing
🔻 small_red_triangle_down down-pointing
💠 diamond_shape_with_a_dot_inside
🔘 radio_button
🔳 white_square_button
🔲 black_square_button
🏁 checkered_flag chequered
🚩 triangular_flag_on_post
🎌 crossed_flags
🏴 waving_black_flag
🏳️ waving_white_flag
🏳️‍🌈 rainbow-flag
🏳️‍⚧️ transgender_flag
🏴‍☠️ pirate_flag
🇦🇨 flag-ac ascension island
🇦🇩 flag-ad andorra
🇦🇪 flag-ae united arab emirates
🇦🇫 flag-af afghanistan
🇦🇬 flag-ag antigua barbuda
🇦🇮 flag-ai anguilla
🇦🇱 flag-al albania
🇦🇲 flag-am armenia
🇦🇴 flag-ao angola
🇦🇶 flag-aq antarctica
🇦🇷 flag-ar argentina
🇦🇸 flag-as american samoa
🇦🇹 flag-at austria
🇦🇺 flag-au australia
🇦🇼 flag-aw aruba
🇦🇽 flag-ax land islands
🇦🇿 flag-az azerbaijan
🇧🇦 flag-ba bosnia herzegovina
🇧🇧 flag-bb barbados
🇧🇩 flag-bd bangladesh
🇧🇪 flag-be belgium
🇧🇫 flag-bf burkina faso
🇧🇬 flag-bg bulgaria
🇧🇭 flag-bh bahrain
🇧🇮 flag-bi burundi
🇧🇯 flag-bj benin
🇧🇱 flag-bl st barth lemy
🇧🇲 flag-bm bermuda
🇧🇳 flag-bn brunei
🇧🇴 flag-bo bolivia
🇧🇶 flag-bq caribbean netherlands
🇧🇷 flag-br brazil
🇧🇸 flag-bs bahamas
🇧🇹 flag-bt bhutan
🇧🇻 flag-bv bouvet island
🇧🇼 flag-bw botswana
🇧🇾 flag-by belarus
🇧🇿 flag-bz belize
🇨🇦 flag-ca canada
🇨🇨 flag-cc cocos keeling islands
🇨🇩 flag-cd congo - kinshasa
🇨🇫 flag-cf central african republic
🇨🇬 flag-cg congo - brazzaville
🇨🇭 flag-ch switzerland
🇨🇮 flag-ci c te d ivoire
🇨🇰 flag-ck cook islands
🇨🇱 flag-cl chile
🇨🇲 flag-cm cameroon
🇨🇳 cn flag-cn china
🇨🇴 flag-co colombia
🇨🇵 flag-cp clipperton island
🇨🇶 flag-sark
🇨🇷 flag-cr costa rica
🇨🇺 flag-cu cuba
🇨🇻 flag-cv cape verde
🇨🇼 flag-cw cura ao
🇨🇽 flag-cx christmas island
🇨🇾 flag-cy cyprus
🇨🇿 flag-cz czechia
🇩🇪 de flag-de germany
🇩🇬 flag-dg diego garcia
🇩🇯 flag-dj djibouti
🇩🇰 flag-dk denmark
🇩🇲 flag-dm dominica
🇩🇴 flag-do dominican republic
🇩🇿 flag-dz algeria
🇪🇦 flag-ea ceuta melilla
🇪🇨 flag-ec ecuador
🇪🇪 flag-ee estonia
🇪🇬 flag-eg egypt
🇪🇭 flag-eh western sahara
🇪🇷 flag-er eritrea
🇪🇸 es flag-es spain
🇪🇹 flag-et ethiopia
🇪🇺 flag-eu european union
🇫🇮 flag-fi finland
🇫🇯 flag-fj fiji
🇫🇰 flag-fk falkland islands
🇫🇲 flag-fm micronesia
🇫🇴 flag-fo faroe islands
🇫🇷 fr flag-fr france
🇬🇦 flag-ga gabon
🇬🇧 gb uk flag-gb united kingdom
🇬🇩 flag-gd grenada
🇬🇪 flag-ge georgia
🇬🇫 flag-gf french guiana
🇬🇬 flag-gg guernsey
🇬🇭 flag-gh ghana
🇬🇮 flag-gi gibraltar
🇬🇱 flag-gl greenland
🇬🇲 flag-gm gambia
🇬🇳 flag-gn guinea
🇬🇵 flag-gp guadeloupe
🇬🇶 flag-gq equatorial guinea
🇬🇷 flag-gr greece
🇬🇸 flag-gs south georgia sandwich islands
🇬🇹 flag-gt guatemala
🇬🇺 flag-gu guam
🇬🇼 flag-gw guinea-bissau
🇬🇾 flag-gy guyana
🇭🇰 flag-hk hong kong sar china
🇭🇲 flag-hm heard mcdonald islands
🇭🇳 flag-hn honduras
🇭🇷 flag-hr croatia
🇭🇹 flag-ht haiti
🇭🇺 flag-hu hungary
🇮🇨 flag-ic canary islands
🇮🇩 flag-id indonesia
🇮🇪 flag-ie ireland
🇮🇱 flag-il israel
🇮🇲 flag-im isle man
🇮🇳 flag-in india
🇮🇴 flag-io british indian ocean territory
🇮🇶 flag-iq iraq
🇮🇷 flag-ir iran
🇮🇸 flag-is iceland
🇮🇹 it flag-it italy
🇯🇪 flag-je jersey
🇯🇲 flag-jm jamaica
🇯🇴 flag-jo jordan
🇯🇵 jp flag-jp japan
🇰🇪 flag-ke kenya
🇰🇬 flag-kg kyrgyzstan
🇰🇭 flag-kh cambodia
🇰🇮 flag-ki kiribati
🇰🇲 flag-km comoros
🇰🇳 flag-kn st kitts nevis
🇰🇵 flag-kp north korea
🇰🇷 kr flag-kr south korea
🇰🇼 flag-kw kuwait
🇰🇾 flag-ky cayman islands
🇰🇿 flag-kz kazakhstan
🇱🇦 flag-la laos
🇱🇧 flag-lb lebanon
🇱🇨 flag-lc st lucia
🇱🇮 flag-li liechtenstein
🇱🇰 flag-lk sri lanka
🇱🇷 flag-lr liberia
🇱🇸 flag-ls lesotho
🇱🇹 flag-lt lithuania
🇱🇺 flag-lu luxembourg
🇱🇻 flag-lv latvia
🇱🇾 flag-ly libya
🇲🇦 flag-ma morocco
🇲🇨 flag-mc monaco
🇲🇩 flag-md moldova
🇲🇪 flag-me montenegro
🇲🇫 flag-mf st martin
🇲🇬 flag-mg madagascar
🇲🇭 flag-mh marshall islands
🇲🇰 flag-mk north macedonia
🇲🇱 flag-ml mali
🇲🇲 flag-mm myanmar burma
🇲🇳 flag-mn mongolia
🇲🇴 flag-mo macao sar china
🇲🇵 flag-mp northern mariana islands
🇲🇶 flag-mq martinique
🇲🇷 flag-mr mauritania
🇲🇸 flag-ms montserrat
🇲🇹 flag-mt malta
🇲🇺 flag-mu mauritius
🇲🇻 flag-mv maldives
🇲🇼 flag-mw malawi
🇲🇽 flag-mx mexico
🇲🇾 flag-my malaysia
🇲🇿 flag-mz mozambique
🇳🇦 flag-na namibia
🇳🇨 flag-nc new caledonia
🇳🇪 flag-ne niger
🇳🇫 flag-nf norfolk island
🇳🇬 flag-ng nigeria
🇳🇮 flag-ni nicaragua
🇳🇱 flag-nl netherlands
🇳🇴 flag-no norway
🇳🇵 flag-np nepal
🇳🇷 flag-nr nauru
🇳🇺 flag-nu niue
🇳🇿 flag-nz new zealand
🇴🇲 flag-om oman
🇵🇦 flag-pa panama
🇵🇪 flag-pe peru
🇵🇫 flag-pf french polynesia
🇵🇬 flag-pg papua new guinea
🇵🇭 flag-ph philippines
🇵🇰 flag-pk pakistan
🇵🇱 flag-pl poland
🇵🇲 flag-pm st pierre miquelon
🇵🇳 flag-pn pitcairn islands
🇵🇷 flag-pr puerto rico
🇵🇸 flag-ps palestinian territories
🇵🇹 flag-pt portugal
🇵🇼 flag-pw palau
🇵🇾 flag-py paraguay
🇶🇦 flag-qa qatar
🇷🇪 flag-re r union
🇷🇴 flag-ro romania
🇷🇸 flag-rs serbia
🇷🇺 ru flag-ru russia
🇷🇼 flag-rw rwanda
🇸🇦 flag-sa saudi arabia
🇸🇧 flag-sb solomon islands
🇸🇨 flag-sc seychelles
🇸🇩 flag-sd sudan
🇸🇪 flag-se sweden
🇸🇬 flag-sg singapore
🇸🇭 flag-sh st helena
🇸🇮 flag-si slovenia
🇸🇯 flag-sj svalbard jan mayen
🇸🇰 flag-sk slovakia
🇸🇱 flag-sl sierra leone
🇸🇲 flag-sm san marino
🇸🇳 flag-sn senegal
🇸🇴 flag-so somalia
🇸🇷 flag-sr suriname
🇸🇸 flag-ss south sudan
🇸🇹 flag-st s o tom pr ncipe
🇸🇻 flag-sv el salvador
🇸🇽 flag-sx sint maarten
🇸🇾 flag-sy syria
🇸🇿 flag-sz eswatini
🇹🇦 flag-ta tristan da cunha
🇹🇨 flag-tc turks caicos islands
🇹🇩 flag-td chad
🇹🇫 flag-tf french southern territories
🇹🇬 flag-tg togo
🇹🇭 flag-th thailand
🇹🇯 flag-tj tajikistan
🇹🇰 flag-tk tokelau
🇹🇱 flag-tl timor-leste
🇹🇲 flag-tm turkmenistan
🇹🇳 flag-tn tunisia
🇹🇴 flag-to tonga
🇹🇷 flag-tr t rkiye
🇹🇹 flag-tt trinidad tobago
🇹🇻 flag-tv tuvalu
🇹🇼 flag-tw taiwan
🇹🇿 flag-tz tanzania
🇺🇦 flag-ua ukraine
🇺🇬 flag-ug uganda
🇺🇲 flag-um u s outlying islands
🇺🇳 flag-un united nations
🇺🇸 us flag-us united states
🇺🇾 flag-uy uruguay
🇺🇿 flag-uz uzbekistan
🇻🇦 flag-va vatican city
🇻🇨 flag-vc st vincent grenadines
🇻🇪 flag-ve venezuela
🇻🇬 flag-vg british virgin islands
🇻🇮 flag-vi u s virgin islands
🇻🇳 flag-vn vietnam
🇻🇺 flag-vu vanuatu
🇼🇫 flag-wf wallis futuna
🇼🇸 flag-ws samoa
🇽🇰 flag-xk kosovo
🇾🇪 flag-ye yemen
🇾🇹 flag-yt mayotte
🇿🇦 flag-za south africa
🇿🇲 flag-zm zambia
🇿🇼 flag-zw zimbabwe
🏴󠁧󠁢󠁥󠁮󠁧󠁿 flag-england
🏴󠁧󠁢󠁳󠁣󠁴󠁿 flag-scotland
🏴󠁧󠁢󠁷󠁬󠁳󠁿 flag-wales`),au.map(e=>{let{rank:n,nameRank:r}=Eie(e,t);return{entry:e,rank:n,nameRank:r,centrality:Die(e,t)}}).filter(({rank:e})=>e<9).sort((e,t)=>e.rank-t.rank||e.nameRank-t.nameRank||e.centrality-t.centrality).slice(0,50).map(({entry:e})=>e)):[]},su=(e,t)=>/^\s/.test(t)?e:`${e} `,cu=e=>e.match(Cie)?.groups?.query,lu=({anchorRect:e,listMaxHeight:t,viewport:n,rtl:r,listWidth:i=280})=>{let{width:a,height:o}=n,s=o-e.bottom,c=e.top,l=s<t+8&&c>s,u=r?e.right-i:e.left;return{top:l?void 0:`${Math.round(e.bottom+4)}px`,bottom:l?`${Math.round(o-e.top+4)}px`:void 0,left:`${Math.round(Math.max(8,Math.min(u,a-i-8)))}px`,maxHeight:`${Math.round(Math.min(t,(l?c:s)-4-8))}px`}},kie=B(`<div role="option" class="option svelte-4w35sy" tabindex="-1"><span role="none" class="emoji svelte-4w35sy"> </span> <span role="none" class="name svelte-4w35sy"> </span></div>`),Aie=B(`<div role="listbox" class="sui emoji-suggestions svelte-4w35sy" popover="manual"></div>`),jie={hash:`svelte-4w35sy`,code:`.emoji-suggestions.svelte-4w35sy {position:fixed;inset:auto;z-index:1000;display:flex;flex-direction:column;overflow-y:auto;margin:0;border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);width:280px;color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);-webkit-user-select:none;user-select:none;}.option.svelte-4w35sy {flex:none;display:flex;align-items:center;gap:8px;border-radius:var(--sui-option-border-radius);padding:var(--sui-option-padding);min-height:var(--sui-option-height);cursor:default;}.option[aria-selected=true].svelte-4w35sy {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.option.svelte-4w35sy .emoji:where(.svelte-4w35sy) {flex:none;width:1.5em;font-size:var(--sui-font-size-large);text-align:center;}.option.svelte-4w35sy .name:where(.svelte-4w35sy) {flex:auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}`};function uu(e,t){let n=Eo();O(t,!0),K(e,jie);let r=J(t,`ariaOwner`,3,void 0),i=j(void 0),a=j(ta([])),o=j(0),s=j(void 0),c=j(void 0),l=j(void 0),u=A(()=>!!z(i)&&!!z(a).length),d=j(0),f=j(0),p=A(()=>z(d)?z(d)*5+z(f):180),m=A(()=>z(s)?lu({anchorRect:z(s),listMaxHeight:z(p),viewport:{width:window.innerWidth,height:window.innerHeight},rtl:qc()}):void 0),h=()=>z(u),g=(e=!1)=>{fo(()=>{M(l,e&&z(i)?z(i).id:void 0,!0),M(i,void 0),M(a,[],!0),M(o,0),M(s,void 0)})},_=e=>{if(!e){(z(i)||z(l))&&g();return}if(z(l)===e.id)return;let{id:n,query:r}=e;M(l,void 0),M(s,t.getAnchorRect(e),!0),z(i)?.id===n&&z(i).query===r?M(i,e,!0):(M(i,e,!0),M(a,Oie(r),!0),M(o,0))},v=e=>{let{length:t}=z(a);t&&M(o,(z(o)+e+t)%t)},y=()=>{let e=z(a)[z(o)];e&&z(i)&&t.onSelect(e,z(i)),g()},b=e=>{let{key:t,altKey:n,ctrlKey:r,metaKey:i,shiftKey:a}=e;if(!z(u)||n||r||i)return!1;if(t===`ArrowDown`||t===`ArrowUp`)v(t===`ArrowDown`?1:-1);else if((t===`Enter`||t===`Tab`)&&!a)y();else if(t===`Escape`)g(!0);else return!1;return e.preventDefault(),!0};L(()=>{if(z(a),!z(c))return;z(c).matches(`:popover-open`)||z(c).showPopover?.();let e=z(c).querySelector(`.option`);if(e){let{paddingTop:t,paddingBottom:n,borderTopWidth:r,borderBottomWidth:i}=getComputedStyle(z(c));M(d,e.getBoundingClientRect().height,!0),M(f,Number.parseFloat(t)+Number.parseFloat(n)+Number.parseFloat(r)+Number.parseFloat(i))}}),L(()=>{if(!r())return;let e=r();return e.setAttribute(`aria-autocomplete`,`list`),e.setAttribute(`aria-haspopup`,`listbox`),()=>{e.removeAttribute(`aria-autocomplete`),e.removeAttribute(`aria-haspopup`)}}),L(()=>{if(!r())return;let e=r();return z(u)?(e.setAttribute(`aria-controls`,n),e.setAttribute(`aria-activedescendant`,`${n}-option-${z(o)}`)):(e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`)),()=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-activedescendant`)}}),L(()=>{z(o),z(c)?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`,behavior:`instant`})}),js(()=>{let e=()=>{z(i)&&M(s,t.getAnchorRect(z(i)),!0)},n=({target:e})=>{let t=e;!z(u)||z(c)?.contains(t)||r()?.contains(t)||g()};return window.addEventListener(`scroll`,e,{capture:!0,passive:!0}),window.addEventListener(`resize`,e,{passive:!0}),document.addEventListener(`pointerdown`,n,{capture:!0}),()=>{window.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`resize`,e),document.removeEventListener(`pointerdown`,n,{capture:!0})}});var x={isOpen:h,close:g,update:_,moveSelection:v,selectHighlighted:y,handleKeyDown:b},S=H(),C=P(S),w=e=>{var t=Aie();let r;Bo(t,23,()=>z(a),e=>e.emoji,(e,t,r)=>{var i=kie(),a=N(i),s=F(a,!0),c=F(I(a,2),!0);D(i),R(()=>{q(i,`id`,`${n}-option-${z(r)}`),q(i,`aria-selected`,z(r)===z(o)),W(s,z(t).emoji),W(c,`:${z(t).name}:`)}),yo(`mouseenter`,i,()=>{M(o,z(r),!0)}),bo(`mousedown`,i,e=>{e.preventDefault(),M(o,z(r),!0),y()}),U(e,i)}),D(t),Ds(t,e=>M(c,e),()=>z(c)),R(e=>{q(t,`id`,n),q(t,`aria-label`,e),r=cs(t,``,r,{top:z(m).top,bottom:z(m).bottom,left:z(m).left,"max-height":z(m).maxHeight})},[()=>Y(`_sui.emoji_suggestions`)]),U(e,t)};return G(C,e=>{z(u)&&z(m)&&e(w)}),U(e,S),k(x)}xo([`mousedown`]);function du(e,t){O(t,!0);let n=J(t,`element`,3,void 0),r=j(void 0),i=()=>{if(!n()||n().disabled||n().readOnly)return;let{value:e,selectionStart:t,selectionEnd:r}=n();if(t===null||t!==r)return;let i=cu(e.slice(0,t));if(i===void 0)return;let a=t-i.length-1;return{id:String(a),query:i,start:a,end:t}};L(()=>{if(!n()||!z(r))return;let e=n(),t=()=>{z(r)?.update(i())},a=e=>{z(r)?.handleKeyDown(e)},o=()=>{z(r)?.close()};return e.addEventListener(`keydown`,a),e.addEventListener(`keyup`,t),e.addEventListener(`input`,t),e.addEventListener(`mouseup`,t),e.addEventListener(`blur`,o),()=>{e.removeEventListener(`keydown`,a),e.removeEventListener(`keyup`,t),e.removeEventListener(`input`,t),e.removeEventListener(`mouseup`,t),e.removeEventListener(`blur`,o),z(r)?.close()}}),Ds(uu(e,{getAnchorRect:e=>{let{start:t,end:r}=e;return n()?Sie(n(),t,r):void 0},onSelect:(e,t)=>{let{query:r,start:i,end:a}=t;if(!n()||n().value.slice(i,a)!==`:${r}`)return;let o=su(e.emoji,n().value.slice(a));n().focus(),n().setSelectionRange(i,a);let s=!1;try{s=document.execCommand(`insertText`,!1,o)}catch{s=!1}s||(n().setRangeText(o,i,a,`end`),n().dispatchEvent(new Event(`input`,{bubbles:!0})))},get ariaOwner(){return n()}}),e=>M(r,e,!0),()=>z(r)),k()}var Mie=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`role`,`keyShortcuts`,`dir`,`name`,`showInlineLabel`,`inputmode`,`flex`,`monospace`,`debounce`,`useEmojiAutocomplete`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`,`oninput`]),Nie=B(`<span aria-hidden="true"><!></span>`),Pie=B(`<div role="none"><input/> <!> <!></div>`),Fie={hash:`svelte-133vcb4`,code:`.text-input.svelte-133vcb4 {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.text-input.flex.svelte-133vcb4:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.text-input.monospace.svelte-133vcb4 {--sui-textbox-font-family: var(--sui-font-family-monospace, monospace);}input.svelte-133vcb4:is(:where(.svelte-133vcb4):-webkit-autofill, :where(.svelte-133vcb4):-webkit-autofill:focus) {transition:background-color 0s 600000s, color 0s 600000s;}input.svelte-133vcb4 {display:inline-block;flex:auto;border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-singleline-padding);min-width:0;height:var(--sui-textbox-height);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-singleline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));text-align:var(--sui-textbox-text-align, start);text-indent:var(--sui-textbox-text-indent, 0);text-transform:var(--sui-textbox-text-transform, none);letter-spacing:var(--sui-textbox-letter-spacing, normal);word-spacing:var(--sui-word-spacing-normal, normal);transition:all 200ms;}input.svelte-133vcb4:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}input.svelte-133vcb4:read-only {color:var(--sui-secondary-foreground-color);border-color:var(--sui-textbox-border-color) !important;}input.svelte-133vcb4:is(:where(.svelte-133vcb4):disabled, :where(.svelte-133vcb4):read-only) {background-color:var(--sui-disabled-background-color);}input[aria-invalid=true].svelte-133vcb4 {border-color:var(--sui-error-border-color);}input.svelte-133vcb4 ~ button {flex:none;margin-inline-start:-1px;border-width:1px;border-color:var(--sui-textbox-border-color);height:var(--sui-textbox-height);aspect-ratio:1/1;}input.svelte-133vcb4 ~ button:last-child {border-start-start-radius:0;border-start-end-radius:4px;border-end-end-radius:4px;border-end-start-radius:0;}input.svelte-133vcb4 ~ button .icon {font-size:var(--sui-font-size-xx-large);}.label.svelte-133vcb4 {position:absolute;inset:var(--sui-textbox-singleline-padding);z-index:2;display:flex;align-items:center;justify-content:var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));pointer-events:none;}.label.hidden.svelte-133vcb4 {opacity:0;}input.svelte-133vcb4:focus + .label:where(.svelte-133vcb4) {opacity:0;}input.svelte-133vcb4::placeholder,
.label.svelte-133vcb4 {color:var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));opacity:var(--sui-textbox-placeholder-opacity, 0.5);font-family:var(--sui-textbox-placeholder-font-family, var(--sui-textbox-font-family));font-size:var(--sui-textbox-placeholder-font-size, var(--sui-textbox-font-size));line-height:var(--sui-textbox-placeholder-singleline-line-height, var(--sui-textbox-singleline-line-height));font-weight:var(--sui-textbox-placeholder-font-weight, var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal)));text-align:var(--sui-textbox-placeholder-text-align, var(--sui-textbox-text-align, start));text-indent:var(--sui-textbox-placeholder-text-indent, var(--sui-textbox-text-indent, 0));letter-spacing:var(--sui-textbox-placeholder-letter-spacing, var(--sui-textbox-letter-spacing, normal));}`};function fu(e,t){let n=Eo();O(t,!0),K(e,Fie);let r=J(t,`value`,15),i=J(t,`element`,15),a=J(t,`role`,3,`textbox`),o=J(t,`keyShortcuts`,3,void 0),s=J(t,`dir`,3,void 0),c=J(t,`name`,3,void 0),l=J(t,`showInlineLabel`,3,!1),u=J(t,`inputmode`,3,`text`),d=J(t,`flex`,3,!1),f=J(t,`monospace`,3,!1),p=J(t,`debounce`,3,!1),m=J(t,`useEmojiAutocomplete`,3,!1),h=J(t,`hidden`,3,!1),g=J(t,`disabled`,3,!1),_=J(t,`readonly`,3,!1),v=J(t,`required`,3,!1),y=J(t,`invalid`,3,!1),b=J(t,`ariaLabel`,3,void 0),x=ks(t,Mie),S=A(()=>typeof p()==`number`?p():300),C=A(()=>b()??x[`aria-label`]),w=0;L(()=>()=>{clearTimeout(w)});let T=e=>{r(i()?.value),t.oninput?.(e)},ee=e=>{let t=e;p()?(clearTimeout(w),w=setTimeout(()=>{T(t)},z(S))):T(t)};var te=Pie();let ne;var re=N(te);bs(re,()=>({...x,value:r(),type:`text`,role:a(),dir:s(),name:c(),tabindex:g()?-1:0,disabled:g()||void 0,readonly:_()||void 0,inputmode:u(),"aria-label":z(C),"aria-hidden":h(),"aria-disabled":g(),"aria-readonly":_(),"aria-required":v(),"aria-invalid":y(),oninputcapture:ee}),void 0,void 0,void 0,`svelte-133vcb4`,!0),Ds(re,e=>i(e),()=>i()),es(re,()=>ul(o()));var ie=I(re,2),ae=e=>{du(e,{get element(){return i()}})};G(ie,e=>{m()&&!g()&&!_()&&e(ae)});var oe=I(ie,2),se=e=>{var t=Nie();let i;fl(N(t),{children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(C))),U(e,n)},$$slots:{default:!0}}),D(t),R(()=>{q(t,`id`,`${n}-label`),i=os(t,1,`label svelte-133vcb4`,null,i,{hidden:!!r()})}),U(e,t)};G(oe,e=>{z(C)&&l()&&e(se)}),D(te),R(()=>{ne=os(te,1,`sui text-input ${t.class??``}`,`svelte-133vcb4`,ne,{flex:d(),monospace:f(),disabled:g(),readonly:_()}),q(te,`hidden`,h()),re.dir=re.dir}),U(e,te),k()}var Iie=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`value`,`title`,`textboxAttrs`,`children`,`input`,`onkeydown`,`onkeyup`,`onkeypress`,`oninput`]),Lie=B(`<!> <div class="input-outer svelte-1wcwjkb"><!></div>`,1),Rie={hash:`svelte-1wcwjkb`,code:`.input-outer.svelte-1wcwjkb {margin:12px 0 0;}`};function pu(e,t){O(t,!0),K(e,Rie);let n=J(t,`open`,15,!1),r=J(t,`value`,15,``),i=J(t,`textboxAttrs`,19,()=>({})),a=ks(t,Iie);tu(e,As(()=>a,{get title(){return t.title},role:`alertdialog`,get open(){return n()},set open(e){n(e)},children:(e,n)=>{var a=Lie(),o=P(a);Go(o,()=>t.children??kr);var s=I(o,2),c=N(s),l=e=>{var n=H();Go(P(n),()=>t.input),U(e,n)},u=e=>{{let n=A(()=>`aria-labelledby`in i()?void 0:t.title);fu(e,As({dir:`auto`,flex:!0,autofocus:!0,get"aria-label"(){return z(n)}},i,{get onkeydown(){return t.onkeydown},get onkeyup(){return t.onkeyup},get onkeypress(){return t.onkeypress},get oninput(){return t.oninput},get value(){return r()},set value(e){r(e)}}))}};G(c,e=>{t.input?e(l):e(u,-1)}),D(s),U(e,a)},$$slots:{default:!0}})),k()}var zie=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`orientation`,`ariaLabel`]),Bie=B(`<div></div>`),Vie={hash:`svelte-sekm1e`,code:`.divider.svelte-sekm1e {flex:none;background-color:var(--sui-secondary-border-color);}.divider[aria-orientation=horizontal].svelte-sekm1e {margin:8px 0;width:100%;height:1px;}.divider[aria-orientation=vertical].svelte-sekm1e {margin:0 8px;width:1px;height:100%;}`};function mu(e,t){K(e,Vie);let n=J(t,`hidden`,3,!1),r=J(t,`orientation`,3,`horizontal`),i=J(t,`ariaLabel`,3,void 0),a=ks(t,zie);var o=Bie();bs(o,()=>({...a,role:`separator`,class:`sui divider ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-orientation":r(),"aria-label":i()}),void 0,void 0,void 0,`svelte-sekm1e`),U(e,o)}var Hie=(e,t)=>e===`top`||e===`bottom`?{axis:`Y`,sign:e===`bottom`?1:-1}:{axis:`X`,sign:e===`right`===t?-1:1},Uie=(e,t)=>Math.max(0,e*t),hu=(e,t)=>[...e.filter(({time:e})=>t.time-e<=100),t],Wie=e=>{let t=e[0],n=e[e.length-1];return!t||!n||n.time<=t.time?0:(n.offset-t.offset)/(n.time-t.time)},Gie=({offset:e,size:t,velocity:n})=>e>0&&(e>=t*.3||e>=16&&n>=.5),Kie=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`class`,`title`,`ariaLabelledby`,`position`,`size`,`showClose`,`swipeDismiss`,`children`,`header`,`headerExtra`,`footer`,`closeIcon`]),gu=B(`<div role="none" class="handle svelte-1h1mk8q"></div>`),qie=B(`<div role="none" class="header svelte-1h1mk8q"><div role="none" class="title svelte-1h1mk8q"> </div> <!> <!> <!></div>`),Jie=B(`<div role="none" class="footer svelte-1h1mk8q"><!></div>`),Yie=B(`<div role="none"><!> <div role="none" class="extra-control svelte-1h1mk8q"><!></div> <!> <div role="none" class="main svelte-1h1mk8q"><!></div> <!> <!></div>`),Xie={hash:`svelte-1h1mk8q`,code:`.content.svelte-1h1mk8q {position:absolute;display:flex;flex-direction:column;max-width:100dvw;max-height:100dvh;border-width:var(--sui-drawer-content-border-width, var(--sui-modal-border-width, 0));border-style:solid;border-color:var(--sui-drawer-content-border-color, var(--sui-primary-border-color));background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);transition-property:transform;}.content.svelte-1h1mk8q .extra-control:where(.svelte-1h1mk8q) {position:absolute;}.content.svelte-1h1mk8q .extra-control:where(.svelte-1h1mk8q) button.close {margin:8px;}dialog.open .content.svelte-1h1mk8q {transition-duration:150ms;transform:translateX(0%);}dialog:not(.open) .content.svelte-1h1mk8q {transition-duration:300ms;}.content.right.svelte-1h1mk8q {inset-block:var(--sui-drawer-right-content-inset-block, 0);inset-inline:var(--sui-drawer-right-content-inset-inline, auto 0);border-start-start-radius:var(--sui-drawer-right-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 4px));border-start-end-radius:var(--sui-drawer-right-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 0));border-end-end-radius:var(--sui-drawer-right-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 0));border-end-start-radius:var(--sui-drawer-right-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 4px));}.content.right.full.svelte-1h1mk8q {border-radius:var(--sui-drawer-right-full-content-border-radius, var(--sui-drawer-right-content-border-radius, 0));}.content.right.svelte-1h1mk8q .extra-control:where(.svelte-1h1mk8q) {inset-block-start:0;inset-inline-end:100%;}dialog:not(.open) .content.right.svelte-1h1mk8q:dir(ltr) {transform:translateX(105%);}dialog:not(.open) .content.right.svelte-1h1mk8q:dir(rtl) {transform:translateX(-105%);}.content.left.svelte-1h1mk8q {inset-block:var(--sui-drawer-left-content-inset-block, 0);inset-inline:var(--sui-drawer-left-content-inset-inline, 0 auto);border-start-start-radius:var(--sui-drawer-left-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 0));border-start-end-radius:var(--sui-drawer-left-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 4px));border-end-end-radius:var(--sui-drawer-left-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 4px));border-end-start-radius:var(--sui-drawer-left-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 0));}.content.left.full.svelte-1h1mk8q {border-radius:var(--sui-drawer-left-full-content-border-radius, var(--sui-drawer-left-content-border-radius, 0));}.content.left.svelte-1h1mk8q .extra-control:where(.svelte-1h1mk8q) {inset-block-start:0;inset-inline-start:100%;}dialog:not(.open) .content.left.svelte-1h1mk8q:dir(ltr) {transform:translateX(-105%);}dialog:not(.open) .content.left.svelte-1h1mk8q:dir(rtl) {transform:translateX(105%);}dialog.open .content.vertical.svelte-1h1mk8q {transform:translateX(0%);}.content.vertical.small.svelte-1h1mk8q {width:var(--sui-drawer-vertical-small-width, var(--sui-drawer-vertical-width, 400px));max-width:var(--sui-drawer-vertical-small-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-small-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.medium.svelte-1h1mk8q {width:var(--sui-drawer-vertical-medium-width, var(--sui-drawer-vertical-width, 600px));max-width:var(--sui-drawer-vertical-medium-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-medium-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.large.svelte-1h1mk8q {width:var(--sui-drawer-vertical-large-width, var(--sui-drawer-vertical-width, 800px));max-width:var(--sui-drawer-vertical-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-large-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.x-large.svelte-1h1mk8q {width:var(--sui-drawer-vertical-x-large-width, var(--sui-drawer-vertical-width, 1000px));max-width:var(--sui-drawer-vertical-x-large-max-width, var(--sui-drawer-vertical-max-width, calc(100dvw - 56px)));height:var(--sui-drawer-vertical-x-large-height, var(--sui-drawer-vertical-height, 100dvh));}.content.vertical.full.svelte-1h1mk8q {width:100dvw;max-width:100dvw;height:100dvh;}.content.top.svelte-1h1mk8q {inset-block-start:var(--sui-drawer-top-content-inset-block, 0);inset-inline:var(--sui-drawer-top-content-inset-inline, 0 0);border-start-start-radius:var(--sui-drawer-top-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 0));border-start-end-radius:var(--sui-drawer-top-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 0));border-end-end-radius:var(--sui-drawer-top-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 4px));border-end-start-radius:var(--sui-drawer-top-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 4px));}.content.top.full.svelte-1h1mk8q {border-radius:var(--sui-drawer-top-full-content-border-radius, var(--sui-drawer-top-content-border-radius, 0));}.content.top.svelte-1h1mk8q .extra-control:where(.svelte-1h1mk8q) {inset-block-start:100%;inset-inline-end:0;}dialog:not(.open) .content.top.svelte-1h1mk8q {transform:translateY(-105%);}.content.bottom.svelte-1h1mk8q {inset-block:var(--sui-drawer-bottom-content-inset-block, auto 0);inset-inline:var(--sui-drawer-bottom-content-inset-inline, 0);border-start-start-radius:var(--sui-drawer-bottom-content-border-start-start-radius, var(--sui-drawer-content-border-start-start-radius, 4px));border-start-end-radius:var(--sui-drawer-bottom-content-border-start-end-radius, var(--sui-drawer-content-border-start-end-radius, 4px));border-end-end-radius:var(--sui-drawer-bottom-content-border-end-end-radius, var(--sui-drawer-content-border-end-end-radius, 0));border-end-start-radius:var(--sui-drawer-bottom-content-border-end-start-radius, var(--sui-drawer-content-border-end-start-radius, 0));}.content.bottom.full.svelte-1h1mk8q {border-radius:var(--sui-drawer-bottom-full-content-border-radius, var(--sui-drawer-bottom-content-border-radius, 0));}.content.bottom.svelte-1h1mk8q .extra-control:where(.svelte-1h1mk8q) {inset-block-end:100%;inset-inline-end:0;}dialog:not(.open) .content.bottom.svelte-1h1mk8q {transform:translateY(105%);}dialog.open .content.horizontal.svelte-1h1mk8q {transform:translateY(0%);}.content.horizontal.small.svelte-1h1mk8q {width:var(--sui-drawer-horizontal-small-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-small-height, var(--sui-drawer-horizontal-height, 400px));max-height:var(--sui-drawer-horizontal-small-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.medium.svelte-1h1mk8q {width:var(--sui-drawer-horizontal-medium-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-medium-height, var(--sui-drawer-horizontal-height, 600px));max-height:var(--sui-drawer-horizontal-medium-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.large.svelte-1h1mk8q {width:var(--sui-drawer-horizontal-large-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-large-height, var(--sui-drawer-horizontal-height, 800px));max-height:var(--sui-drawer-horizontal-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.x-large.svelte-1h1mk8q {width:var(--sui-drawer-horizontal-x-large-width, var(--sui-drawer-horizontal-width, 100dvw));height:var(--sui-drawer-horizontal-x-large-height, var(--sui-drawer-horizontal-height, 1000px));max-height:var(--sui-drawer-horizontal-x-large-max-height, var(--sui-drawer-horizontal-max-height, calc(100dvh - 56px)));}.content.horizontal.full.svelte-1h1mk8q {width:100dvw;height:100dvh;max-height:100dvh;}.content.swipe-dismiss.svelte-1h1mk8q > :not(.main, .footer, .extra-control) {touch-action:none;user-select:none;}.content.swipe-dismiss.swiping.svelte-1h1mk8q, .content.swipe-dismiss.swiping.svelte-1h1mk8q .handle:where(.svelte-1h1mk8q) {cursor:grabbing;}.handle.svelte-1h1mk8q {flex:none;display:flex;justify-content:center;padding:8px 0;cursor:grab;}.handle.svelte-1h1mk8q::before {content:"";border-radius:2px;width:32px;height:4px;background-color:var(--sui-drawer-handle-color, var(--sui-secondary-foreground-color));opacity:0.5;}:is(.header.svelte-1h1mk8q, .footer.svelte-1h1mk8q) {display:flex;align-items:center;gap:8px;}.header.svelte-1h1mk8q {flex-direction:var(--sui-drawer-header-flex-direction, row);box-sizing:content-box;margin:var(--sui-drawer-header-margin, 0 16px);border-width:var(--sui-drawer-header-border-width, 0 0 1px);border-color:var(--sui-drawer-header-border-color, var(--sui-secondary-border-color));padding:var(--sui-drawer-header-padding, 16px 8px);height:var(--sui-drawer-header-height, 32px);}.header.svelte-1h1mk8q .title:where(.svelte-1h1mk8q) {font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-bold);}.footer.svelte-1h1mk8q {margin:0 24px 24px;}.main.svelte-1h1mk8q {flex:auto;overflow:auto;padding:var(--sui-drawer-main-padding, 24px);white-space:normal;}`};function Zie(e,t){let n=Eo();O(t,!0),K(e,Xie);let r=J(t,`open`,15,!1),i=J(t,`title`,3,``),a=J(t,`ariaLabelledby`,3,void 0),o=J(t,`position`,3,`right`),s=J(t,`size`,3,`small`),c=J(t,`showClose`,3,`outside`),l=J(t,`swipeDismiss`,3,!1),u=ks(t,Kie),d=j(void 0),f=A(()=>o()===`right`||o()===`left`?`vertical`:`horizontal`),p=j(void 0),m=j(void 0),h=j(0),g=e=>{let{button:t,isPrimary:n,pointerId:r,target:i,clientX:a,clientY:s}=e;if(!l()||!z(p)||z(m)||t!==0||!n)return;let c=i.closest(`.main, .footer, .extra-control, a, button, input, select, textarea, [contenteditable], [tabindex]`);if(c&&z(p).contains(c))return;let{axis:u,sign:d}=Hie(o(),z(p).matches(`:dir(rtl)`));M(m,{pointerId:r,axis:u,sign:d,start:u===`Y`?s:a,samples:[]}),M(h,0),z(p).setPointerCapture(r)},_=e=>{let{pointerId:t,clientX:n,clientY:r,timeStamp:i}=e;z(m)&&t===z(m).pointerId&&(M(h,Uie((z(m).axis===`Y`?r:n)-z(m).start,z(m).sign),!0),z(m).samples=hu(z(m).samples,{offset:z(h),time:i}))},v=e=>{if(!z(m)||!z(p)||e.pointerId!==z(m).pointerId)return;let{width:t,height:n}=z(p).getBoundingClientRect(),r=hu(z(m).samples,{offset:z(h),time:e.timeStamp}),i=e.type===`pointerup`&&Gie({offset:z(h),size:z(m).axis===`Y`?n:t,velocity:Wie(r)});M(m,void 0),M(h,0),i&&z(d)?.close(`close`)};L(()=>{r()||fo(()=>{M(m,void 0),M(h,0)})});let y=A(()=>a()??(!t.header&&i()?`${n}-title`:void 0)),b=A(()=>z(y)?void 0:i()||void 0);Ds(Dl(e,As(()=>u,{get id(){return n},class:`drawer`,get"aria-label"(){return z(b)},get"aria-labelledby"(){return z(y)},showBackdrop:!0,get open(){return r()},set open(e){r(e)},children:(e,r)=>{var a=Yie();let u;var y=N(a),b=e=>{U(e,gu())};G(y,e=>{l()&&o()===`bottom`&&e(b)});var x=I(y,2),S=N(x),C=e=>{eu(e,{class:`close`,get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{z(d)?.close(`close`)}})};G(S,e=>{c()===`outside`&&e(C)}),D(x);var w=I(x,2),T=e=>{var r=H(),a=P(r),o=e=>{var n=H();Go(P(n),()=>t.header),U(e,n)},s=e=>{var r=qie(),a=N(r),o=F(a,!0),s=I(a,2);$l(s,{flex:!0});var l=I(s,2);Go(l,()=>t.headerExtra??kr);var u=I(l,2),f=e=>{eu(e,{class:`close`,get controls(){return n},get closeIcon(){return t.closeIcon},onClose:()=>{z(d)?.close(`close`)}})};G(u,e=>{c()===`inside`&&e(f)}),D(r),R(()=>{q(a,`id`,`${n}-title`),W(o,i())}),U(e,r)};G(a,e=>{t.header?e(o):e(s,-1)}),U(e,r)};G(w,e=>{(i()||c()===`inside`||t.header||t.headerExtra)&&e(T)});var ee=I(w,2);Go(N(ee),()=>t.children??kr),D(ee);var te=I(ee,2),ne=e=>{var n=Jie();Go(N(n),()=>t.footer??kr),D(n),U(e,n)};G(te,e=>{t.footer&&e(ne)});var re=I(te,2),ie=e=>{U(e,gu())};G(re,e=>{l()&&o()===`top`&&e(ie)}),D(a),Ds(a,e=>M(p,e),()=>z(p)),R(()=>{os(a,1,ns([`content`,t.class,s(),o(),z(f),{"swipe-dismiss":l(),swiping:!!z(m)}]),`svelte-1h1mk8q`),u=cs(a,``,u,{transform:z(m)?`translate${z(m).axis}(${z(m).sign*z(h)}px)`:void 0,"transition-duration":z(m)?`0s`:void 0})}),bo(`pointerdown`,a,g),bo(`pointermove`,a,_),bo(`pointerup`,a,v),yo(`pointercancel`,a,v),U(e,a)},$$slots:{default:!0}})),e=>M(d,e,!0),()=>z(d)),k()}xo([`pointerdown`,`pointermove`,`pointerup`]);var Qie=B(`<input class="sui file-picker" type="file" hidden=""/>`);function _u(e,t){O(t,!0);let n=J(t,`accept`,3,void 0),r=J(t,`multiple`,3,!1),i=J(t,`onSelect`,3,void 0),a=J(t,`onCancel`,3,void 0),o=j(void 0);var s={open:()=>{z(o)?.click()}},c=Qie();return Ds(c,e=>M(o,e),()=>z(o)),R(()=>{q(c,`accept`,n()),c.multiple=r()}),bo(`change`,c,({target:e})=>{let t=e,n=[...t.files];t.value=``,i()?.({files:n,file:n[0]})}),yo(`cancel`,c,e=>{e.stopPropagation(),a()?.()}),U(e,c),k(s)}xo([`change`]);var $ie=new Set([`$$slots`,`$$events`,`$$legacy`,`expanded`,`class`,`label`,`collapsible`,`children`,`chevronIcon`,`onChange`]),eae=B(`<span role="none" class="chevron svelte-hl7w1x"><!></span>`),tae=B(`<div role="row" class="row-group-caption svelte-hl7w1x" data-selectable="false"><!></div>`),nae=B(`<div><!> <!></div>`),rae={hash:`svelte-hl7w1x`,code:`[role=rowgroup].svelte-hl7w1x {display:table-row-group;}[role=row].svelte-hl7w1x {display:table-row;}[role=columnheader].svelte-hl7w1x {display:table-cell;padding:8px;color:var(--sui-secondary-foreground-color);background-color:var(--sui-secondary-background-color);font-size:var(--sui-font-size-default);text-align:start;}[role=columnheader].svelte-hl7w1x:has(> .expander) {padding:0;}[role=columnheader].svelte-hl7w1x .expander {justify-content:flex-start;margin:0;border-radius:0;padding:4px 8px 4px 4px;width:100%;height:auto;color:inherit;font-size:inherit;text-align:start;}.chevron.svelte-hl7w1x {flex:none;display:flex;align-items:center;justify-content:center;transition:transform 200ms;}.expander[aria-expanded='true'] > .chevron.svelte-hl7w1x:dir(ltr) {transform:rotate(90deg);}.expander[aria-expanded='true'] > .chevron.svelte-hl7w1x:dir(rtl) {transform:rotate(-90deg);}`};function vu(e,t){let n=Eo();O(t,!0),K(e,rae);let r=J(t,`expanded`,15,!0),i=J(t,`label`,3,``),a=J(t,`collapsible`,3,!1),o=ks(t,$ie),s=A(()=>a()&&!!i()),c=()=>{r(!r()),t.onChange?.(new CustomEvent(`Change`,{detail:{expanded:r()}}))},l=e=>{let t=t=>{z(s)&&t.target===e&&c()};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}};var u=nae();bs(u,e=>({...o,role:`rowgroup`,class:`sui grid-body row-group ${t.class??``}`,"aria-labelledby":i()?`${n}-label`:void 0,"aria-roledescription":e}),[()=>Y(`_sui.role_descriptions.grid_body`)],void 0,void 0,`svelte-hl7w1x`);var d=N(u),f=e=>{var a=tae();Ate(N(a),()=>`th`,!1,(e,a)=>{bs(e,()=>({role:`columnheader`,id:`${n}-label`,colspan:`9999`,class:``}),void 0,void 0,void 0,`svelte-hl7w1x`);var o=H(),l=P(o),u=e=>{Al(e,{class:`expander`,get label(){return i()},tabindex:`-1`,get"aria-expanded"(){return r()},onclick:c,startIcon:e=>{var n=eae(),r=N(n),i=e=>{var n=H();Go(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{{let t=A(()=>qc()?`chevron_left`:`chevron_right`);Xc(e,{get name(){return z(t)}})}};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),D(n),U(e,n)},$$slots:{startIcon:!0}})},d=e=>{var t=V();R(()=>W(t,i())),U(e,t)};G(l,e=>{z(s)?e(u):e(d,-1)}),U(a,o)}),D(a),es(a,()=>l),U(e,a)};G(d,e=>{i()&&e(f)});var p=I(d,2),m=e=>{var n=H();Go(P(n),()=>t.children??kr),U(e,n)};G(p,e=>{(!z(s)||r())&&e(m)}),D(u),U(e,u),k()}var iae=new Set([`$$slots`,`$$events`,`$$legacy`,`role`,`kind`,`class`,`children`]),aae=B(`<div><!></div>`),oae={hash:`svelte-1wcwpq4`,code:`.table-head.svelte-1wcwpq4,
.grid-head.svelte-1wcwpq4 {display:table-header-group;}.table-foot.svelte-1wcwpq4,
.grid-foot.svelte-1wcwpq4 {display:table-footer-group;}.table-row.svelte-1wcwpq4,
.grid-row.svelte-1wcwpq4 {display:table-row;height:var(--sui-primary-row-height);}.table-col-header.svelte-1wcwpq4,
.grid-col-header.svelte-1wcwpq4,
.table-cell.svelte-1wcwpq4,
.grid-cell.svelte-1wcwpq4 {display:table-cell;}.table-row-header.svelte-1wcwpq4,
.grid-row-header.svelte-1wcwpq4 {display:table-cell;height:var(--sui-secondary-row-height);}`};function yu(e,t){K(e,oae);let n=ks(t,iae);var r=aae();bs(r,()=>({...n,role:t.role,class:`sui ${t.kind??``} ${t.class??``}`}),void 0,void 0,void 0,`svelte-1wcwpq4`),Go(N(r),()=>t.children??kr),D(r),U(e,r)}var sae=new Set([`$$slots`,`$$events`,`$$legacy`]);function bu(e,t){let n=ks(t,sae);yu(e,As(()=>n,{role:`gridcell`,kind:`grid-cell`}))}var cae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`sortOrder`,`children`,`onSort`]),lae={hash:`svelte-1n3kqw5`,code:`:where(.sui.grid-col-header.sortable) {position:relative;}.sui.grid-col-header.sortable > .sui.button.sort-button {justify-content:flex-start;margin:0;border-radius:0;padding:0;width:100%;height:auto;color:inherit;font:inherit;text-align:start;}.sui.grid-col-header.sortable > .sui.button.sort-button::after {position:absolute;inset:0;content:"";}.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon {flex:none;font-size:16px;transition:opacity 200ms;}.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon.none {opacity:0;}.sui.grid-col-header.sortable > .sui.button.sort-button:is(:hover, :focus-visible) .sort-icon.none {opacity:0.4;}
@media (hover: none) {.sui.grid-col-header.sortable > .sui.button.sort-button .sort-icon.none {opacity:0.4;}
}`};function xu(e,t){O(t,!0),K(e,lae);let n=J(t,`sortOrder`,3,void 0),r=ks(t,cae),i=e=>{let r=e=>{e.stopPropagation(),t.onSort?.(new CustomEvent(`Sort`,{detail:{sortOrder:n()===`ascending`?`descending`:`ascending`}}))},i=e=>{let{key:t}=e;(t===`Enter`||t===` `)&&e.stopPropagation()};return e.addEventListener(`click`,r),e.addEventListener(`keydown`,i),()=>{e.removeEventListener(`click`,r),e.removeEventListener(`keydown`,i)}};var a=H(),o=P(a),s=e=>{yu(e,As(()=>r,{role:`columnheader`,kind:`grid-col-header`,get class(){return t.class},children:(e,n)=>{var r=H();Go(P(r),()=>t.children??kr),U(e,r)},$$slots:{default:!0}}))},c=e=>{{let a=A(()=>t.class?`sortable ${t.class}`:`sortable`),o=A(()=>n()===`none`?void 0:n());yu(e,As(()=>r,{role:`columnheader`,kind:`grid-col-header`,get class(){return z(a)},get"aria-sort"(){return z(o)},children:(e,r)=>{{let r=e=>{{let t=A(()=>n()===`descending`?`arrow_downward`:`arrow_upward`);Xc(e,{get class(){return`sort-icon ${n()??``}`},get name(){return z(t)}})}};Al(e,{class:`sort-button`,[po()]:i,endIcon:r,children:(e,n)=>{var r=H();Go(P(r),()=>t.children??kr),U(e,r)},$$slots:{endIcon:!0,default:!0}})}},$$slots:{default:!0}}))}};G(o,e=>{n()===void 0?e(s):e(c,-1)}),U(e,a),k()}var uae=new Set([`$$slots`,`$$events`,`$$legacy`]);function dae(e,t){O(t,!0);let n=ks(t,uae);ci(`sui:grid-unselectable-rows`,!0);{let t=A(()=>Y(`_sui.role_descriptions.grid_head`));yu(e,As(()=>n,{role:`rowgroup`,kind:`grid-head`,get"aria-roledescription"(){return z(t)}}))}k()}var fae=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`]);function Su(e,t){O(t,!0);let n=J(t,`selected`,3,!1),r=ks(t,fae),i=si(`sui:grid-unselectable-rows`)===!0,a=A(()=>{if(!i)return{...r,"aria-selected":n()};let{"aria-selected":e,...t}=r;return{...t,"data-selectable":`false`}}),o=e=>{let t=t=>{let n=e.querySelector(`.sort-button`);t.target===e&&n&&(t.stopPropagation(),n.focus())};return e.addEventListener(`click`,t),()=>{e.removeEventListener(`click`,t)}};var s=H(),c=P(s),l=e=>{yu(e,As(()=>z(a),{role:`row`,kind:`grid-row`,tabindex:`0`,[po()]:o}))},u=e=>{yu(e,As(()=>z(a),{role:`row`,kind:`grid-row`,tabindex:`0`}))};G(c,e=>{i?e(l):e(u,-1)}),U(e,s),k()}var pae=new Set([`$$slots`,`$$events`,`$$legacy`,`element`,`class`,`multiple`,`clickToSelect`,`ariaLabel`,`children`,`onChange`]),mae=B(`<div><!></div>`),hae={hash:`svelte-1qlphqk`,code:`.grid.svelte-1qlphqk {display:table;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.grid.data.svelte-1qlphqk {border-collapse:collapse;}.grid.data.svelte-1qlphqk :is(.grid-col-header, .grid-row-header, .grid-cell) {border:1px solid var(--sui-secondary-border-color);padding:8px 8px;}`};function gae(e,t){O(t,!0),K(e,hae);let n=J(t,`element`,15),r=J(t,`multiple`,3,!1),i=J(t,`clickToSelect`,3,!0),a=J(t,`ariaLabel`,3,void 0),o=ks(t,pae);ci(`sui:grid-unselectable-rows`,!1);var s=mae(),c=e=>{t.onChange?.(e)};bs(s,()=>({...o,role:`grid`,class:`sui grid ${t.class??``}`,"aria-multiselectable":r(),"aria-label":a(),onChange:c}),void 0,void 0,void 0,`svelte-1qlphqk`),Go(N(s),()=>t.children??kr),D(s),Ds(s,e=>n(e),()=>n()),es(s,()=>ql({clickToSelect:i()})),U(e,s),k()}var _ae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`multiple`,`searchTerms`,`ariaLabel`,`children`,`onFilter`]),vae=B(`<div><div role="none" class="inner svelte-rj6sjy"><!></div></div>`),yae={hash:`svelte-rj6sjy`,code:`[role=listbox].svelte-rj6sjy {display:flex;flex-direction:column;margin:var(--sui-focus-ring-width);border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:var(--sui-listbox-padding, 4px);min-width:var(--sui-listbox-min-width, calc(var(--sui-option-height) * 5));color:var(--sui-listbox-foreground-color);background-color:var(--sui-listbox-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}[role=listbox].svelte-rj6sjy [role=separator] {margin:4px 0;background-color:var(--sui-control-border-color);}[role=listbox][aria-invalid=true].svelte-rj6sjy {border-color:var(--sui-error-border-color);}[role=listbox].tabs.svelte-rj6sjy {padding:0;border-block-start-width:0;border-block-end-width:0;border-inline-end-width:1px;border-inline-start-width:0;border-color:var(--sui-control-border-color);}[role=listbox].tabs.svelte-rj6sjy .option button {justify-content:flex-start;border-width:0;border-inline-end-width:2px;border-color:transparent;padding:0 12px;border-start-end-radius:0;border-end-end-radius:0;height:var(--sui-tab-medium-height);}[role=listbox].tabs.svelte-rj6sjy .option button[aria-selected=true] {border-color:var(--sui-primary-accent-color-light);}[role=listbox].tabs.svelte-rj6sjy .option button .icon {display:none;}[role=listbox].tabs[aria-readonly=true].svelte-rj6sjy .option button[aria-selected='true'] {border-color:var(--sui-readonly-accent-color);}[role=listbox].in-combobox.svelte-rj6sjy:focus-visible, [role=listbox].svelte-rj6sjy:focus-visible:has(.focused) {outline-color:transparent;}[role=listbox].filtered.svelte-rj6sjy [role=separator] {display:none;}.inner.svelte-rj6sjy {display:contents;}`};function Cu(e,t){O(t,!0),K(e,yae);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`readonly`,3,!1),a=J(t,`required`,3,!1),o=J(t,`invalid`,3,!1),s=J(t,`multiple`,3,!1),c=J(t,`searchTerms`,3,``),l=J(t,`ariaLabel`,3,void 0),u=ks(t,_ae),d=j(!1);var f=vae(),p=e=>{let{detail:{matched:n,total:r}}=e;M(d,n!==r),t.onFilter?.(e)};bs(f,()=>({...u,role:`listbox`,class:`sui listbox ${t.class??``}`,tabindex:r()?-1:0,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-multiselectable":s(),"aria-label":l(),onFilter:p,[ms]:{filtered:z(d)}}),void 0,void 0,void 0,`svelte-rj6sjy`);var m=N(f);Go(N(m),()=>t.children??kr),D(m),D(f),es(f,()=>ql(()=>({searchTerms:c()}))),R(()=>m.inert=r()),U(e,f),k()}var bae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`label`,`children`]),xae=B(`<div><div role="none" class="label svelte-1xpz2me"><!></div> <div role="none" class="inner svelte-1xpz2me"><!></div></div>`),Sae={hash:`svelte-1xpz2me`,code:`.option-group.svelte-1xpz2me:not(:first-child) {margin:12px 0 0;}.label.svelte-1xpz2me {margin:8px;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.inner.svelte-1xpz2me {display:contents;}`};function wu(e,t){let n=Eo();O(t,!0),K(e,Sae);let r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`label`,3,``),o=ks(t,bae);var s=xae();bs(s,e=>({...o,role:`group`,id:n,class:`sui option-group ${t.class??``}`,hidden:r(),"aria-hidden":r(),"aria-disabled":i(),"aria-labelledby":`${n}-label`,"aria-roledescription":e}),[()=>Y(`_sui.role_descriptions.option_group`)],void 0,void 0,`svelte-1xpz2me`);var c=N(s);fl(N(c),{children:(e,t)=>{Qr();var n=V();R(()=>W(n,a())),U(e,n)},$$slots:{default:!0}}),D(c);var l=I(c,2);Go(N(l),()=>t.children??kr),D(l),D(s),R(()=>{q(c,`id`,`${n}-label`),l.inert=i()}),U(e,s),k()}var Cae=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`hidden`,`class`,`disabled`,`label`,`value`,`searchValue`,`wrap`,`children`,`checkIcon`,`startIcon`,`onChange`,`onToggle`]),wae=B(`<!> <!>`,1),Tae=B(`<div role="none"><!></div>`),Eae={hash:`svelte-18hujd0`,code:`.option.svelte-18hujd0 {display:contents;}.option.svelte-18hujd0:focus-visible {outline-width:0 !important;}.option.wrap.svelte-18hujd0 button {white-space:normal;}.option.svelte-18hujd0 button {flex:none;display:flex;gap:4px;margin:0 !important;border-radius:var(--sui-option-border-radius);padding:var(--sui-option-padding);width:100%;height:auto;min-height:var(--sui-option-height);}.option.svelte-18hujd0 button:active {background-color:var(--sui-active-background-color);}.option.svelte-18hujd0 button[aria-selected=true] .icon.check {color:var(--sui-primary-accent-color-text);}.option.svelte-18hujd0 button * {flex:none;}.option.svelte-18hujd0 button .label {flex:auto;}.option.svelte-18hujd0 :is(.focused, button:hover) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.option.svelte-18hujd0 .icon.check {margin:-2px;}[role='listbox']:focus-visible .option.svelte-18hujd0 .focused {outline-color:var(--sui-focus-ring-color);outline-offset:calc(var(--sui-focus-ring-width) * -1);}[role='listbox'][aria-readonly='true'] .option.svelte-18hujd0 button {cursor:default;}[role='listbox'][aria-readonly='true'] .option.svelte-18hujd0 button:not(.focused):is(:hover, :active) {color:var(--sui-control-foreground-color);background-color:transparent;}[role='listbox'][aria-readonly='true'] .option.svelte-18hujd0 button[aria-selected=true] .icon.check {color:var(--sui-readonly-accent-color);}`};function Tu(e,t){let n=Eo();O(t,!0),K(e,Eae);let r=J(t,`selected`,15,!1),i=J(t,`hidden`,15,!1),a=J(t,`disabled`,3,!1),o=J(t,`value`,19,()=>t.label),s=J(t,`searchValue`,19,()=>t.label),c=J(t,`wrap`,3,!1),l=ks(t,Cae),u=Rre();u&&Ms(u.register({get value(){return o()},get label(){return t.label},get name(){return t.name},get type(){return t.valueType??dl(o())},get selected(){return r()},set selected(e){r(e)},get disabled(){return a()}}));let d=A(()=>!u||u.expanded);var f=H(),p=P(f),m=e=>{var u=Tae();let d;var f=N(u);{let e=e=>{var n=H();Go(P(n),()=>t.startIcon??kr),U(e,n)},c=A(()=>t.id??n);Al(f,As(()=>l,{role:`option`,get id(){return z(c)},tabindex:`-1`,get"aria-selected"(){return r()},get label(){return t.label},get value(){return o()},get hidden(){return i()},get disabled(){return a()},get"data-search-value"(){return s()},onChange:e=>{r(e.detail.selected),t.onChange?.(e)},onToggle:e=>{i(e.detail.hidden),i()&&r(!1),t.onToggle?.(e)},startIcon:e,children:(e,n)=>{var i=wae(),a=P(i),o=e=>{var n=H(),r=P(n),i=e=>{var n=H();Go(P(n),()=>t.checkIcon),U(e,n)},a=e=>{Xc(e,{class:`check`,name:`check`})};G(r,e=>{t.checkIcon?e(i):e(a,-1)}),U(e,n)};G(a,e=>{r()&&e(o)}),Go(I(a,2),()=>t.children??kr),U(e,i)},$$slots:{startIcon:!0,default:!0}}))}D(u),R(()=>{d=os(u,1,`sui option ${t.class??``}`,`svelte-18hujd0`,d,{wrap:c()}),q(u,`hidden`,i())}),U(e,u)};G(p,e=>{z(d)&&e(m)}),U(e,f),k()}var Dae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`ariaLabel`,`children`,`onChange`]),Oae=B(`<div><!></div>`),kae={hash:`svelte-4gwz0i`,code:`.menu.svelte-4gwz0i {display:flex;flex-direction:column;margin:0;border-width:var(--sui-menu-border-width, 1px);border-style:var(--sui-menu-border-style, solid);border-color:var(--sui-menu-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-menu-border-radius, 4px);padding:var(--sui-menu-padding, 4px);}.menu.svelte-4gwz0i [role=separator] {margin:var(--sui-menu-divider-margin, 4px);width:auto;background-color:var(--sui-menu-divider-color, var(--sui-control-border-color));}`};function Eu(e,t){O(t,!0),K(e,kae);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`ariaLabel`,3,void 0),a=ks(t,Dae);var o=Oae(),s=e=>{t.onChange?.(e)};bs(o,()=>({...a,role:`menu`,class:`sui menu ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-label":i(),onChange:s}),void 0,void 0,void 0,`svelte-4gwz0i`),Go(N(o),()=>t.children??kr),D(o),es(o,ql),U(e,o),k()}var Aae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`role`,`hidden`,`disabled`,`label`,`labelDir`,`popupPosition`,`children`,`startIcon`,`endIcon`,`chevronIcon`,`items`,`onmouseenter`,`onmouseleave`,`onclick`,`onChange`,`onSelect`]),jae=B(`<span role="none" class="icon-outer svelte-gbt0hm"><!></span>`),Mae=B(`<div role="none"><!></div> <!>`,1),Nae=B(`<div role="none"><!> <!></div>`),Pae={hash:`svelte-gbt0hm`,code:`.menuitem.svelte-gbt0hm {position:relative;}.menuitem.svelte-gbt0hm button {display:flex;gap:var(--sui-menuitem-gap, 4px);align-items:var(--sui-menuitem-align-items, center);border-radius:var(--sui-menuitem-border-radius, var(--sui-option-border-radius, 4px));margin:0 !important;padding:var(--sui-menuitem-padding, 0 16px);width:100%;min-width:var(--sui-menuitem-min-width, 160px);height:var(--sui-menuitem-height, var(--sui-option-height));color:var(--sui-menuitem-foreground-color, var(--sui-control-foreground-color, inherit));background-color:var(--sui-menuitem-background-color, transparent);font-size:var(--sui-menuitem-font-size, var(--sui-option-font-size));font-weight:var(--sui-menuitem-font-weight, var(--sui-option-font-weight, var(--sui-font-weight-normal, normal)));}.menuitem.svelte-gbt0hm button[aria-checked=true] .icon {color:var(--sui-primary-accent-color-text);}.menuitem.svelte-gbt0hm button:hover {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}.menuitem.svelte-gbt0hm button:active {background-color:var(--sui-active-background-color);}.content.svelte-gbt0hm {flex:auto;}.icon-outer.svelte-gbt0hm {flex:none;width:24px;height:24px;}`};function Du(e,t){O(t,!0),K(e,Pae);let n=J(t,`role`,3,`menuitem`),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`label`,3,``),o=J(t,`labelDir`,3,void 0),s=J(t,`popupPosition`,3,`right-top`),c=ks(t,Aae),l=j(!1),u=j(!1),d,f=j(void 0),p=j(void 0),m=A(()=>n()===`menuitem`&&!!t.items),h=e=>{window.clearTimeout(d),d=window.setTimeout(e,200)};js(()=>(M(p,z(f)?.closest(`dialog`)??void 0,!0),()=>{window.clearTimeout(d)}));var g=Nae(),_=N(g);{let e=e=>{var n=H();Go(P(n),()=>t.startIcon??kr),U(e,n)},s=e=>{var n=Mae(),r=P(n);let i;var s=N(r),c=e=>{var t=V();R(()=>W(t,a())),U(e,t)},l=e=>{var n=H();Go(P(n),()=>t.children??kr),U(e,n)};G(s,e=>{a()?e(c):e(l,-1)}),D(r);var u=I(r,2),d=e=>{var n=jae(),r=N(n),i=e=>{var n=H();Go(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{{let t=A(()=>qc()?`chevron_left`:`chevron_right`);Xc(e,{get name(){return z(t)}})}};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),D(n),U(e,n)};G(u,e=>{z(m)&&e(d)}),R(()=>{i=os(r,1,`content svelte-gbt0hm`,null,i,{label:!!a()}),q(r,`dir`,a()?o():void 0),r.dir=r.dir}),U(e,n)},p=e=>{var n=H();Go(P(n),()=>t.endIcon??kr),U(e,n)},g=A(()=>z(m)?`menu`:void 0),v=A(()=>z(m)?z(l):void 0);Al(_,As(()=>c,{get role(){return n()},get hidden(){return r()},get disabled(){return i()},get"aria-haspopup"(){return z(g)},get"aria-expanded"(){return z(v)},onmouseenter:e=>{z(m)&&h(()=>{M(l,!0)}),t.onmouseenter?.(e)},onmouseleave:e=>{z(m)&&h(()=>{z(u)||M(l,!1)}),t.onmouseleave?.(e)},onclick:e=>{z(m)&&(e.preventDefault(),e.stopPropagation(),window.clearTimeout(d),M(l,e.detail?!0:!z(l),!0)),t.onclick?.(e)},get onChange(){return t.onChange},get onSelect(){return t.onSelect},get element(){return z(f)},set element(e){M(f,e,!0)},startIcon:e,children:s,endIcon:p,$$slots:{startIcon:!0,default:!0,endIcon:!0}}))}var v=I(_,2),y=e=>{Ol(e,{get anchor(){return z(f)},get parentDialogElement(){return z(p)},get position(){return s()},get open(){return z(l)},set open(e){M(l,e,!0)},get hovered(){return z(u)},set hovered(e){M(u,e,!0)},children:(e,n)=>{Eu(e,{children:(e,n)=>{var r=H();Go(P(r),()=>t.items??kr),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(v,e=>{z(m)&&z(f)&&z(p)&&e(y)}),D(g),R(()=>{os(g,1,`sui menuitem ${t.class??``}`,`svelte-gbt0hm`),q(g,`hidden`,r())}),U(e,g),k()}var Fae=new Set([`$$slots`,`$$events`,`$$legacy`,`role`,`checked`,`class`,`hidden`,`disabled`,`label`,`children`,`startIcon`,`onChange`]);function Ou(e,t){O(t,!0);let n=J(t,`checked`,15),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`label`,3,``),o=ks(t,Fae),s=A(()=>t.role===`menuitemradio`?`menu-item-radio`:`menu-item-checkbox`);Du(e,As(()=>o,{get role(){return t.role},get class(){return`sui ${z(s)??``} ${t.class??``}`},get label(){return a()},get hidden(){return r()},get disabled(){return i()},get"aria-checked"(){return n()},onChange:e=>{n(e.detail.checked),t.onChange?.(e)},startIcon:e=>{var n=H();Go(P(n),()=>t.startIcon??kr),U(e,n)},children:e=>{var n=H();Go(P(n),()=>t.children??kr),U(e,n)},endIcon:e=>{var t=H(),r=P(t),i=e=>{Xc(e,{name:`check`})};G(r,e=>{n()&&e(i)}),U(e,t)},$$slots:{startIcon:!0,default:!0,endIcon:!0}})),k()}var Iae=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`]);function ku(e,t){O(t,!0);let n=J(t,`checked`,15),r=ks(t,Iae);Ou(e,As(()=>r,{role:`menuitemcheckbox`,get checked(){return n()},set checked(e){n(e)}})),k()}var Lae=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`]);function Au(e,t){O(t,!0);let n=J(t,`checked`,15),r=ks(t,Lae);Ou(e,As(()=>r,{role:`menuitemradio`,get checked(){return n()},set checked(e){n(e)}})),k()}var Rae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`now`,`min`,`max`,`text`,`ariaLabel`]),zae=B(`<div><div role="none" class="svelte-1818zm6"></div></div>`),Bae={hash:`svelte-1818zm6`,code:`.progressbar.svelte-1818zm6 {overflow:hidden;border-width:var(--sui-progressbar-border-width, 1px);border-style:var(--sui-progressbar-border-style, solid);border-color:var(--sui-progressbar-border-color, var(--sui-control-border-color));border-radius:var(--sui-progressbar-border-radius, 16px);width:var(--sui-progressbar-width, 240px);height:var(--sui-progressbar-height, 10px);background-color:var(--sui-progressbar-background-color, var(--sui-secondary-background-color));}.progressbar.svelte-1818zm6 div:where(.svelte-1818zm6) {height:100%;background-color:var(--sui-progressbar-foreground-color, var(--sui-primary-accent-color-light));transition:width 250ms;}`};function Vae(e,t){K(e,Bae);let n=J(t,`now`,3,0),r=J(t,`min`,3,0),i=J(t,`max`,3,100),a=J(t,`ariaLabel`,3,void 0),o=ks(t,Rae),s=A(()=>i()>r()?Math.min(Math.max((n()-r())/(i()-r())*100,0),100):0);var c=zae();bs(c,()=>({...o,role:`progressbar`,class:`sui progressbar ${t.class??``}`,"aria-valuenow":n(),"aria-valuemin":r(),"aria-valuemax":i(),"aria-valuetext":t.text,"aria-label":a()}),void 0,void 0,void 0,`svelte-1818zm6`);var l=N(c);let u;D(c),R(()=>u=cs(l,``,u,{width:`${z(s)}%`})),U(e,c)}var Hae=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`orientation`,`ariaLabel`,`children`,`onChange`]),Uae=B(`<div><div role="none" class="inner svelte-fua4o0"><!></div></div>`),Wae={hash:`svelte-fua4o0`,code:`.radio-group.svelte-fua4o0 {display:inline-flex;}.radio-group.svelte-fua4o0:focus-visible {outline-width:0 !important;}.radio-group.horizontal.svelte-fua4o0 {gap:8px;align-items:center;flex-wrap:wrap;}.radio-group.vertical.svelte-fua4o0 {gap:4px;flex-direction:column;}
@media (pointer: coarse) {.radio-group.vertical.svelte-fua4o0 {gap:8px;}
}.radio-group[aria-invalid=true].svelte-fua4o0 button {border-color:var(--sui-error-border-color);}.radio-group[aria-invalid=true].svelte-fua4o0 button[aria-checked=true] {border-color:var(--sui-error-border-color);}.radio-group[aria-invalid=true].svelte-fua4o0 button[aria-checked=true]::before {background-color:var(--sui-error-border-color);}.inner.svelte-fua4o0 {display:contents;}`};function ju(e,t){O(t,!0),K(e,Wae);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`readonly`,3,!1),a=J(t,`required`,3,!1),o=J(t,`invalid`,3,!1),s=J(t,`orientation`,3,`horizontal`),c=J(t,`ariaLabel`,3,void 0),l=ks(t,Hae);var u=Uae(),d=e=>{t.onChange?.(e)};bs(u,()=>({...l,role:`radiogroup`,class:[`sui`,`radio-group`,t.class,s()],tabindex:`-1`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-readonly":i(),"aria-required":a(),"aria-invalid":o(),"aria-orientation":s(),"aria-label":c(),onChange:d}),void 0,void 0,void 0,`svelte-fua4o0`);var f=N(u);Go(N(f),()=>t.children??kr),D(f),D(u),es(u,ql),R(()=>f.inert=r()),U(e,u),k()}var Gae=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`class`,`hidden`,`disabled`,`name`,`value`,`valueType`,`label`,`ariaLabel`,`group`,`children`,`onChange`,`onSelect`]),Kae=B(`<label class="svelte-1vzo19m"><!></label>`),qae=B(`<span role="none"><!> <!></span>`),Jae={hash:`svelte-1vzo19m`,code:`.radio.svelte-1vzo19m {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);min-width:24px;min-height:24px;color:var(--sui-control-foreground-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);cursor:pointer;-webkit-user-select:none;user-select:none;}.radio.svelte-1vzo19m:hover button {background-color:var(--sui-hover-background-color);}.radio.svelte-1vzo19m:hover button[aria-checked=true] {border-color:var(--sui-primary-accent-color-light);color:var(--sui-primary-accent-color-text);}.radio.svelte-1vzo19m:hover button[aria-checked=true]::before {background-color:var(--sui-primary-accent-color-light);}.radio.svelte-1vzo19m:active button {background-color:var(--sui-active-background-color);}.radio.svelte-1vzo19m:active button[aria-checked=true] {border-color:var(--sui-primary-accent-color-dark);color:var(--sui-primary-accent-color-dark);}.radio.svelte-1vzo19m button {flex:none;justify-content:center;overflow:hidden;margin:0 !important;border-width:1.5px;border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-height);padding:0;width:var(--sui-checkbox-height);height:var(--sui-checkbox-height);background-color:var(--sui-checkbox-background-color);transition:all 200ms;}.radio.svelte-1vzo19m button::before {content:"";border-radius:var(--sui-checkbox-height);width:calc(var(--sui-checkbox-height) - 7px);height:calc(var(--sui-checkbox-height) - 7px);background-color:var(--sui-primary-accent-color);opacity:0;transition:all 200ms;will-change:opacity;}.radio.svelte-1vzo19m button[aria-checked=true] {border-color:var(--sui-primary-accent-color);}.radio.svelte-1vzo19m button[aria-checked=true]::before {opacity:1;}.radio.svelte-1vzo19m label:where(.svelte-1vzo19m) {cursor:inherit;}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m {cursor:default;}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m button, [role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m:is(:where(.svelte-1vzo19m):hover, :where(.svelte-1vzo19m):active) button {background-color:var(--sui-checkbox-background-color);}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m button[aria-checked='true'], [role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m:is(:where(.svelte-1vzo19m):hover, :where(.svelte-1vzo19m):active) button[aria-checked='true'] {border-color:var(--sui-readonly-accent-color);}[role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m button[aria-checked='true']::before, [role='radiogroup'][aria-readonly='true'] .radio.svelte-1vzo19m:is(:where(.svelte-1vzo19m):hover, :where(.svelte-1vzo19m):active) button[aria-checked='true']::before {background-color:var(--sui-readonly-accent-color);}`};function Mu(e,t){let n=Eo();O(t,!0),K(e,Jae);let r=J(t,`checked`,7,!1),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`name`,3,void 0),s=J(t,`value`,3,void 0),c=J(t,`valueType`,3,void 0),l=J(t,`label`,3,void 0),u=J(t,`ariaLabel`,3,void 0),d=J(t,`group`,15),f=ks(t,Gae),p=j(void 0),m=A(()=>u()??f[`aria-label`]),h=A(()=>!!(t.children||l())),g=()=>!!z(p)?.closest(`[role="radiogroup"]`)?.matches(`[aria-readonly="true"]`);L(()=>{typeof d()==`string`&&(d()===s()?r()||r(!0):r()&&r(!1))});var _=qae();let v;var y=N(_);{let e=A(()=>z(m)||void 0),l=A(()=>!z(m)&&z(h)?`${n}-label`:void 0);Al(y,As(()=>f,{role:`radio`,get id(){return n},get hidden(){return i()},get disabled(){return a()},get name(){return o()},get value(){return s()},get valueType(){return c()},get"aria-checked"(){return r()},get"aria-label"(){return z(e)},get"aria-labelledby"(){return z(l)},onclick:e=>{e.preventDefault(),!(a()||r()||g())&&(r(!0),typeof d()==`string`&&d(s()))},onChange:e=>{r(e.detail.checked),r()&&typeof d()==`string`&&d(s()),t.onChange?.(e)},get onSelect(){return t.onSelect},get element(){return z(p)},set element(e){M(p,e,!0)}}))}var b=I(y,2),x=e=>{var r=Kae(),i=N(r),a=e=>{var n=H();Go(P(n),()=>t.children??kr),U(e,n)},o=e=>{var t=V();R(()=>W(t,l())),U(e,t)};G(i,e=>{t.children?e(a):e(o,-1)}),D(r),R(()=>q(r,`id`,`${n}-label`)),U(e,r)};G(b,e=>{(t.children||l())&&e(x)}),D(_),R(()=>{v=os(_,1,`sui radio ${t.class??``}`,`svelte-1vzo19m`,v,{disabled:a()}),q(_,`hidden`,i())}),bo(`click`,_,e=>{e.target.matches(`button`)||z(p)?.click()}),U(e,_),k()}xo([`click`]);var Nu=(e,t,n)=>{if(typeof e==`number`)return e;if(!e||typeof e!=`string`)return t;let r=e.trim(),i=r.match(/^(-?\d+(?:\.\d+)?)%$/);if(i)return Number(i[1]);let{containerSize:a}=n;if(!a)return t;let o=r.match(/^(-?\d+(?:\.\d+)?)px$/i);if(o)return Number(o[1])/a*100;let s=r.match(/^(-?\d+(?:\.\d+)?)(dvw|vw|dvh|vh)$/i);if(s){let e=Number(s[1]),t=s[2].toLowerCase().endsWith(`w`)?n.viewportWidth:n.viewportHeight;return e/100*t/a*100}return t},Pu=(e,t)=>{if(!e)return{minSize:0,maxSize:100};let n=Math.max(0,Nu(e.minSize,0,t)),r=Math.min(100,Nu(e.maxSize,100,t));return{minSize:n,maxSize:Math.max(n,r)}},Fu=(e,t,n,r)=>{let i=r,a=n;for(;a.length&&Math.abs(i)>1e-9;){let n=i/a.length,r=a.map(r=>{let{minSize:i,maxSize:a}=t[r],o=Math.min(a,Math.max(i,e[r]+n)),s=o-e[r];return e[r]=o,s});i-=r.reduce((e,t)=>e+t,0),a=a.filter(r=>n>0?e[r]<t[r].maxSize:e[r]>t[r].minSize)}return i},Yae=(e,t)=>{let n=e.filter(e=>!Number.isNaN(e)),r=n.reduce((e,t)=>e+t,0),i=e.length-n.length,a=Math.max(0,100-r),o=i>0?a/i:0,s=e.map(e=>Number.isNaN(e)?o:e);if(!t)return s;let c=s.reduce((e,t)=>e+t,0),l=s.map((e,n)=>t[n]??{minSize:0,maxSize:100}),u=s.map((e,t)=>Math.min(l[t].maxSize,Math.max(l[t].minSize,e))),d=s.map((e,t)=>t);return Fu(u,l,d,Fu(u,l,d.filter(t=>Number.isNaN(e[t])),c-u.reduce((e,t)=>e+t,0))),u},Xae=(e,{sizeBefore:t,sizeAfter:n,constraintsBefore:r,constraintsAfter:i})=>{let a=Math.max(0,Math.min(r.maxSize-t,n-i.minSize)),o=Math.max(0,Math.min(t-r.minSize,i.maxSize-n));return e>0?Math.min(e,a):-Math.min(-e,o)},Zae=({key:e,shiftKey:t,isHorizontal:n,rtl:r})=>{if(e===`Enter`)return{type:`toggle`};if(e===`Home`)return{type:`resize`,delta:-100};if(e===`End`)return{type:`resize`,delta:100};let i=t?10:1,{prevKey:a,nextKey:o}=Rl(n?`horizontal`:`vertical`,r);if(e===a)return{type:`resize`,delta:-i};if(e===o)return{type:`resize`,delta:i}},Qae=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`showHandleBar`,`class`,`ariaLabel`,`children`,`onResizeStart`,`onResizeEnd`]),$ae=B(`<div role="none" class="handle-bar svelte-kvcfpg"></div>`),eoe=B(`<div><!></div>`),toe={hash:`svelte-kvcfpg`,code:`.resizable-handle.svelte-kvcfpg {position:relative;flex:0 0 auto;display:flex;align-items:center;justify-content:center;touch-action:none;outline-offset:0;background-color:transparent;transition:background-color 200ms;}.resizable-handle.svelte-kvcfpg:focus-visible, .resizable-handle.svelte-kvcfpg:hover, .resizable-handle.dragging.svelte-kvcfpg {outline:none;z-index:1;background-color:var(--sui-primary-accent-color-translucent-light);}.resizable-handle.svelte-kvcfpg:focus-visible .handle-bar:where(.svelte-kvcfpg), .resizable-handle.svelte-kvcfpg:hover .handle-bar:where(.svelte-kvcfpg), .resizable-handle.dragging.svelte-kvcfpg .handle-bar:where(.svelte-kvcfpg) {background-color:var(--sui-primary-accent-color);}.resizable-handle.disabled.svelte-kvcfpg {pointer-events:none;opacity:0.4;}.resizable-handle.svelte-kvcfpg::before {content:"";position:absolute;inset:0;z-index:1;}.resizable-handle.horizontal.svelte-kvcfpg {width:var(--sui-resizable-handle-size, 4px);height:100%;cursor:col-resize;}.resizable-handle.horizontal.svelte-kvcfpg::before {inset-inline:calc((var(--sui-resizable-handle-size, 4px) - 24px) / 2);}.resizable-handle.horizontal.svelte-kvcfpg .handle-bar:where(.svelte-kvcfpg) {width:2px;height:40%;min-height:20px;}.resizable-handle.vertical.svelte-kvcfpg {width:100%;height:var(--sui-resizable-handle-size, 4px);cursor:row-resize;}.resizable-handle.vertical.svelte-kvcfpg::before {inset-block:calc((var(--sui-resizable-handle-size, 4px) - 24px) / 2);}.resizable-handle.vertical.svelte-kvcfpg .handle-bar:where(.svelte-kvcfpg) {height:2px;width:40%;min-width:20px;}.resizable-handle.svelte-kvcfpg .handle-bar:where(.svelte-kvcfpg) {border-radius:1px;background-color:hsl(var(--sui-border-color-1-hsl));transition:background-color 200ms;}`};function Iu(e,t){O(t,!0),K(e,toe);let n=J(t,`disabled`,3,!1),r=J(t,`showHandleBar`,3,!1),i=J(t,`ariaLabel`,3,void 0),a=ks(t,Qae),o=si(`paneGroup`);if(!o)throw Error(`<ResizableHandle> must be used inside a <ResizablePaneGroup>`);let s=o.registerHandle(),c=A(()=>o.direction===`horizontal`),l=A(()=>o.sizes),u=A(()=>z(l)[s]??0),d=A(()=>o.getPaneConstraints(s)),f=A(()=>o.getPaneConstraints(s+1)),p=A(()=>z(u)+(z(l)[s+1]??0)),m=A(()=>Math.max(z(d).minSize,z(p)-z(f).maxSize)),h=A(()=>Math.min(z(d).maxSize,z(p)-z(f).minSize)),g=j(void 0),_=j(!1),v=j(0),y=0,b=j(0),x=j(!1),S=0,C=e=>{let{screenX:t,screenY:r,pointerId:i}=e;if(n()||!z(_)||i!==z(b))return;e.preventDefault(),e.stopPropagation();let a=(z(c)?t:r)-z(v);if(!S)return;let u=a/S*100;z(c)&&qc()&&(u=-u),o.resize(s,y+u-(z(l)[s]??0))},w=e=>{let{pointerId:n}=e;z(_)&&n===z(b)&&(z(g)?.releasePointerCapture(n),M(_,!1),M(v,0),M(b,0),t.onResizeEnd?.(),document.removeEventListener(`pointermove`,C),document.removeEventListener(`pointerup`,w),document.removeEventListener(`pointercancel`,w))},T=e=>{if(n())return;e.preventDefault(),e.stopPropagation();let{screenX:r,screenY:i,pointerId:a}=e;M(_,!0),M(v,z(c)?r:i,!0),y=z(l)[s]??0,M(b,a,!0),S=o.measurePaneSpace(),z(g)?.setPointerCapture(a),t.onResizeStart?.(),document.addEventListener(`pointermove`,C),document.addEventListener(`pointerup`,w),document.addEventListener(`pointercancel`,w)},ee=e=>{if(n())return;let{key:r,shiftKey:i}=e,a=Zae({key:r,shiftKey:i,isHorizontal:z(c),rtl:qc()});a&&(e.preventDefault(),e.stopPropagation(),a.type===`toggle`?o.toggleCollapse(s):(r!==`Home`&&r!==`End`&&!z(x)&&(M(x,!0),t.onResizeStart?.()),o.resize(s,a.delta)))},te=()=>{z(x)&&(M(x,!1),t.onResizeEnd?.())};L(()=>()=>{document.removeEventListener(`pointermove`,C),document.removeEventListener(`pointerup`,w),document.removeEventListener(`pointercancel`,w)});var ne=eoe();bs(ne,e=>({...a,role:`separator`,tabindex:n()?-1:0,"aria-orientation":z(c)?`vertical`:`horizontal`,"aria-valuenow":e,"aria-valuemin":z(m),"aria-valuemax":z(h),"aria-controls":o.paneDefs[s]?.id,"aria-disabled":n()||void 0,"aria-label":i(),class:`sui resizable-handle ${t.class??``}`,onpointerdown:T,onkeydown:ee,onblur:te,[ms]:{horizontal:z(c),vertical:!z(c),disabled:n(),dragging:z(_)}}),[()=>Math.round(z(u))],void 0,void 0,`svelte-kvcfpg`);var re=N(ne),ie=e=>{var n=H();Go(P(n),()=>t.children),U(e,n)},ae=e=>{U(e,$ae())};G(re,e=>{t.children?e(ie):r()&&e(ae,1)}),D(ne),Ds(ne,e=>M(g,e),()=>z(g)),U(e,ne),k()}var noe=new Set([`$$slots`,`$$events`,`$$legacy`,`direction`,`class`,`children`,`onResize`]),roe=B(`<div><!></div>`),ioe={hash:`svelte-sqq0n6`,code:`.resizable-pane-group.svelte-sqq0n6 {display:flex;overflow:hidden;}.resizable-pane-group.horizontal.svelte-sqq0n6 {flex-direction:row;width:100%;height:100%;}.resizable-pane-group.vertical.svelte-sqq0n6 {flex-direction:column;width:100%;height:100%;}`};function Lu(e,t){O(t,!0),K(e,ioe);let n=J(t,`direction`,3,`horizontal`),r=ks(t,noe),i=ta([]),a=j(void 0),o=ta([]),s=ta([]),c=0,l=()=>{if(!z(a))return 0;let e=n()===`horizontal`,t=e?z(a).clientWidth:z(a).clientHeight,r=[...z(a).querySelectorAll(`:scope > .resizable-handle`)].reduce((t,n)=>t+(e?n.offsetWidth:n.offsetHeight),0);return Math.max(t-r,0)},u=()=>({containerSize:l(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}),d=e=>Pu(i[e],u()),f=()=>{if(!i.length)return;let e=u(),t=i.map(t=>t.defaultSize===void 0?NaN:Nu(t.defaultSize,NaN,e)),n=i.map(t=>Pu(t,e));o.splice(0,o.length,...Yae(t,n))},p=(e,n)=>{let r=e,i=e+1;if(r<0||i>=o.length)return;let a=o[r],s=o[i],c=Xae(n,{sizeBefore:a,sizeAfter:s,constraintsBefore:d(r),constraintsAfter:d(i)});o[r]=a+c,o[i]=s-c,t.onResize?.({sizes:o.map(e=>Number(e.toFixed(1)))})};ci(`paneGroup`,{get direction(){return n()},sizes:o,registerPane:({id:e,defaultSize:t,minSize:n,maxSize:r})=>{let a=i.length;return i.push({id:e,defaultSize:t,minSize:n,maxSize:r}),{index:a}},registerHandle:()=>{let e=c;return c+=1,e},resize:p,toggleCollapse:e=>{let{minSize:t}=d(e);if(s[e]!==void 0){let t=s[e]-o[e];s[e]=void 0,p(e,t)}else s[e]=o[e],p(e,-(o[e]-t))},getPaneConstraints:d,measurePaneSpace:l,paneDefs:i}),L(()=>{i.length&&!o.length&&f()});var m=roe();bs(m,()=>({...r,role:`none`,class:[`sui`,`resizable-pane-group`,n(),t.class],"data-direction":n()}),void 0,void 0,void 0,`svelte-sqq0n6`),Go(N(m),()=>t.children??kr),D(m),Ds(m,e=>M(a,e),()=>z(a)),U(e,m),k()}var aoe=new Set([`$$slots`,`$$events`,`$$legacy`,`defaultSize`,`minSize`,`maxSize`,`class`,`children`,`onResize`]),ooe=B(`<div><!></div>`);function Ru(e,t){let n=Eo();O(t,!0);let r=J(t,`defaultSize`,3,void 0),i=J(t,`minSize`,3,0),a=J(t,`maxSize`,3,100),o=ks(t,aoe),s=si(`paneGroup`);if(!s)throw Error(`<ResizablePane> must be used inside a <ResizablePaneGroup>`);let{index:c}=s.registerPane({id:n,defaultSize:r(),minSize:i(),maxSize:a()}),l=A(()=>s.direction),u=A(()=>s.sizes[c]),d=A(()=>z(u)===void 0?typeof r()==`number`?`${r()}%`:r()??`0%`:`${z(u)}%`);L(()=>{z(u)!==void 0&&fo(()=>t.onResize?.({size:Number(z(u).toFixed(1))}))});var f=ooe();bs(f,()=>({...o,id:n,role:`none`,class:`sui resizable-pane ${t.class??``}`,[hs]:{"flex-basis":z(d),"flex-grow":`0`,"flex-shrink":`1`,"overflow-x":z(l)===`horizontal`?`auto`:void 0,"overflow-y":z(l)===`vertical`?`auto`:void 0}})),Go(N(f),()=>t.children??kr),D(f),U(e,f),k()}var soe=B(`<div role="none" class="spinner svelte-ozrfpd"></div>`),coe=B(`<!> <!>`,1),loe={hash:`svelte-ozrfpd`,code:`.spinner.svelte-ozrfpd {height:1px;}`};function zu(e,t){O(t,!0),K(e,loe);let n=J(t,`itemChunkSize`,3,25),r=j(ta(n())),i=j(void 0),a=A(()=>t.items.length>z(r)),o=e=>{for(let t=e.parentElement;t;t=t.parentElement)if(t.scrollHeight-t.clientHeight>1&&/^(auto|scroll)$/.test(getComputedStyle(t).overflowY))return t;return null};L(()=>{if(z(r),!z(i))return;let e=new IntersectionObserver(e=>{e.at(-1)?.isIntersecting&&z(a)&&M(r,z(r)+n())},{root:o(z(i)),rootMargin:`0px 0px 500px 0px`});return e.observe(z(i)),()=>{e.disconnect()}});var s=coe(),c=P(s);Bo(c,19,()=>t.items.slice(0,z(r)),(e,n)=>e[t.itemKey]??n,(e,n,r)=>{var i=H();Go(P(i),()=>t.renderItem,()=>z(n),()=>z(r)),U(e,i)});var l=I(c,2),u=e=>{var t=soe();Ds(t,e=>M(i,e),()=>z(i)),U(e,t)};G(l,e=>{z(a)&&e(u)}),U(e,s),k()}function uoe(e){let t=e-1;return t*t*t+1}function Bu(e,{from:t,to:n},r={}){var{delay:i=0,duration:a=e=>Math.sqrt(e)*120,easing:o=uoe}=r,s=getComputedStyle(e),c=s.transform===`none`?``:s.transform,[l,u]=s.transformOrigin.split(` `).map(parseFloat);l/=e.clientWidth,u/=e.clientHeight;var d=doe(e),f=e.clientWidth/n.width/d,p=e.clientHeight/n.height/d,m=t.left+t.width*l,h=t.top+t.height*u,g=n.left+n.width*l,_=n.top+n.height*u,v=(m-g)*f,y=(h-_)*p,b=t.width/n.width,x=t.height/n.height;return{delay:i,duration:typeof a==`function`?a(Math.sqrt(v*v+y*y)):a,easing:o,css:(e,t)=>`transform: ${c} translate(${t*v}px, ${t*y}px) scale(${e+t*b}, ${e+t*x});`}}function doe(e){if(`currentCSSZoom`in e)return e.currentCSSZoom;for(var t=e,n=1;t!==null;)n*=+getComputedStyle(t).zoom,t=t.parentElement;return n}var foe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`flex`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`searchIcon`,`closeIcon`,`onClear`]),poe=B(`<div><span role="none" class="svelte-4cx7he"><!></span> <!> <!></div>`),moe={hash:`svelte-4cx7he`,code:`.search-bar.svelte-4cx7he {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.search-bar.flex.svelte-4cx7he:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.search-bar.svelte-4cx7he > span:where(.svelte-4cx7he) {position:absolute;inset-block:0;inset-inline-start:0;inset-inline-end:auto;z-index:2;display:flex;align-items:center;justify-content:center;width:var(--sui-button-medium-height);height:var(--sui-button-medium-height);}.search-bar.svelte-4cx7he .icon {font-size:calc(var(--sui-textbox-height) * 0.6);opacity:0.5;}.search-bar.svelte-4cx7he > button {position:absolute;inset-block:0;inset-inline-start:auto;inset-inline-end:0;z-index:2;margin:0 !important;height:var(--sui-button-medium-height);}.search-bar.svelte-4cx7he .label {--sui-textbox-singleline-padding: 0 36px;}.search-bar.svelte-4cx7he .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.search-bar.svelte-4cx7he input {z-index:1;padding:0 var(--sui-button-medium-height) !important;width:100%;}.search-bar.svelte-4cx7he:dir(rtl) {--sui-textbox-text-align: right;}`};function Vu(e,t){let n=Eo();O(t,!0),K(e,moe);let r=J(t,`value`,15),i=J(t,`flex`,3,!1),a=J(t,`hidden`,3,!1),o=J(t,`disabled`,3,!1),s=J(t,`readonly`,3,!1),c=J(t,`required`,3,!1),l=J(t,`invalid`,3,!1),u=ks(t,foe),d=j(void 0);var f={focus:()=>{z(d)?.focus()}},p=poe();let m;var h=N(p),g=N(h),_=e=>{var n=H();Go(P(n),()=>t.searchIcon),U(e,n)},v=e=>{Xc(e,{name:`search`})};G(g,e=>{t.searchIcon?e(_):e(v,-1)}),D(h);var y=I(h,2);fu(y,As({dir:`auto`},()=>u,{role:`searchbox`,get id(){return n},get flex(){return i()},get hidden(){return a()},get disabled(){return o()},get readonly(){return s()},get required(){return c()},get invalid(){return l()},inputmode:`search`,get element(){return z(d)},set element(e){M(d,e,!0)},get value(){return r()},set value(e){r(e)}}));var b=I(y,2),x=e=>{{let i=e=>{var n=H(),r=P(n),i=e=>{var n=H();Go(P(n),()=>t.closeIcon),U(e,n)},a=e=>{Xc(e,{name:`close`})};G(r,e=>{t.closeIcon?e(i):e(a,-1)}),U(e,n)},a=A(()=>o()||s()),c=A(()=>Y(`_sui.clear`));Al(e,{iconic:!0,get disabled(){return z(a)},get"aria-label"(){return z(c)},get"aria-controls"(){return n},onclick:()=>{r(``),z(d)?.focus(),t.onClear?.()},startIcon:i,$$slots:{startIcon:!0}})}};return G(b,e=>{r()&&e(x)}),D(p),R(()=>{q(p,`role`,a()?void 0:`none`),m=os(p,1,`sui search-bar ${t.class??``}`,`svelte-4cx7he`,m,{flex:i(),disabled:o(),readonly:s()}),q(p,`hidden`,a()),q(p,`aria-hidden`,a())}),U(e,p),k(f)}var hoe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`editable`,`position`,`filterThreshold`,`ariaLabel`,`children`,`chevronIcon`,`onChange`]),goe=B(`<div><div role="none" class="label svelte-iqscl7"><!></div></div>`),_oe=B(`<div role="status" class="no-options svelte-iqscl7"> </div>`),voe=B(`<div role="none" class="combobox-inner svelte-iqscl7"><!> <div role="none" class="listbox-slot svelte-iqscl7"></div> <!></div>`),yoe=B(`<div role="none"><!> <!></div> <div role="none" class="idle-host" hidden=""><div role="none" class="option-host svelte-iqscl7"><!></div></div> <!>`,1),boe={hash:`svelte-iqscl7`,code:`:is(.option-host.svelte-iqscl7, .listbox-slot.svelte-iqscl7) {display:contents;}.combobox.svelte-iqscl7 {margin:var(--sui-focus-ring-width);display:flex;align-items:center;position:relative;min-width:var(--sui-combobox-min-width, calc(var(--sui-option-height) * 5));}.combobox.svelte-iqscl7 div[role=combobox]:where(.svelte-iqscl7) {display:flex;align-items:center;border-width:1px;border-color:var(--sui-control-border-color);border-radius:var(--sui-textbox-border-radius);padding-block:0;padding-inline-start:calc(var(--sui-textbox-height) / 4);padding-inline-end:var(--sui-textbox-height);width:100%;height:var(--sui-textbox-height);color:var(--sui-control-foreground-color);background-color:var(--sui-disabled-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);-webkit-user-select:none;user-select:none;cursor:pointer;transition:all 200ms;}.combobox.svelte-iqscl7 div[role=combobox]:where(.svelte-iqscl7):not(.selected) {font-style:italic;}.combobox.svelte-iqscl7 div[role=combobox]:where(.svelte-iqscl7):is(:where(.svelte-iqscl7):hover, :where(.svelte-iqscl7):focus) {background-color:var(--sui-hover-background-color);}.combobox.svelte-iqscl7 div[role=combobox][aria-readonly=true]:where(.svelte-iqscl7) {cursor:default;}.combobox.svelte-iqscl7 div[role=combobox][aria-readonly=true]:where(.svelte-iqscl7):is(:where(.svelte-iqscl7):hover, :where(.svelte-iqscl7):focus):not(:focus-visible) {background-color:var(--sui-disabled-background-color);}.combobox.svelte-iqscl7 div[role=combobox][aria-invalid=true]:where(.svelte-iqscl7) {border-color:var(--sui-error-border-color);}.combobox.svelte-iqscl7 div[role=combobox]:where(.svelte-iqscl7) .label:where(.svelte-iqscl7) {width:100%;}.combobox.svelte-iqscl7 .icon {font-size:var(--sui-font-size-xx-large);opacity:0.5;}.combobox.svelte-iqscl7 > button {position:absolute;inset-block-start:0;inset-inline-end:0;z-index:1;margin:0 !important;border-start-start-radius:0;border-end-start-radius:0;background-color:transparent !important;}.combobox.svelte-iqscl7 > button[tabindex="-1"] {pointer-events:none;}.combobox.svelte-iqscl7 .text-input {margin:0 !important;width:100% !important;}.combobox.svelte-iqscl7 input {padding-block:0;padding-inline:8px 32px;width:0;}.combobox-inner.svelte-iqscl7 {flex:auto;display:flex;flex-direction:column;overflow:hidden;}.combobox-inner.svelte-iqscl7 .sui.search-bar {flex:none;margin-bottom:calc(8px - var(--sui-focus-ring-width));}.combobox-inner.svelte-iqscl7 .sui.listbox {flex:auto;overflow-y:auto;}.combobox-inner.svelte-iqscl7 .no-options:where(.svelte-iqscl7) {flex:none;display:flex;align-items:center;padding:var(--sui-option-padding);height:var(--sui-option-height);color:var(--sui-tertiary-foreground-color);}`};function xoe(e,t){let n=Eo();O(t,!0),K(e,boe);let r=J(t,`value`,15),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`readonly`,3,!1),s=J(t,`required`,3,!1),c=J(t,`invalid`,3,!1),l=J(t,`editable`,3,!0),u=J(t,`position`,3,`bottom-left`),d=J(t,`filterThreshold`,3,5),f=J(t,`ariaLabel`,3,void 0),p=ks(t,hoe),m=j(!1),h=j(void 0),g=j(void 0),_=j(void 0),v=j(void 0),y=j(void 0),b=j(void 0),x=j(``),S=j(!1),C=j(``),w=j(0),T=A(()=>!z(C)||z(w)>0),ee=A(()=>z(h)??z(g)),te=Lre(),ne=()=>{let e=te.find(r());M(x,e?.label??``,!0),te.selectOnly(r())},re=({type:e,name:n,label:r,value:i})=>{t.onChange?.(new CustomEvent(`Change`,{detail:{target:void 0,type:e,name:n,label:r,value:i}}))},ie=e=>{let n=Fl(e);r(n.value),ne(),t.onChange?.(new CustomEvent(`Change`,{detail:n}))},ae=e=>{let{target:n}=e;r(n.value),ne(),t.oninput?.(e),t.onChange?.(new CustomEvent(`Change`,{detail:{target:n,type:`string`,name:void 0,label:n.value,value:r()}}))},oe=new zl,se=e=>{let{key:t,ctrlKey:n,metaKey:i,altKey:s}=e;if(a()||o()||z(m)||t.length!==1||t===` `||n||i||s)return;e.preventDefault();let c=te.entries.filter(e=>!e.disabled),l=Bl(c.map(e=>Ll(e.label??``)),oe.push(t),c.findIndex(e=>e.value===r()));if(l===-1)return;let u=c[l];u.value!==r()&&(r(u.value),ne(),re(u))},ce=()=>z(y)?.querySelector(`[role="listbox"]`),le=()=>{let e=ce(),t=e?.querySelector(`[role="option"][aria-selected="true"]`);e&&t&&(t.classList.add(`focused`),e.setAttribute(`aria-activedescendant`,t.id),t.scrollIntoView(!0))};L(()=>{te.expanded=z(m)}),L(()=>{if(!z(m))return;let e=globalThis.setTimeout(le,150);return()=>{globalThis.clearTimeout(e),ce()?.removeAttribute(`aria-activedescendant`)}}),L(()=>{if(!z(y))return;let e=z(m)?z(b):z(v);e&&z(y).parentElement!==e&&e.append(z(y))}),js(()=>{let e=te.selectedEntry;e&&(r(e.value),M(x,e.label,!0),re(e))}),L(()=>{r(),ne()});var ue=yoe(),de=P(ue);let fe;var pe=N(de),me=e=>{var t=goe();bs(t,()=>({...p,role:`combobox`,id:n,tabindex:a()?-1:0,"aria-expanded":z(m),"aria-hidden":i(),"aria-disabled":a(),"aria-readonly":o(),"aria-required":s(),"aria-invalid":c(),"aria-haspopup":`listbox`,"aria-label":f(),onkeydown:se,[ms]:{selected:r()!==void 0}}),void 0,void 0,void 0,`svelte-iqscl7`);var l=N(t);fl(N(l),{children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>r()===void 0?Y(`_sui.combobox.select_an_option`):z(x)]),U(e,n)},$$slots:{default:!0}}),D(l),D(t),Ds(t,e=>M(h,e),()=>z(h)),U(e,t)},he=e=>{{let t=A(()=>r()===void 0?``:String(r()));fu(e,As(()=>p,{dir:`auto`,role:`combobox`,get id(){return n},get value(){return z(t)},get hidden(){return i()},get disabled(){return a()},get readonly(){return o()},get required(){return s()},get invalid(){return c()},get"aria-expanded"(){return z(m)},"aria-haspopup":`listbox`,get ariaLabel(){return f()},oninput:ae,get element(){return z(g)},set element(e){M(g,e,!0)}}))}};G(pe,e=>{l()?e(he,-1):e(me)});var ge=I(pe,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Go(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{Xc(e,{name:`expand_more`})};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>!l()||o()||a()?-1:0),s=A(()=>z(m)?Y(`_sui.collapse`):Y(`_sui.expand`)),c=A(()=>z(m)?`${n}-popup`:void 0);Al(ge,{variant:`ghost`,iconic:!0,get hidden(){return i()},get disabled(){return a()},get tabindex(){return z(r)},get"aria-label"(){return z(s)},get"aria-controls"(){return z(c)},get"aria-expanded"(){return z(m)},onclick:e=>{e.preventDefault(),e.stopPropagation(),!a()&&!o()&&M(m,!z(m))},startIcon:e,$$slots:{startIcon:!0}})}D(de);var _e=I(de,2),ve=N(_e);Cu(N(ve),{get id(){return`${n}-listbox`},class:`in-combobox`,get searchTerms(){return z(C)},onclick:e=>{e.target.matches(`[role="option"]`)&&ie(e.target)},onFilter:e=>{M(w,e.detail.matched,!0)},children:(e,n)=>{var r=H();Go(P(r),()=>t.children??kr),U(e,r)},$$slots:{default:!0}}),D(ve),Ds(ve,e=>M(y,e),()=>z(y)),D(_e),Ds(_e,e=>M(v,e),()=>z(v)),Ol(I(_e,2),{get id(){return`${n}-popup`},class:`combobox`,get anchor(){return z(ee)},get position(){return u()},touchOptimized:!0,onOpen:()=>{M(S,d()!==-1&&te.count>d(),!0),M(C,``)},get content(){return z(_)},set content(e){M(_,e,!0)},get open(){return z(m)},set open(e){M(m,e,!0)},children:(e,t)=>{var r=voe(),i=N(r),a=e=>{{let t=A(()=>Y(`_sui.combobox.filter_options`));Vu(e,{flex:!0,get"aria-label"(){return z(t)},get"aria-controls"(){return`${n}-listbox`},onkeydown:e=>{[`ArrowUp`,`ArrowDown`,`Enter`].includes(e.key)&&(e.preventDefault(),z(_)?.querySelector(`.sui.listbox`)?.dispatchEvent(new KeyboardEvent(`keydown`,e)))},get value(){return z(C)},set value(e){M(C,e,!0)}})}};G(i,e=>{z(S)&&e(a)});var o=I(i,2);Ds(o,e=>M(b,e),()=>z(b));var s=I(o,2),c=e=>{var t=_oe(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`_sui.combobox.no_matching_options`)]),U(e,t)};G(s,e=>{z(T)||e(c)}),D(r),U(e,r)},$$slots:{default:!0}}),R(()=>{fe=os(de,1,`sui combobox ${t.class??``}`,`svelte-iqscl7`,fe,{editable:l()}),q(de,`hidden`,i())}),U(e,ue),k()}var Soe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`class`]);function Hu(e,t){O(t,!0);let n=J(t,`value`,15),r=ks(t,Soe);xoe(e,As(()=>r,{get class(){return`sui select ${t.class??``}`},editable:!1,get value(){return n()},set value(e){n(e)}})),k()}var Coe=(e,t,n)=>{if(t===n)return e;let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r},woe=({key:e,index:t,length:n,rtl:r})=>e===(r?`ArrowRight`:`ArrowLeft`)&&t>0?t-1:e===(r?`ArrowLeft`:`ArrowRight`)&&t<n-1?t+1:e===`Home`&&t>0?0:e===`End`&&t<n-1?n-1:-1,Toe=({index:e,clientX:t,rect:n,rtl:r})=>t<n.left+n.width/2===r?e+1:e,Eoe=(e,t)=>{if(t!==e&&t!==e+1)return t>e?t-1:t},Doe=new Set([`$$slots`,`$$events`,`$$legacy`,`values`,`options`,`max`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`onAddValue`,`onRemoveValue`,`onReorder`]),Ooe=B(`<span role="gridcell" class="svelte-1e5oikm"><!></span>`),koe=B(`<span role="row"><span class="label svelte-1e5oikm" role="gridcell"> </span> <!></span>`),Aoe=B(`<div role="none"><span role="grid" class="svelte-1e5oikm"></span> <!></div>`),joe={hash:`svelte-1e5oikm`,code:`.select-tags.svelte-1e5oikm {display:flex;flex-wrap:wrap;align-items:center;}.select-tags.disabled.svelte-1e5oikm {pointer-events:none;}.select-tags.disabled.svelte-1e5oikm > :where(.svelte-1e5oikm) {opacity:0.5;}.select-tags.svelte-1e5oikm span[role=grid]:where(.svelte-1e5oikm) {display:contents;}.select-tags.svelte-1e5oikm span[draggable]:where(.svelte-1e5oikm) {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);padding:0;padding-inline-start:8px;border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-secondary-background-color);cursor:grab;outline:none;}.select-tags.svelte-1e5oikm span[draggable]:where(.svelte-1e5oikm):focus-within {outline:var(--sui-focus-ring-width) solid var(--sui-focus-ring-color);}.select-tags.svelte-1e5oikm span[draggable].drag-source:where(.svelte-1e5oikm) {opacity:0.4;cursor:grabbing;}.select-tags.svelte-1e5oikm span[draggable].drop-before:where(.svelte-1e5oikm)::before, .select-tags.svelte-1e5oikm span[draggable].drop-after:where(.svelte-1e5oikm)::after {content:"";position:absolute;top:0;bottom:0;margin-inline-start:-1px;border-radius:1px;width:4px;background-color:var(--sui-primary-accent-color);pointer-events:none;}.select-tags.svelte-1e5oikm span[draggable].drop-before:where(.svelte-1e5oikm)::before {inset-inline-start:calc(-1 * var(--sui-focus-ring-width) - 1px);}.select-tags.svelte-1e5oikm span[draggable].drop-after:where(.svelte-1e5oikm)::after {inset-inline-end:calc(-1 * var(--sui-focus-ring-width) - 1px);}.select-tags.svelte-1e5oikm span[draggable]:where(.svelte-1e5oikm) .label:where(.svelte-1e5oikm) {outline:none;}.select-tags.svelte-1e5oikm span[draggable]:where(.svelte-1e5oikm) span[role=gridcell]:where(.svelte-1e5oikm):not(.label) {display:contents;}.select-tags.svelte-1e5oikm span[draggable]:where(.svelte-1e5oikm) button {outline-offset:-2px;}.select-tags.svelte-1e5oikm span[draggable]:where(.svelte-1e5oikm) .icon {font-size:var(--sui-font-size-large);}`};function Moe(e,t){O(t,!0),K(e,joe);let n=J(t,`values`,31,()=>ta([])),r=J(t,`max`,3,void 0),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`readonly`,3,!1),s=J(t,`required`,3,!1),c=J(t,`invalid`,3,!1),l=ks(t,Doe),u=A(()=>new Map(t.options.map(e=>[e.value,e]))),d=A(()=>new Set(n())),f=A(()=>t.options.some(({value:e})=>!z(d).has(e))),p=j(void 0),m=j(void 0),h=j(void 0),g=j(void 0),_=(e,r)=>{if(e===r)return;let i=Coe(n(),e,r);n(i),t.onReorder?.(new CustomEvent(`Reorder`,{detail:{values:i}}))},v=async(e,t)=>{_(e,t),await co(),(z(p)?.querySelectorAll(`.label[tabindex]`)?.[t])?.focus()};var y=Aoe();let b;var x=N(y);Bo(x,30,n,e=>e,(e,r,i)=>{let s=A(()=>z(u).get(r)),c=A(()=>z(s)?.label||z(s)?.value||r);var l=koe();let d;var f=N(l),p=F(f,!0),m=I(f,2),_=e=>{var i=Ooe(),s=N(i);{let e=e=>{Xc(e,{name:`close`})},i=A(()=>a()||o()),l=A(()=>Y(`_sui.select_tags.remove_x`,{values:{name:z(c)}}));Al(s,{iconic:!0,size:`small`,get disabled(){return z(i)},get"aria-label"(){return z(l)},onclick:()=>{n(n().filter(e=>e!==r)),t.onRemoveValue?.(new CustomEvent(`RemoveValue`,{detail:{value:r}}))},startIcon:e,$$slots:{startIcon:!0}})}D(i),U(e,i)};G(m,e=>{z(s)&&e(_)}),D(l),R(()=>{q(l,`draggable`,!a()&&!o()),d=os(l,1,`svelte-1e5oikm`,null,d,{"drag-source":z(h)===z(i),"drop-before":z(g)===z(i)&&z(h)!==z(i)&&z(h)!==z(i)-1,"drop-after":z(g)===n().length&&z(i)===n().length-1&&z(h)!==n().length-1}),q(f,`tabindex`,a()||o()?void 0:0),W(p,z(c))}),yo(`dragstart`,l,e=>{M(h,z(i),!0),e.dataTransfer&&(e.dataTransfer.setData(`text/plain`,z(c)),e.dataTransfer.effectAllowed=`move`)}),yo(`dragover`,l,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),M(g,Toe({index:z(i),clientX:e.clientX,rect:e.currentTarget.getBoundingClientRect(),rtl:qc()}),!0)}),yo(`drop`,l,async e=>{e.preventDefault();let t=z(h),n=z(g);if(M(h,void 0),M(g,void 0),t===void 0||n===void 0)return;let r=Eoe(t,n);r!==void 0&&await v(t,r)}),yo(`dragend`,l,()=>{M(h,void 0),M(g,void 0)}),bo(`keydown`,f,async e=>{let t=woe({key:e.key,index:z(i),length:n().length,rtl:qc()});t!==-1&&(e.preventDefault(),await v(z(i),t))}),Zo(l,()=>Bu,()=>({duration:200})),U(e,l)}),D(x);var S=I(x,2),C=e=>{{let r=A(()=>a()||o());Hu(e,As(()=>l,{get disabled(){return z(r)},get readonly(){return o()},get required(){return s()},get invalid(){return c()},onChange:()=>{z(m)!==void 0&&(n([...n(),z(m)]),t.onAddValue?.(new CustomEvent(`AddValue`,{detail:{value:z(m)}})),M(m,void 0))},get value(){return z(m)},set value(e){M(m,e,!0)},children:(e,n)=>{var r=H();Bo(P(r),17,()=>t.options,({label:e,value:t,searchValue:n})=>t,(e,t)=>{let n=()=>z(t).label,r=()=>z(t).value,i=()=>z(t).searchValue;var a=H(),o=P(a),s=e=>{Tu(e,{get label(){return n()},get value(){return r()},get searchValue(){return i()}})},c=A(()=>!z(d).has(r()));G(o,e=>{z(c)&&e(s)}),U(e,a)}),U(e,r)},$$slots:{default:!0}}))}};G(S,e=>{(typeof r()!=`number`||n().length<r())&&z(f)&&e(C)}),D(y),Ds(y,e=>M(p,e),()=>z(p)),R(e=>{b=os(y,1,`sui select-tags ${t.class??``}`,`svelte-1e5oikm`,b,{disabled:a()||o()}),q(y,`hidden`,i()),q(x,`aria-label`,e)},[()=>Y(`_sui.select_tags.selected_options`)]),U(e,y),k()}xo([`keydown`]);var Noe=e=>{let[t,n=`0`]=String(e).split(`e`);return Math.min(Math.max((t.split(`.`)[1]??``).length-Number(n),0),100)},Poe=({min:e,max:t,step:n,barWidth:r})=>{let i=(t-e)/n,a=Math.floor(i+1e-9)+1,o=r/i,s=Array.from({length:a}),c=Math.max(Noe(e),Noe(n));return{valueList:s.map((t,r)=>Number((r*n+e).toFixed(c))),positionList:s.map((e,t)=>t*o)}},Foe=(e,t,n)=>Math.min(t,Math.max(0,n?t-e:e)),Ioe=(e,t)=>{let n=e.findLastIndex(e=>e<=t),r=e.findIndex(e=>t<=e);return n===-1?r:r===-1||Math.abs(e[n]-t)<Math.abs(e[r]-t)?n:r},Loe=(e,t)=>{let{prevKey:n,nextKey:r}=Rl(`horizontal`,t);return e===`ArrowUp`||e===r?1:e===`ArrowDown`||e===n?-1:0},Roe=({key:e,rtl:t,currentIndex:n,length:r})=>{let i=r-1,a=Math.max(1,Math.round(r/10)),o;if(e===`Home`)o=0;else if(e===`End`)o=i;else if(e===`PageUp`)o=n+a;else if(e===`PageDown`)o=n-a;else{let r=Loe(e,t);if(!r)return-1;o=n+r}return o=Math.min(i,Math.max(0,o)),o===n?-1:o},zoe=({valueIndex:e,targetPosition:t,sliderPositions:n})=>e===0&&n[1]<=t||e===1&&n[0]>=t,Boe=({valueList:e,value:t,decreasing:n})=>{let r=e.indexOf(t);if(r!==-1)return r;if(n){let n=e.findIndex(e=>e>t);return n===-1?e.length:n}return e.findLastIndex(e=>e<t)},Voe=(e,t)=>{let[n,r]=e,i=Math.abs(n-t),a=Math.abs(r-t);return i===a?+(t>r):+(a<i)},Hoe=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`min`,`max`,`sliderLabel`,`ariaLabelledby`,`values`,`sliderLabels`,`step`,`optionLabels`,`class`,`hidden`,`disabled`,`readonly`,`invalid`,`children`,`onChange`]),Uoe=B(`<div role="slider" class="svelte-rj5yxm"></div>`),Woe=B(`<span role="none" class="label svelte-rj5yxm"> </span>`),Goe=B(`<div><div role="none" class="base svelte-rj5yxm"><div role="none" class="base-bar svelte-rj5yxm"></div> <div class="slider-bar svelte-rj5yxm"></div> <div role="slider" class="svelte-rj5yxm"></div> <!> <!></div></div>`),Koe={hash:`svelte-rj5yxm`,code:`.slider.svelte-rj5yxm {position:relative;display:inline-block;margin:var(--sui-focus-ring-width);padding:4px 6px;touch-action:none;}.slider.svelte-rj5yxm:hover .base-bar:where(.svelte-rj5yxm) {background-color:var(--sui-hover-background-color);}.slider.svelte-rj5yxm:active .base-bar:where(.svelte-rj5yxm) {background-color:var(--sui-active-background-color);}.slider.readonly.svelte-rj5yxm .base-bar:where(.svelte-rj5yxm), .slider.readonly.svelte-rj5yxm:is(:where(.svelte-rj5yxm):hover, :where(.svelte-rj5yxm):active) .base-bar:where(.svelte-rj5yxm) {background-color:var(--sui-slider-background-color, var(--sui-secondary-background-color));}.slider.readonly.svelte-rj5yxm .base:where(.svelte-rj5yxm),
.slider.readonly.svelte-rj5yxm [role=slider]:where(.svelte-rj5yxm) {cursor:default;}.slider.readonly.svelte-rj5yxm:not(.invalid) .slider-bar:where(.svelte-rj5yxm) {background-color:var(--sui-readonly-accent-color);}.slider.readonly.svelte-rj5yxm:not(.invalid) [role=slider]:where(.svelte-rj5yxm) {border-color:var(--sui-readonly-accent-color);}.base.svelte-rj5yxm {position:relative;width:var(--sui-slider-base-width, 240px);height:calc(var(--sui-checkbox-height) / 2);cursor:pointer;}.base-bar.svelte-rj5yxm {border-width:1px;border-style:solid;border-color:var(--sui-control-border-color);border-radius:var(--sui-checkbox-height);background-color:var(--sui-slider-background-color, var(--sui-secondary-background-color));transition:all 200ms;width:100%;height:100%;}.slider-bar.svelte-rj5yxm {position:absolute;top:0;height:calc(var(--sui-checkbox-height) / 2);border-radius:var(--sui-checkbox-height);background-color:var(--sui-primary-accent-color-light);}.invalid.svelte-rj5yxm .slider-bar:where(.svelte-rj5yxm) {background-color:var(--sui-error-border-color);}[role=slider].svelte-rj5yxm {position:absolute;top:0;border:3px solid var(--sui-primary-accent-color-light);border-radius:var(--sui-checkbox-height);width:calc(var(--sui-checkbox-height) - 2px);height:calc(var(--sui-checkbox-height) - 2px);background-color:var(--sui-primary-accent-color-inverted);cursor:pointer;}[role=slider].svelte-rj5yxm::before {content:"";position:absolute;inset:-4px;border-radius:inherit;}[role=slider].svelte-rj5yxm:dir(ltr) {transform:translate(calc((var(--sui-checkbox-height) / 2 - 1px) * -1), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));}[role=slider].svelte-rj5yxm:dir(rtl) {transform:translate(calc(var(--sui-checkbox-height) / 2 - 1px), calc((var(--sui-checkbox-height) / 4 - 1px) * -1));}.invalid.svelte-rj5yxm [role=slider]:where(.svelte-rj5yxm) {border-color:var(--sui-error-border-color);}.label.svelte-rj5yxm {position:absolute;top:calc(var(--sui-checkbox-height) / 2 + 8px);font-size:var(--sui-font-size-x-small);}.label.svelte-rj5yxm:dir(ltr) {transform:translateX(-50%);}.label.svelte-rj5yxm:dir(rtl) {transform:translateX(50%);}`};function qoe(e,t){O(t,!0),K(e,Koe);let n=J(t,`value`,15,0),r=J(t,`min`,3,0),i=J(t,`max`,3,100),a=J(t,`sliderLabel`,3,``),o=J(t,`ariaLabelledby`,3,void 0),s=J(t,`values`,15,void 0),c=J(t,`sliderLabels`,3,void 0),l=J(t,`step`,3,1),u=J(t,`optionLabels`,19,()=>[]),d=J(t,`hidden`,3,!1),f=J(t,`disabled`,3,!1),p=J(t,`readonly`,3,!1),m=J(t,`invalid`,3,!1),h=ks(t,Hoe),g=A(()=>Array.isArray(s())),_=j(void 0),v=j(0),y=j(ta([])),b=j(ta([])),x=e=>{if(u().length!==z(b).length||e===void 0)return;let t=z(b).indexOf(e);return t===-1?void 0:String(u()[t])},S=j(0),C=j(0),w=ta([0,0]),T=j(!1),ee=j(0),te=j(0),ne=(e,r)=>{let i=s();(z(g)?i[e]:n())!==r&&(z(g)?(i[e]=r,s([...i]),t.onChange?.({values:s()})):(n(r),t.onChange?.({value:n()})))},re=e=>{let t=Ioe(z(y),Foe(e,z(v),qc()));z(g)&&zoe({valueIndex:z(te),targetPosition:z(y)[t],sliderPositions:w})||ne(z(te),z(b)[t])},ie=(e,t=0)=>{let{key:r,ctrlKey:i,metaKey:a,shiftKey:o,altKey:c}=e,l=o||c||i||a;if(f()||p()||l)return;let u=z(g)?s()[t]:n(),d=qc(),m=Roe({key:r,rtl:d,currentIndex:Boe({valueList:z(b),value:u,decreasing:r===`PageDown`||Loe(r,d)===-1}),length:z(b).length});m===-1?[`Home`,`End`,`PageUp`,`PageDown`].includes(r)&&e.preventDefault():(e.preventDefault(),e.stopPropagation(),!(z(g)&&zoe({valueIndex:t,targetPosition:z(y)[m],sliderPositions:w}))&&ne(t,z(b)[m]))},ae=e=>{let{screenX:t,pointerId:n}=e;if(f()||p()||!z(T)||n!==z(ee))return;e.preventDefault(),e.stopPropagation();let r=t-z(C),i=z(S)+r;re(i)},oe=e=>{let{pointerId:t,target:n}=e;if(f()||p()||!z(T)||t!==z(ee))return;e.stopPropagation();let r=n;if(r.matches(`.base-bar, .slider-bar`)){let t=z(_).getBoundingClientRect(),n=e.clientX-t.left;re(n)}r.releasePointerCapture(t),M(T,!1),M(S,0),M(C,0),M(ee,0),M(te,0),document.removeEventListener(`pointermove`,ae),document.removeEventListener(`pointerup`,oe),document.removeEventListener(`pointercancel`,oe)},se=(e,t)=>{if(f()||p())return;e.preventDefault(),e.stopPropagation(),M(T,!0);let{clientX:n,screenX:r,pointerId:i,target:a}=e,o=a,s=z(_).getBoundingClientRect();M(S,n-s.left),M(C,r,!0),M(ee,i,!0),M(te,t??(z(g)?Voe(w,Foe(z(S),z(v),qc())):0),!0),o.setPointerCapture(i),document.addEventListener(`pointermove`,ae),document.addEventListener(`pointerup`,oe),document.addEventListener(`pointercancel`,oe)},ce=e=>z(y)[Ioe(z(b),e)]??0,le=()=>{if(z(g)){let[e,t]=s();w[0]=ce(e),w[1]=ce(t)}else w[0]=ce(n())},ue=()=>{z(_)&&(M(v,z(_).clientWidth,!0),(e=>{M(b,e.valueList,!0),M(y,e.positionList,!0)})(Poe({min:r(),max:i(),step:l(),barWidth:z(v)})),le())};js(()=>{let e=new ResizeObserver(()=>ue()),t=globalThis.matchMedia(`(pointer: coarse)`);return e.observe(z(_)),t.addEventListener(`change`,ue),ue(),()=>{e.disconnect(),t.removeEventListener(`change`,ue),document.removeEventListener(`pointermove`,ae),document.removeEventListener(`pointerup`,oe),document.removeEventListener(`pointercancel`,oe)}}),L(()=>{n(),s(),le()});var de=Goe();yo(`click`,aa.body,()=>{M(T,!1)}),bs(de,()=>({...h,role:`none`,class:`sui slider ${t.class??``}`,hidden:d(),[ms]:{disabled:f(),readonly:p(),invalid:m()}}),void 0,void 0,void 0,`svelte-rj5yxm`);var fe=N(de),pe=I(N(fe),2);let me;var he=I(pe,2);let ge;var _e=I(he,2),ve=e=>{var t=Uoe();let n;R(e=>{q(t,`tabindex`,f()?-1:0),q(t,`aria-label`,c()?.[1]||void 0),q(t,`aria-hidden`,d()),q(t,`aria-disabled`,f()),q(t,`aria-readonly`,p()),q(t,`aria-invalid`,m()),q(t,`aria-valuemin`,r()),q(t,`aria-valuemax`,i()),q(t,`aria-valuenow`,s()?.[1]),q(t,`aria-valuetext`,e),n=cs(t,``,n,{"inset-inline-start":`${w[1]}px`})},[()=>x(s()?.[1])]),bo(`pointerdown`,t,e=>se(e,1)),bo(`keydown`,t,e=>ie(e,1)),U(e,t)};G(_e,e=>{z(g)&&e(ve)});var ye=I(_e,2),be=e=>{var t=H();Bo(P(t),19,u,(e,t)=>`${t}-${e}`,(e,t,n)=>{var r=Woe();let i;var a=F(r,!0);R(()=>{i=cs(r,``,i,{"inset-inline-start":`${z(v)/(u().length-1)*z(n)}px`}),W(a,z(t))}),U(e,r)}),U(e,t)};G(ye,e=>{u().length&&e(be)}),D(fe),Ds(fe,e=>M(_,e),()=>z(_)),D(de),R(e=>{me=cs(pe,``,me,{"inset-inline-start":`${z(g)?w[0]:0}px`,width:`${z(g)?w[1]-w[0]:w[0]}px`}),q(he,`tabindex`,f()?-1:0),q(he,`aria-label`,(z(g)?c()?.[0]:a())||void 0),q(he,`aria-labelledby`,z(g)?void 0:o()),q(he,`aria-hidden`,d()),q(he,`aria-disabled`,f()),q(he,`aria-readonly`,p()),q(he,`aria-invalid`,m()),q(he,`aria-valuemin`,r()),q(he,`aria-valuemax`,i()),q(he,`aria-valuenow`,z(g)?s()?.[0]:n()),q(he,`aria-valuetext`,e),ge=cs(he,``,ge,{"inset-inline-start":`${w[0]}px`})},[()=>x(z(g)?s()?.[0]:n())]),bo(`pointerdown`,fe,e=>se(e)),bo(`pointerdown`,he,e=>se(e,0)),bo(`keydown`,he,e=>ie(e,0)),U(e,de),k()}xo([`pointerdown`,`keydown`]);var Joe=new Set([`$$slots`,`$$events`,`$$legacy`,`checked`,`label`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`children`,`onChange`]),Yoe=B(`<button><span role="none" class="svelte-1cm7zsk"></span> <!></button>`),Xoe={hash:`svelte-1cm7zsk`,code:`button.svelte-1cm7zsk {display:inline-flex;align-items:center;gap:8px;margin:var(--sui-focus-ring-width);border-width:0;border-style:solid;border-color:transparent;padding:0;color:var(--sui-control-foreground-color);background-color:transparent;box-shadow:none;font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);font-weight:var(--sui-font-weight-normal, normal);text-align:start;cursor:pointer;-webkit-user-select:none;user-select:none;}button[aria-invalid=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-error-border-color) !important;}button:hover[aria-checked=false].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-hover-background-color);}button:hover[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-primary-accent-color-light);}button:active[aria-checked=false].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-active-background-color);}button:active[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-primary-accent-color-dark);}button.svelte-1cm7zsk:focus-visible {outline:0;}button.svelte-1cm7zsk:focus-visible span:where(.svelte-1cm7zsk) {outline-color:var(--sui-focus-ring-color);}button[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-primary-accent-color);border-color:transparent;}button[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk)::before {--translateX: var(--sui-checkbox-height) * 2 - var(--sui-checkbox-height);border-color:var(--sui-primary-accent-color);background-color:var(--sui-primary-accent-color-inverted);}button[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk):dir(ltr)::before {transform:translateX(calc(var(--translateX)));}button[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk):dir(rtl)::before {transform:translateX(calc((var(--translateX)) * -1));}button[aria-readonly=true].svelte-1cm7zsk {cursor:default;}button[aria-readonly=true][aria-checked=false].svelte-1cm7zsk span:where(.svelte-1cm7zsk), button[aria-readonly=true]:is(:where(.svelte-1cm7zsk):hover, :where(.svelte-1cm7zsk):active)[aria-checked=false].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-control-background-color);}button[aria-readonly=true][aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk), button[aria-readonly=true]:is(:where(.svelte-1cm7zsk):hover, :where(.svelte-1cm7zsk):active)[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk) {background-color:var(--sui-readonly-accent-color);}button[aria-readonly=true][aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk)::before, button[aria-readonly=true]:is(:where(.svelte-1cm7zsk):hover, :where(.svelte-1cm7zsk):active)[aria-checked=true].svelte-1cm7zsk span:where(.svelte-1cm7zsk)::before {border-color:var(--sui-readonly-accent-color);background-color:var(--sui-readonly-accent-color-inverted);}span.svelte-1cm7zsk {position:relative;width:calc(var(--sui-checkbox-height) * 2);height:var(--sui-checkbox-height);padding:0 2px;display:inline-flex;align-items:center;border-width:1.5px;border-style:solid;border-color:var(--sui-checkbox-border-color);border-radius:var(--sui-checkbox-height);background-color:var(--sui-control-background-color);transition:all 200ms;}span.svelte-1cm7zsk::before {display:inline-block;width:calc(var(--sui-checkbox-height) - 6px);height:calc(var(--sui-checkbox-height) - 6px);border-radius:var(--sui-checkbox-height);background-color:var(--sui-checkbox-border-color);transition:all 200ms;content:"";}`};function Uu(e,t){O(t,!0),K(e,Xoe);let n=J(t,`checked`,15,!1),r=J(t,`label`,3,void 0),i=J(t,`hidden`,3,!1),a=J(t,`disabled`,3,!1),o=J(t,`readonly`,3,!1),s=J(t,`required`,3,!1),c=J(t,`invalid`,3,!1),l=J(t,`ariaLabel`,3,void 0),u=ks(t,Joe);var d=Yoe(),f=()=>{!a()&&!o()&&(n(!n()),t.onChange?.(new CustomEvent(`Change`,{detail:{checked:n()}})))};bs(d,()=>({...u,role:`switch`,class:`sui switch ${t.class??``}`,type:`button`,hidden:i(),disabled:a()||void 0,"aria-checked":n(),"aria-hidden":i(),"aria-disabled":a(),"aria-readonly":o(),"aria-required":s(),"aria-invalid":c(),"aria-label":l(),onclick:f}),void 0,void 0,void 0,`svelte-1cm7zsk`);var p=I(N(d),2),m=e=>{var t=V();R(()=>W(t,r())),U(e,t)},h=e=>{var n=H();Go(P(n),()=>t.children??kr),U(e,n)};G(p,e=>{r()?e(m):e(h,-1)}),D(d),U(e,d),k()}var Zoe=new Set([`$$slots`,`$$events`,`$$legacy`]);function Qoe(e,t){let n=ks(t,Zoe);yu(e,As(()=>n,{role:`cell`,kind:`table-cell`}))}var $oe=new Set([`$$slots`,`$$events`,`$$legacy`]);function ese(e,t){let n=ks(t,$oe);yu(e,As(()=>n,{role:`row`,kind:`table-row`}))}var tse=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`ariaLabel`,`children`]),nse=B(`<div><!></div>`),rse={hash:`svelte-t6lb2u`,code:`.table.svelte-t6lb2u {display:table;margin:var(--sui-focus-ring-width);width:calc(100% - var(--sui-focus-ring-width) * 2);}.table.data.svelte-t6lb2u {border-collapse:collapse;}.table.data.svelte-t6lb2u :is(.table-col-header, .table-row-header, .table-cell) {border:1px solid var(--sui-secondary-border-color);padding:8px 8px;}`};function ise(e,t){K(e,rse);let n=J(t,`ariaLabel`,3,void 0),r=ks(t,tse);var i=nse();bs(i,()=>({...r,role:`table`,class:`sui table ${t.class??``}`,"aria-label":n()}),void 0,void 0,void 0,`svelte-t6lb2u`),Go(N(i),()=>t.children??kr),D(i),U(e,i)}var ase=({offsetTop:e,offsetLeft:t,offsetWidth:n,offsetHeight:r})=>Object.entries({top:e,left:t,width:n,height:r}).map(([e,t])=>`${e}: ${t}px`).join(`; `),ose=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`name`,`ariaLabel`,`children`,`onChange`]),sse=B(`<div><div role="none" class="inner svelte-bk1fk2"><!></div> <div role="none" class="indicator svelte-bk1fk2"></div></div>`),cse={hash:`svelte-bk1fk2`,code:`.tab-list.svelte-bk1fk2 {flex:none;position:relative;display:flex;align-items:center;margin:var(--sui-tab-list-margin, var(--sui-focus-ring-width));border-color:var(--sui-tab-list-border-color, var(--sui-control-border-color));border-radius:var(--sui-tab-list-border-radius, 0);background-color:var(--sui-tab-list-background-color, transparent);}.tab-list[aria-orientation=horizontal].svelte-bk1fk2 {gap:var(--sui-horizontal-tab-list-gap, var(--sui-tab-list-gap, 8px));margin-block:var(--sui-horizontal-tab-list-margin-block, 0 32px);margin-inline:var(--sui-horizontal-tab-list-margin-inline, 0);border-block-width:var(--sui-horizontal-tab-list-border-block-width, 0 1px);border-inline-width:var(--sui-horizontal-tab-list-border-inline-width, 0 0);padding:var(--sui-horizontal-tab-list-padding, var(--sui-tab-list-padding, 0 16px));}.tab-list[aria-orientation=horizontal].svelte-bk1fk2 button {width:var(--sui-horizontal-tab-width, var(--sui-tab-width, auto));height:var(--sui-horizontal-tab-height, var(--sui-tab-height, 100%));justify-content:var(--sui-horizontal-tab-justify-content, center);}.tab-list[aria-orientation=horizontal].svelte-bk1fk2 .indicator:where(.svelte-bk1fk2) {border-block-width:var(--sui-horizontal-tab-list-indicator-border-block-width, 0 2px);border-inline-width:var(--sui-horizontal-tab-list-indicator-border-inline-width, 0 0);}.tab-list[aria-orientation=vertical].svelte-bk1fk2 {gap:var(--sui-vertical-tab-list-gap, var(--sui-tab-list-gap, 8px));flex-direction:column;margin-block:var(--sui-vertical-tab-list-margin-block, 0);margin-inline:var(--sui-vertical-tab-list-margin-inline, 0 32px);border-block-width:var(--sui-vertical-tab-list-border-block-width, 0 0);border-inline-width:var(--sui-vertical-tab-list-border-inline-width, 0 1px);padding:var(--sui-vertical-tab-list-padding, var(--sui-tab-list-padding, 8px 0));width:var(--sui-vertical-tab-list-width, auto);}.tab-list[aria-orientation=vertical].svelte-bk1fk2 button {justify-content:var(--sui-vertical-tab-justify-content, flex-start);padding-inline-end:32px;width:var(--sui-vertical-tab-width, var(--sui-tab-width, 100%));height:var(--sui-vertical-tab-height, var(--sui-tab-height, auto));}.tab-list[aria-orientation=vertical].svelte-bk1fk2 .indicator:where(.svelte-bk1fk2) {border-block-width:var(--sui-vertical-tab-list-indicator-border-block-width, 0 0);border-inline-width:var(--sui-vertical-tab-list-indicator-border-inline-width, 0 2px);}.tab-list.svelte-bk1fk2 button {position:relative;z-index:1;border-color:transparent;margin:0 !important;border-radius:var(--sui-tab-border-radius, 0);font-family:var(--sui-tab-font-family, var(--sui-control-font-family, inherit));font-size:var(--sui-tab-font-size, var(--sui-control-font-size, inherit));font-weight:var(--sui-tab-font-weight, var(--sui-control-font-weight, var(--sui-font-weight-normal, normal)));}.inner.svelte-bk1fk2 {display:contents;}.indicator.svelte-bk1fk2 {position:absolute;z-index:0;inset:auto;border-radius:var(--sui-tab-list-indicator-border-radius, 0);border-color:var(--sui-tab-list-indicator-border-color, var(--sui-primary-accent-color-light));background-color:var(--sui-tab-list-indicator-background-color, transparent);box-shadow:var(--sui-tab-list-indicator-box-shadow, none);pointer-events:none;transition:var(--sui-tab-list-indicator-transition, all 200ms);}`};function lse(e,t){O(t,!0),K(e,cse);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`orientation`,3,`horizontal`),a=J(t,`name`,3,void 0),o=J(t,`ariaLabel`,3,void 0),s=ks(t,ose),c=j(void 0),l=j(void 0),u=()=>{globalThis.requestAnimationFrame(()=>{let e=z(c)?.querySelector(`[role="tab"][aria-selected="true"]`);M(l,e?ase(e):void 0,!0)})};js(()=>{let e=new ResizeObserver(()=>{u()}),t=new MutationObserver(()=>{u()});return e.observe(z(c)),t.observe(z(c),{subtree:!0,attributes:!0,attributeFilter:[`aria-selected`]}),()=>{e.disconnect(),t.disconnect()}});var d=sse(),f=()=>{u()},p=e=>{u(),t.onChange?.(e)};bs(d,()=>({...s,role:`tablist`,class:`sui tab-list ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-orientation":i(),"aria-label":o(),"data-name":a()||void 0,onInitialized:f,onChange:p}),void 0,void 0,void 0,`svelte-bk1fk2`);var m=N(d);Go(N(m),()=>t.children??kr),D(m);var h=I(m,2);D(d),Ds(d,e=>M(c,e),()=>z(c)),es(d,ql),R(()=>{m.inert=r(),cs(h,z(l))}),U(e,d),k()}var use=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`children`]),dse=B(`<div><!></div>`),fse={hash:`svelte-uhed84`,code:`.tab-panel.svelte-uhed84 {flex:auto;transition:all 200ms;}.tab-panel[aria-hidden=true].svelte-uhed84, .tab-panel.svelte-uhed84:not([aria-hidden]) {display:none;}`};function pse(e,t){K(e,fse);let n=ks(t,use);var r=dse();bs(r,()=>({...n,role:`tabpanel`,class:`sui tab-panel ${t.class??``}`}),void 0,void 0,void 0,`svelte-uhed84`),Go(N(r),()=>t.children??kr),D(r),U(e,r)}var mse=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`selected`,`children`,`startIcon`,`endIcon`]);function hse(e,t){let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`selected`,3,!1),a=ks(t,mse);Al(e,As(()=>a,{role:`tab`,get class(){return`sui tab ${t.class??``}`},get hidden(){return n()},get disabled(){return r()},get"aria-selected"(){return i()},startIcon:e=>{var n=H();Go(P(n),()=>t.startIcon??kr),U(e,n)},children:e=>{var n=H();Go(P(n),()=>t.children??kr),U(e,n)},endIcon:e=>{var n=H();Go(P(n),()=>t.endIcon??kr),U(e,n)},$$slots:{startIcon:!0,default:!0,endIcon:!0}}))}var Wu=[],gse=()=>(Wu.splice(0,Wu.length,...Wu.filter(e=>e.isConnected&&e.matches(`:modal`))),Wu.at(-1)??document.querySelector(`.sui.app-shell`)??document.body),Gu=e=>{e.showPopover&&(e.matches(`:popover-open`)&&e.hidePopover(),e.querySelector(`.toast`)&&e.showPopover())},Ku=e=>{let t=gse();if(e.parentElement===t)return!1;let{moveBefore:n}=t;return typeof n==`function`&&e.isConnected?n.call(t,e,null):t.appendChild(e),!0},_se=(e,t)=>{let n=[...e.children].find(e=>e.dataset.position===t);return n||(n=document.createElement(`div`),n.setAttribute(`role`,`none`),n.className=`toast-lane ${t}`,n.dataset.position=t,e.appendChild(n)),n},qu,Ju=0,vse=e=>{let{target:t,newState:n}=e;qu&&t instanceof HTMLDialogElement&&n===`open`&&t.matches(`:modal`)&&!Wu.includes(t)&&(Wu.push(t),Ku(qu),Gu(qu))},Yu=e=>{let{target:t}=e;if(!qu||!(t instanceof HTMLDialogElement)||e.type===`beforetoggle`&&e.newState!==`closed`)return;let n=Wu.indexOf(t);n>-1&&Wu.splice(n,1),t.contains(qu)&&Ku(qu)&&!qu.matches(`:popover-open`)&&Gu(qu)},yse=()=>(Ju+=1,qu||(qu=document.createElement(`div`),qu.setAttribute(`role`,`none`),qu.className=`sui toast-base enabled`,qu.popover=`manual`,Wu.push(...document.querySelectorAll(`dialog:modal`)),document.addEventListener(`toggle`,vse,!0),document.addEventListener(`beforetoggle`,Yu,!0),document.addEventListener(`close`,Yu,!0)),Ku(qu),qu),bse=()=>{--Ju,!(Ju>0||!qu)&&(document.removeEventListener(`toggle`,vse,!0),document.removeEventListener(`beforetoggle`,Yu,!0),document.removeEventListener(`close`,Yu,!0),qu.remove(),qu=void 0,Wu.length=0)},xse=new Set([`$$slots`,`$$events`,`$$legacy`,`show`,`id`,`duration`,`position`,`children`]),Sse=B(`<div><!></div>`),Cse={hash:`svelte-28ad9u`,code:`.sui.toast-base {position:fixed;inset:16px;z-index:99999;overflow:visible;margin:0;border:0;padding:0;width:auto;height:auto;background-color:transparent;font-family:var(--sui-font-family-default);font-size:var(--sui-font-size-default);font-weight:var(--sui-font-weight-normal, normal);text-align:center;pointer-events:none;-webkit-user-select:none;user-select:none;}body:has(.sui.bottom-navigation:not([inert]:not([hidden]))) .toast-base {bottom:calc(var(--sui-bottom-navigation-height) + 16px);}.sui.toast-base > .toast-lane {position:absolute;display:flex;flex-direction:column;margin-block:-4px;max-width:100%;}.sui.toast-base > .toast-lane.top-left, .sui.toast-base > .toast-lane.top-center, .sui.toast-base > .toast-lane.top-right {inset-block-start:0;}.sui.toast-base > .toast-lane.bottom-left, .sui.toast-base > .toast-lane.bottom-center, .sui.toast-base > .toast-lane.bottom-right {inset-block-end:0;}.sui.toast-base > .toast-lane.top-left, .sui.toast-base > .toast-lane.bottom-left {inset-inline-start:0;align-items:flex-start;}.sui.toast-base > .toast-lane.top-center, .sui.toast-base > .toast-lane.bottom-center {inset-inline:0;align-items:center;}.sui.toast-base > .toast-lane.top-right, .sui.toast-base > .toast-lane.bottom-right {inset-inline-end:0;align-items:flex-end;}.toast.svelte-28ad9u {margin-block:4px;width:max-content;max-width:80dvw;height:auto;overflow:clip;opacity:1;transition-duration:250ms;will-change:opacity;}
@starting-style {.toast.svelte-28ad9u {opacity:0;}
}.toast.svelte-28ad9u {pointer-events:auto;}.toast[aria-hidden=true].svelte-28ad9u {display:block;opacity:0;pointer-events:none;}
@supports (interpolate-size: allow-keywords) {.toast.svelte-28ad9u {interpolate-size:allow-keywords;}
@starting-style {.toast.svelte-28ad9u {margin-block:0;height:0;}
}.toast[aria-hidden=true].svelte-28ad9u {margin-block:0;height:0;}
}.toast.svelte-28ad9u:has(.alert) {filter:drop-shadow(0 8px 8px var(--sui-popup-shadow-color));}`};function Xu(e,t){O(t,!0),K(e,Cse);let n=J(t,`show`,15,!1),r=J(t,`id`,3,void 0),i=J(t,`duration`,3,5e3),a=J(t,`position`,7,`auto`),o=ks(t,xse),s=j(void 0),c=j(void 0),l=j(!1),u=j(!1);js(()=>(M(s,yse(),!0),()=>{z(c)?.remove(),bse()})),js(()=>{if(a()!==`auto`)return;let e=globalThis.matchMedia(`(width < 1024px)`),t=()=>{a(e.matches?`bottom-center`:`bottom-right`)};return t(),e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}}),L(()=>{if(!z(s)||!z(c))return;if(!z(u)){z(c).remove(),M(l,!1),!z(s).querySelector(`.toast`)&&z(s).matches(`:popover-open`)&&z(s).hidePopover();return}Ku(z(s));let e=_se(z(s),a());a().startsWith(`top-`)?e.prepend(z(c)):e.append(z(c)),Gu(z(s))}),L(()=>{if(n()){M(u,!0);return}let e=globalThis.setTimeout(()=>{M(u,!1)},250);return()=>{globalThis.clearTimeout(e)}}),L(()=>{if(r(),n(),i(),z(l),!n()||!i()||z(l))return;let e=globalThis.setTimeout(()=>{n(!1)},i());return()=>{globalThis.clearTimeout(e)}});var d=Sse(),f=()=>{M(l,!0)},p=()=>{M(l,!1)},m=()=>{M(l,!0)},h=e=>{M(l,!!e.relatedTarget&&!!z(c)?.contains(e.relatedTarget),!0)};bs(d,()=>({...o,class:[`sui`,`toast`,a()],"aria-hidden":!n(),onpointerenter:f,onpointerleave:p,onfocusin:m,onfocusout:h}),void 0,void 0,void 0,`svelte-28ad9u`);var g=N(d),_=e=>{var n=H();Go(P(n),()=>t.children??kr),U(e,n)};G(g,e=>{z(u)&&e(_)}),D(d),Ds(d,e=>M(c,e),()=>z(c)),U(e,d),k()}var Zu="```",wse=(e,t)=>t?`${Zu}${e}\n${t}\n${Zu}`:`${Zu}${e}\n${Zu}`,Tse=e=>{let{lang:t=`plain`,code:n=``}=e.match(/^```(?<lang>[^\s`]+)?\n(?:(?<code>.*)\n)?```/s)?.groups??{};return{lang:t,code:n}};function Qu(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function $u(e,...t){throw Qu(e,...t)}function ed(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Ese(){return typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0}var td=Ese();function Dse(){return td&&`documentMode`in document?document.documentMode:null}var Ose=Dse();function kse(e){return td&&e.test(navigator.platform)}function nd(e){return td&&e.test(navigator.userAgent)}var rd=kse(/Mac|iPod|iPhone|iPad/),id=nd(/^(?!.*Seamonkey)(?=.*Firefox).*/i);function Ase(){return!(!td||!(`InputEvent`in window)||Ose)&&`getTargetRanges`in new window.InputEvent(`input`)}var ad=Ase();function jse(){return td&&!window.MSStream&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&navigator.maxTouchPoints>1)}var od=jse(),sd=nd(/Android/),cd=nd(/Version\/[\d.]+.*Safari/)&&!sd,ld=nd(/^(?=.*Chrome).*/i),ud=td&&sd&&ld,dd=nd(/AppleWebKit\/[\d.]+/)&&rd&&!ld;function Mse(){return 2047}var Nse=Mse(),fd=cd||od||dd?`\xA0`:`​`,pd=`
`,md=id?`\xA0`:fd,hd=`֑-߿יִ-﷽ﹰ-ﻼ`,gd=`A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿`;function _d(e,t){return RegExp(`^[^`+e+`]*[`+t+`]`)}var Pse=_d(gd,hd),Fse=_d(hd,gd),vd={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},yd={directionless:1,unmergeable:2},bd={center:2,end:6,justify:4,left:1,right:3,start:5};function xd(e){let t={};for(let n of Object.keys(e))t[e[n]]=n;return t}var Sd=xd(bd),Cd={normal:0,segmented:2,token:1},wd=xd(Cd),Ise=Symbol.for(`@lexical/ctrlOrOtherKey`),Td=`$config`;function Ed(){return gy()._blockCursorElement}function Dd(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-slot`)}var Lse=dd||od||cd;function Od(){let e=ny().createElement(`img`);e.setAttribute(`data-lexical-decorator-boundary`,`true`),e.alt=``;for(let[t,n]of[[`position`,`absolute`],[`width`,`0px`],[`height`,`0px`],[`border`,`0px`],[`margin`,`0px`],[`padding`,`0px`]])e.style.setProperty(t,n,`important`);return e}function kd(e){return e!==null&&e.nodeType===1&&e.hasAttribute(`data-lexical-decorator-boundary`)}var Ad=class e{element;before;after;constructor(e,t,n){this.element=e,this.before=t||null,this.after=n||null}withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}insertChild(e){let t=this.getInsertionAnchor();return t!==null&&t.parentElement!==this.element&&$u(357),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&$u(358),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&$u(359),this.element.replaceChild(e,t),this}getFirstChild(){let e=this.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;return t===this.getInsertionAnchor()?null:t}getFirstChildAnchor(){return this.after}resolveLeafPosition(e,t,n){if(this.element===e)return t===e&&n===0?`before`:`after`;let r=jd(e,this.element);if(r===null)return`after`;let i=Array.prototype.indexOf.call(e.childNodes,r);if(i<0)return`after`;if(t===e)return n<=i?`before`:`after`;let a=jd(e,t);if(a===null)return`after`;let o=Array.prototype.indexOf.call(e.childNodes,a);return o>=0&&o<=i?`before`:`after`}getInsertionAnchor(){return this.before}};function jd(e,t){let n=t;for(;n!==null&&n.parentNode!==e;)n=n.parentNode;return n}var Md=class e extends Ad{withBefore(t){return new e(this.element,t,this.after)}withAfter(t){return new e(this.element,this.before,t)}withElement(t){return this.element===t?this:new e(t,this.before,this.after)}getInsertionAnchor(){return super.getInsertionAnchor()||this.getManagedLineBreak()||this.getDecoratorBoundaryAnchor(`trailing`)}getFirstChildAnchor(){let e=super.getFirstChildAnchor(),t=e?e.nextSibling:this.element.firstChild;for(;Dd(t);)e=t,t=t.nextSibling;kd(t)&&(e=t,t=t.nextSibling);let n=e?e.nextSibling:this.element.firstChild;return n!==null&&n===Ed()?n:e}getDecoratorBoundaryAnchor(e){let t;if(e===`leading`){let e=super.getFirstChildAnchor();for(t=e?e.nextSibling:this.element.firstChild;Dd(t);)t=t.nextSibling}else t=this.before?this.before.previousSibling:this.element.lastChild,t!==null&&t===Ed()&&(t=t.previousSibling);return kd(t)?t:null}setDecoratorBoundaryAnchor(e,t){let n=this.getDecoratorBoundaryAnchor(e);if(t!==(n!==null)){if(n!==null)this.element.removeChild(n);else if(e===`leading`){let e=this.getFirstChildAnchor();this.element.insertBefore(Od(),e?e.nextSibling:this.element.firstChild)}else this.element.insertBefore(Od(),this.before)}}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){let t=this.element,n=this.after===null?t.firstChild:this.after.nextSibling,r=e===`empty`&&Dd(n)?null:e;if(t.__lexicalLastChildKind!==r){if(t.__lexicalLastChildKind=r,r===null)this.removeManagedLineBreak();else{let e=r===`decorator`&&Lse;this.insertManagedLineBreak(e)}}}removeManagedLineBreak(){let e=this.getManagedLineBreak();if(e){let t=this.element,n=e.nodeName===`IMG`?e.nextSibling:null;n&&t.removeChild(n),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){let t=this.getManagedLineBreak();if(t){if(e===(t.nodeName===`IMG`))return;this.removeManagedLineBreak()}let n=this.element,r=this.before||this.getDecoratorBoundaryAnchor(`trailing`),i=ny().createElement(`br`);if(i.setAttribute(`data-lexical-managed-linebreak`,`true`),n.insertBefore(i,r),e){let e=ny().createElement(`img`);e.setAttribute(`data-lexical-managed-linebreak`,`true`),e.style.setProperty(`display`,`inline`,`important`),e.style.setProperty(`border`,`0px`,`important`),e.style.setProperty(`margin`,`0px`,`important`),e.alt=``,n.insertBefore(e,i),n.__lexicalLineBreak=e}else n.__lexicalLineBreak=i}getFirstChildOffset(){let e=this.getFirstChild(),t=this.getInsertionAnchor(),n=0;for(let r=this.element.firstChild;r!==null&&r!==e&&r!==t;r=r.nextSibling)n++;return n}resolveChildIndex(e,t,n,r){if(n===this.element){let t=this.getFirstChildOffset(),n=Ed(),i=this.element.childNodes,a=Math.min(r,i.length),o=0;for(let e=t;e<a;e++)i[e]!==n&&o++;return[e,Math.min(o,e.getChildrenSize())]}let i=Nd(t,n);i.push(r);let a=Nd(t,this.element),o=e.getIndexWithinParent();for(let e=0;e<a.length;e++){let t=i[e],n=a[e];if(t===void 0||t<n)break;if(t>n){o+=1;break}}return[e.getParentOrThrow(),o]}};function Nd(e,t){let n=[],r=t;for(;r!==e&&r!==null;r=r.parentNode){let e=0;for(let t=r.previousSibling;t!==null;t=t.previousSibling)e++;n.push(e)}return r!==e&&$u(225),n.reverse()}function Rse(){let e;try{e=`0.52.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var Pd=Rse(),Fd=class{_front=new Set;_back=new Set;_cache;get size(){return this._front.size+this._back.size}addBack(e){return delete this._cache,this._front.has(e)||this._back.add(e),this}addFront(e){return delete this._cache,this._back.has(e)||this._front.add(e),this}delete(e){return delete this._cache,this._front.delete(e)||this._back.delete(e)}toArray(){let e=Array.from(this._front).reverse();for(let t of this._back)e.push(t);return e}toReadonlyArray(){return this._cache=this._cache||this.toArray(),this._cache}[Symbol.iterator](){return this.toReadonlyArray()[Symbol.iterator]()}},Id=null;function Ld(e,t=1e3){return e instanceof Rd?e.clone():e.size<t?new Map(e):new Rd().init(new Map(e),void 0,e.size)}var Rd=class e{_mutable=!1;_old=void 0;_nursery=void 0;_size=0;clone(){return this._mutable=!1,new e().init(this._old,this._nursery,this._size)}init(e,t,n){return this._old=e,this._nursery=t,this._size=n,this}get size(){return this._size}has(e){return this.get(e)!==void 0}getWithTombstone(e){let t=this._nursery&&this._nursery.get(e);return t===void 0?this._old&&this._old.get(e):t}get(e){let t=this.getWithTombstone(e);return t===Id?void 0:t}shouldCompact(){return this._nursery!==void 0&&2*this._nursery.size>this._size}getNursery(){return this._mutable&&this._nursery||(this.compact(),this._nursery=new Map(this._nursery),this._mutable=!0),this._nursery}compact(e=!1){if(this._nursery&&this._nursery.size>0&&(e||this.shouldCompact())){let e=new Map(this._old);for(let[t,n]of this._nursery)n===Id?e.delete(t):e.set(t,n);this._old=e,this._nursery=void 0}return this._mutable=!1,this}set(e,t){let n=this.getWithTombstone(e);if(n===t)return this;let r=this.getNursery();return n!==Id&&n!==void 0||(this._size++,n===Id&&r.delete(e)),r.set(e,t),this}delete(e){let t=this.has(e);return t&&(this.getNursery().set(e,Id),this._size--),t}getOrInsert(e,t){let n=this.get(e);return n===void 0?(this.set(e,t),t):n}getOrInsertComputed(e,t){let n=this.get(e);if(n!==void 0)return n;let r=t(e);return this.set(e,r),r}clear(){this._mutable=!1,this._old=void 0,this._nursery=void 0,this._size=0}*keys(){for(let e of this.entries())yield e[0]}*values(){for(let e of this.entries())yield e[1]}*entries(){let e=this._nursery,t=this._old;if(e){if(t)for(let n of t){let t=n[0],r=e.get(t);r!==Id&&(r!==void 0&&(n[1]=r),yield n)}for(let n of e)n[1]===Id||t&&t.has(n[0])||(yield n)}else t&&(yield*t)}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.entries())e(n,t,this)}get[Symbol.toStringTag](){return`GenMap`}[Symbol.iterator](){return this.entries()}},zd=!1;function zse(e,t,...n){let r=zd,i;try{zd=e,i=t()}finally{zd=r}var a;return(a=i)===null||typeof a!=`object`&&typeof a!=`function`||typeof a.then!=`function`||$u(421),i}function Bse(){return zd}function Bd(e){let t=e.exportJSON(zd),n=e.constructor;return t.type!==n.getType()&&$u(130,n.name),$(e)&&!Array.isArray(t.children)&&$u(59,n.name),t}function Vd(e,t,n,r,i,a){if($(e)){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(($(o)||Xy(o)&&o.__slots!==null)&&Vd(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}for(let o of Xy(e)&&e.__slots!==null?e.__slots.values():[]){let e=r.get(o);e!==void 0&&Zy(e)&&e.__slotHost===t&&(($(e)||Xy(e)&&e.__slots!==null)&&Vd(e,o,n,r,i,a),n.has(o)||a.delete(o),i.push(o))}}var Hd=!1,Ud=0;function Vse(e){Ud=e.timeStamp}function Wd(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&sv(e,n)!==void 0}function Hse(e,t,n){let r=Zv(Bv(n)),i=r&&ay(r,n._rootElement),a=null,o=null;i!==null&&i.anchorNode===e&&(a=i.anchorOffset,o=i.focusOffset);let s=e.nodeValue;s!==null&&xv(t,s,a,o,!1)}function Use(e,t,n){if(Z(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return X_(t)&&n.isAttached()}function Wse(e,t,n){for(let r=e;r&&!Dy(r);r=Mv(r)){let e=sv(r,t);if(e!==void 0){let t=iv(e,n);if(t)return e_(t)||!uy(r)?void 0:[r,t]}}}function Gd(e,t,n){Hd=!0;let r=performance.now()-Ud>100;try{Xg(e,()=>{let i=Q()||function(e){return e.read(`latest`,()=>{let e=Q();return e===null?null:e.clone()})}(e),a=new Map,o=e._editorState,s=e._blockCursorElement,c=!1,l=``;for(let n=0;n<t.length;n++){let u=t[n],d=u.type,f=u.target,p=Wse(f,e,o);if(!p)continue;let[m,h]=p;if(d===`characterData`)r&&X(h)&&X_(f)&&Use(i,f,h)&&Hse(f,h,e);else if(d===`childList`){c=!0;let t=u.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=av(r),a=r.parentNode;if(!(a==null||r===s||i!==null||Wd(r,a,e)||kd(r)||e._slotsUsed&&uy(r)&&r.hasAttribute(`data-lexical-slot`)||Dy(r))){if(id){let e=(uy(r)?r.innerText:null)||r.nodeValue;e&&(l+=e)}a.removeChild(r)}}let n=u.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];Wd(r,f,e)||s===r?(f.appendChild(r),t++):kd(r)&&t++}r!==t&&a.set(m,h)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let u=n.takeRecords();if(u.length>0){for(let t=0;t<u.length;t++){let n=u[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||Wd(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(c&&pv(i),id&&kv(e)&&i.insertRawText(l))})}finally{Hd=!1}}function Kd(e){let t=e._observer;t!==null&&Gd(e,t.takeRecords(),t)}function qd(e){(function(e){Ud===0&&Bv(e).addEventListener(`textInput`,Vse,!0)})(e),e._observer=new MutationObserver((t,n)=>{Gd(e,t,n)})}function Jd(e,t,n){let{isEqual:r}=e;return t===n||r!==void 0&&r(t,n)}function Yd(e,t){return Jd(e,t,e.defaultValue)}function Xd(e){return typeof e==`object`&&!!e}function Zd(e,t){let n=nf(e,t).getter;return Xd(n)&&n.getterTable!==void 0||$u(405,t),tf(n.getterTable)}function Qd(e,t){let n=nf(e,t).setter;return Xd(n)&&n.setterTable!==void 0||$u(406,t),tf(n.setterTable)}function $d(e,t,n){let{meta:r}=nf(e,t);for(let e=0;;)if(r.kind===`aliased`){if(e===n)return tf(r.aliases);e++,r=r.inner.meta}else r.kind===`nullable`||r.kind===`optional`?r=r.inner.meta:r.kind===`array`?r=r.item.meta:$u(407,t,String(n))}function ef(e,t){let n=nf(e,t),{setter:r}=n;Xd(r)&&r.setterTable!==void 0||$u(408,t);let i=String(n.defaultValue);return uf(r.setterTable,i)||$u(409,t,i),r.setterTable[i]}function tf(e){return Object.assign(Object.create(null),e)}function nf(e,t){let n=e.get(t);return n===void 0&&$u(410,t),n}function rf(e,t,n,r,i){i!==void 0&&Gse.add(i);let a=n===void 0,o=a?e(void 0):n;return a&&of(o),Object.assign(e,{accepts:i,defaultValue:o,isEqual:r,meta:t})}var Gse=new WeakSet,af=new WeakSet;function Kse(e){return typeof e==`object`&&e&&af.add(e),e}function of(e){if(typeof e==`object`&&e&&!Object.isFrozen(e)&&!af.has(e)){Object.freeze(e);for(let t of Object.values(e))of(t)}}function sf(e){let{isEqual:t}=e;return t===void 0?void 0:(e,n)=>e==null||n==null?e===n:t(e,n)}function cf(e,t){return n=>t(n)||lf(e,n)}function lf(e,t){let{accepts:n}=e;return n===void 0?function(e,t){let{accepts:n}=e;if(n!==void 0)return lf(e,t)?{parsed:e(t)}:void 0;let r=e(t);return Yd(e,r)&&t!==e.defaultValue?void 0:{parsed:r}}(e,t)!==void 0:n.call(e,t)}function uf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function df(e=``){return rf(t=>typeof t==`string`?t:e,{kind:`string`},void 0,void 0,e=>typeof e==`string`)}var qse=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function ff(e=0,t={}){let{integer:n,clamp:r}=t,i=n&&t.min!==void 0?Math.ceil(t.min):t.min,a=n&&t.max!==void 0?Math.floor(t.max):t.max,o=e=>typeof e==`string`&&qse.test(e)?Number(e):e,s=e=>typeof e==`number`&&Number.isFinite(e)&&(!n||Number.isInteger(e)),c=e=>s(e)&&(i===void 0||e>=i)&&(a===void 0||e<=a);return rf(t=>{let n=o(t);return r&&s(n)?i!==void 0&&n<i?i:a!==void 0&&n>a?a:n:c(n)?n:e},{clamp:r,integer:n,kind:`number`,max:a,min:i},void 0,void 0,e=>r?s(o(e)):c(o(e)))}function pf(e=!1){return rf(t=>typeof t==`boolean`?t:e,{kind:`boolean`},void 0,void 0,e=>typeof e==`boolean`)}function mf(e,...t){let n=Kse(t.length===0?e[0]:t[0]),r=new Set(e);return rf(e=>e!==void 0&&r.has(e)?e:n,{kind:`enum`,values:e},n,void 0,e=>r.has(e)&&(e!==void 0||n===void 0))}function hf(e,t={}){let{defaultAsNull:n}=t;return rf(t=>{if(t==null)return null;let r=e(t);return n&&Yd(e,r)?null:r},{defaultAsNull:n,inner:e,kind:`nullable`},void 0,sf(e),cf(e,e=>e==null))}function gf(e,t={}){let{omitDefault:n}=t;return rf(t=>{if(t===void 0)return;let r=e(t);return n&&Yd(e,r)?void 0:r},{inner:e,kind:`optional`,omitDefault:n},void 0,sf(e),cf(e,e=>e===void 0))}function _f(){return e=>function(e){return{meta:{fields:e,kind:`node`}}}(e)}function vf(e,t){let n=e=>typeof e==`string`&&uf(t,e);return rf(r=>n(r)?t[r]:e(r),{aliases:t,inner:e,kind:`aliased`},e.defaultValue,e.isEqual,t=>n(t)||lf(e,t))}function Jse(e){return rf(t=>{if(!Array.isArray(t))return[];let n=Array(t.length);for(let r=0;r<t.length;r++)n[r]=e(t[r]);return n},{item:e,kind:`array`},void 0,(t,n)=>{if(!Array.isArray(t)||!Array.isArray(n)||t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!Jd(e,t[r],n[r]))return!1;return!0},e=>Array.isArray(e))}function yf(e,t){return xf(0,e,{getter:{field:t.field,getterTable:t.getterTable,method:t.getter,when:t.when},setter:{field:t.field,method:t.setter,setterTable:t.setterTable}})}function bf(e,t){return xf(0,e,t)}function xf(e,t,n){return Object.assign(e=>t(e),{accepts:t.accepts,defaultValue:t.defaultValue,getter:n.getter,isEqual:t.isEqual,meta:t.meta,setter:n.setter})}var Yse=class{key;parse;unparse;isEqual;defaultValue;resetOnCopyNode;schema;constructor(e,t){this.key=e;let n=`meta`in(r=t.parse)&&typeof r.meta==`object`&&r.meta!==null&&`kind`in r.meta&&typeof r.meta.kind==`string`&&`defaultValue`in r?t.parse:void 0;var r;this.schema=n,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Qse).bind(t),this.isEqual=t.isEqual?t.isEqual.bind(t):n!==void 0&&n.isEqual!==void 0?(e,t)=>Jd(n,e,t):Object.is,this.defaultValue=n===void 0?this.parse(void 0):n.defaultValue,this.resetOnCopyNode=t.resetOnCopyNode||!1}};function Sf(e,t){return new Yse(e,t)}function Cf(e,t,n=`latest`){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function wf(e,t,n){let r;if(jg(),typeof n==`function`){let i=e.getLatest(),a=Cf(i,t);if(r=n(a),t.isEqual(a,r))return i}else r=n;let i=e.getWritable();return Ef(i).updateFromKnown(t,r),i}function Xse(e){let t=new Map,n=new Set;for(let{ownNodeConfig:r}of Wy(typeof e==`function`?e:e.replace))if(r&&r.stateConfigs)for(let e of r.stateConfigs){let r;`stateConfig`in e?(r=e.stateConfig,e.flat&&n.add(r.key)):r=e,t.set(r.key,r)}return{flatKeys:n,sharedConfigMap:t}}var Tf=new Set([`__proto__`,`constructor`,`prototype`]),Zse=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return Of(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){if(Tf.has(i))continue;let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}resetOnCopyNode(){for(let e of this.knownState.keys())e.resetOnCopyNode&&this.knownState.set(e,e.defaultValue);return this}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=Of(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){if(Tf.has(e))return;let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function Ef(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new Zse(t,function(e){return e.__state?e.__state.sharedNodeState:V_(gy(),e.getType()).sharedNodeState}(t));return t.__state=n,n}function Df(e,t){let n=e.getWritable(),r=t.$;return(n.__state||r)&&Ef(e).updateFromJSON(r),n}function Of(e){if(e)for(let t in e)return e}function Qse(e){return e}function kf(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function Af(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function jf(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function Mf(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;let n=new Set;return!(e&&kf(n,e,t)||t&&kf(n,t,e)||e&&Af(n,e,t)||t&&Af(n,t,e))}(c,l))}function Nf(e,t){let n=e.mergeWithSibling(t),r=Pg()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function Pf(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&X(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(Mf(t,r)){r=Nf(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&X(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(Mf(r,n)){r=Nf(r,n);break}break}n.remove()}}else r.remove()}function Ff(e){return If(e.anchor),If(e.focus),e}function If(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),X(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!$(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var Lf=Symbol.for(`@lexical/CachedTextSize`);function Rf(e,t){return ep.read(()=>{let n=0,r=e;for(let e=0;e<t&&r!==null;e++){let i=$f.get(r);if(i===void 0&&$u(345,r),$(i)){let a=tp.get(r);if(a!==void 0&&$(a)&&a.__parent!==i.__parent)n+=i.getTextContentSize();else{let e=np.get(r),t=e&&e.__lexicalTextContent;typeof t!=`string`&&$u(346,i.getType()),n+=t.length}e<t-1&&!i.isInline()&&(n+=2)}else{let e=i[Lf];e===void 0&&$u(347,i.getType(),r),n+=e}r=i.__next}return n},{editor:Vf})}function zf(e){$(e)||e[Lf]===void 0&&(e[Lf]=X(e)?e.__text.length:e.getTextContentSize())}var $se=4,Bf,Vf,Hf,Uf=``,Wf=null,Gf=null,Kf=null;function qf(){return{firstTextKey:Kf,format:Wf,style:Gf}}function Jf(e){e.firstTextKey!==null&&(Wf=e.format,Gf=e.style,Kf=e.firstTextKey)}function Yf(e){if(Kf!==null)return;let t=e.__lexicalFirstTextKey;if(t===void 0&&$u(348),t===null)return;let n=tp.get(t);X(n)&&(Wf=n.getFormat(),Gf=n.getStyle(),Kf=t)}var Xf,Zf,Qf,$f,ep,tp,np,rp,ip,ap,op=!1,sp=!1;function cp(e,t){let n=$f.get(e),r=tp.has(e);if(t!==null){let n=jp(e);n.parentNode===t&&t.removeChild(n)}if(!r){if(Vf._keyToDOMMap.delete(e),$(n)){let e=qy(n,$f);lp(e,0,e.length-1,null)}if(n!==void 0){for(let e of _p(n).values()){let t=yp(e);cp(e,null),t!==null&&t.remove()}Dv(ip,Hf,Xf,n,`destroyed`)}}}function lp(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&cp(t,r)}}function up(e,t){e.setProperty(`text-align`,t)}var ece=`40px`;function dp(e,t){let n=Bf.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}e.style.setProperty(`padding-inline-start`,t===0?``:`calc(${t} * var(--lexical-indent-base-value, ${ece}))`),Tv(e,`class`),Tv(e,`style`)}function fp(e,t){let n=e.style;t===0?up(n,``):t===1?up(n,`left`):t===2?up(n,`center`):t===3?up(n,`right`):t===4?up(n,`justify`):t===5?up(n,`start`):t===6&&up(n,`end`),Tv(e,`style`)}function pp(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(n_(e))return null;let n=e.getParent();return n===null||Wv(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function mp(e){let t=ny().createElement(`div`);return t.setAttribute(`data-lexical-slot`,e),t.style.display=`none`,t}function hp(e,t,n){t||e.contentEditable===`false`?Ale(n,Vf):n.removeAttribute(`contenteditable`)}function gp(e,t,n){let r=Uf,i=qf();Uf=``;let a=``,o=e_(e);for(let[r,i]of n){let n=mp(r);hp(t,o,n),t.appendChild(n),Uf=``;let s=qf();xp(i,vy(e,n,Vf)),Jf(s),vp(e,r,t,n),a+=Uf}return Jf(i),Uf=r,a}function _p(e){return Xy(e)&&e.__slots!==null?e.__slots:Yy}function vp(e,t,n,r){let i=ap.$getSlotTargetElement(e,t,n,Vf);i!==null&&(r.parentElement!==i&&i.appendChild(r),r.style.display=``)}function yp(e){let t=np.get(e);return t===void 0?null:t.parentElement}function bp(e,t,n){let r=_p(e),i=_p(t);for(let[e,t]of r)if(!i.has(e)){let e=yp(t);cp(t,null),e!==null&&e.remove()}let a=Uf,o=qf(),s=``,c=null,l=e_(t);for(let[e,a]of i){let i=r.get(e),o=i===void 0?null:yp(i);Uf=``;let u=qf();if(o===null){o=mp(e);let r=null;for(let e of n.children)if(!e.hasAttribute(`data-lexical-slot`)){r=e;break}n.insertBefore(o,r),xp(a,vy(t,o,Vf))}else i===a?Dp(a,o):(i!==void 0&&cp(i,o),xp(a,vy(t,o,Vf)));if(Jf(u),hp(n,l,o),vp(t,e,n,o),s+=Uf,o.parentElement===n){let e=c===null?n.firstChild:c.nextSibling;e!==o&&n.insertBefore(o,e),c=o}}return Jf(o),Uf=a,s}function xp(e,t){let n=tp.get(e);if(n===void 0&&$u(60),t!==null){let r=$f.get(e);if(r!==void 0){let i=np.get(e);if(i!==void 0){let a=Zy(r)?r.__slotHost:null,o=Zy(n)?n.__slotHost:null,s=r.__parent!==n.__parent||a!==o,c=o!==null&&i.parentElement!==t.element;if(s||c)return t.insertChild(i),Dp(e,t.element)}}}let r=ap.$createDOM(n,Vf);if(function(e,t,n){let r=n._keyToDOMMap;ov(t,n,e),r.set(e,t)}(e,r,Vf),X(n)?r.setAttribute(`data-lexical-text`,`true`):e_(n)&&(r.setAttribute(`data-lexical-decorator`,`true`),Ey(r,{captureSelection:!0})),$(n)){let e=n.__indent,t=n.__size;pp(r,n),e!==0&&dp(r,e);let i=_p(n),a=i.size>0?gp(n,r,i):``;if(t===0)r.__lexicalTextContent=a,r.__lexicalFirstTextKey=null,Uf+=a,i.size>0&&(r.__lexicalSlotTextLength=a.length);else{let e=Uf,o=t-1;if(Sp(qy(n,tp),n,0,o,vy(n,r,Vf)),a!==``){let t=r.__lexicalTextContent||``;r.__lexicalTextContent=a+t,Uf=e+a+t}i.size>0&&(r.__lexicalSlotTextLength=a.length)}let o=n.__format;o!==0&&fp(r,o),n.isInline()||(Tp(0,n,r),wp(n,r))}else{let t=n.getTextContent();if(e_(n)){let t=n.decorate(Vf,Bf);t!==null&&Op(e,t),r.contentEditable=`false`;let i=_p(n);i.size>0&&gp(n,r,i)}Uf+=t}return t!==null&&t.insertChild(r),ap.$decorateDOM(n,null,r,Vf),zf(n),Dv(ip,Hf,Xf,n,`created`),r}function Sp(e,t,n,r,i){let a=Uf,o=qf();Uf=``,Wf=null,Gf=null,Kf=null;let s=n;for(;s<=r;++s){let t=qf();xp(e[s],i);let n=tp.get(e[s]);n!==null&&X(n)?Wf===null&&(Wf=n.getFormat(),Gf=n.getStyle(),Kf=n.__key):$(n)&&s<r&&!n.isInline()&&(Uf+=pd),Jf(t)}let c=Vf._keyToDOMMap.get(t.__key);c===void 0&&$u(349,t.__key),c.__lexicalTextContent=Uf,c.__lexicalFirstTextKey=Kf,Uf=a+Uf,Jf(o)}function Cp(e,t){if(!e)return!1;let n=t.get(e);return e_(n)&&!n.isInline()}function wp(e,t){let n=vy(e,t,Vf);n.setDecoratorBoundaryAnchor(`leading`,Cp(e.__first,tp)),n.setDecoratorBoundaryAnchor(`trailing`,Cp(e.__last,tp))}function Tp(e,t,n){let r=vy(t,n,Vf),i=function(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return u_(e)?`line-break`:e_(e)&&e.isInline()?`decorator`:null}return`empty`}return null}(t,tp);r.setManagedLineBreak(i)}function Ep(e,t,n){let r=t.__lexicalFirstTextKey;if(r!=null){let t=e.__key,i=r;for(;i!==null;){let e=tp.get(i);if(e===void 0){i=null;break}if(e.__parent===t)break;i=e.__parent}if(i!==null&&!n.has(i)){let e=tp.get(r);if(X(e))return Wf=e.getFormat(),void(Gf=e.getStyle())}}t.__lexicalFirstTextKey=Kf}function Dp(e,t){let n=$f.get(e),r=tp.get(e);n!==void 0&&r!==void 0||$u(61);let i=op||Qf.has(e)||Zf.has(e),a=jv(Vf,e);if(n===r&&!i){let e;if($(n)){let t=a.__lexicalTextContent;typeof t!=`string`&&$u(355,n.getType()),e=t,Yf(a)}else e=n.getTextContent();return Uf+=e,a}if(n!==r&&i&&Dv(ip,Hf,Xf,r,`updated`),ap.$updateDOM(r,n,a,Vf)){let n=xp(e,null);return t===null&&$u(62),t.replaceChild(n,a),cp(e,null),n}if($(n)){$(r)||$u(334,e);let t=r.__indent;(op||t!==n.__indent)&&dp(a,t);let o=r.__format;(op||o!==n.__format)&&fp(a,o);let s=i&&(_p(r).size>0||_p(n).size>0)?bp(n,r,a):``;if(i){let e=Uf;if(function(e,t,n){var r;Wf=null,Gf=null,Kf=null,function(e,t,n){let r=Uf,i=e.__size,a=t.__size;Uf=``;let o=n.element,s=Vf._keyToDOMMap.get(t.__key);s===void 0&&$u(351,t.__key);let c=a-i;if(!op&&Math.abs(c)<=1&&i>=$se&&e.__first===t.__first&&(c!==0||!Vf._cloneNotNeeded.has(e.__key))){let i=s.__lexicalTextContent,l=rp.get(e.__key);if(!op&&typeof i==`string`&&l!==void 0){let a=function(e,t){let n=t.size;if(n===0||n>=e.__size)return null;let r=e.__last,i=null,a=0;for(;r!==null&&a<n;){if(!t.has(r))return null;i=r;let e=tp.get(r);if(e===void 0)return null;r=e.__prev,a++}return a!==n||r!==null&&t.has(r)?null:i}(t,l);if(a!==null){let u=l.size;if(c===0){let e=Rf(a,u),n=a,c=0;for(;n!==null&&c<u;){let e=tp.get(n);if(e===void 0)break;let t=qf();Dp(n,o),X(e)&&Wf===null&&(Wf=e.getFormat(),Gf=e.getStyle(),Kf=e.__key),Jf(t),n=e.__next,c++}let d=``;for(n=a,c=0;n!==null&&c<u;){let e=tp.get(n);if(e===void 0)break;let t;if($(e)){let r=Vf._keyToDOMMap.get(n),i=r&&r.__lexicalTextContent;typeof i!=`string`&&$u(352,e.getType()),t=i}else t=e.getTextContent();d+=t,c<u-1&&$(e)&&!e.isInline()&&(d+=pd),n=e.__next,c++}let f=s.__lexicalSlotTextLength||0,p=f>0?i.slice(f):i,m=p.slice(0,p.length-e)+d;s.__lexicalTextContent=m,Uf=r+m,Ep(t,s,l);return}if(function(e,t,n,r,i,a,o,s){if(s!==1&&s!==-1||o!==(s===1?2:1))return!1;let c=o-s,l=e.__last;for(let e=0;e<c-1;e++){if(l===null)return!1;let e=$f.get(l);if(e===void 0)return!1;l=e.__prev}if(l===null)return!1;let u=tp.get(a),d=$f.get(l);if(u===void 0||d===void 0||u.__prev!==d.__prev)return!1;let f=[],p=a;for(let e=0;e<o;e++){if(p===null)return!1;f.push(p);let e=tp.get(p);p=e?e.__next:null}let m=[];p=l;for(let e=0;e<c;e++){if(p===null)return!1;m.push(p);let e=$f.get(p);p=e?e.__next:null}let h=new Set(m),g=new Set(f),_=[],v=0,y=0;for(;v<c&&y<o;)if(f[y]===m[v])_.push({key:f[y],kind:`reconcile`}),v++,y++;else if(g.has(m[v])){if(h.has(f[y]))return!1;_.push({key:f[y],kind:`create`,nextIndex:y}),y++}else _.push({key:m[v],kind:`destroy`}),v++;for(;v<c;)_.push({key:m[v++],kind:`destroy`});for(;y<o;)_.push({key:f[y],kind:`create`,nextIndex:y}),y++;let b=Rf(l,c);for(let e of _){let t=qf();if(e.kind===`reconcile`)Dp(e.key,n.element);else if(e.kind===`destroy`)cp(e.key,n.element);else{let t=null;for(let n=e.nextIndex+1;n<o;n++){let e=Vf._keyToDOMMap.get(f[n]);if(e!==void 0){t=e;break}}xp(e.key,n.withBefore(t??n.before))}if(e.kind!==`destroy`){let t=tp.get(e.key);t&&X(t)&&Wf===null&&(Wf=t.getFormat(),Gf=t.getStyle(),Kf=t.__key)}Jf(t)}let x=``;for(let e=0;e<o;e++){let t=tp.get(f[e]);if(t===void 0)return!1;let n;if($(t)){let r=Vf._keyToDOMMap.get(f[e]),i=r&&r.__lexicalTextContent;typeof i!=`string`&&$u(350,t.getType()),n=i}else n=t.getTextContent();x+=n,e<o-1&&$(t)&&!t.isInline()&&(x+=pd)}let S=r.__lexicalSlotTextLength||0,C=S>0?i.slice(S):i;return r.__lexicalTextContent=C.slice(0,C.length-b)+x,!0}(e,0,n,s,i,a,u,c)){let e=s.__lexicalTextContent;typeof e!=`string`&&$u(353),Uf=r+e,Ep(t,s,l);return}}}if(c===0){let t=e.__first,n=0;for(;t!==null;){let e=tp.get(t);if(e===void 0)break;let r=op||Qf.has(t)||Zf.has(t),i=qf();if(r)Dp(t,o);else{let n,r;if($(e)){r=np.get(t);let i=r&&r.__lexicalTextContent;typeof i!=`string`&&$u(354,e.getType()),n=i}else n=e.getTextContent();Uf+=n,r!==void 0&&Yf(r)}X(e)?Wf===null&&(Wf=e.getFormat(),Gf=e.getStyle(),Kf=e.__key):$(e)&&n<a-1&&!e.isInline()&&(Uf+=pd),Jf(i),t=e.__next,n++}s.__lexicalTextContent=Uf,s.__lexicalFirstTextKey=Kf,Uf=r+Uf;return}}if(i===1&&a===1){let r=e.__first,i=t.__first;if(r===i)Dp(r,o);else{let e=jp(r),t=xp(i,null);try{e.parentNode===o?o.replaceChild(t,e):n.insertChild(t)}catch(n){if(typeof n==`object`&&n){let a=`${n.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${i}}, old child: {tag: ${e.tagName}, key: ${r}}.`;throw Error(a)}throw n}cp(r,null)}let a=tp.get(i);X(a)&&Wf===null&&(Wf=a.getFormat(),Gf=a.getStyle(),Kf=a.__key)}else{let r=qy(e,$f),s=qy(t,tp);if(r.length!==i&&$u(227),s.length!==a&&$u(228),i===0)a!==0&&Sp(s,t,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&_p(t).size===0&&n.element.__lexicalLineBreak==null;lp(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f],i=qf();if(e===r)u=kp(Dp(r,a.element)),d++,f++;else{if(l===void 0&&(l=Ap(n,f)),c===void 0)c=Ap(t,d);else if(!c.has(e)){d++,Jf(i);continue}if(!l.has(e)){u=kp(jp(e)),cp(e,a.element),d++,c.delete(e),Jf(i);continue}if(c.has(r)){let e=jv(Vf,r);e!==u&&a.withBefore(u??a.before).insertChild(e),u=kp(Dp(r,a.element)),d++,f++}else xp(r,a.withBefore(u??a.before)),f++}let o=tp.get(r);o!==null&&X(o)?Wf===null&&(Wf=o.getFormat(),Gf=o.getStyle(),Kf=o.__key):$(o)&&f<=s&&!o.isInline()&&(Uf+=pd),Jf(i)}let p=d>o,m=f>s;if(p&&!m){let t=n[s+1],r=t===void 0?null:Vf.getElementByKey(t);Sp(n,e,f,s,a.withBefore(r??a.before))}else m&&!p&&lp(t,d,o,a.element)})(t,r,s,i,a,n)}s.__lexicalTextContent=Uf,s.__lexicalFirstTextKey=Kf,Uf=r+Uf}(e,t,vy(t,n,Vf)),Wv(t)||(r=t,Wf==null||Wf===r.__textFormat||sp||r.setTextFormat(Wf),function(e){Gf==null||Gf===e.__textStyle||sp||e.setTextStyle(Gf)}(t))}(n,r,a),r.isInline()||(n_(r)||Tp(0,r,a),wp(r,a)),s!==``){let t=a.__lexicalTextContent||``;a.__lexicalTextContent=s+t,Uf=e+s+t,a.__lexicalSlotTextLength=s.length}else(_p(r).size>0||_p(n).size>0)&&(a.__lexicalSlotTextLength=0)}else{let e=a.__lexicalTextContent;typeof e!=`string`&&$u(356,n.getType()),Uf+=e,Yf(a)}if((op||r.__dir!==n.__dir||r.__parent!==n.__parent)&&(pp(a,r),n_(r)&&!op))for(let e of r.getChildren())$(e)&&pp(jv(Vf,e.getKey()),e)}else{let t=r.getTextContent();if(e_(r)){let t=r.decorate(Vf,Bf);t!==null&&Op(e,t),i&&(_p(r).size>0||_p(n).size>0)&&bp(n,r,a)}Uf+=t}if(!sp&&n_(r)){let e=r.getLatest();if(e.__cachedText!==Uf){let t=e.getWritable();t.__cachedText=Uf,r=t}}return ap.$decorateDOM(r,n,a,Vf),zf(r),a}function Op(e,t){let n=Vf._pendingDecorators,r=Vf._decorators;if(n===null){if(r[e]===t)return;n=lv(Vf)}n[e]=t}function kp(e){let t=e.nextSibling;return t!==null&&t===Vf._blockCursorElement&&(t=t.nextSibling),t}function Ap(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function tce(e,t,n,r,i,a){Uf=``,Wf=null,Gf=null,Kf=null,op=r===2,Vf=n,Bf=n._config,ap=n._config.dom||P_,Hf=n._nodes,Xf=Vf._listeners.mutation,Zf=i,Qf=a,$f=e._nodeMap,ep=e,tp=t._nodeMap,sp=t._readOnly,np=Ld(n._keyToDOMMap),rp=function(){let e=new Map,t=t=>{for(let n of t){let t=tp.get(n);if(t===void 0)continue;let r=t.__parent;if(r===null)continue;let i=e.get(r);i===void 0&&(i=new Set,e.set(r,i)),i.add(n)}};return t(Zf.keys()),t(Qf),e}();let o=new Map;return ip=o,Dp(`root`,null),Vf=void 0,Hf=void 0,Zf=void 0,Qf=void 0,$f=void 0,ep=void 0,tp=void 0,Bf=void 0,np=void 0,rp=void 0,ip=void 0,ap=P_,o}function jp(e){let t=np.get(e);return t===void 0&&$u(75,e),t}function nce(e){return()=>{}}function Mp(e){return{type:e}}var Np=Mp(`SELECTION_CHANGE_COMMAND`),Pp=Mp(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),Fp=Mp(`CLICK_COMMAND`),Ip=Mp(`BEFORE_INPUT_COMMAND`),Lp=Mp(`INPUT_COMMAND`),Rp=Mp(`COMPOSITION_START_COMMAND`),zp=Mp(`COMPOSITION_END_COMMAND`),Bp=Mp(`DELETE_CHARACTER_COMMAND`),Vp=Mp(`INSERT_LINE_BREAK_COMMAND`),Hp=Mp(`INSERT_PARAGRAPH_COMMAND`),Up=Mp(`CONTROLLED_TEXT_INSERTION_COMMAND`),Wp=Mp(`PASTE_COMMAND`),Gp=Mp(`REMOVE_TEXT_COMMAND`),Kp=Mp(`DELETE_WORD_COMMAND`),qp=Mp(`DELETE_LINE_COMMAND`),Jp=Mp(`FORMAT_TEXT_COMMAND`),rce=Mp(`SET_TEXT_FORMAT_COMMAND`),Yp=Mp(`UNDO_COMMAND`),Xp=Mp(`REDO_COMMAND`),Zp=Mp(`KEYDOWN_COMMAND`),Qp=Mp(`KEY_ARROW_RIGHT_COMMAND`),$p=Mp(`MOVE_TO_END`),em=Mp(`KEY_ARROW_LEFT_COMMAND`),tm=Mp(`MOVE_TO_START`),nm=Mp(`KEY_ARROW_UP_COMMAND`),rm=Mp(`KEY_ARROW_DOWN_COMMAND`),im=Mp(`KEY_ENTER_COMMAND`),am=Mp(`KEY_SPACE_COMMAND`),om=Mp(`KEY_BACKSPACE_COMMAND`),sm=Mp(`KEY_ESCAPE_COMMAND`),cm=Mp(`KEY_DELETE_COMMAND`),lm=Mp(`KEY_TAB_COMMAND`),um=Mp(`INSERT_TAB_COMMAND`),dm=Mp(`INDENT_CONTENT_COMMAND`),fm=Mp(`OUTDENT_CONTENT_COMMAND`),pm=Mp(`DROP_COMMAND`),mm=Mp(`FORMAT_ELEMENT_COMMAND`),hm=Mp(`DRAGSTART_COMMAND`),gm=Mp(`DRAGOVER_COMMAND`),ice=Mp(`DRAGEND_COMMAND`),_m=Mp(`COPY_COMMAND`),vm=Mp(`CUT_COMMAND`),ym=Mp(`SELECT_ALL_COMMAND`),ace=Mp(`CLEAR_EDITOR_COMMAND`),oce=Mp(`CLEAR_HISTORY_COMMAND`),bm=Mp(`CAN_REDO_COMMAND`),xm=Mp(`CAN_UNDO_COMMAND`),Sm=Mp(`FOCUS_COMMAND`),sce=Mp(`BLUR_COMMAND`),cce=Mp(`KEY_MODIFIER_COMMAND`);function Cm(e,t){return{...t,[Ise]:e}}var wm=Cm(`metaKey`,{ctrlKey:!rd,metaKey:rd}),Tm=Cm(`altKey`,{altKey:rd,ctrlKey:!rd}),Em=[[`altKey`,1],[`ctrlKey`,2],[`metaKey`,4],[`shiftKey`,8]];function Dm(e,t,n){let r=e.get(t);r?r.push(n):e.set(t,[n])}var lce=class{byKey=new Map;byCode=new Map;add(e){let{key:t,modifiers:n={}}=e;t.length>0||$u(399);let r=t.toLowerCase();for(let i of function(e){let t=[0];for(let[n,r]of Em){let i=e[n]||!1;i===`any`?t=t.concat(t.map(e=>e|r)):i&&(t=t.map(e=>e|r))}return t}(n))Dm(this.byKey,`${i}:${r}`,e),t.length===1&&(/[0-9]/.test(t)?Dm(this.byCode,`${i}:Digit${t}`,e):/[a-z]/.test(r)&&Dm(this.byCode,`${i}:Key${r.toUpperCase()}`,e));return this}matches(e){let t=e.key;if(!t)return[];let n=function(e){let t=0;for(let[n,r]of Em)e[n]&&(t|=r);return t}(e),r=this.byKey.get(`${n}:${t.toLowerCase()}`),i=r?r.slice():[];if(this.byCode.size>0&&!(t.length===1&&t.charCodeAt(0)<=127)){let t=this.byCode.get(`${n}:${e.code}`);t&&i.push(...t)}return i}match(e){return this.matches(e)[0]}};function uce(e){let t=new lce;for(let n of e)t.add(n);return t}function dce(e){let t=new Map;return{dispose(){for(let e of t.values())e.dispose();t.clear()},register(n,r){let i=t.get(n);i===void 0&&(i={dispose:e(n,r),holders:new Set},t.set(n,i));let a=()=>{let e=t.get(n);e&&e.holders.delete(a)&&e.holders.size===0&&(t.delete(n),e.dispose())};return i.holders.add(a),a}}}function Om(e,t,n,r){return e.addEventListener(t,n,r),e.removeEventListener.bind(e,t,n,r)}var km=Object.freeze({}),Am,jm=new WeakMap,Mm=new WeakMap,fce=dce(e=>(e.addEventListener(`selectionchange`,Qm),()=>e.removeEventListener(`selectionchange`,Qm)));function Nm(e,t,n,r,i,a){let o=e.anchor,s=e.focus,c=o.getNode(),l=Pg(),u;if(a!==void 0)u=a;else{let e=Zv(Bv(l));u=e===null?null:ay(e,l._rootElement)}let d=u===null?null:u.anchorNode,f=o.key,p=l.getElementByKey(f),m=n.length;return f!==s.key||!X(c)||(!i&&(!ad||l._inputState.lastBeforeInputInsertTextTimeStamp<r+50)||c.isDirty()&&m<2||gv(n))&&o.offset!==s.offset&&!c.isComposing()||Y_(c)||c.isDirty()&&m>1||(i||!ad)&&p!==null&&!c.isComposing()&&d!==yy(c,p,l)||u!==null&&t!==null&&(!t.collapsed||t.startContainer!==u.anchorNode||t.startOffset!==u.anchorOffset)||!c.isComposing()&&(c.getFormat()!==e.format||c.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=J_(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(X(t)||$(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,c)}function Pm(e,t){return X_(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function Fm(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=ay(e,t._rootElement),s=t._inputState;if(s.isSelectionChangeFromDOMUpdate){s.isSelectionChangeFromDOMUpdate=!1;let e=s.selectionChangeFromDOMUpdatePoints;if(s.selectionChangeFromDOMUpdatePoints=null,Pm(r,i)&&Pm(a,o)&&!s.postDeleteSelectionToRestore&&(e===null||e.anchorNode===r&&e.anchorOffset===i&&e.focusNode===a&&e.focusOffset===o))return}Xg(t,()=>{if(!n)return void pv(null);if(!W_(t,r,a))return;let c=Q();if(s.postDeleteSelectionToRestore&&Z(c)&&c.isCollapsed()){let e=c.anchor,t=s.postDeleteSelectionToRestore.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(c=s.postDeleteSelectionToRestore.clone(),pv(c))}if(s.postDeleteSelectionToRestore=null,Z(c)){let n=c.anchor,l=n.getNode();if(c.isCollapsed()){e.type===`Range`&&r===a&&(c.dirty=!0);let i=Bv(t).event,o=i?i.timeStamp:performance.now(),{format:u,style:d,offset:f,key:p,timeStamp:m}=s.collapsedSelectionFormat,h=dv(),g=!1===t.isComposing()&&h.getTextContent()===``;if(o<m+200&&n.offset===f&&n.key===p)Im(c,u,d);else if(n.type===`text`)X(l)||$u(141),Lm(c,l);else if(n.type===`element`&&!g){$(l)||$u(259);let e=n.getNode();e.isEmpty()?function(e,t){Im(e,t.getTextFormat(),t.getTextStyle())}(c,e):Im(c,c.format,``)}}else{let e=n.key,t=c.focus.key,r=c.getNodes(),a=r.length,s=c.isBackward(),l=s?o:i,u=s?i:o,d=s?t:e,f=s?e:t,p=Nse,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(X(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}c.format=m?p:0}}(function(e,t,n=!1){(n||Gg(e,t))&&e.dispatchCommand(Np)})(t,c,c!==null&&(c.dirty||!Z(c)))})}function Im(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function Lm(e,t){Im(e,t.getFormat(),t.getStyle())}function pce(e,t){Xg(t,()=>{let n=Q(),r=Zv(Bv(t)),i=ag();if(r){if(Z(n)){let e=n.anchor,t=e.getNode();e.type===`element`&&e.offset===0&&n.isCollapsed()&&!n_(t)&&dv().getChildrenSize()===1&&t.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i)&&(r.removeAllRanges(),n.dirty=!0)}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=ay(r,t._rootElement).anchorNode;(uy(n)||X_(n))&&pv(ig(i,r,t,e))}}if(id&&r!==null&&r.rangeCount===0){let n=t._rootElement;if(n!==null&&e.target===n){let a=e.clientY,o=n.childNodes.length;for(let e=0;e<n.childNodes.length;e++){let t=n.childNodes[e];if(uy(t)){let n=t.getBoundingClientRect();if(a<=(n.top+n.bottom)/2){o=e;break}}}r.setBaseAndExtent(n,o,n,o);let s=ig(i,r,t,e);s===null?r.removeAllRanges():pv(s)}}Av(t,Fp,e)})}function mce(e,t){let n=cy(e),r=e.pointerType;dy(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&Xg(t,()=>{Oy(n,t)||(t._inputState.isSelectionChangeFromMouseDown=!0)})}function Rm(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function zm(e){let{lastKeyCode:t}=Pg()._inputState;if(e==null||e.length<=1||t==null)return;let n=t.length===1?t:t===`Enter`?`
`:t===`Tab`?` `:null;if(!n)return;let r=Q();if(!Z(r)||!r.isCollapsed())return;let i=r.anchor.getNode();if(!X(i))return;let{offset:a}=r.anchor;if(i.getTextContentSize()===a){let e=i.getNextSibling();if(n===`
`){if(od)return;if(u_(e))e.selectEnd();else if(!e){let e=Ky(i,eg),t=e&&e.getNextSibling();$(t)&&t.selectStart()}}else n===` `?Oh(e)&&e.selectEnd():X(e)&&e.getTextContent()[0]===n&&e.select(1,1)}else i.getTextContent()[a]===n&&i.select(a+1,a+1)}function Bm(e){e.isInsertTextAfterHandledSelectionCommand=!1,e.handledSelectionCommandTimeoutId!==null&&(clearTimeout(e.handledSelectionCommandTimeoutId),e.handledSelectionCommandTimeoutId=null)}function Vm(e){rd&&!od&&ld&&(Bm(e),e.isInsertTextAfterHandledSelectionCommand=!0,e.handledSelectionCommandTimeoutId=setTimeout(()=>Bm(e),0))}function Hm(e,t){let n=cy(e);if(uy(n)&&Oy(n,t))return!0;let r=t.getRootElement();if(r===null)return!1;let i=sy(r.ownerDocument);return i!==null&&r.contains(i)&&Oy(i,t)}function hce(e){let t=e.inputType,n=Rm(e),r=Pg(),i=r._inputState,a=Q();if(t===`insertText`&&e.data&&i.isInsertTextAfterHandledSelectionCommand){if(Bm(i),e.preventDefault(),Z(a)&&!a.isCollapsed()){let e=a.isBackward()?a.anchor:a.focus;a.anchor.set(e.key,e.offset,e.type),a.focus.set(e.key,e.offset,e.type)}return!0}if(t===`deleteContentBackward`){if(a===null){let e=ag();if(!Z(e))return!0;pv(e.clone())}if(Z(a)){let t=a.anchor.key===a.focus.key;if(function(e,t){return e.lastKeyCode===`MediaLast`&&t<e.lastKeyDownTimeStamp+30}(i,e.timeStamp)&&r.isComposing()&&t){if(nv(null),i.lastKeyDownTimeStamp=0,setTimeout(()=>{Xg(r,()=>{nv(null)})},30),Z(a)){let e=a.anchor.getNode();e.markDirty(),X(e)||$u(142),Lm(a,e)}}else{if(nv(null),od&&n!==null&&!n.collapsed&&(a.applyDOMRange(n),!a.isCollapsed()))return e.preventDefault(),a.removeText(),!0;e.preventDefault();let o=a.anchor.getNode(),s=o.getTextContent(),c=o.canInsertTextAfter(),l=a.anchor.offset===0&&a.focus.offset===s.length,u=ud&&t&&!l&&c;if(u&&a.isCollapsed()&&(u=!e_(_le(a.anchor,!0))),!u){Av(r,Bp,!0);let e=Q();ud&&Z(e)&&e.isCollapsed()&&(i.postDeleteSelectionToRestore=e,setTimeout(()=>i.postDeleteSelectionToRestore=null))}}return!0}}if(!Z(a))return t!==`historyUndo`&&t!==`historyRedo`||(e.preventDefault(),Av(r,t===`historyUndo`?Yp:Xp)),!0;let o=e.data;i.unprocessedBeforeInputData!==null&&bv(!1,r,i.unprocessedBeforeInputData),a.dirty&&i.unprocessedBeforeInputData===null||!a.isCollapsed()||n_(a.anchor.getNode())||n===null||a.applyDOMRange(n),i.unprocessedBeforeInputData=null;let s=a.anchor,c=a.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
`)e.preventDefault(),Av(r,Vp,!1);else if(o===pd)e.preventDefault(),Av(r,Hp);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),a.insertRawText(t)}else o!=null&&Nm(a,n,o,e.timeStamp,!0)?(e.preventDefault(),Av(r,Up,o),zm(o)):i.unprocessedBeforeInputData=o;return i.lastBeforeInputInsertTextTimeStamp=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:Av(r,Up,e),zm((e.dataTransfer?e.dataTransfer.getData(`text/plain`):null)??e.data);break;case`insertFromComposition`:{let t=i.hadOrphanedCompositionEvents;i.hadOrphanedCompositionEvents=!1;let n=r._compositionKey;nv(null),t||Av(r,Up,e),Um(n);break}case`insertLineBreak`:nv(null),i.isInsertLineBreak=!1,Av(r,Vp,!1);break;case`insertParagraph`:nv(null),i.isInsertLineBreak?(i.isInsertLineBreak=!1,Av(r,Vp,!1)):Av(r,Hp);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:Av(r,Wp,e);break;case`deleteByComposition`:(function(e,t){return e!==t||$(e)||$(t)||!J_(e)||!J_(t)})(l,u)&&Av(r,Gp,e);break;case`deleteByDrag`:Iv(`skip-selection-focus`),Av(r,Gp,e);break;case`deleteByCut`:Av(r,Gp,e);break;case`deleteContent`:Av(r,Bp,!1);break;case`deleteWordBackward`:Av(r,Kp,!0);break;case`deleteWordForward`:Av(r,Kp,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:Av(r,qp,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:Av(r,qp,!1);break;case`formatStrikeThrough`:Av(r,Jp,`strikethrough`);break;case`formatBold`:Av(r,Jp,`bold`);break;case`formatItalic`:Av(r,Jp,`italic`);break;case`formatUnderline`:Av(r,Jp,`underline`);break;case`historyUndo`:Av(r,Yp);break;case`historyRedo`:Av(r,Xp)}return!0}function gce(e,t){e.stopPropagation();let n=t._inputState;Bm(n),Xg(t,()=>{Hm(e,t)||t.dispatchCommand(Lp,e)},{event:e}),n.unprocessedBeforeInputData=null}function _ce(e){let t=Pg(),n=t._inputState,r=Q(),i=e.data,a=Rm(e),o=!1;if(i!=null&&Z(r)){let s=Zv(Bv(t)),c=s===null?null:ay(s,t._rootElement),l=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&!t.isComposing();l&&(n.hadOrphanedCompositionEvents=!0);let u=r.anchor.getNode(),d=e.inputType===`insertCompositionText`&&n.compositionPhase!==`ending-firefox`&&t.isComposing()&&X(u)&&Y_(u);if(!l&&!d&&Nm(r,a,i,e.timeStamp,!1,c)){if(o=!0,n.compositionPhase===`ending-firefox`){let e=Wm(t,i);if(n.compositionPhase=`idle`,e)return Iv(`composition-end`),mv(),!0}let a=r.anchor.getNode();if(s===null||c===null)return!0;let l=r.isBackward(),u=l?r.anchor.offset:r.focus.offset,d=l?r.focus.offset:r.anchor.offset;ad&&!r.isCollapsed()&&X(a)&&c.anchorNode!==null&&a.getTextContent().slice(0,u)+i+a.getTextContent().slice(u+d)===yv(c.anchorNode)||Av(t,Up,i);let f=i.length;id&&f>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(r.anchor.offset-=f,r._cachedNodes=null,r._cachedIsBackward=null),ud&&t.isComposing()&&(n.lastKeyDownTimeStamp=0,nv(null))}}return o||(bv(!1,t,i===null?void 0:i),n.compositionPhase===`ending-firefox`&&(Wm(t,i||void 0),Iv(`composition-end`),n.compositionPhase=`idle`)),mv(),!0}function vce(e,t){Av(t,Rp,e)}function yce(e){let t=Pg(),n=t._inputState,r=Q();if(Z(r)&&!t.isComposing()){n.compositionPhase=`composing`,n.hadOrphanedCompositionEvents=!1;let i=r.anchor,a=r.anchor.getNode();if(nv(i.key),Iv(`composition-start`),e.timeStamp<n.lastKeyDownTimeStamp+30||i.type===`element`||!r.isCollapsed()||!ud&&(a.getFormat()!==r.format||X(a)&&a.getStyle()!==r.style)||X(a)&&(Y_(a)||i.offset===0&&!a.canInsertTextBefore()||i.offset===a.getTextContentSize()&&!a.canInsertTextAfter())){Av(t,Up,md);let e=Q();Z(e)&&nv(e.anchor.key)}}return!0}function bce(e){let t=Pg();return t._inputState.compositionPhase=`idle`,Wm(t,e.data),Iv(`composition-end`),!0}function Um(e){if(e===null)return;let t=iv(e);if(!X(t)||t.getType()===`text`||Y_(t)||!t.isAttached())return;let n=Q(),r=Z(n)&&n.anchor.key===e?n.anchor.offset:null,i=wh(t.getTextContent());if(i.setFormat(t.getFormat()),i.setStyle(t.getStyle()),t.replace(i),r!==null){let e=Math.min(r,i.getTextContentSize());i.select(e,e)}}function Wm(e,t){let n=e._compositionKey;if(nv(null),n!==null&&t!=null){if(t===``){let t=iv(n),r=e.getElementByKey(n),i=r!==null&&X(t)?yy(t,r,e):null;if(i!==null&&i.nodeValue!==null&&X(t)){let n=Zv(Bv(e)),r=n&&ay(n,e._rootElement),a=null,o=null;r!==null&&r.anchorNode===i&&(a=r.anchorOffset,o=r.focusOffset),xv(t,i.nodeValue,a,o,!0)}return Um(n),!1}if(t[t.length-1]===`
`){let t=Q();if(Z(t)||Lh(t)){if(Z(t)){let e=t.focus;t.anchor.set(e.key,e.offset,e.type)}return Av(e,im,null),Um(n),!1}}let r=iv(n);if(r!==null&&X(r)&&Y_(r)){r.markDirty();let e=Q(),i=r.getTextContentSize(),a=Z(e)&&e.anchor.key===n?e.anchor.offset:i;return r.select(a,a).insertText(t),!0}}return bv(!0,e,t),Um(n),!1}function xce(e,t){let n=t._inputState;id?n.compositionPhase=`ending-firefox`:od||!cd&&!dd?Av(t,zp,e):(n.compositionPhase=`ending-safari`,n.compositionEndData=e.data)}function Sce(e,t){let n=t._inputState;od&&(n.isShiftKeyDown=e.key===`Shift`||n.isShiftKeyDown&&e.shiftKey&&e.key!==`CapsLock`),n.lastKeyDownTimeStamp=e.timeStamp,n.lastKeyCode=e.key,e.key!==`Backspace`&&Bm(n),t.isComposing()||Av(t,Zp,e)}var Gm={altKey:`any`,ctrlKey:`any`,metaKey:`any`,shiftKey:`any`},Km={ctrlKey:!0},qm={metaKey:!0},Jm={shiftKey:`any`},Ym={altKey:`any`,shiftKey:`any`};function Cce(e){let t=Pg(),n=t._inputState;if(e.key==null)return!0;if(n.compositionPhase===`ending-safari`){let r=function(e){return e.key===`Backspace`}(e);if(r&&Xg(t,()=>{Wm(t,n.compositionEndData)}),n.compositionPhase=`idle`,n.compositionEndData=``,r)return!0}let r=t._keyDownShortcuts;r===null&&(r=uce(function(){let e=(e,t,n)=>({key:e,modifiers:t,onMatch:(e,t)=>{Av(t,n,e)}}),t=(e,t,n,r)=>({key:e,modifiers:t,onMatch:(e,t)=>{e.preventDefault(),Av(t,n,r)}}),n=(e,t)=>({key:`Enter`,modifiers:e,onMatch:(e,n)=>{let r=n._inputState;r.isInsertLineBreak=t&&(!od||r.isShiftKeyDown),Av(n,im,e),e.defaultPrevented&&(r.isInsertLineBreak=!1)}}),r=(e,t)=>({key:e,modifiers:wm,onMatch:(e,n)=>{let r=n._editorState._selection;r===null||Z(r)||(e.preventDefault(),Av(n,t,e))}});return[e(`ArrowRight`,Jm,Qp),e(`ArrowLeft`,Jm,em),e(`ArrowUp`,Ym,nm),e(`ArrowDown`,Ym,rm),n({...Gm,shiftKey:!0},!0),n({...Gm,shiftKey:!1},!1),e(` `,Gm,am),{key:`Backspace`,modifiers:Jm,onMatch:(e,t)=>{Av(t,om,e)&&Vm(t._inputState)}},e(`Escape`,Gm,sm),e(`Delete`,{},cm),t(`Backspace`,Tm,Kp,!0),t(`Delete`,Tm,Kp,!1),t(`b`,wm,Jp,`bold`),t(`u`,wm,Jp,`underline`),t(`i`,wm,Jp,`italic`),e(`Tab`,Jm,lm),t(`z`,wm,Yp,void 0),t(`z`,{...wm,shiftKey:!0},Xp,void 0),...rd?[{key:`o`,modifiers:Km,onMatch:(e,t)=>{e.preventDefault(),Av(t,Vp,!0)}},e(`ArrowLeft`,{metaKey:!0,...Jm},tm),e(`ArrowRight`,{metaKey:!0,...Jm},$p),t(`h`,Km,Bp,!0),t(`d`,Km,Bp,!1),t(`Backspace`,qm,qp,!0),t(`Delete`,qm,qp,!1),t(`k`,Km,qp,!1)]:[e(`Home`,Jm,tm),e(`End`,Jm,$p),t(`y`,Km,Xp,void 0)],{key:`a`,modifiers:wm,onMatch:(e,t)=>{e.preventDefault(),Av(t,ym,e)&&Vm(t._inputState)}},r(`c`,_m),r(`x`,vm)]}()),t._keyDownShortcuts=r);let i=r.match(e);return i&&i.onMatch(e,t),function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)&&t.dispatchCommand(cce,e),!0}function Xm(e){let t=e.__lexicalEventHandles;return t===void 0&&(t=[],e.__lexicalEventHandles=t),t}var Zm=new Map;function Qm(e){let t=yle(e.target);if(t===null)return;let n=Nv(e.target),r=null,i=null,a=n===null?void 0:Mm.get(n);if(n!==null){if(a!==void 0){let e=a.editors,n=a.hasShadowEditor;if(n===void 0){n=!1;for(let t of e)if(t._rootElement!==null&&Qv(t._rootElement.getRootNode())){n=!0;break}a.hasShadowEditor=n}if(n){let n=null,a=null;for(let o of e){let e=o._rootElement;if(e===null)continue;let s=ay(t,e).anchorNode;if(s!==null&&K_(s)===o){if(Qv(e.getRootNode())){r=o,i=s;break}n===null&&(n=o,a=s)}}r===null&&n!==null&&(r=n,i=a)}else{let e=t.anchorNode;e===null||uy(e)&&e.shadowRoot!==null||(r=K_(e),r!==null&&(i=e))}}if(r===null){let e=sy(n);r=e===null?null:K_(e)}}if(r===null)return;if(r._inputState.isSelectionChangeFromMouseDown){if(a!==void 0)for(let e of a.editors)e._inputState.isSelectionChangeFromMouseDown=!1;Xg(r,()=>{let n=ag(),a=i??ay(t,r._rootElement).anchorNode;(uy(a)||X_(a))&&pv(ig(n,t,r,e))})}let o=_v(r),s=o[o.length-1],c=s._key,l=Zm.get(c),u=l||s;u!==r&&Fm(t,u,!1),Fm(t,r,!0),r===s?l&&Zm.delete(c):Zm.set(c,r)}function $m(e){e._lexicalHandled=!0}function eh(e){return!0===e._lexicalHandled}var th=nce();function nh(e,t,n){jg();let r=e.__key,i=e.getParent();if(i===null)return void(Qy(e)!==null&&$u(367,r,String(Qy(e))));let a=function(e){let t=Q();if(!Z(t)||!$(e))return t;let{anchor:n,focus:r}=t,i=n.getNode(),a=r.getNode();return Rv(i,e)&&n.set(e.__key,0,`element`),Rv(a,e)&&r.set(e.__key,0,`element`),t}(e),o=!1;if(Z(a)&&t){let t=a.anchor,n=a.focus;t.key===r&&(lg(t,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0),n.key===r&&(lg(n,e,i,e.getPreviousSibling(),e.getNextSibling()),o=!0)}else Lh(a)&&t&&e.isSelected()&&e.selectPrevious();if(Z(a)&&t&&!o&&og(a,i)){let t=e.getIndexWithinParent();ev(e),sg(a,i,t,-1)}else ev(e);n||Wv(i)||i.canBeEmpty()||!i.isEmpty()||nh(i,t),t&&a&&n_(i)&&i.isEmpty()&&i.selectEnd()}function rh(e){return e}var ih=Symbol.for(`ephemeral`);function ah(e){return e[ih]||!1}var oh={configurable:!0,enumerable:!1,value:void 0,writable:!0},sh=class{__type;__key;__parent;__prev;__next;__state;static getType(){let{ownNodeType:e}=Hy(this);return e===void 0&&$u(64,this.name),e}static clone(e){$u(65,this.name)}$config(){return{}}config(e,t){let n=t.extends||Jy(this.constructor);return Object.assign(t,{extends:n}),typeof e==`string`&&Object.assign(t,{type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}resetOnCopyNodeFrom(e){this.__state&&=this.__state.getWritable(this).resetOnCopyNode()}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",oh),Object.defineProperty(this,Lf,oh),$_(this,e)}getType(){return this.__type}isInline(){$u(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e===`root`)return!0;let t=iv(e);if(t===null)break;e=t.__parent===null?Qy(t):t.__parent}return!1}isSelected(e){let t=e||Q();if(t==null)return!1;let n=t.getNodes().some(e=>e.__key===this.__key);if(X(this))return n;if(Z(t)&&t.anchor.type===`element`&&t.focus.type===`element`){if(t.isCollapsed())return!1;let e=this.getParent();if(e_(this)&&this.isInline()&&e){let n=t.isBackward()?t.focus:t.anchor;if(e.is(n.getNode())&&n.offset===e.getChildrenSize()&&this.is(e.getLastChild()))return!1}}return n}getKey(){return this.__key}getIndexWithinParent(){let e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),n=0;for(;t!==null;){if(this.is(t))return n;n++,t=t.getNextSibling()}return-1}getParent(){let e=this.getLatest().__parent;return e===null?null:iv(e)}getParentOrThrow(){let e=this.getParent();return e===null&&$u(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){let t=e.getParent();if(Wv(t)||Qy(e)!==null)return $(e)||e===this&&e_(e)||$u(194),e;e=t}return null}getTopLevelElementOrThrow(){let e=this.getTopLevelElement();return e===null&&$u(67,this.__key),e}getParents(){let e=[],t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){let e=[],t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){let e=this.getLatest().__prev;return e===null?null:iv(e)}getPreviousSiblings(){let e=[],t=this.getParent();if(t===null)return e;let n=t.getFirstChild();for(;n!==null&&!n.is(this);)e.push(n),n=n.getNextSibling();return e}getNextSibling(){let e=this.getLatest().__next;return e===null?null:iv(e)}getNextSiblings(){let e=[],t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}is(e){return e!=null&&this.__key===e.__key}isBefore(e){let t=Fb(this,e);return t!==null&&(t.type===`descendant`||(t.type===`branch`?Mb(t)===-1:(t.type!==`same`&&t.type!==`ancestor`&&$u(279),!1)))}isParentOf(e){return Rv(e,this)}getNodesBetween(e){let t=this.isBefore(e),n=[],r=new Set,i=this;for(;i!==null;){let a=i.__key;if(r.has(a)||(r.add(a),n.push(i)),i===e)break;let o=$(i)?t?i.getFirstChild():i.getLastChild():null;if(o!==null){i=o;continue}let s=t?i.getNextSibling():i.getPreviousSibling();if(s!==null){i=s;continue}let c=i.getParentOrThrow();if(r.has(c.__key)||n.push(c),c===e)break;let l=null,u=c;do{if(u===null&&$u(68),l=t?u.getNextSibling():u.getPreviousSibling(),u=u.getParent(),u===null)break;l!==null||r.has(u.__key)||n.push(u)}while(l===null);i=l}return t||n.reverse(),n}isDirty(){let e=Pg()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(ah(this))return this;let e=iv(this.__key);return e===null&&$u(113),e}getWritable(){if(ah(this))return this;jg();let e=Ng(),t=Pg(),n=this.__key,r=t._cloneNotNeeded,i=r.get(n),a=e._selection;if(a!==null&&a.setCachedNodes(null),i!==void 0)return tv(i),i;let o=e._nodeMap,s=o.get(n);s===void 0&&$u(113);let c=Sy(s);return r.set(n,c),o.set(n,c),tv(c),c}getTextContent(){return cb(this)}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){$u(70)}updateDOM(e,t,n){$u(71)}getDOMSlot(e){return new Ad(e)}exportDOM(e){return{element:_y(e).$createDOM(this,e)}}exportJSON(e=!1){let t=function(e,t){let n=My(jy(e.constructor)),{generated:r,isCompactDefault:i}=n,a=r===null?void 0:t?r.exportCompactJSON:r.exportJSON;return a===void 0?function(e,t,n){let r=n?{type:e.__type}:{};return $(e)&&(r.children=[]),function(e,t,n,r){for(let i=0;i<t.length;i++){let a=t[i];if(r&&a.derived)continue;let o;if(a.kind===`ownField`){let t=zy(e)[a.field];o=a.getterTable===void 0?t:uf(a.getterTable,t)?a.getterTable[t]:void 0}else o=a.getter.call(e);a.kind===`ownField`&&a.when!==void 0&&(!By(a,o)&&a.when.call(e)||(o=void 0)),r&&By(a,o)||(n[a.key]=o)}}(e,t,r,n),n||(r.type=e.__type,r.version=1),r}(e,n.getters,t):t?a(e,i):a(e)}(this,e),n=this.__state?this.__state.toJSON():void 0;return n!==void 0&&Object.assign(t,n),t}static importJSON(e){$u(18,this.name)}updateFromJSON(e){return Vy(Df(this,e),e)}static transform(){return null}remove(e){nh(this,!0,e)}replace(e,t){jg();let n=Q();n!==null&&(n=n.clone()),qv(this,e);let r=this.getLatest(),i=this.__key,a=$y(r);a!==null&&$u(400,i,r.getType(),a.getKey(),a.getType());let o=e.__key,s=e.getWritable(),c=this.getParentOrThrow().getWritable(),l=c.__size,u=s.getParent(),d=u!==null&&Z(n)&&og(n,u),f=d?s.getIndexWithinParent():-1;ev(s),d&&u!==null&&Z(n)&&sg(n,u,f,-1);let p=r.getPreviousSibling(),m=r.getNextSibling(),h=r.__prev,g=r.__next,_=r.__parent;nh(r,!1,!0),p===null?c.__first=o:p.getWritable().__next=o,s.__prev=h,m===null?c.__last=o:m.getWritable().__prev=o,s.__next=g,s.__parent=_,c.__size=u!==null&&u.is(c)?l-1:l;let v=0;if(t&&($(this)&&$(s)||$u(139),v=s.getChildrenSize(),s.splice(v,0,this.getChildren())),Z(n)){pv(n);let e=n.anchor,r=n.focus;e.key===i&&(t&&e.type===`element`?e.set(s.__key,v+e.offset,`element`):jh(e,s)),r.key===i&&(t&&r.type===`element`?r.set(s.__key,v+r.offset,`element`):jh(r,s))}return rv()===i&&nv(o),s}insertAfter(e,t=!0){jg(),qv(this,e);let n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();let i=r.getParent(),a=Q(),o=!1,s=!1,c=-1;if(i!==null&&t&&Z(a)&&og(a,i)){let t=i.__key,n=a.anchor,r=a.focus;c=e.getIndexWithinParent(),o=n.type===`element`&&n.key===t&&n.offset===c+1,s=r.type===`element`&&r.key===t&&r.offset===c+1}ev(r),c!==-1&&i!==null&&Z(a)&&sg(a,i,c,-1);let l=this.getNextSibling(),u=this.getParentOrThrow().getWritable(),d=r.__key,f=n.__next;if(l===null?u.__last=d:l.getWritable().__prev=d,u.__size++,n.__next=d,r.__next=f,r.__prev=n.__key,r.__parent=n.__parent,t&&Z(a)){let e=u.__key;if(o||s||og(a,u)){let t=this.getIndexWithinParent();sg(a,u,t+1),o&&a.anchor.set(e,t+2,`element`),s&&a.focus.set(e,t+2,`element`)}}return e}insertBefore(e,t=!0){jg(),qv(this,e);let n=this.getWritable(),r=e.getWritable();this.getParentOrThrow();let i=r.__key,a=Q(),o=r.getParent(),s=o!==null&&t&&Z(a)&&og(a,o),c=s?r.getIndexWithinParent():-1;ev(r),s&&o!==null&&Z(a)&&sg(a,o,c,-1);let l=this.getPreviousSibling(),u=this.getParentOrThrow().getWritable(),d=n.__prev,f=t&&Z(a)&&og(a,u),p=f?this.getIndexWithinParent():-1;return l===null?u.__first=i:l.getWritable().__next=i,u.__size++,n.__prev=i,r.__prev=d,r.__next=n.__key,r.__parent=n.__parent,f&&Z(a)&&sg(a,u,p),e}isParentRequired(){return!1}createParentElementNode(){return j_()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){jg();let n=$y(this);if(n!==null)return n.selectPrevious(e,t);let r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if($(r))return r.select();if(!X(r)){let e=r.getIndexWithinParent()+1;return i.select(e,e)}return r.select(e,t)}selectNext(e,t){jg();let n=$y(this);if(n!==null)return n.selectNext(e,t);let r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if($(r))return r.select(0,0);if(!X(r)){let e=r.getIndexWithinParent();return i.select(e,e)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}};function ch(e){return e instanceof sh}var wce=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function lh(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!wce.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function uh(e,t,n,r,i){let a=lh(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}var Tce=e=>{let t=Zd(e,`format`),n=Qd(e,`format`),r=ef(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=uh(t.indent,0,0,1/0),e.__textFormat=lh(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}};function Ece(e,t){e.__detail=t.__detail,e.__format=t.__format,e.__mode=t.__mode,e.__style=t.__style,e.__text=t.__text}var Dce=e=>{let t=Zd(e,`mode`),n=$d(e,`detail`,0),r=$d(e,`format`,0),i=Qd(e,`mode`),a=ef(e,`mode`);return{exportJSON:function(e){return{detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__detail;r!==void 0&&r!==0&&(n.detail=r);let i=e.__format;i!==void 0&&i!==0&&(n.format=i);let a=t[e.__mode];a!==void 0&&a!==`normal`&&(n.mode=a);let o=e.__style;o!==void 0&&o!==``&&(n.style=o);let s=e.__text;return s!==void 0&&s!==``&&(n.text=s),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:lh(o,0);let s=t.format;e.__format=typeof s==`string`&&s in r?r[s]:lh(s,0);let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;return e.__text=typeof u==`string`?u:``,e},afterCloneFrom:Ece}},Oce=e=>{let t=Zd(e,`format`),n=Qd(e,`format`),r=ef(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=uh(t.indent,0,0,1/0),e.__textFormat=lh(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},kce=()=>({exportJSON:function(e){return{type:e.__type,version:1}},exportCompactJSON:function(e){return{type:e.__type}}}),Ace=e=>{let t=Zd(e,`mode`),n=$d(e,`format`,0);return{exportJSON:function(e){return{detail:e.__detail,mode:t[e.__mode],text:e.__text,format:e.__format,style:e.__style,type:e.__type,version:1}},exportCompactJSON:function(e){let t={type:e.__type},n=e.__format;n!==void 0&&n!==0&&(t.format=n);let r=e.__style;return r!==void 0&&r!==``&&(t.style=r),t},updateFromJSON:function(e,t){let r=t.format;e.__format=typeof r==`string`&&r in n?n[r]:lh(r,0);let i=t.style;return e.__style=typeof i==`string`?i:``,e}}};function dh(e){let t={};if(!e)return t;let n=``,r=``,i=null,a=!1,o=!1,s=!1,c=0,l=e.length,u=-1;for(let d=0;d<l;d++){let l=e[d];if(a)l===`*`&&e[d+1]===`/`&&(a=!1,d++);else if(o)u===-1&&(u=d),o=!1;else if(i===null){if(l!==`/`||e[d+1]!==`*`){if(l!==`"`&&l!==`'`){if(l!==`(`){if(l!==`)`){if(s||l!==`:`||c!==0){if(l===`;`&&c===0){u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1);let i=n.trim(),a=r.trim();i!==``&&a!==``&&(t[i]=a),n=``,r=``,s=!1;continue}u===-1&&(u=d)}else u!==-1&&(n+=e.slice(u,d),u=-1),s=!0}else u===-1&&(u=d),c=Math.max(0,c-1)}else u===-1&&(u=d),c++}else u===-1&&(u=d),i=l}else u!==-1&&(s?r+=e.slice(u,d):n+=e.slice(u,d),u=-1),a=!0,d++}else u===-1&&(u=d),l===`\\`?o=!0:l===i&&(i=null)}u!==-1&&(s?r+=e.slice(u,l):n+=e.slice(u,l));let d=n.trim(),f=r.trim();return d!==``&&f!==``&&(t[d]=f),t}function jce(e,t,n){let r=n.trimEnd(),i=r.length-10;i>=0&&r.slice(i).toLowerCase()===`!important`?e.setProperty(t,r.slice(0,i).trim(),`important`):e.setProperty(t,n,``)}function fh(e,t,n=``){if(t===n)return;let r=dh(n),i=dh(t);for(let t in i)delete r[t],jce(e,t,i[t]);for(let t in r)e.removeProperty(t)}var Mce=_f()({detail:yf(vf(ff(),yd),{field:`__detail`}),format:yf(vf(ff(),vd),{field:`__format`}),mode:yf(mf([`normal`,`token`,`segmented`]),{field:`__mode`,getterTable:wd,setterTable:Cd}),style:yf(df(),{field:`__style`}),text:yf(df(),{field:`__text`,getter:`getTextContent`,setter:`setTextContent`})});function ph(e,t){return 16&t?`code`:128&t?`mark`:32&t?`sub`:64&t?`sup`:null}function mh(e,t){return 1&t?`strong`:2&t?`em`:`span`}function hh(e,t,n,r,i){let a=r.classList,o=Ev(i,`base`);o!==void 0&&a.add(...o),o=Ev(i,`underlineStrikethrough`);let s=!1,c=8&t&&4&t;o!==void 0&&(8&n&&4&n?(s=!0,c||a.add(...o)):c&&a.remove(...o));for(let e in vd){let r=vd[e];if(o=Ev(i,e),o!==void 0){if(n&r){if(s&&(e===`underline`||e===`strikethrough`)){t&r&&a.remove(...o);continue}((t&r)===0||c&&e===`underline`||e===`strikethrough`)&&a.add(...o)}else t&r&&a.remove(...o)}}Tv(r,`class`)}function gh(e,t,n){let r=n.isComposing(),i=e+(r?fd:``),a=gy(),o=_y(a).$getDOMSlot(n,t,a),s=o.getFirstChild();if(s===null||s.nodeType!==Node.TEXT_NODE)return void o.insertChild(ny().createTextNode(i));let c=s,l=c.nodeValue;if(l!==i){if(r||id){let[e,t,n]=function(e,t){let n=e.length,r=t.length,i=0,a=0;for(;i<n&&i<r&&e[i]===t[i];)i++;for(;a+i<n&&a+i<r&&e[n-a-1]===t[r-a-1];)a++;return[i,n-i-a,t.slice(i,r-a)]}(l,i);t!==0&&c.deleteData(e,t),c.insertData(e,n)}else c.nodeValue=i}}function _h(e,t,n,r,i,a){gh(i,e,t);let o=a.theme.text;o!==void 0&&hh(0,0,r,e,o)}function vh(e,t){let n=ny().createElement(t);return n.appendChild(e),n}function yh(e){return e!=null&&!0===e.__isInlineFormattable}var bh=class extends sh{__text;__format;__style;__mode;__detail;get __isInlineFormattable(){return!0}$config(){return this.config(`text`,{extends:sh,generated:Dce,importDOM:{"#text":()=>({conversion:Ice,priority:0}),b:()=>({conversion:Pce,priority:0}),code:()=>({conversion:Ch,priority:0}),em:()=>({conversion:Ch,priority:0}),i:()=>({conversion:Ch,priority:0}),mark:()=>({conversion:Ch,priority:0}),s:()=>({conversion:Ch,priority:0}),span:()=>({conversion:Nce,priority:0}),strong:()=>({conversion:Ch,priority:0}),sub:()=>({conversion:Ch,priority:0}),sup:()=>({conversion:Ch,priority:0}),u:()=>({conversion:Ch,priority:0})},json:Mce})}constructor(e=``,t){super(t),this.__text=e,this.__format=0,this.__style=``,this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){return wd[this.getLatest().__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===rv()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){let t=vd[e];return(this.getFormat()&t)!==0}isSimpleText(){let e=this.getLatest();return e.__type===`text`&&e.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return Q_(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){let n=this.__format,r=ph(0,n),i=mh(0,n),a=r===null?i:r,o=ny().createElement(a),s=o;this.hasFormat(`code`)&&o.setAttribute(`spellcheck`,`false`),r!==null&&(s=ny().createElement(i),o.appendChild(s)),_h(s,this,0,n,this.__text,e);let c=this.__style;return c!==``&&fh(o.style,c),o}updateDOM(e,t,n){let r=this.__text,i=e.__format,a=this.__format,o=ph(0,i),s=ph(0,a),c=mh(0,i),l=mh(0,a);if((o===null?c:o)!==(s===null?l:s))return!0;if(o===s&&c!==l){let e=t.firstChild;e??$u(48);let i=ny().createElement(l);return _h(i,this,0,a,r,n),t.replaceChild(i,e),!1}let u=t;s!==null&&o!==null&&(u=t.firstChild,u??$u(49)),gh(r,u,this);let d=n.theme.text;d!==void 0&&i!==a&&hh(0,i,a,u,d);let f=e.__style,p=this.__style;return f!==p&&(fh(t.style,p,f),Tv(t,`style`)),!1}exportDOM(e){let{element:t}=super.exportDOM(e);return uy(t)||$u(132),t.style.whiteSpace=`pre-wrap`,this.hasFormat(`lowercase`)?t.style.textTransform=`lowercase`:this.hasFormat(`uppercase`)?t.style.textTransform=`uppercase`:this.hasFormat(`capitalize`)&&(t.style.textTransform=`capitalize`),this.hasFormat(`bold`)&&(t=vh(t,`b`)),this.hasFormat(`italic`)&&(t=vh(t,`i`)),this.hasFormat(`strikethrough`)&&(t=vh(t,`s`)),this.hasFormat(`underline`)&&(t=vh(t,`u`)),{element:t}}selectionTransform(e,t){}setFormat(e){let t=this.getWritable();return t.__format=typeof e==`string`?vd[e]:e,t}setDetail(e){let t=this.getWritable();return t.__detail=typeof e==`string`?yd[e]:e,t}setStyle(e){let t=this.getWritable();return t.__style=e,t}toggleFormat(e){let t=Q_(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){let e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){let e=this.getWritable();return e.__detail^=2,e}setMode(e){let t=Cd[e];if(this.getLatest().__mode===t)return this;let n=this.getWritable();return n.__mode=t,n}setTextContent(e){if(this.getLatest().__text===e)return this;let t=this.getWritable();return t.__text=e,t}select(e,t){jg();let n=e,r=t,i=Q(),a=this.getTextContent(),o=this.__key;if(typeof a==`string`){let e=a.length;n===void 0&&(n=e),r===void 0&&(r=e)}else n=0,r=0;if(!Z(i))return tg(o,n,o,r,`text`,`text`);{let e=rv();e!==i.anchor.key&&e!==i.focus.key||nv(o),i.setTextNodeRange(this,n,this,r)}return i}selectStart(){return this.select(0,0)}selectEnd(){let e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,n,r){let i=this.getWritable(),a=i.__text,o=n.length,s=e;s<0&&(s=o+s,s<0&&(s=0));let c=Q();if(r&&Z(c)){let t=e+o;c.setTextNodeRange(i,t,i,t)}return i.__text=a.slice(0,s)+n+a.slice(s+t),i}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){jg();let t=this.getLatest(),n=t.getTextContent();if(n===``)return[];let r=t.__key,i=rv(),a=n.length;e.sort((e,t)=>e-t),e.push(a);let o=[],s=e.length;for(let t=0,r=0;t<a&&r<=s;r++){let i=e[r];i>t&&(o.push(n.slice(t,i)),t=i)}let c=o.length;if(c===1)return[t];let l=o[0],u=t.getParent(),d,f=t.getFormat(),p=t.getStyle(),m=t.__detail,h=!1,g=null,_=null,v=Q();if(Z(v)){let[e,t]=v.isBackward()?[v.focus,v.anchor]:[v.anchor,v.focus];e.type===`text`&&e.key===r&&(g=e),t.type===`text`&&t.key===r&&(_=t)}t.isSegmented()?(d=wh(l),d.__format=f,d.__style=p,d.__detail=m,d.__state=jf(t,d),h=!0):d=t.setTextContent(l);let y=[d];for(let e=1;e<c;e++){let n=wh(o[e]);n.__format=f,n.__style=p,n.__detail=m,n.__state=jf(t,n);let a=n.__key;i===r&&nv(a),y.push(n)}let b=g?g.offset:null,x=_?_.offset:null,S=0;for(let e of y){if(!g&&!_)break;let t=S+e.getTextContentSize();if(g!==null&&b!==null&&b<=t&&b>=S&&(g.set(e.getKey(),b-S,`text`),b<t&&(g=null)),_!==null&&x!==null&&x<=t&&x>=S){_.set(e.getKey(),x-S,`text`);break}S=t}if(u!==null){(function(e){let t=e.getPreviousSibling(),n=e.getNextSibling();t!==null&&tv(t),n!==null&&tv(n)})(this);let e=u.getWritable(),t=this.getIndexWithinParent();h?(e.splice(t,0,y),this.remove()):e.splice(t,1,y),Z(v)&&sg(v,u,t,c-1)}return y}mergeWithSibling(e){let t=e===this.getPreviousSibling();t||e===this.getNextSibling()||$u(50);let n=this.__key,r=e.__key,i=this.__text,a=i.length;rv()===r&&nv(n);let o=Q();if(Z(o)){let i=o.anchor,s=o.focus;i!==null&&i.key===r&&ug(i,t,n,e,a),s!==null&&s.key===r&&ug(s,t,n,e,a)}let s=e.__text,c=t?s+i:i+s;this.setTextContent(c);let l=this.getWritable();return e.remove(),l}isTextEntity(){return!1}};function Nce(e){return{forChild:Th(e.style),node:null}}function Pce(e){let t=e,n=t.style.fontWeight===`normal`;return{forChild:Th(t.style,n?void 0:`bold`),node:null}}var xh=new WeakMap;function Fce(e){if(!uy(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function Ice(e){let t=e;e.parentElement===null&&$u(129);let n=t.textContent||``;if(function(e){let t,n=e.parentNode,r=[e];for(;n!==null&&(t=xh.get(n))===void 0&&!Fce(n);)r.push(n),n=n.parentNode;let i=t===void 0?n:t;for(let e=0;e<r.length;e++)xh.set(r[e],i);return i}(t)!==null)return{node:hg(n)};if(n=n.replace(/\r/g,``).replace(/[ \t\n]+/g,` `),n===``)return{node:null};if(n[0]===` `){let e=t,r=!0;for(;e!==null&&(e=Sh(e,!1))!==null;){let t=e.textContent||``;if(t.length>0){/[ \t\n]$/.test(t)&&(n=n.slice(1)),r=!1;break}}r&&(n=n.slice(1))}if(n[n.length-1]===` `){let e=t,r=!0;for(;e!==null&&(e=Sh(e,!0))!==null;)if((e.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){r=!1;break}r&&(n=n.slice(0,n.length-1))}return n===``?{node:null}:{node:wh(n)}}function Sh(e,t){let n=e;for(;;){let e;for(;(e=t?n.nextSibling:n.previousSibling)===null;){let e=n.parentElement;if(e===null)return null;n=e}if(n=e,uy(n)){let e=n.style.display;if(e===``&&!py(n)||e!==``&&!e.startsWith(`inline`))return null}let r=n;for(;(r=t?n.firstChild:n.lastChild)!==null;)n=r;if(X_(n))return n;if(n.nodeName===`BR`)return null}}var Lce={code:`code`,em:`italic`,i:`italic`,mark:`highlight`,s:`strikethrough`,strong:`bold`,sub:`subscript`,sup:`superscript`,u:`underline`};function Ch(e){let t=Lce[e.nodeName.toLowerCase()];return t===void 0?{node:null}:{forChild:Th(e.style,t),node:null}}function wh(e=``){return Kv(new bh(e))}function X(e){return e instanceof bh}function Th(e,t){let n=e.fontWeight,r=e.textDecoration.split(` `),i=n===`700`||n===`bold`,a=r.includes(`line-through`),o=e.fontStyle===`italic`,s=r.includes(`underline`),c=e.verticalAlign,l=e.textTransform;return e=>((X(e)||yh(e))&&(i&&!e.hasFormat(`bold`)&&e.toggleFormat(`bold`),a&&!e.hasFormat(`strikethrough`)&&e.toggleFormat(`strikethrough`),o&&!e.hasFormat(`italic`)&&e.toggleFormat(`italic`),s&&!e.hasFormat(`underline`)&&e.toggleFormat(`underline`),c!==`sub`||e.hasFormat(`subscript`)||e.toggleFormat(`subscript`),c!==`super`||e.hasFormat(`superscript`)||e.toggleFormat(`superscript`),l!==`lowercase`&&l!==`uppercase`&&l!==`capitalize`||e.hasFormat(l)||e.toggleFormat(l),t&&!e.hasFormat(t)&&e.toggleFormat(t)),e)}var Rce=_f()({detail:bf(ff(2),{getter:{field:`__detail`},setter:null}),mode:bf(mf([`normal`]),{getter:{field:`__mode`,getterTable:{0:`normal`}},setter:null}),text:bf(df(` `),{getter:{field:`__text`,method:`getTextContent`},setter:null})}),Eh=class extends bh{$config(){return this.config(`tab`,{extends:bh,generated:Ace,json:Rce})}constructor(e=void 0){super(` `,e),this.__detail=2}createDOM(e){let t=super.createDOM(e),n=Ev(e.theme,`tab`);return n!==void 0&&t.classList.add(...n),t}setTextContent(e){return super.setTextContent(` `)}spliceText(e,t,n,r){return n===``&&t===0||n===` `&&t===1||$u(286),this}setDetail(e){return e!==2&&$u(127),this}setMode(e){return e!==`normal`&&$u(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}};function Dh(){return Kv(new Eh)}function Oh(e){return e instanceof Eh}var zce=class{key;offset;type;_selection;constructor(e,t,n){this._selection=null,this.key=e,this.offset=t,this.type=n}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:jb(S_(m_(this,`next`)),S_(m_(e,`next`)))<0}getNode(){let e=iv(this.key);return e===null&&$u(20),e}set(e,t,n,r){let i=this._selection,a=this.key;r&&this.key===e&&this.offset===t&&this.type===n||(this.key=e,this.offset=t,this.type=n,Ag()||(rv()===a&&nv(e),i!==null&&(i.setCachedNodes(null),Z(i)&&(i._cachedIsBackward=null),i.dirty=!0)))}};function kh(e,t,n){return new zce(e,t,n)}function Ah(e,t){let n=t.__key,r=e.offset,i=`element`;if(X(t)){i=`text`;let e=t.getTextContentSize();r>e&&(r=e)}else if(!$(t)){let e=t.getNextSibling();if(X(e))n=e.__key,r=0,i=`text`;else{let e=t.getParent();e&&(n=e.__key,r=t.getIndexWithinParent()+1)}}e.set(n,r,i)}function jh(e,t){if($(t)){let n=t.getLastDescendant();$(n)||X(n)?Ah(e,n):Ah(e,t)}else Ah(e,t)}function Mh(e,t,n,r){let i=e.getNode(),a=i.getChildAtIndex(e.offset),o=wh();if(o.setFormat(n),o.setStyle(r),M_(a))a.splice(0,0,[o]);else if(a!==null){let e=Wv(i)?j_().append(o):o;a.insertBefore(e)}else if(Wv(i)){let e=i.getLastChild();$(e)&&!e.isInline()&&e.isEmpty()?e.append(o):i.append(j_().append(o))}else i.append(o);e.is(t)&&t.set(o.__key,0,`text`),e.set(o.__key,0,`text`)}function Nh(e,t,n,r){let i=e.anchor.getNode();X(i)||$u(398);let a=e.anchor.offset,o=wh(t);o.setFormat(n),o.setStyle(r);let s=i.getParentOrThrow();if(a===0)s.isInline()&&!i.__prev?s.insertBefore(o):i.insertBefore(o,!1);else if(a===i.getTextContentSize())s.isInline()&&!i.__next?s.insertAfter(o):i.insertAfter(o,!1);else{let[e]=i.splitText(a);e.insertAfter(o,!1)}i.getTextContent()===``&&i.isAttached()&&i.remove(),o.selectEnd(),o.isComposing()&&e.anchor.type===`text`&&e.anchor.set(e.anchor.key,e.anchor.offset-t.length,e.anchor.type)}var Ph=class e{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Lh(e))return!1;let t=this._nodes,n=e._nodes;return t.size===n.size&&Array.from(t).every(e=>n.has(e))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new e(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){let t=this.getNodes().filter(e=>Qy(e)===null),n=t.length;if(n===0)return;let r=t[n-1],i;if(X(r))i=r.select();else{let e=r.getIndexWithinParent()+1;i=r.getParentOrThrow().select(e,e)}i.insertNodes(e);for(let e=0;e<n;e++)t[e].remove()}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=this._nodes,n=[];for(let e of t){let t=iv(e);t!==null&&n.push(t)}return Ag()||(this._cachedNodes=n),n}getTextContent(){let e=this.getNodes(),t=``;for(let n=0;n<e.length;n++)t+=e[n].getTextContent();return t}deleteNodes(){let e=this.getNodes().filter(e=>Qy(e)===null);if((Q()||ag())===this&&e[0]){let t=yb(e[0],`next`);g_(kb(t,t))}for(let t of e)t.remove();Fh()}};function Fh(){let e=dv();if(e.getChildrenSize()===0&&tb(Q())===null){let t=j_();e.append(t),t.select()}}function Z(e){return e instanceof Ih}var Ih=class e{format;style;anchor;focus;_cachedNodes;_cachedIsBackward;dirty;constructor(e,t,n,r){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this._cachedIsBackward=null,this.format=n,this.style=r,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!Z(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){let e=this._cachedNodes;if(e!==null)return e;let t=function(e){let t=[],[n,r]=e.getTextSlices();n&&t.push(n.caret.origin);let i=new Set,a=new Set;for(let n of e)if(vb(n)){let{origin:e}=n;t.length===0?i.add(e):(a.add(e),t.push(e))}else{let{origin:e}=n;$(e)&&a.has(e)||t.push(e)}if(r&&t.push(r.caret.origin),_b(e.focus)&&$(e.focus.origin)&&e.focus.getNodeAtCaret()===null)for(let n=Cb(e.focus.origin,`previous`);vb(n)&&i.has(n.origin)&&!n.origin.isEmpty()&&n.origin.is(t[t.length-1]);n=Tb(n))i.delete(n.origin),t.pop();for(;t.length>1;){let e=t[t.length-1];if(!$(e)||a.has(e)||e.isEmpty()||i.has(e))break;t.pop()}if(t.length===0&&e.isCollapsed()){let n=S_(e.anchor),r=S_(e.anchor.getFlipped()),i=e=>gb(e)?e.origin:e.getNodeAtCaret(),a=i(n)||i(r)||(e.anchor.getNodeAtCaret()?n.origin:r.origin);t.push(a)}return t}(w_(v_(this),`next`));return Ag()||(this._cachedNodes=t),t}setTextNodeRange(e,t,n,r){return this.anchor.set(e.__key,t,`text`),this.focus.set(n.__key,r,`text`),this}getTextContent(){let e=this.getNodes();if(e.length===0)return``;let t=e[0],n=e[e.length-1],r=this.anchor,i=this.focus,a=r.isBefore(i),[o,s]=Vh(this),c=``,l=!0;for(let u=0;u<e.length;u++){let d=e[u];if($(d)&&!d.isInline()){l||(c+=`
`);let e=``;for(let t of rb(d)){let n=ib(d,t);n!==null&&(e+=n.getTextContent())}e===``?l=!d.isEmpty():(c+=e,l=!1)}else if(l=!1,X(d)){let e=d.getTextContent();d===t?d===n?r.type===`element`&&i.type===`element`&&i.offset!==r.offset||(e=o<s?e.slice(o,s):e.slice(s,o)):e=a?e.slice(o):e.slice(s):d===n&&(e=a?e.slice(0,s):e.slice(0,o)),c+=e}else!e_(d)&&!u_(d)||d===n&&this.isCollapsed()||(c+=d.getTextContent())}return c}applyDOMRange(e){let t=Pg(),n=t.getEditorState()._selection,r=$h(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,n);if(r===null)return;let[i,a,o]=r;this.anchor.set(i.key,i.offset,i.type,!0),this.focus.set(a.key,a.offset,a.type,!0),o&&(this.dirty=!0),Ff(this)}clone(){let t=this.anchor,n=this.focus;return new e(kh(t.key,t.offset,t.type),kh(n.key,n.offset,n.type),this.format,this.style)}toggleFormat(e){this.format=Q_(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){let t=vd[e];return(this.format&t)!==0}insertRawText(e){this.insertNodes(hg(e))}insertText(e){let t=this.format,n=this.style;if(!this.isCollapsed()){let r=(this.focus.isBefore(this.anchor)?this.focus:this.anchor).getNode();if(X(r)&&(t=r.getFormat(),n=r.getStyle()),this.removeText(),this.format=t,this.style=n,e===``)return;if(rv()===null)return this.anchor.type===`element`&&Mh(this.anchor,this.focus,t,n),void Nh(this,e,t,n)}this.anchor.type===`element`&&Mh(this.anchor,this.focus,t,n);let r=this.anchor.getNode();X(r)||$u(398);let i=this.anchor.offset,a=r.getParentOrThrow(),o=r.getTextContentSize();if(Y_(r)||i===0&&(!r.canInsertTextBefore()||!a.canInsertTextBefore()&&!r.__prev)||i===o&&(!r.canInsertTextAfter()||!a.canInsertTextAfter()&&!r.__next)){if(r.isSegmented()&&i!==0&&i!==o){if(rv()!==null)r.setMode(`normal`).setFormat(t).setStyle(n);else{let e=wh(r.getTextContent());e.setFormat(t),e.setStyle(n);let a=Q()===this;r.replace(e),this.setTextNodeRange(e,i,e,i),a&&Q()!==this&&pv(this)}e!==``&&this.insertText(e);return}if(e===``)return;if(i===0){let i=r.getPreviousSibling();if(X(i)&&i.canInsertTextAfter()&&!Y_(i))i.select();else{let e=wh();e.setFormat(t),e.setStyle(n),a.canInsertTextBefore()?r.insertBefore(e):a.insertBefore(e),e.select()}this.insertText(e);return}if(i===o){let i=r.getNextSibling();if(X(i)&&i.canInsertTextBefore()&&!Y_(i))i.select(0,0);else{let e=wh();e.setFormat(t),e.setStyle(n),a.canInsertTextAfter()?r.insertAfter(e):a.insertAfter(e),e.select(0,0)}this.insertText(e);return}let s=wh(e);s.setFormat(t),s.setStyle(n),r.replace(s),s.select();return}if(e===``)return;let s=a.isInline()&&i===0&&!r.__prev,c=a.isInline()&&i===o&&!r.__next,l=r.getFormat()!==t||r.getStyle()!==n;if(s||c||l){if(r.getTextContent()!==``||s||c)return void Nh(this,e,t,n);r.setFormat(t),r.setStyle(n)}r.spliceText(i,0,e,!0),r.isComposing()&&this.anchor.type===`text`&&this.anchor.set(this.anchor.key,this.anchor.offset-e.length,this.anchor.type)}removeText(){let e=Q()===this,t=this.anchor.key;__(this,ile(v_(this))),this.isCollapsed()&&function(e,t){let n=e.anchor;if(n.key===t)return;let r=n.getNode(),i=0,a=``;X(r)?(i=r.getFormat(),a=r.getStyle()):$(r)&&(i=r.getTextFormat(),a=r.getTextStyle()),e.format===i&&e.style===a||(e.format=i,e.style=a,e.dirty=!0)}(this,t),e&&Q()!==this&&pv(this)}formatText(e,t=null){zh(this,e,t)}insertNodes(e){if(e.length===0)return;this.isCollapsed()||this.removeText();let t=this.anchor.getNode();if(this.anchor.type===`element`&&$(t)&&t.isShadowRoot()&&Qy(t)!==null){let n=t.getFirstChild()??t.append(j_()).getFirstChild();if(n!==null&&!$(n)){let e=j_();n.insertBefore(e),n=e}if(n!==null){n.selectStart();let t=Q();return Z(t)||$u(369),t.insertNodes(e)}}if(this.anchor.type===`element`&&Wv(t)){let n=yg(e),r=n.getLastDescendant();t.splice(this.anchor.offset,0,n.getChildren()),r!==null&&r.selectEnd();return}let n=this.isBackward()?this.focus:this.anchor,r=n.getNode(),i=Ky(r,hy),a=e[e.length-1];if($(i)&&`__language`in i){if(`__language`in e[0])this.insertText(e[0].getTextContent());else{let[,t]=_g(this);i.splice(t,0,e),a.selectEnd()}return}if(!e.some(e=>($(e)||e_(e))&&!e.isInline())){$(i)||$u(211,r.constructor.name,r.getType());let[t,n]=_g(this,!0);($(t)?t:i).splice(n,0,e),a.selectEnd();return}if($(i)&&Qy(i)!==null){let[,t]=_g(this),n=gg(e);i.splice(t,0,n);let r=n[n.length-1];r===void 0?i.select(t,t):r.selectEnd();return}if(i===null){let t=yg(e),n=t.getLastDescendant(),r=m_(this.anchor,`next`);for(let e of t.getChildren())r=O_(e,r);n!==null&&n.selectEnd();return}if($(i)&&!i.isParentRequired()&&!Wv(i.getParentOrThrow())){let[,t]=_g(this),n=gg(e);i.splice(t,0,n);let r=n[n.length-1];r===void 0?i.select(t,t):r.selectEnd();return}let o=yg(e),s=o.getLastDescendant(),c=o.getChildren(),l=function(e){let t=function(e){let t=e.getNode();if(e.offset>0)return e.type===`element`&&$(t)?t.getChildAtIndex(e.offset-1):null;for(let e=t;e!==null&&!hy(e)&&!Wv(e);e=e.getParent()){let t=e.getPreviousSibling();if(t!==null)return t}return null}(e);return u_(t)&&u_(t.getPreviousSibling())}(n),u=$(i)&&i.isEmpty()?null:this.insertParagraph();u&&!i.isAttached()&&(r=this.anchor.getNode(),i=Ky(r,hy));let d=c[c.length-1],f=c[0];var p=f;l||!$(p)||!hy(p)||p.isEmpty()||!$(i)||i.isEmpty()&&!i.canMergeWhenEmpty()||($(i)||$u(211,r.constructor.name,r.getType()),i.append(...f.getChildren()),f=c[1]),f&&(i===null&&$u(212,r.constructor.name,r.getType()),function(e,t){let n=t.getParentOrThrow().getLastChild(),r=t,i=[t];for(;r!==n;)r.getNextSibling()||$u(140),r=r.getNextSibling(),i.push(r);let a=e;for(let e of i)a=a.insertAfter(e)}(i,f));let m=Ky(s,hy),h=s.selectEnd();u&&($(m)&&(u.canMergeWhenEmpty()||hy(d))?(m.append(...u.getChildren()),u.remove()):u.isEmpty()&&u.remove()),$(i)&&i.isEmpty()&&i.remove();let g=$(i)?i.getLastChild():null;u_(g)&&m!==i&&g.remove();let _=S_(m_(h.anchor,`next`));h_(h.anchor,_),h_(h.focus,_)}insertParagraph(){this.isCollapsed()||this.removeText();let e=this.anchor.getNode();if(this.anchor.type===`element`&&Wv(e)){let t=j_();return e.splice(this.anchor.offset,0,[t]),t.select(),t}let[,t]=_g(this),n=Ky(this.anchor.getNode(),hy);if(n!==null&&Qy(n)!==null)return null;$(n)||$u(213);let r=n.getChildAtIndex(t),i=r?[r,...r.getNextSiblings()]:[],a=n.insertNewAfter(this,!1);return a?(a.append(...i),a.selectStart(),a):null}insertLineBreak(e){let t=l_();if(this.insertNodes([t]),e){let e=t.getParentOrThrow(),n=t.getIndexWithinParent();e.select(n,n)}}extract(){let e=[...this.getNodes()],t=e.length,n=e[0],r=e[t-1],[i,a]=Vh(this),o=this.isBackward(),[s,c]=o?[this.focus,this.anchor]:[this.anchor,this.focus],[l,u]=o?[a,i]:[i,a];if(t===0)return[];if(t===1){if(X(n)&&!this.isCollapsed()){let e=n.splitText(l,u),t=l===0?e[0]:e[1];return t?(s.set(t.getKey(),0,`text`),c.set(t.getKey(),t.getTextContentSize(),`text`),[t]):[]}return[n]}if(X(n)&&(l===n.getTextContentSize()?e.shift():l!==0&&([,n]=n.splitText(l),e[0]=n,s.set(n.getKey(),0,`text`))),X(r)){let t=r.getTextContent().length;u===0?e.pop():u!==t&&([r]=r.splitText(u),e[e.length-1]=r,c.set(r.getKey(),r.getTextContentSize(),`text`))}return e}modify(e,t,n){if(bg(this,e,t,n))return;let r=e===`move`,i=Pg(),a=Zv(Bv(i));if(!a)return;let o=i._blockCursorElement,s=i._rootElement,c=this.focus.getNode();s===null||o===null||!$(c)||c.isInline()||c.canBeEmpty()||Xv(o,i,s);let l=jv(i,this.focus.key),u=l;if(this.focus.type===`text`&&(u=X(c)?yy(c,l,i):null),this.dirty){let e=jv(i,this.anchor.key),t=e;if(this.anchor.type===`text`){let n=this.anchor.getNode();t=X(n)?yy(n,e,i):null}t&&u&&dg(a,t,this.anchor.offset,u,this.focus.offset)}if(n===`character`&&X(c)&&c.isUnmergeable()&&(t?this.focus.offset===0:this.focus.offset===c.getTextContentSize())){let e=yb(c,t?`previous`:`next`).getNodeAtCaret();if(X(e)){if(!r){let n=e.getTextContentSize();t?this.focus.set(e.__key,n-1,`text`):this.focus.set(e.__key,1,`text`),this.dirty=!0;return}{let n=i.getElementByKey(e.getKey()),r=n?yy(e,n,i):null;if(r){let e=t?r.length:0;dg(a,r,e,r,e)}}}}if(Wh(a,e,t?`backward`:`forward`,n,s),a.rangeCount>0){let e=ry(a,i._rootElement),n=e||a.getRangeAt(0),o=this.anchor.getNode(),s=n_(o)?o:Hv(o);this.applyDOMRange(n),this.dirty=!0,r||(Gh(this,t,s),(e?a.direction!==`backward`:a.anchorNode===n.startContainer&&a.anchorOffset===n.startOffset)||Uh(this))}n===`lineboundary`&&bg(this,e,t,n,`decorators`)}forwardDeletion(e,t,n){if(!n&&(e.type===`element`&&$(t)&&e.offset===t.getChildrenSize()||e.type===`text`&&e.offset===t.getTextContentSize())){let e=t.getParent(),n=t.getNextSibling()||(e===null?null:e.getNextSibling());if($(n)&&n.isShadowRoot())return!0}return!1}deleteCharacter(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e)){let e=$(n)?n.getNextSibling():null;if(!($(n)&&n.isEmpty()&&$(e)&&e.isShadowRoot()))return}let r=m_(t,e?`previous`:`next`),i=Db(r);if(i.getTextSlices().every(e=>e===null||e.distance===0)){if(t.type===`element`){let e=r.getNodeAtCaret();if($(e)&&Yv(e)){let t=e.getParent();e.remove();let n=fv(t,e);n!==null&&n.selectStart();return}}let e={type:`initial`};for(let t of i.iterNodeCarets(`shadowRoot`))if(vb(t)){if(!t.origin.isInline()){if(t.origin.isShadowRoot()){if(e.type===`merge-block`)break;if($(i.anchor.origin)&&i.anchor.origin.isEmpty()){let e=S_(t);__(this,kb(e,e)),i.anchor.origin.remove()}return}e.type!==`merge-next-block`&&e.type!==`merge-block`||(e={block:e.block,caret:t,type:`merge-block`})}}else{if(e.type===`merge-block`)break;if(_b(t)){if($(t.origin)){if(t.origin.isInline()){if(!t.origin.isParentOf(i.anchor.origin))break}else e={block:t.origin,type:`merge-next-block`};continue}if(e_(t.origin)){if(!t.origin.isIsolated()){if(e.type===`merge-next-block`&&(t.origin.isKeyboardSelectable()||!t.origin.isInline())&&$(i.anchor.origin)&&i.anchor.origin.isEmpty()){i.anchor.origin.remove();let e=rg();e.add(t.origin.getKey()),pv(e)}else{let e=t.origin,n=e.getParent();e.remove();let r=fv(n,e);r!==null&&r.selectStart()}}return}if(u_(t.origin))return void t.origin.remove();break}}if(e.type===`merge-block`){let{caret:t,block:n}=e;return rb(n).length>0?void 0:t.origin.isEmpty()&&!n.isEmpty()&&t.origin.getParent()===n.getParent()?void t.origin.remove(!0):(__(this,kb(!t.origin.isEmpty()&&n.isEmpty()?y_(yb(n,t.direction)):i.anchor,t)),this.removeText())}for(let e=t.getNode();e!==null;){if(Qy(e)!==null)return;if($(e)&&e.isShadowRoot())break;e=e.getParent()}}let a=this.focus;if(Kh(this,e,`character`),this.isCollapsed()){if(e&&t.offset===0&&function(e,t){for(let n=t;n;n=n.getParent()){if($(n)){if(n.collapseAtStart(e))return!0;if(Wv(n))break}if(n.getPreviousSibling())break}return!1}(this,t.getNode()))return}else{let r=a.type===`text`?a.getNode():null;if(n=t.type===`text`?t.getNode():null,r!==null&&r.isSegmented()){let t=a.offset,i=r.getTextContentSize();if(r.is(n)||e&&t!==i||!e&&t!==0)return void qh(r,e,t)}else if(n!==null&&n.isSegmented()){let i=t.offset,a=n.getTextContentSize();if(n.is(r)||e&&i!==0||!e&&i!==a)return void qh(n,e,i)}(function(e,t){let n=e.anchor,r=e.focus,i=n.getNode();if(i===r.getNode()&&n.type===`text`&&r.type===`text`){let e=n.offset,o=r.offset,s=e<o,c=s?e:o,l=s?o:e,u=l-1;c!==u&&!gv(a=i.getTextContent().slice(c,l))&&!Hce(a)&&(t?r.set(r.key,u,r.type):n.set(n.key,u,n.type))}var a})(this,e)}}t||Hh(this),this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type===`element`&&this.anchor.offset===0&&Fh()}deleteLine(e){let t=this.isCollapsed(),n=Xh(this.anchor);if(n!==null&&e_($y(n)))return this.isCollapsed()||this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),void this.deleteCharacter(e);this.isCollapsed()&&Kh(this,e,`lineboundary`),this.isCollapsed()?this.deleteCharacter(e):Ky(this.anchor.getNode(),hy)===Ky(this.focus.getNode(),hy)?(t||Hh(this),this.removeText()):(this.focus.set(this.anchor.key,this.anchor.offset,this.anchor.type),this.deleteCharacter(e))}deleteWord(e){let t=this.isCollapsed();if(this.isCollapsed()){let t=this.anchor,n=t.getNode();if(this.forwardDeletion(t,n,e))return;Kh(this,e,`word`)}this.isCollapsed()?this.deleteCharacter(e):(t||Hh(this),this.removeText())}isBackward(){let e=this._cachedIsBackward;if(e!==null)return e;let t=this.focus.isBefore(this.anchor);return Ag()||(this._cachedIsBackward=t),t}getStartEndPoints(){return[this.anchor,this.focus]}};function Lh(e){return e instanceof Ph}function Rh(e,t){if(Lh(e)){for(let n of e.getNodes())yh(n)&&n.setFormat(t(n.getFormat()));return}if(e.isCollapsed())return e.setFormat(t(e.format)),void nv(null);let n=[];for(let r of e.getNodes())X(r)?n.push(r):$(r)?r.setTextFormat(t(r.getTextFormat())):yh(r)&&r.setFormat(t(r.getFormat()));let r=n.length;if(r===0)return e.setFormat(t(e.format)),void nv(null);let i=e.anchor,a=e.focus,o=e.isBackward(),s=o?a:i,c=o?i:a,l=0,u=n[0],d=s.type===`element`?0:s.offset;if(s.type===`text`&&d===u.getTextContentSize()&&(l=1,u=n[1],d=0),u==null)return;let f=r-1,p=n[f],m=c.type===`text`?c.offset:p.getTextContentSize();if(u.is(p)){if(d===m)return;let n=t(u.getFormat());if(Y_(u)||d===0&&m===u.getTextContentSize())u.setFormat(n);else{let e=u.splitText(d,m),t=d===0?e[0]:e[1];t.setFormat(n),s.type===`text`&&s.set(t.__key,0,`text`),c.type===`text`&&c.set(t.__key,m-d,`text`)}e.format=n;return}d===0||Y_(u)||([,u]=u.splitText(d),d=0);let h=t(u.getFormat());u.setFormat(h);let g=t(p.getFormat());m>0&&(m===p.getTextContentSize()||Y_(p)||([p]=p.splitText(m)),p.setFormat(g));for(let e=l+1;e<f;e++){let r=n[e];r.setFormat(t(r.getFormat()))}s.type===`text`&&s.set(u.__key,d,`text`),c.type===`text`&&c.set(p.__key,m,`text`),e.format=h|g}function Bce(e,t){let n=[];for(let[e,r]of Object.entries(t))typeof r==`boolean`&&n.push([e,r]);n.length!==0&&Rh(e,e=>{for(let[t,r]of n)e=Q_(e,t,r?vd[t]:0);return e})}function zh(e,t,n=null){let r=n===null&&Z(e)?Q_(e.format,t,null):n;Rh(e,e=>Q_(e,t,r))}function Bh(e){let t=e.offset;if(e.type===`text`)return t;let n=e.getNode();return t===n.getChildrenSize()?n.getTextContent().length:0}function Vh(e){let t=e.getStartEndPoints();if(t===null)return[0,0];let[n,r]=t;return n.type===`element`&&r.type===`element`&&n.key===r.key&&n.offset===r.offset?[0,0]:[Bh(n),Bh(r)]}function Hh(e){let t=dv();!t.isEmpty()&&k_(t,e)&&(e.anchor.set(t.getKey(),0,`element`),e.focus.set(t.getKey(),t.getChildrenSize(),`element`))}function Uh(e){let t=e.focus,n=e.anchor,r=n.key,i=n.offset,a=n.type;n.set(t.key,t.offset,t.type,!0),t.set(r,i,a,!0)}function Wh(e,t,n,r,i){let a=r===`character`?ay(e,i):null,o=a&&a.focusNode,s=a?a.focusOffset:0;if(e.modify(t,n,r),a===null||!function(e,t,n){return e!==null&&e.nodeType===3&&(n===`backward`?t>0:n===`forward`&&t<e.length)}(o,s,n))return;let c=ay(e,i);c.focusNode===o&&c.focusOffset===s&&e.modify(t,n,r)}function Gh(e,t,n){let r=e.getNodes(),i=r.filter(e=>Rv(e,n));if(i.length===0||i.length===r.length)return!1;let a=t?i[0]:i[i.length-1],o=$(a)?a:a.getParentOrThrow();return t?o.selectStart():o.selectEnd(),!0}function Kh(e,t,n){if(bg(e,`extend`,t,n))return;let r=Pg(),i=Zv(Bv(r));if(!i||typeof i.modify!=`function`)return;let a=r._blockCursorElement,o=r._rootElement,s=e.anchor,c=e.focus.getNode();o===null||a===null||!$(c)||c.isInline()||c.canBeEmpty()||Xv(a,r,o);let l=e=>{let t=e.getNode(),n=r.getElementByKey(e.key);return n!==null&&e.type===`text`&&X(t)?yy(t,n,r):n},u=s.getNode(),d=l(s);if(d===null)return;let f=s.offset,p=e.isCollapsed(),m=e.focus,h=p?d:l(m);if(h===null)return;let g=m.offset;if(dg(i,h,g,h,g),Wh(i,`move`,t?`backward`:`forward`,n,o),i.rangeCount===0)return;let _=ry(i,o)||i.getRangeAt(0),v=_.startContainer,y=_.startOffset;if(n===`lineboundary`&&X_(v)&&K_(v)===r){let e=hv(v);if(e_(e)&&e.isInline()&&!e.isIsolated()){let n=r.getElementByKey(e.getKey());n!==null&&n.contains(v)&&(v=n,y=t?0:n.childNodes.length)}}if(p&&n===`character`&&s.type===`text`&&X(u)&&u.isUnmergeable()&&f===(t?0:u.getTextContentSize())){let n=yb(u,t?`previous`:`next`).getNodeAtCaret();if(X(n)){let r=t?n.getTextContentSize()-1:1;e.focus.set(n.__key,r,`text`),e.dirty=!0;return}}if(p&&n===`character`&&s.type===`text`){let n=t?0:u.getTextContentSize(),r=v===d?y:f===n?-1:n;if(r>=0)return void(r!==f&&(e.focus.set(s.key,r,`text`),e.dirty=!0))}let[b,x,S,C]=t?[v,y,d,f]:[d,f,v,y],w=n_(u)?u:Hv(u);e.applyDOMRange({collapsed:!1,endContainer:S,endOffset:C,startContainer:b,startOffset:x}),e.dirty=!0,!Gh(e,t,w)&&t&&Uh(e),n===`lineboundary`&&bg(e,`extend`,t,n,`decorators`)}function Vce(){try{let e=RegExp(`\\p{Emoji}`,`u`),t=e.test.bind(e);if(t(`❤️`)&&t(`#️⃣`)&&t(`👍`))return t}catch{}return()=>!1}var Hce=Vce();function qh(e,t,n){let r=e,i=r.getTextContent().split(/(?=\s)/g),a=i.length,o=0,s=0;for(let e=0;e<a;e++){let r=e===a-1;if(s=o,o+=i[e].length,t&&o===n||o>n||r){i.splice(e,1),r&&(s=void 0);break}}let c=i.join(``).trim();c===``?r.remove():(r.setTextContent(c),r.select(s,s))}function Jh(e,t,n,r){let i,a=t,o=!1;if(uy(e)){let s=!1,c=e.childNodes,l=c.length,u=r._blockCursorElement;a===l&&l>0&&(s=!0,a=l-1),sv(e,r)!==void 0||Oy(e,r)||(o=!0);let d=c[a],f=!1;if(d===u)d=c[a+1],f=!0;else if(u!==null){let n=u.parentNode;e===n&&t>Array.prototype.indexOf.call(n.children,u)&&a--}if(i=hv(d),X(i))a=xb(i,s?`next`:`previous`);else{let c=hv(e);if(c===null)return null;if($(c)){let o=r.getElementByKey(c.getKey());o===null&&$u(214);let l=vy(c,o,r);[c,a]=l.resolveChildIndex(c,o,e,t),$(c)||$u(215),s&&a>=c.getChildrenSize()&&(a=Math.max(0,c.getChildrenSize()-1));let u=c.getChildAtIndex(a);if($(u)&&function(e,t,n){let r=e.getParent();return n===null||r===null||!r.canBeEmpty()||r!==n.getNode()}(u,0,n)){let e=s?u.getLastDescendant():u.getFirstDescendant();e===null?c=u:(u=e,c=$(u)?u:u.getParentOrThrow()),a=0}X(u)?(i=u,c=null,a=xb(u,s?`next`:`previous`)):u!==c&&s&&!f&&($(c)||$u(216),a=Math.min(c.getChildrenSize(),a+1))}else{let n=$y(c),i=n===null?c:n,o=i.getIndexWithinParent(),s=r.getElementByKey(c.getKey()),l=`after`;if(s!==null&&hv(e)===c){let n=vy(c,s,r);n.element===s?t===0&&e_(c)&&(l=`before`):l=n.resolveLeafPosition(s,e,t)}a=l===`before`?o:o+1,c=i.getParentOrThrow()}if($(c))return[kh(c.__key,a,`element`),o]}}else i=hv(e);return X(i)?[kh(i.__key,xb(i,a,`clamp`),`text`),o]:null}function Yh(e,t,n){let r=e.offset,i=e.getNode();if(r===0){let r=i.getPreviousSibling(),a=i.getParent();if(t){if((n||!t)&&r===null&&$(a)&&a.isInline()){let t=a.getPreviousSibling();X(t)&&e.set(t.__key,t.getTextContent().length,`text`)}}else $(r)&&!n&&r.isInline()?e.set(r.__key,r.getChildrenSize(),`element`):X(r)&&!i.isUnmergeable()&&e.set(r.__key,r.getTextContent().length,`text`)}else if(r===i.getTextContent().length){let r=i.getNextSibling(),a=i.getParent();if(t&&$(r)&&r.isInline())e.set(r.__key,0,`element`);else if((n||t)&&r===null&&$(a)&&a.isInline()&&!a.canInsertTextAfter()&&a.getTextContentSize()>1){let t=a.getNextSibling();X(t)&&e.set(t.__key,0,`text`)}}}function Xh(e){let t=iv(e.key);return t===null?null:eb(t)}function Zh(e,t,n){let r=Xh(e),i=Xh(t);if(r===i||r!==null&&i!==null&&r.is(i))return!1;let a=n(r,i);if(r!==null)return $(r)?t.set(r.getKey(),a?r.getChildrenSize():0,`element`):t.set(r.getKey(),a?r.getTextContentSize():0,`text`),!0;let o=$y(i);if(o===null)return!1;let s=o.getParent();if(s===null)return!1;let c=o.getIndexWithinParent();return t.set(s.getKey(),a?c+1:c,`element`),!0}function Qh(e){let t=Zh(e.anchor,e.focus,(t,n)=>function(e,t,n,r){if(n!==null&&r!==null){let e=$y(n),t=$y(r);if(e!==null&&e.is(t)){for(let t of nb(e).values()){if(t===n.getKey())return!0;if(t===r.getKey())return!1}return!0}return e===null||t===null||e.isBefore(t)}if(n!==null){let e=$y(n),r=iv(t.key);return e===null||r===null||!(!e.is(r)&&!e.isParentOf(r))||e.isBefore(r)}let i=$y(r),a=iv(e.key);return i!==null&&a!==null&&!i.is(a)&&!i.isParentOf(a)&&a.isBefore(i)}(e.anchor,e.focus,t,n));return t&&(e.dirty=!0),t}function $h(e,t,n,r,i,a){if(e===null||n===null||!W_(i,e,n))return null;let o=Jh(e,t,Z(a)?a.anchor:null,i);if(o===null)return null;let s=Jh(n,r,Z(a)?a.focus:null,i);if(s===null)return null;let[c,l]=o,[u,d]=s;if(c.type===`element`&&u.type===`element`){let t=hv(e),r=hv(n);if(e_(t)&&e_(r))return null}let f=i._slotsUsed&&Zh(c,u,()=>(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)!==0);return function(e,t){if(e.type===`text`&&t.type===`text`){let n=e.isBefore(t),r=e.is(t);Yh(e,n,r),Yh(t,!n,r),r&&t.set(e.key,e.offset,e.type)}}(c,u),[c,u,l||d||f]}function eg(e){return $(e)&&!e.isInline()}function tg(e,t,n,r,i,a){let o=Ng(),s=new Ih(kh(e,t,i),kh(n,r,a),0,``);return s.dirty=!0,o._selection=s,s}function ng(){return new Ih(kh(`root`,0,`element`),kh(`root`,0,`element`),0,``)}function rg(){return new Ph(new Set)}function Uce(e,t){return ig(null,e,t,null)}function ig(e,t,n,r){let i=n._window;if(i===null)return null;let a=r||i.event,o=a?a.type:void 0,s=o===`selectionchange`,c=!Hd&&(s||o===`beforeinput`||o===`compositionstart`||o===`compositionend`||o===`click`&&a&&a.detail===3||o===`drop`||o===void 0),l,u,d,f;if(Z(e)&&!c)return e.clone();{if(t===null)return null;let r=ay(t,n._rootElement);if(l=r.anchorNode,u=r.focusNode,d=r.anchorOffset,f=r.focusOffset,(s||o===void 0)&&Z(e)&&!W_(n,l,u))return e.clone()}let p=$h(l,d,u,f,n,e);if(p===null)return null;let[m,h,g]=p,_=0,v=``;if(Z(e)){let t=e.anchor;if(m.key===t.key)_=e.format,v=e.style;else{let e=m.getNode();X(e)?(_=e.getFormat(),v=e.getStyle()):$(e)&&(_=e.getTextFormat(),v=e.getTextStyle())}}let y=new Ih(m,h,_,v);return g&&(y.dirty=!0),y}function Q(){return Ng()._selection}function ag(){return Pg()._editorState._selection}function og(e,t){let n=t.__key;return e.anchor.key===n||e.focus.key===n}function sg(e,t,n,r=1){if(!og(e,t))return;let i=e.anchor,a=e.focus,o=t.__key;if(e.isCollapsed()){let t=i.offset;if(n<=t&&r>0||n<t&&r<0){let n=Math.max(0,t+r);i.set(o,n,`element`),a.set(o,n,`element`),cg(e)}}else{let s=e.isBackward(),c=s?a:i,l=c.getNode(),u=s?i:a,d=u.getNode();if(t.is(l)){let e=c.offset;(n<=e&&r>0||n<e&&r<0)&&c.set(o,Math.max(0,e+r),`element`)}if(t.is(d)){let e=u.offset;(n<=e&&r>0||n<e&&r<0)&&u.set(o,Math.max(0,e+r),`element`)}}cg(e)}function cg(e){let t=e.anchor,n=t.offset,r=e.focus,i=r.offset,a=t.getNode(),o=r.getNode();if(e.isCollapsed()){if(!$(a))return;let e=a.getChildrenSize(),i=n>=e,o=i?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(X(o)){let e=0;i&&(e=o.getTextContentSize()),t.set(o.__key,e,`text`),r.set(o.__key,e,`text`)}}else{if($(a)){let e=a.getChildrenSize(),r=n>=e,i=r?a.getChildAtIndex(e-1):a.getChildAtIndex(n);if(X(i)){let e=0;r&&(e=i.getTextContentSize()),t.set(i.__key,e,`text`)}}if($(o)){let e=o.getChildrenSize(),t=i>=e,n=t?o.getChildAtIndex(e-1):o.getChildAtIndex(i);if(X(n)){let e=0;t&&(e=n.getTextContentSize()),r.set(n.__key,e,`text`)}}}}function lg(e,t,n,r,i){let a=null,o=0,s=null;r===null?i!==null&&(a=i.__key,X(i)?s=`text`:$(i)&&(s=`element`)):(a=r.__key,X(r)?(o=r.getTextContentSize(),s=`text`):$(r)&&(o=r.getChildrenSize(),s=`element`)),a!==null&&s!==null?e.set(a,o,s):(o=t.getIndexWithinParent(),o===-1&&(o=n.getChildrenSize()),e.set(n.__key,o,`element`))}function ug(e,t,n,r,i){e.type===`text`?e.set(n,e.offset+(t?0:i),`text`):e.offset>r.getIndexWithinParent()&&e.set(e.key,e.offset-1,`element`)}function dg(e,t,n,r,i){try{e.setBaseAndExtent(t,n,r,i)}catch{}}function fg(e,t,n){let r=jv(e,t.getKey());if($(t)){let i=vy(t,r,e);return[i.element,n+i.getFirstChildOffset()]}return[r,n]}function Wce(e,t,n,r,i,a){let o=a.getRootNode(),s=Z_(o)||Qv(o)?sy(o):null;if(i.has(`collaboration`)&&s!==a||s!==null&&U_(s,s))return;let c=ay(r,a),l;if(!Z(t))return void(e!==null&&W_(n,c.anchorNode,c.focusNode)&&r.removeAllRanges());let u=t.anchor,d=t.focus,f=u.getNode(),p=d.getNode(),[m,h]=fg(n,f,u.offset),[g,_]=fg(n,p,d.offset),v=t.format,y=t.style,b=t.isCollapsed(),x=m,S=g,C=!1;if(u.type===`text`?(x=X(f)?yy(f,m,n):null,C=f.getFormat()!==v||f.getStyle()!==y):Z(e)&&e.anchor.type===`text`&&(C=!0),d.type===`text`&&(S=X(p)?yy(p,g,n):null),x!==null&&S!==null){if(b&&(e===null||C||Z(e)&&(e.format!==v||e.style!==y))&&function(e,t,n,r,i,a){e._inputState.collapsedSelectionFormat={format:t,key:i,offset:r,style:n,timeStamp:a}}(n,v,y,h,u.key,performance.now()),(r.type!==`Range`||!b)&&c.anchorOffset===h&&c.focusOffset===_&&c.anchorNode===x&&c.focusNode===S){if(s===null||!a.contains(s)){let e=s===null?null:K_(s);e!==null&&e!==n||i.has(`skip-selection-focus`)||a.focus({preventScroll:!0})}if(u.type!==`element`)return}if(dg(r,x,h,S,_),id&&t.isCollapsed()&&a!==null&&!i.has(`skip-selection-focus`)){let e=oy(a);if(e===null||!a.contains(e)){let e=sy(a.ownerDocument),t=e===null?null:K_(e);t!==null&&t!==n||a.focus({preventScroll:!0})}}if(!i.has(`skip-scroll-into-view`)&&t.isCollapsed()&&a!==null&&a===oy(a)){let e=Z(t)&&t.anchor.type===`element`?function(e,t,n){let r=t.childNodes[n];if(!uy(r))return r||null;let i=sv(r,e),a=i===void 0?null:iv(i);return a===null||$(a)?r:vy(a,r,e).element}(n,x,h):(l===void 0&&(l=iy(r,a)),l);if(e!==null){let t;if(X_(e)){let n=e.ownerDocument.createRange();n.selectNode(e),t=n.getBoundingClientRect()}else t=uy(e)?e.getBoundingClientRect():function(e){let t=e.getBoundingClientRect(),{startContainer:n,startOffset:r}=e;if(!e.collapsed||t.width!==0||t.height!==0||!X_(n)||n.length===0)return t;let i=e.cloneRange();return r>0?i.setStart(n,r-1):i.setEnd(n,1),i.getBoundingClientRect()}(e);(function(e,t,n,r=null){let i=Nv(n),a=zv(i);if(i===null||a===null)return;let o=n.getBoundingClientRect();if(t.bottom<o.top)return;if(r!==null&&t.height>0){let{left:e,right:i}=t,o=uy(r)?r:Mv(r);for(;o!==null&&n.contains(o);){let t=vle(a,o,e,i);e-=t,i-=t,o=o===n?null:Mv(o)}}let{top:s,bottom:c}=t,l=0,u=0,d=n;for(;d!==null;){let t=d===i.body;if(t){let t=a.visualViewport;if(t){let e=t.offsetTop;l=e,u=e+t.height}else l=0,u=Bv(e).innerHeight;let n=a.getComputedStyle(i.documentElement),r=parseFloat(n.scrollPaddingTop),o=parseFloat(n.scrollPaddingBottom);isFinite(r)&&(l+=r),isFinite(o)&&(u-=o)}else{let e=d===n?o:d.getBoundingClientRect();l=e.top,u=e.bottom}let r=0;if(s<l?r=-(l-s):c>u&&(r=c-u),r!==0){if(t)a.scrollBy(0,r);else{let e=d.scrollTop;d.scrollTop+=r;let t=d.scrollTop-e;s-=t,c-=t}}if(t)break;d=Mv(d)}})(n,t,a,x)}}(function(e,t,n,r,i){let a=e._inputState;a.isSelectionChangeFromDOMUpdate=!0,a.selectionChangeFromDOMUpdatePoints=t!==void 0&&n!==void 0&&r!==void 0&&i!==void 0?{anchorNode:t,anchorOffset:n,focusNode:r,focusOffset:i}:null})(n,x,h,S,_)}}function pg(e){let t=Q()||ag();t===null&&(t=dv().selectEnd()),t.insertNodes(e)}function mg(e,t){for(let n of e.split(/(\r?\n|\t)/))n===`
`||n===`\r
`?t.linebreak():n===` `?t.tab():n!==``&&t.text(n)}function hg(e){let t=[];return mg(e,{linebreak:()=>t.push(l_()),tab:()=>t.push(Dh()),text:e=>t.push(wh(e))}),t}function Gce(){let e=Q();return e===null?``:e.getTextContent()}function gg(e){let t=[];for(let n of e)u_(n)||(!$(n)&&!e_(n)||n.isInline()?t.push(n):$(n)&&t.push(...gg(n.getChildren())));return t}function _g(e,t=!1){let n=e;e.isCollapsed()||n.removeText();let r=Q();Z(r)&&(n=r),Z(n)||$u(161);let i=n.anchor,a=i.getNode(),o=i.offset;for(;!hy(a)&&Qy(a)===null;){let e=a;if([a,o]=Kce(a,o,t),e.is(a))break}return[a,o]}function Kce(e,t,n=!1){let r=e.getParent();if(!r){let e=j_();return dv().append(e),e.select(),[dv(),0]}if(X(e)){let n=e.splitText(t);if(n.length===0)return[r,e.getIndexWithinParent()];let i=t===0?0:1;return[r,n[0].getIndexWithinParent()+i]}if(!$(e)||t===0)return[r,e.getIndexWithinParent()];let i=e.getChildAtIndex(t);if(i){let r=new Ih(kh(e.__key,t,`element`),kh(e.__key,t,`element`),0,``),a=e.insertNewAfter(r);if(a)a.append(i,...i.getNextSiblings());else if(n)return[e,t]}return[r,e.getIndexWithinParent()+1]}function vg(e){return u_(e)||Vv(e)||X(e)||e.isParentRequired()}function yg(e){let t=j_(),n=null;for(let r=0;r<e.length;r++){let i=e[r];if(vg(i)){if(n===null){n=i.createParentElementNode(),t.append(n);let a=e[r+1];if(u_(i)&&(a===void 0||!vg(a)))continue}n.append(i)}else t.append(i),n=null}return t}function bg(e,t,n,r,i=`decorators-and-blocks`){if(t===`move`&&r===`character`&&!e.isCollapsed()){let[t,r]=n===e.isBackward()?[e.focus,e.anchor]:[e.anchor,e.focus];return r.set(t.key,t.offset,t.type),!0}let a=m_(e.focus,n?`previous`:`next`),o=r===`lineboundary`,s=t===`move`,c=a,l=i===`decorators-and-blocks`,u=!1;if(!C_(c)){for(let e of c){l=!1;let{origin:t}=e;if(e_(t)){if(t.isIsolated()){u=!0;break}if(c=e,o&&t.isInline())continue}break}if(u)return!0;if(l)for(let e of Db(a).iterNodeCarets(t===`extend`?`shadowRoot`:`root`)){if(vb(e))e.origin.isInline()||(c=e);else{if($(e.origin))continue;e_(e.origin)&&!e.origin.isInline()&&(c=e)}break}}if(c===a)return!1;if(s&&!o&&e_(c.origin)&&c.origin.isKeyboardSelectable()){let e=rg();return e.add(c.origin.getKey()),pv(e),!0}return c=S_(c),s&&h_(e.anchor,c),h_(e.focus,c),l||!o}var xg=null,Sg=null,Cg=!1,wg=!1,Tg=!1,Eg=new Set,Dg=new Set,Og=0,kg={characterData:!0,childList:!0,subtree:!0};function Ag(){return Cg||xg!==null&&xg._readOnly}function jg(){Cg&&$u(13)}function Mg(){Og>99&&$u(14)}function Ng(){return xg===null&&$u(195,Ig()),xg}function qce(e){Ng()!==null&&Sg===null&&(Sg=e),Sg!==e&&ed(378)}function Pg(){return Sg===null&&$u(337,Ig()),Sg}function Fg(){Pg()._dirtyType=2}function Ig(){let e=0,t=new Set,n=L_.version;if(typeof window<`u`)for(let r of ey(document)){let i=q_(r);if(G_(i))e++;else if(i){let e=String(i.constructor.version||`<0.17.1`);e===n&&(e+=` (separately built, likely a bundler configuration issue)`),t.add(e)}}let r=` Detected on the page: ${e} compatible editor(s) with version ${n}`;return t.size&&(r+=` and incompatible editors with versions ${Array.from(t).join(`, `)}`),r}function Lg(){return Sg}function Rg(e,t,n){let r=t.__type,i=V_(e,r),a=n.get(r);a===void 0&&(a=Array.from(i.transforms),n.set(r,a));let o=a.length;for(let e=0;e<o&&(a[e](t),t.isAttached());e++);}function zg(e,t){return e!==void 0&&e.__key!==t&&e.isAttached()}function Bg(e,t){if(!t)return;let n=e._updateTags,r=t;Array.isArray(t)||(r=[t]);for(let e of r)n.add(e)}function Jce(e){return Vg(e,Pg()._nodes)}function Vg(e,t){let n=e.type,r=t.get(n);r===void 0&&$u(17,n);let i=r.klass;e.type!==i.getType()&&$u(18,i.name);let a=i.importJSON(e),o=e.children;if($(a)&&Array.isArray(o))for(let e=0;e<o.length;e++){let n=Vg(o[e],t);a.append(n)}let s=e.$slots;if(s){Xy(a)||$u(379,i.name);for(let e in s)Gle(a,e,Vg(s[e],t))}return a}function Hg(e,t,n){let r=xg,i=Cg,a=Sg;xg=t,Cg=!0,Sg=e;try{return n()}finally{xg=r,Cg=i,Sg=a}}function Ug(e,t){let n=Tg;Tg=!0;try{let n=function(e){if(Dg.has(e))return!1;Dg.add(e);try{for(let t=0;e._pendingEditorState!==null;t++){let n=e._pendingEditorState._selection,r=e._rootElement;if(!Gg(e,n))return!1;let i=(n===null||Z(n))&&(e._headless||r===null||!r.isConnected);if(i||t===100)return e._lastNotifiedSelection=n===null?null:n.clone(),!i;Yg(e,()=>e.dispatchCommand(Np),void 0,!0)}return!1}finally{Dg.delete(e)}}(e);(function(e,t){let n=e._pendingEditorState,r=e._rootElement,i=e._headless||r===null;if(n===null)return void(!e._updating&&e._deferred.length>0&&qg(e,e._deferred));let a=e._editorState,o=a._selection,s=n._selection,c=e._dirtyType!==0,l=xg,u=Cg,d=Sg,f=e._updating,p=e._observer,m=null;if(e._pendingEditorState=null,e._editorState=n,!i&&c&&p!==null){Sg=e,xg=n,Cg=!1,e._updating=!0;try{let t=e._dirtyType,r=e._dirtyElements,i=e._dirtyLeaves;p.disconnect(),m=tce(a,n,e,t,r,i)}catch(t){if(t instanceof Error&&e._onError(t),wg)throw t;N_(e,null,r,n),qd(e),e._dirtyType=2,wg=!0,Ug(e,a),wg=!1;return}finally{p.observe(r,kg),e._updating=f,xg=l,Cg=u,Sg=d}}n._readOnly||=!0;let h=e._dirtyLeaves,g=e._dirtyElements,_=e._normalizedNodes,v=e._updateTags;c&&(e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements=new Map,e._normalizedNodes=new Set),e._updateTags=new Set;let y=e._deferred;f||(e._deferred=[]),function(e,t){let n=e._decorators,r=e._pendingDecorators||n,i=t._nodeMap,a;for(a in r)i.has(a)||(r===n&&(r=lv(e)),delete r[a])}(e,n);let b=i?null:Zv(Bv(e));if(e._editable&&b!==null&&(c||s===null||s.dirty||!s.is(o))&&r!==null&&!v.has(`skip-dom-selection`)){Sg=e,xg=n;try{if(p!==null&&p.disconnect(),c||s===null||s.dirty){let t=e._blockCursorElement;t!==null&&Xv(t,e,r),Wce(o,s,e,b,v,r)}(function(e,t,n){let r=e._blockCursorElement;if(Z(n)&&n.isCollapsed()&&n.anchor.type===`element`&&t.contains(oy(t))){let i=n.anchor,a=i.getNode(),o=i.offset,s=!1,c=null;if(o===a.getChildrenSize())Yv(a.getChildAtIndex(o-1))&&(s=!0);else{let t=a.getChildAtIndex(o);t!==null&&Yv(t)&&(s=!0,c=e.getElementByKey(t.__key))}if(s){let n=vy(a,e.getElementByKey(a.__key),e).element;r===null&&(e._blockCursorElement=r=function(e){let t=e.theme,n=ny().createElement(`div`);n.contentEditable=`false`,n.setAttribute(`data-lexical-cursor`,`true`);let r=t.blockCursor;return r!==void 0&&(typeof r==`string`&&(r=t.blockCursor=Lb(r)),r!==void 0&&n.classList.add(...r)),n}(e._config)),t.style.caretColor=`transparent`,c===null?n.appendChild(r):n.insertBefore(r,c);return}}r!==null&&Xv(r,e,t)})(e,r,s)}finally{p!==null&&p.observe(r,kg),Sg=d,xg=l}}m!==null&&function(e,t,n,r,i){let a=Array.from(e._listeners.mutation),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];for(let e of s){let a=t.get(e);a!==void 0&&o(a,{dirtyLeaves:r,prevEditorState:i,updateTags:n})}}}(e,m,v,h,a);let x=e._pendingDecorators;x!==null&&(e._decorators=x,e._pendingDecorators=null,Wg(`decorator`,e,!0,x)),function(e,t,n){let r=uv(t),i=uv(n);r!==i&&Wg(`textcontent`,e,!0,i)}(e,t||a,n),Wg(`update`,e,!0,{dirtyElements:g,dirtyLeaves:h,editorState:n,mutatedNodes:m,normalizedNodes:_,prevEditorState:t||a,tags:v}),f||qg(e,y),function(e){let t=e._updates;if(t.length===0)return void(e._cascadeCount=0);if(function(e){Eg.has(e)||(Eg.add(e),setTimeout(()=>{Eg.delete(e),e._cascadeCount=0},0))}(e),e._cascadeCount++>99)return e._updates=[],e._cascadeCount=0,void e._onWarn(Qu(437,e._config.namespace));let n=t.shift();if(n){let[t,r]=n;Yg(e,t,r)}}(e)})(e,t),n&&e._onWarn(Qu(436))}finally{Tg=n}}function Wg(e,t,n,...r){let i=t._updating;t._updating=n;try{let n=t._listeners[e],i=Array.from(n);for(let[e,t]of i){t&&t();let i=e(...r),a=typeof i==`function`?i:void 0;n.has(e)?n.set(e,a):a&&a()}}finally{t._updating=i}}function Gg(e,t){let n=e._lastNotifiedSelection;return t===null?n!==null:!t.is(n)}function Kg(e,t,n,r){let i=_v(e),a;if(!Tg)for(let e=0;e<i.length;e++)i[e]._updating||(i[e]._cascadeCount=0);if(t===Np){if(Sg!==e||Cg){let i=!1;return Xg(e,()=>{i=Kg(e,t,n,r)}),i}let i=Ng()._selection;e._lastNotifiedSelection=i===null?null:i.clone()}for(let e=4;e>=0;e--)for(let o=0;o<i.length;o++){let s=i[o];if(o>0&&s._updating){a=s;break}let c=s._commands.get(t);if(c!==void 0){let t=c[e];if(t.size>0){let e=!1;if(Xg(s,()=>{for(let i of t)if(i(n,r))return void(e=!0)}),e)return e}}}return a&&a.update(()=>{Kg(a,t,n,r)}),!1}function qg(e,t){if(e._deferred===t&&(e._deferred=[]),t.length!==0){let n=e._updating;e._updating=!0;try{for(let e=0;e<t.length;e++)t[e]()}finally{e._updating=n}}}function Jg(e,t){let n=e._updates,r=t||!1;for(;n.length!==0;){let t=n.shift();if(t){let[n,i]=t,a=e._pendingEditorState,o;i!==void 0&&(o=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&$u(191),a._flushSync=!0),o&&e._deferred.push(o),Bg(e,i.tag)),a==null?Yg(e,n,i):n()}}return r}function Yce(){let e=Ng();jg(),e._flushSync=!0}function Yg(e,t,n,r=!1){let i=e._updateTags,a,o=!1,s=!1;n!==void 0&&(a=n.onUpdate,Bg(e,n.tag),o=n.skipTransforms||!1,s=n.discrete||!1),a&&e._deferred.push(a);let c=e._editorState,l=e._pendingEditorState,u=!1;(l===null||l._readOnly)&&(l=e._pendingEditorState=r_(l||c),u=!0),l._flushSync=s;let d=xg,f=Cg,p=Sg,m=e._updating;xg=l,Cg=!1,e._updating=!0,Sg=e;let h=e._headless||e.getRootElement()===null;z_(null);try{u&&(h?c._selection!==null&&(l._selection=c._selection.clone()):l._selection=function(e,t){let n=e.getEditorState()._selection,r=Zv(Bv(e));return Z(n)||n==null?ig(n,r,e,t):n.clone()}(e,n&&n.event||null));let r=e._compositionKey;t(),o=Jg(e,o),function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(Z(r)){let e=r.anchor,t=r.focus,i;if(e.type===`text`&&(i=e.getNode(),i.selectionTransform(n,r)),t.type===`text`){let e=t.getNode();i!==e&&e.selectionTransform(n,r)}}}(l,e),e._dirtyType!==0&&(o?function(e,t){let n=t._dirtyLeaves,r=e._nodeMap;for(let e of n){let t=r.get(e);X(t)&&t.isAttached()&&t.isSimpleText()&&!t.isUnmergeable()&&Pf(t)}}(l,e):function(e,t){let n=t._dirtyLeaves,r=t._dirtyElements,i=e._nodeMap,a=rv(),o=new Map,s=n,c=s.size,l=r,u=l.size;for(;c>0||u>0;){if(c>0){t._dirtyLeaves=new Set;for(let e of s){let r=i.get(e);X(r)&&r.isAttached()&&r.isSimpleText()&&!r.isUnmergeable()&&Pf(r),r!==void 0&&zg(r,a)&&Rg(t,r,o),n.add(e)}if(s=t._dirtyLeaves,c=s.size,c>0){Og++;continue}}t._dirtyLeaves=new Set,t._dirtyElements=new Map,l.delete(`root`)&&l.set(`root`,!0);for(let e of l){let n=e[0],s=e[1];if(r.set(n,s),!s)continue;let c=i.get(n);c!==void 0&&zg(c,a)&&Rg(t,c,o)}s=t._dirtyLeaves,c=s.size,l=t._dirtyElements,u=l.size,Og++}t._dirtyLeaves=n,t._dirtyElements=r}(l,e),Jg(e),function(e,t,n,r){let i=e._nodeMap,a=t._nodeMap,o=[];for(let[e]of r){let t=a.get(e);t!==void 0&&(t.isAttached()||($(t)&&Vd(t,e,i,a,o,r),i.has(e)||r.delete(e),o.push(e)))}for(let e of n){let t=a.get(e);t===void 0||t.isAttached()||(Xy(t)&&t.__slots!==null&&Vd(t,e,i,a,o,n),i.has(e)||n.delete(e),o.push(e))}let s=Pg(),c=s._cloneNotNeeded;for(let e of o)a.delete(e),c.delete(e);let l=s._compositionKey;l===null||a.has(l)||(s._compositionKey=null)}(c,l,e._dirtyLeaves,e._dirtyElements)),r!==e._compositionKey&&(l._flushSync=!0);let i=l._selection;if(Z(i)){e._slotsUsed&&Qh(i);let t=l._nodeMap,n=i.anchor.key,r=i.focus.key;t.get(n)!==void 0&&t.get(r)!==void 0||$u(19)}else Lh(i)&&i._nodes.size===0&&(l._selection=null)}catch(t){t instanceof Error&&e._onError(t),e._pendingEditorState=c;let n=c._selection;e._lastNotifiedSelection=n===null?null:n.clone(),e._dirtyType=2,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),Ug(e);return}finally{xg=d,Cg=f,Sg=p,e._updating=m,Og=0}r||(e._dirtyType!==0||e._deferred.length>0||function(e,t){let n=t.getEditorState()._selection,r=e._selection;if(r!==null){if(r.dirty||!r.is(n))return!0}else if(n!==null)return!0;return!1}(l,e)?l._flushSync?(l._flushSync=!1,Ug(e)):u&&fle(()=>{Ug(e)}):(l._flushSync=!1,u&&(i.clear(),e._deferred=[],e._pendingEditorState=null)))}function Xg(e,t,n){Sg===e&&n===void 0?Ag()?Yg(e,t,n):t():Yg(e,t,n)}function Xce(){return{...Sd,0:``}}function Zce(){return{...bd,"":0}}var Qce=Xce(),$ce=Zce(),ele=_f()({direction:yf(mf([null,`ltr`,`rtl`]),{field:`__dir`}),format:yf(mf([``,`left`,`start`,`center`,`right`,`end`,`justify`]),{field:`__format`,getter:`getFormatType`,getterTable:Qce,setter:`setFormat`,setterTable:$ce}),indent:yf(ff(0,{integer:!0,min:0}),{field:`__indent`}),textFormat:bf(ff(),{getter:{field:`__textFormat`,method:`getSerializedTextFormat`,when:`shouldSerializeTextStyles`},setter:{field:`__textFormat`}}),textStyle:bf(df(),{getter:{field:`__textStyle`,method:`getSerializedTextStyle`,when:`shouldSerializeTextStyles`},setter:{field:`__textStyle`}})});function tle(e){if(Wv(e)){let t=null;for(let n of e.getChildren())t=n.isInline()?(t||n.replace(n.createParentElementNode())).append(n):null}}var Zg=class extends sh{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;__slotHost;__slots;$config(){return this.config(Symbol.for(`ElementNode`),{$transform:tle,extends:sh,generated:Tce,json:ele})}constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style=``,this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=``,this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size,this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&$u(384,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots),this.__style=e.__style,function(e,t){e.__dir=t.__dir,e.__format=t.__format,e.__indent=t.__indent,e.__textFormat=t.__textFormat,e.__textStyle=t.__textStyle}(this,e)}getFormat(){return this.getLatest().__format}getFormatType(){return Sd[this.getFormat()]||``}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){let e=[],t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0&&rb(this).length===0}isDirty(){let e=Pg()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){let e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){let e=[];for(let t of rb(this)){let n=ib(this,t);if($(n))for(let t of n.getAllTextNodes())e.push(t)}let t=this.getFirstChild();for(;t!==null;){if(X(t)&&e.push(t),$(t))for(let n of t.getAllTextNodes())e.push(n);t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;$(e);){let t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;$(e);){let t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){let t=this.getChildren(),n=t.length;if(e>=n){let e=t[n-1];return $(e)&&e.getLastDescendant()||e||null}let r=t[e];return $(r)&&r.getFirstDescendant()||r||null}getFirstChild(){let e=this.getLatest().__first;return e===null?null:iv(e)}getFirstChildOrThrow(){let e=this.getFirstChild();return e===null&&$u(45,this.__key),e}getLastChild(){let e=this.getLatest().__last;return e===null?null:iv(e)}getLastChildOrThrow(){let e=this.getLastChild();return e===null&&$u(96,this.__key),e}getChildAtIndex(e){let t=this.getChildrenSize(),n,r;if(e<t/2){for(n=this.getFirstChild(),r=0;n!==null&&r<=e;){if(r===e)return n;n=n.getNextSibling(),r++}return null}for(n=this.getLastChild(),r=t-1;n!==null&&r>=e;){if(r===e)return n;n=n.getPreviousSibling(),r--}return null}getTextContent(){let e=cb(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContent(),$(i)&&r!==n-1&&!i.isInline()&&(e+=pd)}return e}getTextContentSize(){let e=function(e){let t=0;for(let n of rb(e)){let r=ib(e,n);r!==null&&(t+=r.getTextContentSize())}return t}(this),t=this.getChildren(),n=t.length;for(let r=0;r<n;r++){let i=t[r];e+=i.getTextContentSize(),$(i)&&r!==n-1&&!i.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==``){let t=bd[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){let t=vd[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return Q_(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){jg();let n=Q(),r=e,i=t,a=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){let e=this.getFirstChild();if(X(e)||$(e))return e.select(0,0)}else if(!(e!==void 0&&e!==a||t!==void 0&&t!==a)){let e=this.getLastChild();if(X(e)||$(e))return e.select()}}r===void 0&&(r=a),i===void 0&&(i=a);let o=this.__key;return Z(n)?(n.anchor.set(o,r,`element`),n.focus.set(o,i,`element`),n.dirty=!0,n):tg(o,r,o,i,`element`,`element`)}selectStart(){let e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){let e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){let e=this.getWritable();return this.getChildren().forEach(e=>e.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){let t=this.getWritable();return t.__dir=e,t}setFormat(e){let t=this.getWritable();return t.__format=e!==``&&bd[e]||0,t}setStyle(e){let t=this.getWritable();return t.__style=e||``,t}setTextFormat(e){let t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){let t=this.getWritable();return t.__textStyle=e,t}setIndent(e){let t=this.getWritable();return t.__indent=e,t}splice(e,t,n){ah(this)&&$u(324,this.__key,this.__type);let r=this.getChildrenSize(),i=this.getWritable();e+t<=r||$u(226,String(e),String(t),String(r));for(let e of n);let a=i.__key,o=[],s=[],c=this.getChildAtIndex(e+t),l=null,u=r-t+n.length;if(e!==0){if(e===r)l=this.getLastChild();else{let t=this.getChildAtIndex(e);t!==null&&(l=t.getPreviousSibling())}}if(t>0){let e=l===null?this.getFirstChild():l.getNextSibling();for(let n=0;n<t;n++){e===null&&$u(100);let t=e.getNextSibling(),n=e.__key;ev(e.getWritable()),s.push(n),e=t}}let d=l;for(let e of n){d!==null&&e.is(d)&&(l=d=d.getPreviousSibling()),c!==null&&e.is(c)&&(c=c.getNextSibling());let t=e.getWritable();t.__parent===a&&u--,ev(t);let n=e.__key;if(d===null)i.__first=n,t.__prev=null;else{let e=d.getWritable();e.__next=n,t.__prev=e.__key}e.__key===a&&$u(76),t.__parent=a,o.push(n),d=e}if(c===null)d!==null&&(d.getWritable().__next=null,i.__last=d.__key);else{let e=c.getWritable();if(d!==null){let t=d.getWritable();e.__prev=d.__key,t.__next=c.__key}else e.__prev=null}if(i.__size=u,s.length){let e=Q();if(Z(e)){let t=new Set(s),n=new Set(o),{anchor:r,focus:i}=e;Qg(r,t,n)&&lg(r,r.getNode(),this,l,c),Qg(i,t,n)&&lg(i,i.getNode(),this,l,c),u!==0||this.canBeEmpty()||Wv(this)||this.remove()}}return i}getDOMSlot(e){return new Md(e)}exportDOM(e){let{element:t}=super.exportDOM(e);if(uy(t)){let e=this.getIndent();e>0&&(t.style.paddingInlineStart=40*e+`px`,t.setAttribute(`data-lexical-indent`,String(e)));let n=this.getDirection();n&&(t.dir=n)}return{element:t}}shouldSerializeTextStyles(){if(Wv(this))return!1;for(let e=this.getFirstChild();e!==null;e=e.getNextSibling())if(X(e))return!1;return!0}getSerializedTextFormat(){let e=this.getTextFormat();return e!==0&&this.shouldSerializeTextStyles()?e:void 0}getSerializedTextStyle(){let e=this.getTextStyle();return e!==``&&this.shouldSerializeTextStyles()?e:void 0}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,n){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){let n=vy(this,e,t),r=n.getFirstChild();for(let e=this.getFirstChild();e;e=e.getNextSibling()){let i=t.getElementByKey(e.getKey());i!==null&&(r==null?(n.insertChild(i),r=i):r!==i&&n.replaceChild(i,r),r=r.nextSibling)}}};function $(e){return e instanceof Zg}function Qg(e,t,n){let r=e.getNode();for(;r;){let e=r.__key;if(t.has(e)&&!n.has(e))return!0;r=r.getParent()}return!1}var $g=class extends sh{__slotHost;__slots;constructor(e){super(e),this.__slotHost=null,this.__slots=null}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__slotHost=e.__slotHost,this.__slotHost!==null&&this.__parent!==null&&$u(383,this.__key,String(this.__slotHost),String(this.__parent)),this.__slots=e.__slots)}decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}};function e_(e){return e instanceof $g}var t_=class extends Zg{__cachedText;$config(){return this.config(`root`,{extends:Zg})}constructor(){super(`root`),this.__cachedText=null}getTopLevelElementOrThrow(){$u(51)}getTextContent(){let e=this.__cachedText;return e===null||!Ag()&&Pg()._dirtyType!==0?super.getTextContent():e}remove(){$u(52)}replace(e){$u(53)}insertBefore(e){$u(54)}insertAfter(e){$u(55)}updateDOM(e,t){return!1}splice(e,t,n){for(let e of n)$(e)||e_(e)||$u(282);return super.splice(e,t,n)}static importJSON(e){return dv().updateFromJSON(e)}collapseAtStart(){return!0}};function n_(e){return e instanceof t_}function r_(e){return new o_(Ld(e._nodeMap),null,e._slotsUsed)}function i_(){return new o_(new Map([[`root`,new t_]]),null,!1)}function a_(e){let t=e.constructor,n=Bd(e);if($(e)){let t=n.children,r=e.getChildren();for(let e=0;e<r.length;e++)t.push(a_(r[e]))}let r=rb(e);if(r.length>0){let i={};for(let n of r){let r=ib(e,n);r===null&&$u(366,t.name,n),i[n]=a_(r)}n.$slots=i}return n}function nle(e){return e instanceof o_}var o_=class e{_nodeMap;_selection;_flushSync;_readOnly;_parsed;_slotsUsed;constructor(e,t=null,n=!1){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1,this._parsed=!1,this._slotsUsed=n}isEmpty(){return this._nodeMap.size<=1&&this._selection===null}read(e,t){return Hg(t&&t.editor||null,this,e)}clone(t){let n=new e(this._nodeMap,t===void 0?this._selection:t,this._slotsUsed);return n._readOnly=!0,n._parsed=this._parsed,n}toJSON(e){return zse(typeof e==`boolean`&&e,()=>Hg(null,this,()=>({root:a_(dv())})))}},s_=class extends Zg{$config(){return this.config(`artificial`,{extends:Zg})}createDOM(e){return ny().createElement(`div`)}},c_=class extends sh{$config(){return this.config(`linebreak`,{extends:sh,generated:kce,importDOM:{br:e=>d_(e)||f_(e)?null:{conversion:rle,priority:0}}})}getTextContent(){return`
`}createDOM(){return ny().createElement(`br`)}updateDOM(){return!1}isInline(){return!0}};function rle(e){return{node:l_()}}function l_(){return Kv(new c_)}function u_(e){return e instanceof c_}function d_(e){let t=e.parentElement;if(t!==null&&my(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&p_(n)){let n=t.lastChild;if(n===e||n.previousSibling===e&&p_(n))return!0}}return!1}function f_(e){let t=e.parentElement;if(t!==null&&my(t)){let n=t.firstChild;if(n===e||n.nextSibling===e&&p_(n))return!1;let r=t.lastChild;if(r===e||r.previousSibling===e&&p_(r))return!0}return!1}function p_(e){return X_(e)&&/^( |\t|\r?\n)+$/.test(e.textContent||``)}function m_(e,t){let{type:n,key:r,offset:i}=e,a=Jv(e.key);return n===`text`?(X(a)||$u(266,a.getType(),r),bb(a,t,i)):($(a)||$u(267,a.getType(),r),T_(a,e.offset,t))}function h_(e,t){let{origin:n,direction:r}=t,i=r===`next`;gb(t)?e.set(n.getKey(),t.offset,`text`):_b(t)?X(n)?e.set(n.getKey(),xb(n,r),`text`):e.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent()+ +!!i,`element`):(vb(t)&&$(n)||$u(268),e.set(n.getKey(),i?0:n.getChildrenSize(),`element`))}function g_(e){let t=Q(),n=Z(t)?t:ng();return __(n,e),pv(n),n}function __(e,t){h_(e.anchor,t.anchor),h_(e.focus,t.focus)}function v_(e){let{anchor:t,focus:n}=e,r=m_(t,`next`),i=m_(n,`next`),a=jb(r,i)<=0?`next`:`previous`;return kb(Eb(r,a),Eb(i,a))}function y_(e){let{direction:t,origin:n}=e,r=yb(n,fb(t)).getNodeAtCaret();return r?yb(r,t):Cb(n.getParentOrThrow(),t)}function b_(e,t=`root`){let n=[e];for(let r=vb(e)?e.getParentCaret(t):e.getSiblingCaret();r!==null;r=r.getParentCaret(t))n.push(y_(r));return n}function x_(e){return!!e&&e.origin.isAttached()}function ile(e,t=`removeEmptySlices`){if(e.isCollapsed())return e;let n=`root`,r=`next`,i=t,a=w_(e,r),o=a.anchor.origin;for(;o!==null&&!Wv(o);)o=o.getParent();let s=$(o)?o.getFirstChild():null,c=b_(a.anchor,n),l=b_(a.focus.getFlipped(),n),u=new Set,d=[];for(let e of a.iterNodeCarets(n))if(vb(e))u.add(e.origin.getKey());else if(_b(e)){let{origin:t}=e;$(t)&&!u.has(t.getKey())||d.push(t)}let f=new Set;for(let e of d){let t=e.getParent();t===null||u.has(t.getKey())||f.add(t),ev(e)}for(let e of f)!e.canBeEmpty()&&!Wv(e)&&e.isEmpty()&&e.isAttached()&&e.remove();for(let e of a.getTextSlices()){if(!e)continue;let{origin:t}=e.caret,n=t.getTextContentSize(),a=y_(yb(t,r)),o=t.getMode();if(Math.abs(e.distance)===n&&i===`removeEmptySlices`||o===`token`&&e.distance!==0)a.remove();else if(e.distance!==0){i=`removeEmptySlices`;let t=e.removeTextSlice(),n=e.caret.origin;if(o===`segmented`){let e=t.origin,n=wh(e.getTextContent()).setStyle(e.getStyle()).setFormat(e.getFormat());a.replaceOrInsert(n),t=bb(n,r,t.offset)}n.is(c[0].origin)&&(c[0]=t),n.is(l[0].origin)&&(l[0]=t.getFlipped())}}let p,m;for(let e of c)if(x_(e)){p=S_(e);break}for(let e of l)if(x_(e)){m=S_(e);break}let h=function(e,t,n){if(!e||!t)return null;let r=e.getParentAtCaret(),i=t.getParentAtCaret();if(!r||!i)return null;let a=r.getParents().reverse();a.push(r);let o=i.getParents().reverse();o.push(i);let s=Math.min(a.length,o.length),c=0;for(;c<s&&a[c]===o[c];c++);let l=(e,t)=>{let n;for(let r=c;r<e.length;r++){let i=e[r];if(Wv(i))return;!n&&t(i)&&(n=i)}return n},u=l(a,hy),d=u&&l(o,e=>n.has(e.getKey())&&hy(e));return d&&rb(d).length>0?null:u&&d?[u,d]:null}(p,m,u);if(h){let[e,t]=h;Cb(e,`previous`).splice(0,t.getChildren());let n=t.getParent();for(t.remove(!0);n&&n.isEmpty();){let e=n;n=n.getParent(),e.remove(!0)}}else if(m){let e=function(e){if(vb(e)){let t=e.origin;if(hy(t))return t}else{let t=e.getParentAtCaret();if(t&&hy(t))return t}return null}(m),t=e&&e.getParent(),n=e&&e.getParents().findLast(Uv);if(e&&t&&!n_(t)&&e.isEmpty()&&u.has(e.getKey())&&rb(e).length===0&&(!n||u.has(n.getKey()))){e.remove(!0);let n=t;for(;n&&!n_(n)&&n.isEmpty();){let e=n.getParent();if(e&&n_(e)&&e.getChildrenSize()<=1&&n.canBeEmpty())break;let t=n;n=e,t.remove(!0)}}}fv(o,s)!==null||o===null||o.isAttached()||fv(dv(),null);let g=[p,m,...c,...l].find(x_);if(g)return Ob(Eb(S_(g),e.direction));$u(269,JSON.stringify(c.map(e=>e.origin.__key)))}function S_(e){let t=function(e){let t=e;for(;vb(t);){let e=Tb(t);if(!vb(e))break;t=e}return t}(e.getLatest()),{direction:n}=t;if(X(t.origin))return gb(t)?t:bb(t.origin,n,n);let r=t.getAdjacentCaret();return _b(r)&&X(r.origin)?bb(r.origin,n,fb(n)):t}function C_(e){return gb(e)&&e.offset!==xb(e.origin,e.direction)}function w_(e,t){return e.direction===t?e:kb(Eb(e.focus,t),Eb(e.anchor,t))}function T_(e,t,n){let r=Cb(e,`next`);for(let e=0;e<t;e++){let e=r.getAdjacentCaret();if(e===null)break;r=e}return Eb(r,n)}function E_(e,t=`root`){let n=0,r=e,i=Tb(r);for(;i===null;){if(n--,i=r.getParentCaret(t),!i)return null;r=i,i=Tb(r)}return i&&[i,n]}function ale(e){let{origin:t,offset:n,direction:r}=e;if(n===xb(t,r))return e.getSiblingCaret();if(n===xb(t,fb(r)))return y_(e.getSiblingCaret());let[i]=t.splitText(n);return X(i)||$u(281),Eb(yb(i,`next`),r)}function ole(e,t){return!0}function D_(e,{$copyElementNode:t=Gv,$splitTextPointCaretNext:n=ale,rootMode:r=`shadowRoot`,$shouldSplit:i=ole,removeEmptyDestination:a=!1}={}){if(gb(e))return n(e);let o=e.getParentCaret(r);if(o){let{origin:n}=o;if(vb(e)){let e=y_(o);if(a&&n.isEmpty())return n.remove(),e;if(!n.canBeEmpty()||!i(n,`first`))return e}let r=function(e){let t=[];for(let n=e.getAdjacentCaret();n;n=n.getAdjacentCaret())t.push(n.origin);return t}(e);(r.length>0||!a&&n.canBeEmpty()&&i(n,`last`))&&o.insert(t(n).splice(0,0,r))}return o}function O_(e,t,n){let r=Eb(t,`next`);gb(r)&&(r.offset===0?r=yb(r.origin,`previous`).getFlipped():r.offset===r.origin.getTextContentSize()&&(r=yb(r.origin,`next`))),r.origin.is(e)&&(_b(r)||$u(342,e.getKey(),e.getType()),r=y_(r)),(e.is(r.getNodeAtCaret())||e.is(r.getFlipped().getNodeAtCaret()))&&e.remove(!0);for(let e=r;e;e=D_(e,n))r=e;return gb(r)&&$u(283),r.insert(e.isInline()?j_().append(e):e),Eb(yb(e.getLatest(),`next`),t.direction)}function k_(e,t){let n=w_(Z(t)?v_(t):t,`next`),r=eb(n.anchor.origin),i=eb(e.getLatest());if(r===null?i!==null:!r.is(i))return!1;let a=S_(Cb(e,`next`)),o=Eb(S_(Cb(e,`previous`)),`next`);return jb(n.anchor,a)<=0&&jb(n.focus,o)>=0}var A_=class extends Zg{$config(){return this.config(`paragraph`,{extends:Zg,generated:Oce,importDOM:{p:()=>({conversion:sle,priority:0})}})}createDOM(e){let t=ny().createElement(`p`),n=Ev(e.theme,`paragraph`);return n!==void 0&&t.classList.add(...n),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(uy(t)){this.isEmpty()&&t.append(ny().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e)}return{element:t}}exportJSON(e=!1){let t=super.exportJSON(e);if(t.textFormat===void 0||t.textStyle===void 0){let n=this.getChildren().find(X),r=n?n.getFormat():this.getTextFormat(),i=n?n.getStyle():this.getTextStyle();e&&r===0||(t.textFormat=r),e&&i===``||(t.textStyle=i)}return t}extractWithChild(e,t,n){if(!Z(t)||this.getFormatType()===``&&this.getIndent()===0&&this.getStyle()===``)return!1;if(k_(this,t)){let e=this.getTextContent();return e!==``&&t.getTextContent()===e}return!1}insertNewAfter(e,t){let n=j_();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.getChildren().every(e=>X(e)&&!/\S/.test(e.getTextContent()))){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}};function sle(e){let t=j_();if(Ty(t,e),Cy(e,t),t.getFormatType()===``){let n=e.getAttribute(`align`);n&&n&&n in bd&&t.setFormat(n)}return wy(t,e),{node:t}}function j_(){return Kv(new A_)}function M_(e){return e instanceof A_}function cle(e){console.warn(e)}function N_(e,t,n,r,i){let a=e._keyToDOMMap;a.clear(),e._editorState=i_(),e._pendingEditorState=r,e._compositionKey=null,e._dirtyType=0,e._cloneNotNeeded.clear(),e._dirtyLeaves=new Set,e._dirtyElements.clear(),e._normalizedNodes=new Set,i&&i.preserveUpdateQueue||(e._updateTags=new Set,e._updates=[],e._cascadeCount=0),e._blockCursorElement=null,e._inputState.handledSelectionCommandTimeoutId!==null&&clearTimeout(e._inputState.handledSelectionCommandTimeoutId),e._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},compositionEndData:``,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null};let o=e._observer;o!==null&&(o.disconnect(),e._observer=null),t!==null&&(t.textContent=``,function(e,t){delete e[`__lexicalKey_${t._key}`]}(t,e)),n!==null&&(n.textContent=``,a.set(`root`,n),ov(n,e,`root`))}function lle(e){let t=new Set,n=new Set;for(let{klass:r,ownNodeConfig:i}of Wy(e)){let e=r.transform;if(!n.has(e)){n.add(e);let i=r.transform();i&&t.add(i)}if(i){let e=i.$transform;e&&t.add(e)}}return t}var P_={$createDOM:(e,t)=>e.createDOM(t._config,t),$decorateDOM:(e,t,n,r)=>{},$exportDOM:(e,t)=>{let n=H_(t,e.getType());return n&&n.exportDOM!==void 0?n.exportDOM(t,e):e.exportDOM(t)},$extractWithChild:(e,t,n,r,i)=>$(e)&&e.extractWithChild(t,n,r),$getDOMSlot:(e,t,n)=>e.getDOMSlot(t),$getSlotTargetElement:(e,t,n,r)=>null,$shouldExclude:(e,t,n)=>$(e)&&e.excludeFromCopy(`html`),$shouldInclude:(e,t,n)=>!t||e.isSelected(t),$updateDOM:(e,t,n,r)=>e.updateDOM(t,n,r._config)};function F_(e){let t=e||{},n=Lg(),r=t.theme||{},i=e===void 0?n:t.parentEditor||null,a=t.disableEvents||!1,o=i_(),s=t.namespace||(i===null?vv():i._config.namespace),c=t.editorState,l=[t_,bh,c_,Eh,A_,s_,...t.nodes||[]],{onError:u,onWarn:d,html:f}=t,p=t.editable===void 0||t.editable,m;if(e===void 0&&n!==null)m=n._nodes;else{m=new Map;for(let e=0;e<l.length;e++){let n=l[e],r=null,i=null;if(n&&typeof n==`object`){let e=n;n=e.replace,r=e.with,i=e.withKlass||null}if(typeof n!=`function`||!n.prototype||!(n===sh||n.prototype instanceof sh)){let r=`<unknown>`;try{r=JSON.parse(Pd)}catch{}$u(365,String(e-l.length+(t.nodes?t.nodes.length:0)),typeof n==`function`?`${n.name}${typeof n.getType==`function`?` (type ${String(n.getType())})`:``}`:String(n),String(r))}Hy(n);let a=n.getType(),o=lle(n);m.set(a,{exportDOM:f&&f.export?f.export.get(n):void 0,klass:n,replace:r,replaceWithKlass:i,sharedNodeState:Xse(l[e]),transforms:o})}}let h=new L_(o,i,m,{disableEvents:a,dom:{...P_,...e&&e.dom},namespace:s,theme:r},u||console.error,d||cle,function(e,t){let n=new Map,r=new Set,i=e=>{Object.keys(e).forEach(t=>{let r=n.get(t);r===void 0&&(r=[],n.set(t,r)),r.push(e[t])})};return e.forEach(e=>{let t=e.klass.importDOM;if(t==null||r.has(t))return;r.add(t);let n=t.call(e.klass);n!==null&&i(n)}),t&&i(t),n}(m,f?f.import:void 0),p,e);return c!==void 0&&(h._pendingEditorState=c,h._dirtyType=2),function(e){e.registerCommand(Ip,hce,0),e.registerCommand(Lp,_ce,0),e.registerCommand(Rp,yce,0),e.registerCommand(zp,bce,0),e.registerCommand(Zp,Cce,0)}(h),h}function ule(e,t){let n=e.get(t);e.delete(t),n&&n()}function I_(e,t,n){return e.set(t,n),ule.bind(null,e,t)}var L_=class{static version=Pd;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_cascadeCount;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_onWarn;_htmlConversions;_window;_editable;_blockCursorElement;_slotsUsed;_keyDownShortcuts;_inputState;_lastNotifiedSelection;_createEditorArgs;constructor(e,t,n,r,i,a,o,s,c){this._createEditorArgs=c,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Rd,this._updates=[],this._updating=!1,this._cascadeCount=0,this._listeners={decorator:new Map,editable:new Map,mutation:new Map,root:new Map,textcontent:new Map,update:new Map},this._commands=new Map,this._config=r,this._nodes=n,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Map,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=vv(),this._onError=i,this._onWarn=a,this._htmlConversions=o,this._editable=s,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null,this._slotsUsed=!1,this._keyDownShortcuts=null,this._inputState={collapsedSelectionFormat:{format:0,key:`root`,offset:0,style:``,timeStamp:0},compositionEndData:``,compositionPhase:`idle`,hadOrphanedCompositionEvents:!1,handledSelectionCommandTimeoutId:null,isInsertLineBreak:!1,isInsertTextAfterHandledSelectionCommand:!1,isSelectionChangeFromDOMUpdate:!1,isSelectionChangeFromMouseDown:!1,isShiftKeyDown:!1,lastBeforeInputInsertTextTimeStamp:0,lastKeyCode:null,lastKeyDownTimeStamp:0,postDeleteSelectionToRestore:null,selectionChangeFromDOMUpdatePoints:null,unprocessedBeforeInputData:null},this._lastNotifiedSelection=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){return I_(this._listeners.update,e)}registerEditableListener(e){return I_(this._listeners.editable,e)}registerDecoratorListener(e){return I_(this._listeners.decorator,e)}registerTextContentListener(e){return I_(this._listeners.textcontent,e)}registerRootListener(e){let t=this._listeners.root;return Bb(I_(t,e,e(this._rootElement,null)||void 0),()=>function(e,t,n){let r=e.get(t);r&&r(),e.set(t,t(...n)||void 0)}(t,e,[null,this._rootElement]))}registerCommand(e,t,n){n===void 0&&$u(35);let r=this._commands;r.has(e)||r.set(e,[new Fd,new Fd,new Fd,new Fd,new Fd]);let i=r.get(e);i===void 0&&$u(36,String(e));let a=function(e){return 7&e}(n),o=i[a];return a===n?o.addBack(t):o.addFront(t),()=>{o.delete(t),i.every(e=>e.size===0)&&r.delete(e)}}registerMutationListener(e,t,n){let r=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,i=this._listeners.mutation,a=i.get(t);a===void 0&&(a=new Set,i.set(t,a)),a.add(r);let o=n&&n.skipInitialization;return o!==void 0&&o||this.initializeMutationListener(t,r),()=>{a.delete(r),a.size===0&&i.delete(t)}}getRegisteredNode(e){let t=this._nodes.get(e.getType());return t===void 0&&$u(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){let n=this._editorState,r=xy(n).get(t.getType());if(!r)return;let i=new Map;for(let e of r.keys())i.set(e,`created`);i.size>0&&e(i,{dirtyLeaves:new Set,prevEditorState:n,updateTags:new Set([`registerMutationListener`])})}registerNodeTransformToKlass(e,t){let n=this.getRegisteredNode(e);return n.transforms.add(t),n}registerNodeTransform(e,t){let n=this.registerNodeTransformToKlass(e,t),r=[n],i=n.replaceWithKlass;if(i!=null){let e=this.registerNodeTransformToKlass(i,t);r.push(e)}return function(e,t){let n=xy(e.getEditorState()),r=[];for(let e of t){let t=n.get(e);t&&r.push(t)}r.length!==0&&e.update(()=>{for(let e of r)for(let t of e.keys()){let e=iv(t);e&&e.markDirty()}},e._pendingEditorState===null?{tag:`history-merge`}:void 0)}(this,r.map(e=>e.klass.getType())),()=>{r.forEach(e=>e.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,...t){return Av(this,e,...t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){let t=this._rootElement;if(e!==t){let n=Ev(this._config.theme,`root`),r=this._pendingEditorState||this._editorState;if(this._rootElement=e,N_(this,t,e,r,{preserveUpdateQueue:!0}),t!==null&&(this._config.disableEvents||function(e){let t=jm.get(e);if(t===void 0)return void th();let n=Mm.get(t);if(n===void 0)return void th();jm.delete(e);let r=q_(e);G_(r)?(function(e){if(e._parentEditor!==null){let t=_v(e),n=t[t.length-1]._key;Zm.get(n)===e&&Zm.delete(n)}else Zm.delete(e._key)}(r),n.editors.delete(r),n.hasShadowEditor=void 0,e.__lexicalEditor=null):r&&$u(198);let i=Xm(e);for(let e=0;e<i.length;e++)i[e]();e.__lexicalEventHandles=[]}(t),n!=null&&t.classList.remove(...n)),e!==null){let t=zv(e),r=e.style;r.userSelect=`text`,r.whiteSpace=`pre-wrap`,r.wordBreak=`break-word`,e.setAttribute(`data-lexical-editor`,`true`),this._window=t,this._dirtyType=2,qd(this),this._updateTags.add(`history-merge`),Ug(this),this._config.disableEvents||function(e,t){let n=e.ownerDocument;jm.set(e,n);let r=Mm.get(n);r===void 0&&(r={editors:new Set,hasShadowEditor:void 0},Mm.set(n,r)),r.editors.add(t),r.hasShadowEditor=void 0,e.__lexicalEditor=t;let i=Xm(e);i.push(fce.register(n));let a=function(){if(Am!==void 0)return Am;let e=[[`keydown`,Sce],[`pointerdown`,mce],[`compositionstart`,vce],[`compositionend`,xce],[`input`,gce],[`click`,pce],[`cut`,km],[`copy`,km],[`dragstart`,km],[`dragover`,km],[`dragend`,km],[`paste`,km],[`focus`,km],[`blur`,km],[`drop`,km]];return ad&&e.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||id&&kv(t)||n!==`insertCompositionText`&&Xg(t,()=>{Hm(e,t)||Av(t,Ip,e)},{event:e})}(e,t)]),od&&e.push([`keyup`,(e,t)=>function(e,t){e.shiftKey&&e.key!==`CapsLock`||(t._inputState.isShiftKeyDown=!1)}(e,t)]),Am=e,e}();for(let n=0;n<a.length;n++){let[r,o]=a[n],s=typeof o==`function`?e=>{eh(e)||($m(e),(t.isEditable()||r===`click`)&&o(e,t))}:e=>{if(eh(e))return;$m(e);let n=t.isEditable();switch(r){case`cut`:return n&&Av(t,vm,e);case`copy`:return Av(t,_m,e);case`paste`:return n&&Av(t,Wp,e);case`dragstart`:return n&&Av(t,hm,e);case`dragover`:return n&&Av(t,gm,e);case`dragend`:return n&&Av(t,ice,e);case`focus`:return n&&Av(t,Sm,e);case`blur`:return t._inputState.isShiftKeyDown=!1,t._inputState.isInsertLineBreak=!1,n&&Av(t,sce,e);case`drop`:return n&&Av(t,pm,e)}};i.push(Om(e,r,s))}}(e,this),n!=null&&e.classList.add(...n)}else this._window=null,this._updateTags.add(`history-merge`),Ug(this);Wg(`root`,this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){let n=e.isEmpty(),r=e;r._readOnly&&(r=r_(e),r._selection=e._selection?e._selection.clone():null),Kd(this);let i=this._pendingEditorState,a=t===void 0?null:t.tag;i===null||i.isEmpty()||(a!=null&&this._updateTags.add(a),Ug(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set(`root`,!1),this._compositionKey=null,this._slotsUsed=this._slotsUsed||e._slotsUsed,Xg(this,()=>{if(a&&this._updateTags.add(a),n&&(ed(38),dv().append(j_())),e._parsed)for(let[e,t]of r._nodeMap.entries())$(t)?this._dirtyElements.set(e,!0):this._dirtyLeaves.add(e)},{discrete:!this._updating||void 0})}parseEditorState(e,t){return function(e,t,n){let r=i_(),i=xg,a=Cg,o=Sg,s=t._dirtyElements,c=t._dirtyLeaves,l=t._cloneNotNeeded,u=t._dirtyType;t._dirtyElements=new Map,t._dirtyLeaves=new Set,t._cloneNotNeeded=new Map,t._dirtyType=0,xg=r,Cg=!1,Sg=t,z_(null);try{let i=t._nodes;Vg(e.root,i),n&&n(),r._readOnly=!0,r._parsed=!0}catch(e){e instanceof Error&&t._onError(e)}finally{t._dirtyElements=s,t._dirtyLeaves=c,t._cloneNotNeeded=l,t._dirtyType=u,xg=i,Cg=a,Sg=o}return r}(typeof e==`string`?JSON.parse(e):e,this,t)}read(...e){let[t,n]=e.length===1?[`force-commit`,e[0]]:e;return t===`force-commit`&&Ug(this),(t===`pending`?this._pendingEditorState||this._editorState:this.getEditorState()).read(n,{editor:this})}update(e,t){(function(e,t,n){e._updating?e._updates.push([t,n]):Yg(e,t,n)})(this,e,t)}focus(e,t={}){let n=this._rootElement;n!==null&&(n.setAttribute(`autocapitalize`,`off`),Xg(this,()=>{let r=Q(),i=dv();r===null?i.getChildrenSize()!==0&&(t.defaultSelection===`rootStart`?i.selectStart():i.selectEnd()):r.dirty||pv(r.clone()),Iv(`focus`),Lv(()=>{n.removeAttribute(`autocapitalize`),e&&e()})}),this._pendingEditorState===null&&n.removeAttribute(`autocapitalize`))}blur(){let e=this._rootElement;e!==null&&e.blur();let t=Zv(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,Wg(`editable`,this,!0,e),this._slotsUsed&&this.update(()=>Fg()))}toJSON(){return{editorState:this._editorState.toJSON(Bse())}}},R_=null;function z_(e){R_=e}var B_=Symbol(`INTERNAL_SKIP_AFTER_CLONE_FROM`),dle=1;function V_(e,t){let n=H_(e,t);return n===void 0&&$u(30,t),n}function H_(e,t){return e._nodes.get(t)}var fle=typeof queueMicrotask==`function`?queueMicrotask:e=>{Promise.resolve().then(e)};function U_(e,t){let n=t===void 0?(()=>{let t=e.getRootNode();return Z_(t)||Qv(t)?sy(t):null})():t;if(!uy(n)||n.hasAttribute(`data-lexical-slot`))return!1;let r=cv(n),i=n.nodeName;return ch(r)&&(i===`INPUT`||i===`TEXTAREA`||n.contentEditable===`true`&&q_(n)==null)}function W_(e,t,n){let r=e.getRootElement();if(!r)return!1;try{if(!t||!r.contains(t)||!r.contains(n))return!1}catch{return!1}return K_(t)===e&&e.read(`latest`,()=>!U_(t))}function G_(e){return e instanceof L_}function K_(e){let t=e;for(;t!=null;){let e=q_(t);if(G_(e))return e;t=Mv(t)}return null}function q_(e){return e?e.__lexicalEditor:null}function ple(e){return Pse.test(e)?`rtl`:Fse.test(e)?`ltr`:null}function J_(e){return Oh(e)||e.isToken()}function Y_(e){return J_(e)||e.isSegmented()}function X_(e){return dy(e)&&e.nodeType===3}function Z_(e){return dy(e)&&e.nodeType===9}function mle(e){let t=e;for(;t!=null;){if(X_(t))return t;t=t.firstChild}return null}function Q_(e,t,n){let r=vd[t];if(n!==null&&(e&r)===(n&r))return e;let i=e^r;return t===`subscript`?i&=~vd.superscript:t===`superscript`?i&=~vd.subscript:t===`lowercase`?(i&=~vd.uppercase,i&=~vd.capitalize):t===`uppercase`?(i&=~vd.lowercase,i&=~vd.capitalize):t===`capitalize`&&(i&=~vd.lowercase,i&=~vd.uppercase),i}function hle(e){return X(e)||u_(e)||e_(e)}function $_(e,t){let n=function(){let e=R_;return R_=null,e}();if((t||=n&&n.__key)!=null)return void(e.__key=t);jg(),Mg();let r=Pg(),i=Ng(),a=``+dle++;i._nodeMap.set(a,e),$(e)?r._dirtyElements.set(a,!0):r._dirtyLeaves.add(a),r._cloneNotNeeded.set(a,e),r._dirtyType===0&&(r._dirtyType=1),e.__key=a}function ev(e){Qy(e)!==null&&$u(380,e.__key,String(Qy(e)));let t=e.getParent();if(t!==null){let n=e.getWritable(),r=t.getWritable(),i=e.getPreviousSibling(),a=e.getNextSibling(),o=a===null?null:a.__key,s=i===null?null:i.__key,c=i===null?null:i.getWritable(),l=a===null?null:a.getWritable();i===null&&(r.__first=o),a===null&&(r.__last=s),c!==null&&(c.__next=o),l!==null&&(l.__prev=s),n.__prev=null,n.__next=null,n.__parent=null,r.__size--}}function tv(e){Mg(),ah(e)&&$u(323,e.__key,e.__type);let t=e.__parent===null?Zy(e)?e.__slotHost:null:e.__parent,n=Ng(),r=Pg(),i=n._nodeMap,a=r._dirtyElements;t!==null&&function(e,t,n){let r=e;for(;r!==null;){if(n.has(r))return;let e=t.get(r);if(e===void 0)break;n.set(r,!1),r=e.__parent===null?Zy(e)?e.__slotHost:null:e.__parent}}(t,i,a);let o=e.__key;r._dirtyType===0&&(r._dirtyType=1),$(e)?a.set(o,!0):r._dirtyLeaves.add(o)}function nv(e){jg();let t=Pg(),n=t._compositionKey;if(e!==n){if(t._compositionKey=e,n!==null){let e=iv(n);e!==null&&e.getWritable()}if(e!==null){let t=iv(e);t!==null&&t.getWritable()}}}function rv(){return Ag()?null:Pg()._compositionKey}function iv(e,t){let n=(t||Ng())._nodeMap.get(e);return n===void 0?null:n}function av(e,t){let n=sv(e,Pg());return n===void 0?null:iv(n,t)}function ov(e,t,n){e[`__lexicalKey_${t._key}`]=n}function sv(e,t){return e[`__lexicalKey_${t._key}`]}function cv(e,t){let n=e;for(;n!=null;){let e=av(n,t);if(e!==null)return e;n=Mv(n)}return null}function lv(e){let t=e._decorators,n=Object.assign({},t);return e._pendingDecorators=n,n}function uv(e){return e.read(()=>dv().getTextContent())}function dv(){return Ng()._nodeMap.get(`root`)}function fv(e,t){if(!(Wv(e)&&e.isAttached()&&(n_(e)?e.getChildrenSize()===0:e.isEmpty())&&(n_(e)||t!==null&&hy(t))))return null;let n=j_();return e.append(n),n}function pv(e){jg();let t=Ng();e!==null&&(e.dirty=!0,e.setCachedNodes(null),Z(e)&&Pg()._slotsUsed&&Qh(e)),t._selection=e}function mv(){jg(),Kd(Pg())}function hv(e){let t=function(e,t){let n=e;for(;n!=null;){let e=sv(n,t);if(e!==void 0)return e;n=Mv(n)}return null}(e,Pg());return t===null?null:iv(t)}function gv(e){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(e)}function _v(e){let t=[];for(let n=e;n!==null;n=n._parentEditor)t.push(n);return t}function vv(){return Math.random().toString(36).replace(/[^a-z]+/g,``).substring(0,5)}function yv(e){return X_(e)?e.nodeValue:null}function bv(e,t,n){let r=Zv(Bv(t));if(r===null)return;let i=ay(r,t._rootElement),a=i.anchorNode,{anchorOffset:o,focusOffset:s}=i;if(a!==null){let t=yv(a),r=cv(a);if(t!==null&&X(r)){if((t===fd||t===md)&&n){let e=n.length;t=n,o=e,s=e}t!==null&&xv(r,t,o,s,e)}}}function xv(e,t,n,r,i){let a=e;if(a.isAttached()&&(i||!a.isDirty())){let o=a.isComposing();if(a.isToken()&&o)return;let s=t;if((o||i)&&(t.endsWith(fd)&&(s=t.slice(0,-fd.length)),i)){let e=md,t;for(;(t=s.indexOf(e))!==-1;)s=s.slice(0,t)+s.slice(t+e.length),n!==null&&n>t&&(n=Math.max(t,n-e.length)),r!==null&&r>t&&(r=Math.max(t,r-e.length))}let c=a.getTextContent();if(i||s!==c){let t=Q();if(s===``){if(nv(null),cd||od||dd)a.remove();else{let e=Pg();Sv(a,``,t),setTimeout(()=>{e.update(()=>{a.isAttached()&&a.getTextContent()===``&&a.remove()})},20)}return}let i=a.getParent(),c=ag(),l=a.getTextContentSize(),u=rv(),d=a.getKey();if(a.isToken()&&!o||u!==null&&d===u&&!o||Z(c)&&(i!==null&&!i.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===e.__key&&c.anchor.offset===0&&!a.canInsertTextBefore()&&!o||c.focus.key===e.__key&&c.focus.offset===l&&!a.canInsertTextAfter()&&!o))return void a.markDirty();if(!Z(t)||n===null||r===null)return void Sv(a,s,t);if(t.setTextNodeRange(a,n,a,r),a.isSegmented()){let e=wh(a.getTextContent());a.replace(e),a=e}Sv(a,s,t)}}}function Sv(e,t,n){if(e.setTextContent(t),Z(n)){let t=e.getKey(),r=!1;for(let i of[`anchor`,`focus`]){let a=n[i];a.type===`text`&&a.key===t&&(a.offset=xb(e,a.offset,`clamp`),r=!0)}r&&(n._cachedNodes=null,n._cachedIsBackward=null)}}function Cv(e){let t=e;for(;t!==null;){let e=t.getParent();if(e===null)return null;if(n_(e))return t;t=e}return null}function wv(e,t){let{anchor:n,focus:r}=e,i=n.key,a=n.offset,o=n.type,s=r.key,c=r.offset,l=r.type;if(Ff(e),!n_(t))return e;let u=Cv(n.getNode());return $(u)&&u.isShadowRoot()&&u.is(Cv(r.getNode()))&&(n.set(i,a,o),r.set(s,c,l)),e}function gle(e){let t=dv();if(Z(e)){let t=e.anchor,n=e.focus,r=t.getNode();if(n_(r))return t.set(r.getKey(),0,`element`),n.set(r.getKey(),r.getChildrenSize(),`element`),wv(e,r),e;let i=r.getTopLevelElementOrThrow(),a=i.getParent();return a===null?($(i)&&(t.set(i.getKey(),0,`element`),n.set(i.getKey(),i.getChildrenSize(),`element`),wv(e,i)),e):(t.set(a.getKey(),0,`element`),n.set(a.getKey(),a.getChildrenSize(),`element`),wv(e,a),e)}{let e=t.select(0,t.getChildrenSize());return pv(wv(e,t)),e}}function Tv(e,t){e.getAttribute(t)===``&&e.removeAttribute(t)}function Ev(e,t){e.__lexicalClassNameCache===void 0&&(e.__lexicalClassNameCache={});let n=e.__lexicalClassNameCache,r=n[t];if(r!==void 0)return r;let i=e[t];if(typeof i==`string`){let e=Lb(i);return n[t]=e,e}return i}function Dv(e,t,n,r,i){if(n.size===0)return;let a=r.__type,o=r.__key,s=t.get(a);s===void 0&&$u(33,a);let c=s.klass,l=e.get(c);l===void 0&&(l=new Map,e.set(c,l));let u=l.get(o),d=u===`destroyed`&&i===`created`;(u===void 0||d)&&l.set(o,d?`updated`:i)}function Ov(e,t,n){let r=e.getParent(),i=n,a=e;return r!==null&&(t&&n===0?(i=a.getIndexWithinParent(),a=r):t||n!==a.getChildrenSize()||(i=a.getIndexWithinParent()+1,a=r)),a.getChildAtIndex(t?i-1:i)}function _le(e,t){let n=e.offset;if(e.type===`element`)return Ov(e.getNode(),t,n);{let r=e.getNode();if(t&&n===0||!t&&n===r.getTextContentSize()){let e=t?r.getPreviousSibling():r.getNextSibling();return e===null?Ov(r.getParentOrThrow(),t,r.getIndexWithinParent()+ +!t):e}}return null}function kv(e){let t=Bv(e).event,n=t&&t.inputType;return n===`insertFromPaste`||n===`insertFromPasteAsQuotation`}function Av(e,t,...n){return Kg(e,t,n[0],e)}function jv(e,t){let n=e._keyToDOMMap.get(t);return n===void 0&&$u(75,t),n}function Mv(e){let t=e.assignedSlot||e.parentElement;if(t!==null)return t;let n=e.parentNode;return Qv(n)?n.host:null}function Nv(e){return Z_(e)?e:uy(e)?e.ownerDocument:null}function Pv(e,t){let n=parseFloat(e);return isFinite(n)?e.endsWith(`%`)?n*t/100:n:0}function vle(e,t,n,r){let i=t.clientWidth,a=t.scrollWidth-i;if(a<=0)return 0;let o=e.getComputedStyle(t);if(o.overflowX!==`auto`&&o.overflowX!==`scroll`)return 0;let s=t.getBoundingClientRect(),c=t.offsetWidth,l=c>0&&Math.abs(s.width-c)>1?s.width/c:1,u=o.direction===`rtl`,d=s.left+t.clientLeft*l,f=d+Pv(o.scrollPaddingLeft,i)*l,p=d+(i-Pv(o.scrollPaddingRight,i))*l,m=n,h=Math.max(r,n+1);h-m>p-f&&(u?m=h-1:h=m+1);let g=0;if(m<f?g=m-f:h>p&&(g=h-p),g===0)return 0;let _=t.scrollLeft,v=_+g/l,y=g>0?Math.ceil(v):Math.floor(v),b=u?Math.min(0,Math.max(-a,y)):Math.max(0,Math.min(a,y)),x=_*l;return Math.abs(b)<Math.abs(_)&&m+x>=f&&h+x<=p&&(b=0),b===_?0:(t.scrollLeft=b,(t.scrollLeft-_)*l)}function Fv(e){return Pg()._updateTags.has(e)}function Iv(e){jg(),Pg()._updateTags.add(e)}function Lv(e){jg(),Pg()._deferred.push(e)}function Rv(e,t){let n=e.getParent();for(;n!==null;){if(n.is(t))return!0;n=n.getParent()}return!1}function zv(e){let t=Nv(e);return t?t.defaultView:null}function Bv(e){let t=e._window;return t===null&&$u(78),t}function Vv(e){return $(e)&&e.isInline()||e_(e)&&e.isInline()}function Hv(e){let t=e.getLatest();for(;t!==null;){if(Qy(t)!==null&&$(t))return t;let e=t.getParentOrThrow();if(Wv(e))return e;t=e}return t}function Uv(e){return $(e)&&e.isShadowRoot()}function Wv(e){return n_(e)||Uv(e)}function Gv(e,t=!1){let n=e.constructor.clone(e,B_);return $_(n,null),n.afterCloneFrom(e),t||n.resetOnCopyNodeFrom(e),n}function Kv(e){let t=Pg(),n=e.getType(),r=H_(t,n);r===void 0&&$u(200,e.constructor.name,n);let{replace:i,replaceWithKlass:a}=r;if(i!==null){let t=i(e),r=t.constructor;return a===null?t instanceof e.constructor&&r!==e.constructor||$u(202,r.name,r.getType(),e.constructor.name,n):t instanceof a||$u(201,a.name,a.getType(),r.name,r.getType(),e.constructor.name,n),t.__key===e.__key&&$u(203,e.constructor.name,n,r.name,r.getType()),t}return e}function qv(e,t){!n_(e.getParent())||$(t)||e_(t)||$u(99)}function Jv(e){let t=iv(e);return t===null&&$u(63,e),t}function Yv(e){if(!e||e.isInline())return!1;if(e_(e))return!0;if($(e)){if(e.isShadowRoot()){let t=e.getParent();return!($(t)&&t.isShadowRoot())}return!e.canBeEmpty()}return!1}function Xv(e,t,n){n.style.removeProperty(`caret-color`),t._blockCursorElement=null;let r=e.parentElement;r!==null&&r.removeChild(e)}function Zv(e){return td?(e||window).getSelection():null}function yle(e){let t=zv(e);return t?t.getSelection():null}function Qv(e){return fy(e)&&`host`in e}var ble=[];function $v(e){let t=e.getRootNode();if(t===e||!Qv(t))return ble;let n=[t],r=t.host;for(;;){let e=r.getRootNode();if(e===r||!Qv(e))break;n.push(e),r=e.host}return n}function*ey(e){let t=[e],n;for(;n=t.pop();){yield*n.querySelectorAll(`[data-lexical-editor="true"]`);let e=(Z_(n)?n:n.ownerDocument).createTreeWalker(n,NodeFilter.SHOW_ELEMENT),r;for(;r=e.nextNode();)r.shadowRoot&&t.push(r.shadowRoot)}}function ty(e){return e===null?document:e.ownerDocument}function ny(){let e=Lg();return ty(e===null?null:e._rootElement)}function ry(e,t){if(t===null||typeof e.getComposedRanges!=`function`)return null;let n=$v(t);if(n.length===0)return null;let r=e.getComposedRanges;try{let t=r.call(e,{shadowRoots:n})[0];if(t!==void 0)return t}catch{}try{let t=r.apply(e,n)[0];if(t!==void 0)return t}catch{}return null}function iy(e,t){let n=ry(e,t);if(n!==null){let e=xle(n);if(e!==null)return e}return e.rangeCount>0?e.getRangeAt(0):null}function ay(e,t){let n=ry(e,t);return n===null?e:Sle(n,Cle(e))}function xle(e){let t=e.startContainer.ownerDocument;if(t===null)return null;let n=t.createRange();try{return n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),n}catch{return null}}function Sle(e,t){let{startContainer:n,startOffset:r,endContainer:i,endOffset:a}=e;return t===`backward`?{anchorNode:i,anchorOffset:a,direction:t,focusNode:n,focusOffset:r}:{anchorNode:n,anchorOffset:r,direction:t,focusNode:i,focusOffset:a}}function Cle(e){return e.direction}function oy(e){let t=e.getRootNode();return Z_(t)||Qv(t)?t.activeElement:null}function sy(e){let t=e.activeElement;for(;t!==null&&t.shadowRoot!==null;){let e=t.shadowRoot.activeElement;if(e===null)break;t=e}return t}function cy(e){let t=e.target;if(t!==null&&uy(t)&&t.shadowRoot!==null&&typeof e.composedPath==`function`){let t=e.composedPath();if(t.length>0)return t[0]}return t}function ly(e){return uy(e)&&e.tagName===`A`}function wle(e){return uy(e)&&e.tagName===`TR`}function uy(e){return dy(e)&&e.nodeType===1}function dy(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function fy(e){return dy(e)&&e.nodeType===11}var Tle=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/i;function py(e){return!(!uy(e)||!e.style.display.startsWith(`inline`))||Tle.test(e.nodeName)}var Ele=/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/i;function my(e){return(!uy(e)||!e.style.display.startsWith(`inline`))&&Ele.test(e.nodeName)}function hy(e){if(e_(e)&&!e.isInline())return!0;if(!$(e)||Wv(e))return!1;let t=e.getFirstChild(),n=t===null||u_(t)||X(t)||t.isInline();return!e.isInline()&&!1!==e.canBeEmpty()&&n}function gy(){return Pg()}function _y(e=gy()){return e._config.dom||P_}function vy(e,t,n=gy()){let r=_y(n).$getDOMSlot(e,t,n);return $(e)&&(Dle(r)||$u(344,e.getKey(),e.getType())),r}function Dle(e){return e instanceof Md}function yy(e,t,n=gy()){return mle(vy(e,t,n).element)}var by=new WeakMap,Ole=new Map;function xy(e){if(!e._readOnly&&e.isEmpty())return Ole;e._readOnly||$u(192);let t=by.get(e);return t||(t=function(e){let t=new Map;for(let[n,r]of e._nodeMap){let e=r.__type,i=t.get(e);i||(i=new Map,t.set(e,i)),i.set(n,r)}return t}(e),by.set(e,t)),t}function Sy(e){let t=e.constructor.clone(e,B_);return t.afterCloneFrom(e),t}function kle(e){return(t=Sy(e))[ih]=!0,t;var t}function Cy(e,t){let n=e.getAttribute(`data-lexical-indent`);if(n!==null){let e=parseInt(n,10);if(Number.isFinite(e)&&e>=0)return void t.setIndent(e)}let r=parseInt(e.style.paddingInlineStart,10)||0,i=Math.round(r/40);t.setIndent(i)}function wy(e,t){let n=t.getAttribute(`dir`);return n===`ltr`||n===`rtl`?e.setDirection(n):e}function Ty(e,t){let n=t.style.textAlign;return n&&n in bd?e.setFormat(n):e}function Ey(e,t){e.__lexicalUnmanaged=!0,t&&t.captureSelection!==void 0&&(e.__lexicalCapturedSelection=t.captureSelection)}function Dy(e){return!0===e.__lexicalUnmanaged}function Ale(e,t=gy()){let n=t.isEditable();e.contentEditable=n?`true`:`false`,n?e.__lexicalEditor=t:delete e.__lexicalEditor}function Oy(e,t){let n=e;for(;n!=null;){if(!0===n.__lexicalCapturedSelection)return!0;if(uy(n)&&n.hasAttribute(`data-lexical-slot`)||sv(n,t)!==void 0)return!1;n=Mv(n)}return!1}function ky(e,t){return uf(e,t)&&e[t]!==sh[t]}var Ay=new WeakMap;function jy(e){let t=Ay.get(e);return t===void 0?function(e){let t=e.prototype!=null&&Td in e.prototype?e.prototype[Td]():void 0,n=function(e){if(!(e===sh||e.prototype instanceof sh)){let t=`<unknown>`,n=`<unknown>`;try{t=e.getType()}catch{}try{L_.version&&(n=JSON.parse(L_.version))}catch{}$u(290,e.name,t,n)}return e===$g||e===Zg||e===sh}(e),r=!n&&ky(e,`getType`)?e.getType:void 0,i=r&&!(Ny in r)?r.call(e):void 0,a,o=i;if(t){if(i)a=t[i];else{for(let[e,n]of Object.entries(t))o=e,a=n;if(!a)for(let e of Object.getOwnPropertySymbols(t)){let n=t[e];if(n){a=n;break}}}}let s={compiled:void 0,composed:void 0,config:{declaresOwnConfig:uf(e.prototype,Td),klass:e,ownNodeConfig:a,ownNodeType:o},ownFieldsValidated:!1};Ay.set(e,s);try{let t=function(e){let t=e.prototype,n=new Map,{fieldsBaseFirst:r}=Ry(e);for(let[i,a]of r){let r=Fle(e,i,a);if(r===null)continue;if(Xd(r)){let t=r.field;if(t===`__proto__`&&$u(430,e.name,i),r.setterTable!==void 0){let{setterTable:t}=r,{meta:n}=a;for(let r of n.kind===`enum`?n.values:[a.defaultValue])uf(t,String(r))||$u(431,e.name,i,JSON.stringify(r))}n.set(i,{field:t,key:i,kind:`ownField`,schema:a,setterTable:r.setterTable});continue}let o=t[r];typeof o!=`function`&&$u(432,e.name,i,r),n.set(i,{key:i,kind:`field`,schema:a,setter:o})}return n.size===0?jle:[...n.values()]}(e),r=function(e){let t=e.prototype,n=new Map;for(let[r,i]of Ry(e).fieldsDerivedFirst){let a=Ple(e,r,i);if(a===null)continue;if(Xd(a)){let o=a.field;o===`__proto__`&&$u(426,e.name,r);let s=a.when,c;if(s!==void 0){let n=t[s];typeof n!=`function`&&$u(427,e.name,r,s),c=n}n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,field:o,getterTable:a.getterTable,isEqual:i.isEqual,key:r,kind:`ownField`,schema:i,when:c});continue}let o=t[a];typeof o!=`function`&&$u(428,e.name,r,a),n.set(r,{defaultValue:i.defaultValue,derived:i.setter===null,getter:o,isEqual:i.isEqual,key:r,kind:`method`,schema:i})}return n.size===0?Nle:[...n.values()]}(e),i=Ry(e),c=function(e,t,n){let r,i=e;for(let{klass:t,ownNodeConfig:n}of Wy(e))n&&n.generated!==void 0&&(r===void 0?(r=n.generated,i=t):n.generated===r&&(i=t));return r===void 0?null:i===e||function(e,t){if(e.getters.length!==t.getters.length||e.setters.length!==t.setters.length)return!1;for(let n=0;n<e.getters.length;n++){let r=e.getters[n],i=t.getters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.derived!==i.derived||r.isEqual!==i.isEqual||!Object.is(r.defaultValue,i.defaultValue)||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.getterTable===void 0!=(i.getterTable===void 0)))return!1}for(let n=0;n<e.setters.length;n++){let r=e.setters[n],i=t.setters[n];if(r.kind!==i.kind||r.key!==i.key||r.schema!==i.schema||r.kind===`ownField`&&i.kind===`ownField`&&(r.field!==i.field||r.setterTable===void 0!=(i.setterTable===void 0)))return!1}return!0}(n,My(jy(i)))?r:null}(e,0,{getters:r,setters:t});s.compiled={flatStates:i.flatStates,generated:c===null?null:c(i.fields),getters:r,isCompactDefault:Ile(r),setters:t},function(e,t,n,r){if(!t&&n){if(!ky(e,`getType`)){let t=e,r=function(){return this===t?n:sh.getType.call(this)};r[Ny]=!0,e.getType=r}if(ky(e,`clone`)||(e.clone=(t,n)=>{z_(t);let r=new e;return n!==B_&&r.afterCloneFrom(t),r}),ky(e,`importJSON`)||(e.importJSON=r&&r.$importJSON||function(e){return t=>{let n=Gy(e);return n.updateFromJSON===sh.prototype.updateFromJSON?function(e,t){return Vy(e.__state||t.$!==void 0?Df(e,t):e,t)}(n,t):n.updateFromJSON(t)}}(e)),!ky(e,`importDOM`)&&r){let{importDOM:t}=r;t&&(e.importDOM=()=>t)}}}(e,n,o,a),function(e){for(let{klass:t,ownNodeConfig:n}of Wy(e)){let e=t.prototype;if(uf(e,`afterCloneFrom`))continue;let r=Ble(t);if(r.length===0)continue;let i=Object.getPrototypeOf(e),a=n&&n.generated!==void 0?My(jy(t)).generated:null,o=a!==null&&a.afterCloneFrom||((e,t)=>{let n=e,i=t;for(let e=0;e<r.length;e++){let t=r[e];n[t]=i[t]}});e.afterCloneFrom=function(e){i.afterCloneFrom.call(this,e),o(this,e)},e.afterCloneFrom[zle]=!0}}(e)}catch(t){throw Ay.delete(e),t}return s}(e):t}function My(e){let{compiled:t}=e;return t===void 0&&$u(422,e.config.klass.name),t}var Ny=Symbol(`lexical.synthesizedGetType`),jle=[];function Py(e,t,n,r){let i=n.method===void 0?r:n.method,a=Ry(e).declaredBy.get(t);if(a===void 0)return n;let o=e.prototype,s=a.prototype;return Fy(o,s,i)&&Fy(o,s,r)?n:i}function Fy(e,t,n){return e[n]===t[n]}function Iy(e){return`set${e.charAt(0).toUpperCase()}${e.slice(1)}`}function Ly(e){return`get${e.charAt(0).toUpperCase()}${e.slice(1)}`}var Mle={declaredBy:new Map,fields:new Map,fieldsBaseFirst:[],fieldsDerivedFirst:[],flatStates:[]};function Ry(e){let t=jy(e);return t.composed===void 0&&(t.composed=function(e){let t=[],n=[],r=[];for(let{klass:i,ownNodeConfig:a}of Wy(e)){let e=a&&a.json;n.push(i),t.push(e&&e.meta.kind===`node`?Object.entries(e.meta.fields):[]);let o=[];if(a&&a.stateConfigs)for(let e of a.stateConfigs)`stateConfig`in e&&e.flat&&o.push(e.stateConfig);r.push(o)}let i=new Map;for(let e=0;e<t.length;e++)for(let[n,r]of t[e])i.has(n)||i.set(n,r);let a=new Map,o=new Map,s=new Map;for(let e=t.length-1;e>=0;e--){for(let[r,s]of t[e]){let t=i.get(r);t===void 0||a.has(r)||a.set(r,t),t===void 0||s!==t||o.has(r)||o.set(r,n[e])}for(let t of r[e])s.has(t.key)||s.set(t.key,t)}return i.size===0&&s.size===0?Mle:{declaredBy:o,fields:a,fieldsBaseFirst:[...a],fieldsDerivedFirst:[...i],flatStates:[...s.values()]}}(e)),t.composed}var Nle=[];function Ple(e,t,n){let r=n.getter;if(r===null)return null;let i=r===void 0?Ly(t):r;return Xd(i)?Py(e,t,i,Ly(t)):i}function Fle(e,t,n){let r=n.setter;if(r===null)return null;let i=r===void 0?Iy(t):r;return Xd(i)?Py(e,t,i,Iy(t)):i}function zy(e){return e}function By(e,t){let{defaultValue:n,isEqual:r}=e;return t===void 0||t===n||r!==void 0&&r(t,n)}function Ile(e){let t;return(n,r)=>{t===void 0&&(t=new Map(e.map(e=>[e.key,e])));let i=t.get(n);return i!==void 0&&By(i,r)}}function Lle(e){let{setterTable:t,schema:n}=e,{defaultValue:r}=n;return t===void 0?r:t[String(r)]}function Vy(e,t){let{flatStates:n,generated:r,setters:i}=My(jy(e.constructor)),a=function(e,t,n){let r=e;for(let e=0;e<n.length;e++){let i=n[e],a=t[i.key];if(a!==void 0){let e=i.parse(a);r=wf(r,i,()=>e)}}return r}(e,t,n);return r!==null&&r.updateFromJSON!==void 0?r.updateFromJSON(a,t):function(e,t,n){for(let r=0;r<n.length;r++){let i=n[r],a=i.schema(t[i.key]);i.kind===`ownField`?zy(e)[i.field]=i.setterTable===void 0?a:uf(i.setterTable,a)?i.setterTable[a]:Lle(i):i.setter.call(e,a)}return e}(a,t,i)}function Hy(e){return jy(e).config}function Rle(e){let t=[];for(let n of[e.getter,e.setter])Xd(n)&&n.field!==`__proto__`&&!t.includes(n.field)&&t.push(n.field);return t}var zle=`__lexicalSynthesizedAfterCloneFrom`;function Uy(e){let{declaredBy:t,fieldsBaseFirst:n}=Ry(e),r=[];for(let[i,a]of n)if(t.get(i)===e)for(let e of Rle(a))r.includes(e)||r.push(e);return r}function Ble(e){let t=Uy(e);if(t.length===0)return t;let n=new Set;for(let{klass:t}of Wy(e))if(t!==e)for(let e of Uy(t))n.add(e);return n.size===0?t:t.filter(e=>!n.has(e))}function*Wy(e){for(let t=e;t&&(t===sh||ch(t.prototype));){let e=Hy(t),n=e.declaresOwnConfig;yield n?e:{...e,ownNodeConfig:void 0},t=n&&e.ownNodeConfig&&e.ownNodeConfig.extends||Jy(t)}}function Gy(e){let t=gy();jg();let n=t.resolveRegisteredNodeAfterReplacements(t.getRegisteredNode(e)),r=new n.klass;return n.replace===null?r:Kv(r)}var Ky=(e,t)=>{let n=e;for(;n!=null&&!n_(n);){if(t(n))return n;n=n.getParent()}return null};function qy(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t===null?iv(r):t.get(r);e??$u(174),n.push(r),r=e.__next}return n}function Jy(e){let t=Object.getPrototypeOf(e);if(typeof t==`function`&&t!==Function.prototype)return t;let n=e.prototype&&Object.getPrototypeOf(e.prototype);return n?n.constructor:null}var Yy=new Map;function Xy(e){return $(e)||e_(e)}function Zy(e){return $(e)||e_(e)}function Qy(e){let t=e.getLatest();return Zy(t)?t.__slotHost:null}function $y(e){let t=Qy(e);if(t===null)return null;let n=iv(t);return $(n)||e_(n)||$u(370),n}function Vle(e){let t=$y(e);if(t===null)return null;let n=e.getLatest().__key;for(let[e,r]of nb(t))if(r===n)return e;return null}function eb(e){let t=e.getLatest();for(;t!==null;){if(Qy(t)!==null)return t;t=t.getParent()}return null}function tb(e){if(e===null)return null;let t=Z(e)?e.anchor.getNode():e.getNodes()[0]??null;return t===null?null:eb(t)}function nb(e){let t=e.getLatest();return Xy(t)&&t.__slots!==null?t.__slots:Yy}function rb(e){return Array.from(nb(e).keys())}function ib(e,t){let n=nb(e).get(t);return n===void 0?null:iv(n)}var Hle=[`__proto__`,`constructor`,`prototype`],ab=Symbol(`slotMapOwner`);function ob(e){let t=e.__slots;return t!==null&&t[ab]===e||(t=new Map(t),t[ab]=e,e.__slots=t),t}var sb=new WeakMap,Ule=[];function Wle(e){for(let{ownNodeConfig:t}of Wy(e)){let e=t&&t.slots;if(e)return e}return Ule}function cb(e){let t=``;for(let n of rb(e)){let r=ib(e,n);r!==null&&(t+=r.getTextContent())}return t}function lb(e,t,n){let r=n.get(e),i=n.get(t);return r===void 0?i===void 0?e<t?-1:+(e>t):1:i===void 0?-1:r-i}function Gle(e,t,n){t!==`__proto__`&&t!==`constructor`&&t!==`prototype`||$u(373,t);let r=e.getLatest();if(r.__slots!==null&&r.__slots.get(t)===n.getLatest().__key)return r;(!$(n)&&!e_(n)||n.isInline())&&$u(374,n.__key);let i=e.getWritable(),a=ob(i),o=a.get(t);o!==void 0&&Kle(o);let s=n.getWritable(),c=$y(s);if(c!==null){let e=Vle(s);e!==null&&ob(c.getWritable()).delete(e),s.__slotHost=null}return ev(s),s.__slotHost=i.__key,a.set(t,s.__key),function(e){let t=e.__slots;if(t===null||t.size<2)return;let n=function(e){let t=sb.get(e);if(t===void 0){let n=Wle(e),r=new Map;for(let t of n)Hle.includes(t)&&$u(371,e.name,t),r.has(t)&&$u(372,e.name,t),r.set(t,r.size);t=r,sb.set(e,t)}return t}(e.constructor),r=null,i=!0;for(let e of t.keys()){if(r!==null&&lb(r,e,n)>0){i=!1;break}r=e}if(i)return;let a=Array.from(t).sort(([e],[t])=>lb(e,t,n));t.clear();for(let[e,n]of a)t.set(e,n)}(i),Pg()._slotsUsed=!0,Ng()._slotsUsed=!0,i}function Kle(e){let t=iv(e);if(t===null)return;let n=t.getWritable();Zy(n)||$u(377,e),n.__slotHost=null,n.remove()}var qle={next:`previous`,previous:`next`},ub=class{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Ab({hasNext:_b,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return yb(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return yb(this.origin,this.direction)}remove(){let e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){let n=this.getNodeAtCaret();return e.is(this.origin)||e.is(n)||(n===null?this.insert(e):n.replace(e,t)),this}splice(e,t,n=`next`){let r=n===this.direction?t:Array.from(t).reverse(),i=this,a=this.getParentAtCaret(),o=new Map;for(let t=i.getAdjacentCaret();t!==null&&o.size<e;t=t.getAdjacentCaret()){let e=t.origin.getWritable();o.set(e.getKey(),e)}for(let e of r){if(o.size>0){let t=i.getNodeAtCaret();if(t){if(o.delete(t.getKey()),o.delete(e.getKey()),!(t.is(e)||i.origin.is(e))){let n=e.getParent();n&&n.is(a)&&e.remove(),t.replace(e)}}else t===null&&$u(263,Array.from(o).join(` `))}else i.insert(e);i=yb(e,this.direction)}for(let e of o.values())e.remove();return this}},db=class e extends ub{type=`child`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:Cb(e,this.direction)}getParentCaret(e=`root`){return yb(pb(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=fb(this.direction);return yb(this.getNodeAtCaret(),e)||Cb(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}},Jle={root:n_,shadowRoot:Wv};function fb(e){return qle[e]}function pb(e,t=`root`){return e===null||Jle[t](e)?null:Qy(e)===null?e:null}var mb=class e extends ub{type=`sibling`;getLatest(){let e=this.origin.getLatest();return e===this.origin?this:yb(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return $(this.origin)?Cb(this.origin,this.direction):null}getParentCaret(e=`root`){return yb(pb(this.getParentAtCaret(),e),this.direction)}getFlipped(){let e=fb(this.direction);return yb(this.getNodeAtCaret(),e)||Cb(this.origin.getParentOrThrow(),e)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)}isSameNodeCaret(t){return(t instanceof e||t instanceof hb)&&this.direction===t.direction&&this.origin.is(t.origin)}},hb=class e extends ub{type=`text`;offset;constructor(e,t){super(e),this.offset=t}getLatest(){let e=this.origin.getLatest();return e===this.origin?this:bb(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e=`root`){return yb(pb(this.getParentAtCaret(),e),this.direction)}getFlipped(){return bb(this.origin,fb(this.direction),this.offset)}isSamePointCaret(t){return t instanceof e&&this.direction===t.direction&&this.origin.is(t.origin)&&this.offset===t.offset}isSameNodeCaret(t){return(t instanceof mb||t instanceof e)&&this.direction===t.direction&&this.origin.is(t.origin)}getSiblingCaret(){return yb(this.origin,this.direction)}};function gb(e){return e instanceof hb}function _b(e){return e instanceof mb}function vb(e){return e instanceof db}var Yle={next:class extends hb{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends hb{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Xle={next:class extends mb{direction=`next`;getNodeAtCaret(){return this.origin.getNextSibling()}insert(e){return this.origin.insertAfter(e),this}},previous:class extends mb{direction=`previous`;getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(e){return this.origin.insertBefore(e),this}}},Zle={next:class extends db{direction=`next`;getNodeAtCaret(){return this.origin.getFirstChild()}insert(e){return this.origin.splice(0,0,[e]),this}},previous:class extends db{direction=`previous`;getNodeAtCaret(){return this.origin.getLastChild()}insert(e){return this.origin.splice(this.origin.getChildrenSize(),0,[e]),this}}};function yb(e,t){return e?new Xle[t](e):null}function bb(e,t,n){return e?new Yle[t](e,xb(e,n)):null}function xb(e,t,n=`error`){let r=e.getTextContentSize(),i=t===`next`?r:t===`previous`?0:t;return(i<0||i>r)&&(n!==`clamp`&&ed(284,String(t),String(r),e.getKey()),i=i<0?0:r),i}function Sb(e,t){return new $le(e,t)}function Cb(e,t){return $(e)?new Zle[t](e):null}function wb(e){return e&&e.getChildCaret()||e}function Tb(e){return e&&wb(e.getAdjacentCaret())}var Qle=class e{type=`node-caret-range`;direction;anchor;focus;constructor(e,t,n){this.anchor=e,this.focus=t,this.direction=n}getLatest(){let t=this.anchor.getLatest(),n=this.focus.getLatest();return t===this.anchor&&n===this.focus?this:new e(t,n,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){let e=e=>{let t=this[e].getLatest();return gb(t)?function(e,t){let{direction:n,origin:r}=e;return Sb(e,xb(r,t===`focus`?fb(n):n)-e.offset)}(t,e):null},t=e(`anchor`),n=e(`focus`);if(t&&n){let{caret:e}=t,{caret:r}=n;if(e.isSameNodeCaret(r))return[Sb(e,r.offset-e.offset),null]}return[t,n]}iterNodeCarets(e=`root`){let t=gb(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),n=this.focus.getLatest(),r=gb(n),i=t=>t.isSameNodeCaret(n)?null:Tb(t)||t.getParentCaret(e);return Ab({hasNext:e=>e!==null&&!(r&&n.isSameNodeCaret(e)),initial:t.isSameNodeCaret(n)?null:i(t),map:e=>e,step:i})}[Symbol.iterator](){return this.iterNodeCarets(`root`)}},$le=class{type=`slice`;caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){let{distance:e,caret:{offset:t}}=this,n=t+e;return n<t?[n,t]:[t,n]}getTextContent(){let[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){let{caret:{origin:e,direction:t}}=this,[n,r]=this.getSliceIndices(),i=e.getTextContent();return bb(e.setTextContent(i.slice(0,n)+i.slice(r)),t,n)}};function Eb(e,t){return e.direction===t?e:e.getFlipped()}function Db(e){return kb(e,Eb(Cb(dv(),fb(e.direction)),e.direction))}function Ob(e){return kb(e,e)}function kb(e,t){return e.direction!==t.direction&&$u(265),new Qle(e,t,e.direction)}function Ab(e){let{initial:t,hasNext:n,step:r,map:i}=e,a=t;return{[Symbol.iterator](){return this},next(){if(!n(a))return{done:!0,value:void 0};let e={done:!1,value:i(a)};return a=r(a),e}}}function jb(e,t){let n=Fb(e.origin,t.origin);switch(n===null&&$u(275,e.origin.getKey(),t.origin.getKey()),n.type){case`same`:{let n=e.type===`text`,r=t.type===`text`;return n&&r?function(e,t){return Math.sign(e-t)}(e.offset,t.offset):e.type===t.type?0:n?-1:r?1:e.type===`child`?-1:1}case`ancestor`:return e.type===`child`?-1:1;case`descendant`:return t.type===`child`?1:-1;case`branch`:return Mb(n)}}function Mb(e){let{a:t,b:n}=e,r=t.__key,i=n.__key,a=t,o=n;for(;a&&o;a=a.getNextSibling(),o=o.getNextSibling()){if(a.__key===i)return-1;if(o.__key===r)return 1}return a===null?1:-1}function Nb(e,t){return t.is(e)}function Pb(e){return $(e)?[e.getLatest(),null]:[e.getParent(),e.getLatest()]}function Fb(e,t){if(e.is(t))return{commonAncestor:e,type:`same`};let n=new Map;for(let[t,r]=Pb(e);t;r=t,t=t.getParent())n.set(t,r);for(let[r,i]=Pb(t);r;i=r,r=r.getParent()){let a=n.get(r);if(a!==void 0)return a===null?(Nb(e,r)||$u(276),{commonAncestor:r,type:`ancestor`}):i===null?(Nb(t,r)||$u(277),{commonAncestor:r,type:`descendant`}):(($(a)||Nb(e,a))&&($(i)||Nb(t,i))&&r.is(a.getParent())&&r.is(i.getParent())||$u(278),{a,b:i,commonAncestor:r,type:`branch`})}return null}function eue(e){return e}function tue(...e){return e}function Ib(e,t){if(!t||e===t)return e;for(let n in t)if(e[n]!==t[n])return{...e,...t};return e}function Lb(...e){let t=[];for(let n of e)if(n&&typeof n==`string`)for(let[e]of n.matchAll(/\S+/g))t.push(e);return t}function Rb(e,...t){let n=Lb(...t);n.length>0&&e.classList.add(...n)}function zb(e,...t){let n=Lb(...t);n.length>0&&e.classList.remove(...n)}function Bb(...e){return()=>{for(let t=e.length-1;t>=0;t--)e[t]();e.length=0}}function nue(e,t,n){return Bb(...Object.entries(t).map(([t,r])=>Om(e,t,r,n)))}function Vb(e){let t=e;for(;t!=null;){if(t.nodeType===Node.TEXT_NODE)return t;t=t.firstChild}return null}function Hb(e){let t=e.parentNode;if(t==null)throw Error(`Should never happen`);return[t,Array.from(t.childNodes).indexOf(e)]}function rue(e,t,n,r,i){let a=t.getKey(),o=r.getKey(),s=ty(e.getRootElement()).createRange(),c=e.getElementByKey(a),l=e.getElementByKey(o),u=n,d=i;if(X(t)&&(c=Vb(c)),X(r)&&(l=Vb(l)),t===void 0||r===void 0||c===null||l===null)return null;c.nodeName===`BR`&&([c,u]=Hb(c)),l.nodeName===`BR`&&([l,d]=Hb(l));let f=c.firstChild;c===l&&f!=null&&f.nodeName===`BR`&&u===0&&d===0&&(d=1);try{s.setStart(c,u),s.setEnd(l,d)}catch{return null}return!s.collapsed||u===d&&a===o||(s.setStart(l,d),s.setEnd(c,u)),s}function Ub(e){let t=gy().getElementByKey(e.getKey());if(t===null)return null;let n=t.ownerDocument.defaultView;return n===null?null:n.getComputedStyle(t)}function Wb(e){let t=n_(e)?e:e.getParent();return t&&Ub(t)}function Gb(e){let t=Wb(e);return t!==null&&t.direction===`rtl`}function Kb(e,t,n=`self`){let r=e.getStartEndPoints();if(t.isSelected(e)&&!Y_(t)&&r!==null){let[i,a]=r,o=e.isBackward(),s=i.getNode(),c=a.getNode(),l=t.is(s),u=t.is(c);if(l||u){let[r,i]=Vh(e),a=s.is(c),l=t.is(o?c:s),u=t.is(o?s:c),d,f=0;a?(f=r>i?i:r,d=r>i?r:i):l?(f=o?i:r,d=void 0):u&&(f=0,d=o?r:i);let p=t.__text.slice(f,d);p!==t.__text&&(n===`clone`&&(t=kle(t)),t.__text=p)}}return t}function iue(e,t){let n=e.getFormatType(),r=e.getIndent();n!==t.getFormatType()&&t.setFormat(n),r!==t.getIndent()&&t.setIndent(r)}function qb(e,t,n){let r=m_(e,n);if(C_(r))return!1;for(;r;r=r.getParentCaret()){let e=r.getParentAtCaret();if(!e||r.getNodeAtCaret())return!1;if(t.is(e))return!0}return!1}function aue(e,t,n=iue){if(!e)return;let r=e.getStartEndPoints(),i=!1,a=null,o=new Map;if(r){let[t,n]=r,s=Ky(t.getNode(),hy);a=Ky(n.getNode(),hy);let c=e.isBackward()?`previous`:`next`;i=$(a)&&!a.is(s)&&function(e,t,n){let r=e.getNode();return(!$(r)||!r.isEmpty())&&qb(e,t,n)}(n,a,fb(c)),$(s)&&o.set(s.getKey(),s),$(a)&&!i&&o.set(a.getKey(),a)}for(let t of e.getNodes())if($(t)&&hy(t)){if(i&&t.is(a))continue;o.set(t.getKey(),t)}else if(!r){let e=Ky(t,hy);$(e)&&o.set(e.getKey(),e)}for(let e of o.values()){if($y(e)!==null)continue;let r=t();n(e,r),e.replace(r,!0)}}function Jb(e){let t=Yb(e);return t!==null&&t.writingMode===`vertical-rl`}function Yb(e){let t=e.anchor.getNode();return $(t)?Ub(t):Wb(t)}function Xb(e,t){let n=Jb(e)?!t:t;Zb(e)&&(n=!n);let r=m_(e.focus,n?`previous`:`next`);if(C_(r))return!1;if(gb(r)&&!Oh(r.origin)&&r.origin.isUnmergeable()){let e=r.getNodeAtCaret();if(X(e)&&!Oh(e))return!0}for(let e of Db(r)){if(vb(e))return!e.origin.isInline();if(!$(e.origin)){if(e_(e.origin))return!0;break}}return!1}function oue(e,t,n,r){e.modify(t?`extend`:`move`,n,r)}function Zb(e){let t=Yb(e);return t!==null&&t.direction===`rtl`}function Qb(e,t,n){let r=Zb(e),i;i=Jb(e)||r?!n:n,oue(e,t,i,`character`)}function sue(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function cue(e,t){return Array.from(lue(e,t))}function lue(e,t){return uue(`next`,e,t)}function $b(e,t){let n=E_(yb(e,t));return n&&n[0]}function uue(e,t,n){let r=dv(),i=t||r,a=$(i)?Cb(i,e):yb(i,e),o=due(i),s=n?Tb(wb(yb(n,e)))||$b(n,e):$b(i,e),c=o;return Ab({hasNext:e=>e!==null,initial:a,map:e=>({depth:c,node:e.origin}),step:e=>{if(e.isSameNodeCaret(s))return null;vb(e)&&c++;let t=E_(e);return!t||t[0].isSameNodeCaret(s)?null:(c+=t[1],t[0])}})}function due(e){let t=-1;for(let n=e;n!==null;n=n.getParent()??$y(n))t++;return t}function ex(e,t){let n=e;for(;n!=null;){if(n instanceof t)return n;n=n.getParent()}return null}function fue(e){let t=Ky(e,e=>$(e)&&!e.isInline());return $(t)||sue(4,e.__key),t}function tx(e){let t=Q()||ag(),n;if(Z(t))n=m_(t.focus,`next`);else{if(t!=null){let e=t.getNodes(),r=e[e.length-1];r&&(n=yb(r,`next`))}n||=Cb(dv(),`previous`).getFlipped().insert(j_())}let r=O_(e,n,C_(i=n)||E_(gb(i)?i.getSiblingCaret():i,`shadowRoot`)!==null?{$shouldSplit:(e,t)=>t!==`last`}:void 0);var i;let a=Tb(r);return g_(Ob(vb(a)?S_(a):r)),e.getLatest()}function nx(e,t){if(e==null)return!1;let n=Object.getPrototypeOf(e);return n!=null&&n.constructor!=null&&n.constructor.name===t.name}function rx(e){let t=null;if(nx(e,DragEvent)?t=e.dataTransfer:nx(e,ClipboardEvent)&&(t=e.clipboardData),t===null)return[!1,[],!1];let n=t.types,r=n.includes(`Files`),i=n.includes(`text/html`)||n.includes(`text/plain`);return[r,Array.from(t.files),i]}function ix(e){let t=Q();if(!Z(t))return!1;let n=new Set,r=t.getNodes();for(let t=0;t<r.length;t++){let i=r[t],a=i.getKey();if(n.has(a))continue;let o=Ky(i,e=>$(e)&&!e.isInline());if(o===null)continue;let s=o.getKey();o.canIndent()&&!n.has(s)&&(n.add(s),e(o))}return n.size>0}function pue(e,t){Cb(e,`next`).insert(t)}function ax(e,t){return ox(e,t,null)}function ox(e,t,n){let r=!1;for(let i of cx(e))t(i)?n!==null&&n(i):(r=!0,$(i)&&ox(i,t,n||(e=>i.insertAfter(e))),i.remove());return r}function sx(e,t){let n=[],r=Array.from(e).reverse();for(let e=r.pop();e!==void 0;e=r.pop())if(t(e))n.push(e);else if($(e))for(let t of cx(e))r.push(t);return n}function cx(e){return mue(Cb(e,`previous`))}function mue(e){return Ab({hasNext:_b,initial:e.getAdjacentCaret(),map:e=>e.origin.getLatest(),step:e=>e.getAdjacentCaret()})}function hue(e){y_(yb(e,`next`)).splice(1,e.getChildren())}function lx(e,t){let n=Q();if(Z(n)&&n.isCollapsed()){let r=Ky(n.anchor.getNode(),e);if(r){let e=r.getParent();if(e!==null&&e.getFirstChild()===r&&gue(n.anchor,r))return r.insertBefore(j_()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function ux(e,t){let n=Q();if(Z(n)&&n.isCollapsed()){let r=Ky(n.anchor.getNode(),e);if(r){let e=r.getParent();if(e!==null&&e.getLastChild()===r&&_ue(n.anchor,r))return r.insertAfter(j_()).selectEnd(),t&&t.preventDefault(),!0}}return!1}function gue(e,t){return qb(e,t,`previous`)}function _ue(e,t){return qb(e,t,`next`)}function vue(e){return(typeof e.nodes==`function`?e.nodes():e.nodes)||[]}var dx={tag:`history-merge`};function yue(){let e=dv();e.isEmpty()&&e.append(j_())}var bue={config:{setOptions:dx,updateOptions:dx},init:({$initialEditorState:e=yue})=>({$initialEditorState:e,initialized:!1}),afterRegistration(e,{updateOptions:t,setOptions:n},r){let i=r.getInitResult();if(!i.initialized){i.initialized=!0;let{$initialEditorState:r}=i;if(nle(r))e.setEditorState(r,n);else if(typeof r==`function`)e.update(()=>{r(e)},t);else if(r&&(typeof r==`string`||typeof r==`object`)){let t=e.parseEditorState(r);e.setEditorState(t,n)}}return()=>{}},name:`@lexical/extension/InitialState`,nodes:[t_,bh,c_,Eh,A_]};function fx(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function xue(){let e;try{e=`0.52.0+prod.esm`}catch{}return e??`"<unknown>+source"`}var Sue=xue(),Cue=new Set([`__proto__`,`constructor`,`prototype`]);function px(e,t){if(e&&t&&!Array.isArray(t)&&typeof e==`object`&&typeof t==`object`){let n=e,r=t;for(let e in r)!Cue.has(e)&&Object.prototype.hasOwnProperty.call(r,e)&&(n[e]=px(n[e],r[e]));return e}return t}function mx(e){return e.id===0}function hx(e){return e.id===2}var wue=new Set,Tue=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:0}}mergeConfigs(){let e=this.extension.config||{},t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):Ib;for(let n of this.configs)e=t(e,n);return e}init(e){let t=this.state;hx(t)||fx(306,String(t.id));let n={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},r={...n,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},i=function(e,t,n){return Object.assign(e,{config:t,id:3,registerState:n})}(t,this.mergeConfigs(),n),a;this.state=i,this.extension.init&&(a=this.extension.init(e,i.config,n)),this.state=function(e,t,n){return Object.assign(e,{id:4,initResult:t,registerState:n})}(i,a,r)}build(e){let t=this.state,n;t.id!==4&&fx(307,String(t.id),`5`),this.extension.build&&(n=this.extension.build(e,t.config,t.registerState));let r={...t.registerState,getOutput:()=>n,getSignal:this.getSignal.bind(this)};this.state=function(e,t,n){return Object.assign(e,{id:5,output:t,registerState:n})}(t,n,r)}register(e,t){this._signal=t;let n=this.state;n.id!==5&&fx(308,String(n.id),`5`);let r=this.extension.register&&this.extension.register(e,n.config,n.registerState);return this.state=function(e){return Object.assign(e,{id:6})}(n),()=>{let e=this.state;e.id!==7&&fx(309,String(n.id),`7`),this.state=function(e){return Object.assign(e,{id:5})}(e),r&&r()}}afterRegistration(e){let t=this.state,n;return t.id!==6&&fx(310,String(t.id),`6`),this.extension.afterRegistration&&(n=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=function(e){return Object.assign(e,{id:7})}(t),n}getSignal(){return this._signal===void 0&&fx(311),this._signal}getInitResult(){this.extension.init===void 0&&fx(312,this.extension.name);let e=this.state;return function(e){return e.id>=4}(e)||fx(313,String(e.id),`4`),e.initResult}getInitPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){let e=this.state;return function(e){return e.id>=3}(e)||fx(314,String(e.id),`3`),{config:e.config}}getPeer(e){let t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&fx(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){let t=this.builder.getExtensionRep(e);return t===void 0&&fx(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){let e=this.state;return function(e){return e.id>=7}(e)||fx(316,String(e.id),`7`),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||wue}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([e])=>e)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){let e=this.state;(function(e){return e.id>=5})(e)||fx(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}},gx=Symbol.for(`@lexical/extension/LexicalBuilder`);function Eue(...e){return bx.fromExtensions(e).buildEditor()}function _x(){}function Due(e){throw e}function vx(e){return Array.isArray(e)?e:[e]}var yx=Sue,bx=class e{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=yx,this.roots=e;for(let t of e)this.addExtension(t)}static fromExtensions(t){let n=[vx(bue)];for(let e of t)n.push(vx(e));return new e(n)}static maybeFromEditor(t){let n=t[gx];return n&&(n.PACKAGE_VERSION!==yx&&fx(292,n.PACKAGE_VERSION,yx),n instanceof e||fx(293)),n}static fromEditor(t){let n=e.maybeFromEditor(t);return n===void 0&&fx(294),n}constructEditor(){let{$initialEditorState:e,onError:t,onWarn:n,...r}=this.buildCreateEditorArgs(),i=Object.assign(F_({...r,...t?{onError:e=>{t(e,i)}}:{},...n?{onWarn:e=>{n(e,i)}}:{}}),{[gx]:this});for(let e of this.sortedExtensionReps())e.build(i);return i}buildEditor(){let e=_x;function t(){try{e()}finally{e=_x}}let n=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=Bb(this.registerEditor(n),()=>n.setRootElement(null)),n}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){let t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&fx(295,e.name),t}addEdge(e,t,n){let r=this.outgoingConfigEdges.get(e);if(r){let e=r.get(t);e?e.push(...n):r.set(t,n)}else this.outgoingConfigEdges.set(e,new Map([[t,n]]));let i=this.incomingEdges.get(t);i?i.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&fx(296);let[t]=vx(e);typeof t.name!=`string`&&fx(297,typeof t.name);let n=this.extensionNameMap.get(t.name);if(n!==void 0&&n.extension!==t&&fx(298,t.name),!n){n=new Tue(this,t),this.extensionNameMap.set(t.name,n);let e=this.conflicts.get(t.name);typeof e==`string`&&fx(299,t.name,e);for(let e of t.conflictsWith||[])this.extensionNameMap.has(e)&&fx(299,t.name,e),this.conflicts.set(e,t.name);for(let e of t.dependencies||[]){let n=vx(e);this.addEdge(t.name,n[0].name,n.slice(1)),this.addExtension(n)}for(let[e,n]of t.peerDependencies||[])this.addEdge(t.name,e,n?[n]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;let e=[],t=(n,r)=>{let i=n.state;if(hx(i))return;let a=n.extension.name;var o;mx(i)||fx(300,a,r||`[unknown]`),mx(o=i)||fx(304,String(o.id),`0`),i=Object.assign(o,{id:1}),n.state=i;let s=this.outgoingConfigEdges.get(a);if(s)for(let e of s.keys()){let n=this.extensionNameMap.get(e);n&&t(n,a)}i=function(e){return function(e){return e.id===1}(e)||fx(305,String(e.id),`1`),Object.assign(e,{id:2})}(i),n.state=i,e.push(n)};for(let e of this.extensionNameMap.values())mx(e.state)&&t(e);for(let t of e)for(let[e,n]of this.outgoingConfigEdges.get(t.extension.name)||[])if(n.length>0){let t=this.extensionNameMap.get(e);if(t)for(let e of n)t.configs.add(e)}for(let[e,...t]of this.roots)if(t.length>0){let n=this.extensionNameMap.get(e.name);n===void 0&&fx(301,e.name);for(let e of t)n.configs.add(e)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){let t=this.sortedExtensionReps(),n=new AbortController,r=[()=>n.abort()],i=n.signal;for(let n of t){let t=n.register(e,i);t&&r.push(t)}for(let n of t){let t=n.afterRegistration(e);t&&r.push(t)}return Bb(...r)}buildCreateEditorArgs(){let e={},t=new Set,n=new Map,r=new Map,i={},a={},o=this.sortedExtensionReps();for(let s of o){let{extension:o}=s;if(o.onError!==void 0&&(e.onError=o.onError),o.onWarn!==void 0&&(e.onWarn=o.onWarn),o.disableEvents!==void 0&&(e.disableEvents=o.disableEvents),o.parentEditor!==void 0&&(e.parentEditor=o.parentEditor),o.editable!==void 0&&(e.editable=o.editable),o.namespace!==void 0&&(e.namespace=o.namespace),o.$initialEditorState!==void 0&&(e.$initialEditorState=o.$initialEditorState),o.nodes)for(let e of vue(o)){if(typeof e!=`function`){let t=n.get(e.replace);t&&fx(302,o.name,e.replace.name,t.extension.name),n.set(e.replace,s)}t.add(e)}if(o.html){if(o.html.export)for(let[e,t]of o.html.export.entries())r.set(e,t);o.html.import&&Object.assign(i,o.html.import)}o.theme&&px(a,o.theme)}Object.keys(a).length>0&&(e.theme=a),t.size&&(e.nodes=Array.from(t));let s=Object.keys(i).length>0,c=r.size>0;(s||c)&&(e.html={},s&&(e.html.import=i),c&&(e.html.export=r));for(let t of o)t.init(e);return e.onError||=Due,e}};function xx(e,t){let n=bx.maybeFromEditor(e);if(!n)return;let r=n.extensionNameMap.get(t);return r?r.getExtensionDependency():void 0}var Oue=Symbol.for(`preact-signals`);function Sx(){if(Dx>1)Dx--;else{var e,t=!1;for((function(){var e=Ax;for(Ax=void 0;e!==void 0;){var t=e.S;if(t.v===e.v)for(var n=t.t;n!==void 0;n=n.x)n.i===e.i&&(n.i=t.i);e=e.o}})();Ex!==void 0;){var n=Ex;for(Ex=void 0,Ox++;n!==void 0;){var r=n.u;if(n.u=void 0,n.f&=-3,!(8&n.f)&&Fx(n))try{n.c()}catch(n){t||=(e=n,!0)}n=r}}if(Ox=0,Dx--,t)throw e}}function kue(e){if(Dx>0)return e();kx=++Aue,Dx++;try{return e()}finally{Sx()}}var Cx,wx=void 0;function Tx(e){var t=wx,n=Cx;wx=void 0,Cx=void 0;try{return e()}finally{wx=t,Cx=n}}var Ex=void 0,Dx=0,Ox=0,Aue=0,kx=0,Ax=void 0,jx=0;function Mx(e){if(wx!==void 0){var t=e.n;if(t===void 0||t.t!==wx)return t={i:0,S:e,p:wx.s,n:void 0,t:wx,e:void 0,x:void 0,r:t},wx.s!==void 0&&(wx.s.n=t),wx.s=t,e.n=t,32&wx.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=wx.s,t.n=void 0,wx.s.n=t,wx.s=t),t}}function Nx(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=t?.watched,this.Z=t?.unwatched,this.name=t?.name}Nx.prototype.brand=Oue,Nx.prototype.h=function(){return!0},Nx.prototype.S=function(e){var t=this,n=this.t;n!==e&&e.e===void 0&&(e.x=n,this.t=e,n===void 0?Tx(function(){var e;(e=t.W)==null||e.call(t)}):n.e=e)},Nx.prototype.U=function(e){var t=this;if(this.t!==void 0){var n=e.e,r=e.x;n!==void 0&&(n.x=r,e.e=void 0),r!==void 0&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,r===void 0&&Tx(function(){var e;(e=t.Z)==null||e.call(t)}))}},Nx.prototype.subscribe=function(e){var t=this;return Hx(function(){var n=t.value;Tx(function(){return e(n)})},{name:`sub`})},Nx.prototype.valueOf=function(){return this.value},Nx.prototype.toString=function(){return this.value+``},Nx.prototype.toJSON=function(){return this.value},Nx.prototype.peek=function(){var e=this;return Tx(function(){return e.value})},Object.defineProperty(Nx.prototype,"value",{get:function(){var e=Mx(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Ox>100)throw Error(`Cycle detected`);(function(e){Dx!==0&&Ox===0&&e.l!==kx&&(e.l=kx,Ax={S:e,v:e.v,i:e.i,o:Ax})})(this),this.v=e,this.i++,jx++,Dx++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Sx()}}}});function Px(e,t){return new Nx(e,t)}function Fx(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ix(e){for(var t=e.s;t!==void 0;t=t.n){var n=t.S.n;if(n!==void 0&&(t.r=n),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Lx(e){for(var t=e.s,n=void 0;t!==void 0;){var r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):n=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}e.s=n}function Rx(e,t){Nx.call(this,void 0,t),this.x=e,this.s=void 0,this.g=jx-1,this.f=4}Rx.prototype=new Nx,Rx.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===jx))return!0;if(this.g=jx,this.f|=1,this.i>0&&!Fx(this))return this.f&=-2,!0;var e=wx;try{Ix(this),wx=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return wx=e,Lx(this),this.f&=-2,!0},Rx.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}Nx.prototype.S.call(this,e)},Rx.prototype.U=function(e){if(this.t!==void 0&&(Nx.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}},Rx.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}},Object.defineProperty(Rx.prototype,"value",{get:function(){if(1&this.f)throw Error(`Cycle detected`);var e=Mx(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function jue(e,t){return new Rx(e,t)}function zx(e){var t=e.m;if(e.m=void 0,typeof t==`function`){Dx++;var n=wx;wx=void 0;try{t()}catch(t){throw e.f&=-2,e.f|=8,Bx(e),t}finally{wx=n,Sx()}}}function Bx(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,zx(e)}function Mue(e){if(wx!==this)throw Error(`Out-of-order effect`);Lx(this),wx=e,this.f&=-2,8&this.f&&Bx(this),Sx()}function Vx(e,t){this.x=e,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=t?.name,Cx&&Cx.push(this)}Vx.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.m=t)}finally{e()}},Vx.prototype.S=function(){if(1&this.f)throw Error(`Cycle detected`);this.f|=1,this.f&=-9,zx(this),Ix(this),Dx++;var e=wx;return wx=this,Mue.bind(this,e)},Vx.prototype.N=function(){2&this.f||(this.f|=2,this.u=Ex,Ex=this)},Vx.prototype.d=function(){this.f|=8,1&this.f||Bx(this)},Vx.prototype.dispose=function(){this.d()};function Hx(e,t){var n=new Vx(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function Ux(e,t){let n;return Px(e(),{unwatched(){n&&=(n(),void 0)},watched(){this.value=e(),n=t(this)}})}var Wx={build:e=>Ux(()=>e.getEditorState(),t=>e.registerUpdateListener(e=>{t.value=e.editorState})),name:`@lexical/extension/EditorState`},Nue=new Set,Gx={build(e,t,n){let r=n.getDependency(Wx).output,i=Px({watchedNodeKeys:new Map}),a=Ux(()=>{},()=>Hx(()=>{let e=a.peek(),{watchedNodeKeys:t}=i.value,n,o=!1;r.value.read(()=>{if(Q())for(let[r,i]of t.entries()){if(i.size===0){t.delete(r);continue}let a=iv(r),s=a&&a.isSelected()||!1;o||=s!==(!!e&&e.has(r)),s&&(n||=new Set,n.add(r))}}),!o&&n&&e&&n.size===e.size||(a.value=n)}));return{watchNodeKey:function(e){let t=jue(()=>(a.value||Nue).has(e)),{watchedNodeKeys:n}=i.peek(),r=n.get(e),o=r!==void 0;return r||=new Set,r.add(t),o||(n.set(e,r),i.value={watchedNodeKeys:n}),t}}},dependencies:[Wx],name:`@lexical/extension/NodeSelection`},Pue=Mp(`INSERT_HORIZONTAL_RULE_COMMAND`),Kx=class extends $g{$config(){return this.config(`horizontalrule`,{extends:$g,importDOM:{hr:()=>({conversion:Fue,priority:0})}})}exportDOM(){return{element:ny().createElement(`hr`)}}createDOM(e){let t=ny().createElement(`hr`);return Rb(t,e.theme.hr),t}getTextContent(){return`
`}isInline(){return!1}updateDOM(){return!1}};function Fue(){return{node:qx()}}function qx(){return Gy(Kx)}function Jx(e){return e instanceof Kx}var Iue={dependencies:[Wx,Gx],name:`@lexical/extension/HorizontalRule`,nodes:()=>[Kx],register(e,t,n){let{watchNodeKey:r}=n.getDependency(Gx).output,i=Px({nodeSelections:new Map}),a=e._config.theme.hrSelected??`selected`;return Bb(e.registerCommand(Pue,e=>{let t=Q();return Z(t)?(t.focus.getNode()!==null&&tx(qx()),!0):!1},0),e.registerCommand(Fp,e=>{if(dy(e.target)){let t=av(e.target);if(Jx(t))return function(e,t=!1){let n=Q(),r=e.isSelected(),i=e.getKey(),a;t&&Lh(n)?a=n:(a=rg(),pv(a)),r?a.delete(i):a.add(i)}(t,e.shiftKey),!0}return!1},1),e.registerMutationListener(Kx,(t,n)=>{kue(()=>{let n=!1,{nodeSelections:a}=i.peek();for(let[i,o]of t.entries())if(o===`destroyed`)a.delete(i),n=!0;else{let t=a.get(i),o=e.getElementByKey(i);t?t.domNode.value=o:(n=!0,a.set(i,{domNode:Px(o),selectedSignal:r(i)}))}n&&(i.value={nodeSelections:a})})}),Hx(()=>{let e=[];for(let{domNode:t,selectedSignal:n}of i.value.nodeSelections.values())e.push(Hx(()=>{let e=t.value;e&&(n.value?Rb(e,a):zb(e,a))}));return Bb(...e)}))}};function Lue(e){return xx(gy(),e)}function Yx(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Xx;function Zx(e,t){let{key:n}=t;return e&&n in e?e[n]:t.defaultValue}function Qx(e){return Xx&&Xx.editor===e?Xx:void 0}function $x(e,t){let n=Qx(t);return n&&n[e]}function Rue(e,t){if(`cfg`in t){let{cfg:n,updater:r}=t;return[n,r(Zx(e,n))]}return t}function eS(e,t){let n=t;for(let r of e){let[e,i]=Rue(n,r),a=e.key;if(n===t&&Zx(n,e)===i)continue;let o=n===t||n===void 0?zue(t):n;o[a]=i,n=o}return n}function zue(e){return Object.create(e||null)}function tS(e,t){return[e,t]}function nS(e,t,n,r=gy()){let i=Xx,a=Qx(r);try{return Xx={...a,editor:r,[e]:t},n()}finally{Xx=i}}function rS(e,t=()=>{}){return(n,r=gy())=>i=>{let a=Qx(r),o=a&&a[e],s=eS(n,o||t(r));return s&&s!==o?nS(e,s,i,r):i()}}function iS(e,t,n,r){return Object.assign(Sf(Symbol(t),{isEqual:r,parse:n}),{[e]:!0})}var Bue=(e,t,n)=>{aS(e),n()};function aS(e){if(!Z_(e))return;let t=e;if(t.querySelector(`style`)===null)return;let n=new Map;function r(e){let t=n.get(e);if(t===void 0){t=new Set;for(let n=0;n<e.style.length;n++)t.add(e.style[n]);n.set(e,t)}return t}try{for(let e of Array.from(t.styleSheets)){let n;try{n=e.cssRules}catch{continue}for(let e of Array.from(n)){if(!nx(e,CSSStyleRule))continue;let n;try{n=t.querySelectorAll(e.selectorText)}catch{continue}for(let t of Array.from(n)){if(!uy(t))continue;let n=r(t);for(let r=0;r<e.style.length;r++){let i=e.style[r];n.has(i)||t.style.setProperty(i,e.style.getPropertyValue(i),e.style.getPropertyPriority(i))}}}}}catch{}}var oS=`@lexical/html/DOM`,sS=Symbol.for(`@lexical/html/DOMExportContext`),cS=`@lexical/html/DOMImport`,lS=Symbol.for(`@lexical/html/DOMImportContext`);function Vue(e,t,n){return iS(sS,e,t,n)}var Hue=Vue(`isExport`,Boolean);function Uue(e){let t=xx(e,oS);return t?t.output.defaults:void 0}function Wue(e){let t=xx(e,oS);return t?t.output.runtime:void 0}function Gue(e=gy()){let t=Wue(e);return t?t.getSessionConfig():_y(e)}var Kue=rS(sS,Uue),uS=Symbol.for(`@lexical/html/SelectorImpl`);function dS(e,t){let n={kind:`element`,predicate:(r=t,r.length===0?uy:r.length===1?r[0]:(e,t)=>{for(let n of r)if(!n(e,t))return!1;return!0}),tags:e};var r;let i=n=>dS(e,[...t,n]);return{[uS]:n,attr:(e,t,n)=>i(mS(e,t,n)),classAll:(...e)=>i(pS(e)),classAny:(...e)=>i(function(e){let t=fS(e);return t.length===0?()=>!1:e=>{if(!uy(e))return!1;let n=e.classList;for(let e of t)if(n.contains(e))return!0;return!1}}(e)),styleAny:(e,t,n)=>i(function(e,t,n){if(typeof t==`string`)return n=>uy(n)&&n.style.getPropertyValue(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!uy(t))return!1;let a=t.style.getPropertyValue(e);if(!a)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}Yx(362,JSON.stringify(e))}(e,t,n))}}function fS(e){let t=[];for(let n of e)n&&t.push(n);return t}function pS(e){let t=fS(e);return t.length===0?()=>!0:e=>{if(!uy(e))return!1;let n=e.classList;for(let e of t)if(!n.contains(e))return!1;return!0}}function mS(e,t,n){if(!0===t)return t=>uy(t)&&t.hasAttribute(e);if(typeof t==`string`)return n=>uy(n)&&n.getAttribute(e)===t;if(t instanceof RegExp){let r=n&&n.capture,i=t;return(t,n)=>{if(!uy(t))return!1;let a=t.getAttribute(e);if(a==null)return!1;let o=a.match(i);return o!==null&&(r!==void 0&&(n[r]=o),!0)}}Yx(361,JSON.stringify(e))}function hS(e){return{[uS]:e}}var que=hS({kind:`text`,predicate:X_,tags:new Set}),Jue=hS({kind:`comment`,predicate:e=>e.nodeType===8,tags:new Set});function gS(){return dS(new Set,[])}function _S(){return Jue}function vS(...e){e.length>0||Yx(363);let t=new Set;for(let n of e)t.add(n.toUpperCase());return dS(t,[])}function yS(){return que}var bS={any:gS,comment:_S,tag:vS,text:yS},xS=/[A-Za-z0-9_-]/,Yue=class{constructor(e,t){this.source=e,this.pos=t}peek(e=0){return this.source[this.pos+e]||``}consume(){return this.source[this.pos++]||``}eof(){return this.pos>=this.source.length}skipWhitespace(){for(;!this.eof()&&/\s/.test(this.peek());)this.pos++}readIdent(){let e=this.pos;for(;!this.eof()&&xS.test(this.peek());)this.pos++;return this.source.slice(e,this.pos)}readQuoted(){let e=this.consume();this.assert(e===`"`||e===`'`,`expected quote`);let t=this.pos;for(;!this.eof()&&this.peek()!==e;)this.peek()===`\\`?this.pos+=2:this.pos++;this.assert(!this.eof(),`unterminated string`);let n=this.source.slice(t,this.pos);return this.pos++,n.replace(/\\(.)/g,`$1`)}assert(e,t){e||Yx(364,String(this.pos+1),t,this.source)}};function Xue(e){let t=new Set,n=[],r=[],i=!1;if(e.skipWhitespace(),e.peek()===`*`)e.consume(),i=!0;else if(xS.test(e.peek())){let n=e.readIdent();n&&t.add(n.toUpperCase())}for(;!e.eof();){let t=e.peek();if(t===`.`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected class name after "."`),r.push(t)}else if(t===`#`){e.consume();let t=e.readIdent();e.assert(t!==``,`expected id after "#"`),n.push(mS(`id`,t))}else{if(t!==`[`)break;{e.consume(),e.skipWhitespace();let t=e.readIdent();e.assert(t!==``,`expected attribute name after "["`),e.skipWhitespace();let r=!0;if(e.peek()===`=`){e.consume(),e.skipWhitespace();let t=e.peek();t===`"`||t===`'`?r=e.readQuoted():(r=e.readIdent(),e.assert(r!==``,`expected attribute value`)),e.skipWhitespace()}e.assert(e.peek()===`]`,`expected "]"`),e.consume(),n.push(mS(t,r))}}}return r.length>0&&n.push(pS(r)),e.assert(i||t.size>0||n.length>0,`expected a selector`),{predicates:n,tags:t}}function Zue(e){let t=new Yue(e,0),n=[];for(;n.push(Xue(t)),t.skipWhitespace(),!t.eof();)t.assert(t.peek()===`,`,`expected "," (selector lists are the only supported combinator)`),t.consume(),t.skipWhitespace();if(n.length===1)return dS(n[0].tags,n[0].predicates);let r=new Set;if(n.every(e=>e.tags.size>0))for(let e of n)for(let t of e.tags)r.add(t);return dS(r,[(e,t)=>{for(let r of n){let n=e.nodeName;if(r.tags.size>0&&!r.tags.has(n))continue;let i=!0;for(let n of r.predicates)if(!n(e,t)){i=!1;break}if(i)return!0}return!1}])}function SS(e,t,n){return iS(lS,e,t,n)}var CS=SS(`textFormat`,()=>0),wS=SS(`textStyle`,()=>({}));function Que(e){if(!uy(e))return!1;if(e.nodeName===`PRE`)return!0;let t=e.style.whiteSpace;return typeof t==`string`&&t.startsWith(`pre`)}function $ue(e){if(X_(e))return!0;if(!uy(e))return!1;let t=e.style.display;return t?t.startsWith(`inline`):!my(e)&&py(e)}var ede=SS(`whitespaceConfig`,()=>({isInline:$ue,preservesWhitespace:Que})),TS=SS(`importOverlays`,()=>[]),tde=class{constructor(e){this.record=e}get(e){return Zx(this.record,e)}set(e,t){this.record[e.key]=t}update(e,t){this.record[e.key]=t(Zx(this.record,e))}has(e){return Object.prototype.hasOwnProperty.call(this.record,e.key)}};function ES(e){let t=xx(e,cS);return t?t.output.defaults:void 0}function nde(e,t=gy()){return Zx(function(e){return $x(lS,e)||ES(e)}(t),e)}var DS=rS(lS,ES);function OS(e){return eg(e)||e_(e)&&!e.isInline()}function kS(e,t){if(!uy(t))return e;let n=t.style.textAlign;if(!MS(n))return e;for(let t of e)eg(t)&&t.getFormatType()===``&&t.setFormat(n);return e}function AS(e,t,n){e.length===1&&u_(e[0])&&(e=[]);let r=j_();if(uy(n)){let e=n.style.textAlign;MS(e)&&r.setFormat(e)}return[r.splice(0,0,e)]}var rde={$accepts:OS,$packageRun:AS,name:`BlockSchema`},ide={$accepts:OS,$packageRun:AS,name:`RootSchema`},jS=bS,ade=new Set([`center`,`end`,`justify`,`left`,`right`,`start`]);function MS(e){return ade.has(e)}var ode={B:{fontWeight:`bold`},EM:{fontStyle:`italic`},I:{fontStyle:`italic`},S:{textDecoration:`line-through`},STRONG:{fontWeight:`bold`},SUB:{verticalAlign:`sub`},SUP:{verticalAlign:`super`},U:{textDecoration:`underline`}},sde={CODE:16,MARK:128},cde=new Set([`font-weight`,`font-style`,`text-decoration`,`text-transform`,`vertical-align`]),lde={$import:(e,t)=>{let n=e.get(CS),r=ode[t.nodeName],i=function(e){return{fontStyle:e.style.fontStyle,fontWeight:e.style.fontWeight,textDecoration:e.style.textDecoration,textTransform:e.style.textTransform,verticalAlign:e.style.verticalAlign}}(t);var a,o;let s=n&~(c=function(e){let t=0,n=0,{fontWeight:r,fontStyle:i,textDecoration:a,textTransform:o,verticalAlign:s}=e;if(r===`700`||r===`bold`?t|=1:r!==`normal`&&r!==`400`||(n|=1),i===`italic`?t|=2:i===`normal`&&(n|=2),a){let e=a.split(` `);e.includes(`underline`)&&(t|=8),e.includes(`line-through`)&&(t|=4),e.includes(`none`)&&(n|=12)}return o===`lowercase`?(t|=vd.lowercase,n|=vd.uppercase|vd.capitalize):o===`uppercase`?(t|=vd.uppercase,n|=vd.lowercase|vd.capitalize):o===`capitalize`?(t|=vd.capitalize,n|=vd.lowercase|vd.uppercase):o===`none`&&(n|=vd.lowercase|vd.uppercase|vd.capitalize),s===`sub`?(t|=32,n|=64):s===`super`?(t|=64,n|=32):s===`baseline`&&(n|=96),{clear:n,set:t}}(r?(a=r,{fontStyle:(o=i).fontStyle||a.fontStyle,fontWeight:o.fontWeight||a.fontWeight,textDecoration:o.textDecoration||a.textDecoration,textTransform:o.textTransform||a.textTransform,verticalAlign:o.verticalAlign||a.verticalAlign}):i)).clear|c.set;var c;let l=sde[t.nodeName];return l&&(s|=l),s===n?e.$importChildren(t):e.$importChildren(t,{context:[tS(CS,s)]})},match:jS.tag(`b`,`strong`,`em`,`i`,`code`,`mark`,`s`,`sub`,`sup`,`u`,`span`),name:`@lexical/html/inline-format`};function NS(e,t,n){let r=e;for(;;){let e=null;for(;(e=t?r.nextSibling:r.previousSibling)===null;){let e=r.parentNode;if(e===null)return null;r=e}if(r=e,!n.isInline(r))return null;let i=r;for(;(i=t?r.firstChild:r.lastChild)!==null;)r=i;if(X_(r))return r;if(r.nodeName===`BR`)return null}}function PS(e,t){return t!==0&&X(e)?e.setFormat(t):e}function FS(e,t){if(X(e)){let n=function(e){let t=``;for(let n in e)cde.has(n)||(t+=`${n}: ${e[n]}; `);return t.trimEnd()}(t);n!==``&&e.setStyle(n)}return e}var ude={$import:(e,t)=>{let n=e.get(CS),r=e.get(wS),i=e.get(ede);if(function(e,t){let n=e.parentNode;for(;n!==null;){if(t.preservesWhitespace(n))return!0;n=n.parentNode}return!1}(t,i)){let e=hg(t.textContent||``);for(let t of e)PS(t,n),FS(t,r);return e}let a=function(e,t){let n=(e.textContent||``).replace(/\r/g,``).replace(/[ \t\n]+/g,` `);if(n.length===0)return``;if(n[0]===` `){let r=e,i=!0;for(;r!==null&&(r=NS(r,!1,t))!==null;){let e=r.textContent||``;if(e.length>0){/[ \t\n]$/.test(e)&&(n=n.slice(1)),i=!1;break}}i&&(n=n.slice(1))}if(n.length>0&&n[n.length-1]===` `){let r=e,i=!0;for(;r!==null&&(r=NS(r,!0,t))!==null;)if((r.textContent||``).replace(/^( |\t|\r?\n)+/,``).length>0){i=!1;break}i&&(n=n.slice(0,-1))}return n}(t,i);if(a===``)return[];let o=wh(a);return PS(o,n),FS(o,r),[o]},match:jS.text(),name:`@lexical/html/#text`},dde={$import:()=>[],match:jS.tag(`script`,`style`),name:`@lexical/html/script-style-ignore`},fde={$import:(e,t)=>d_(t)||f_(t)?[]:[l_()],match:jS.tag(`br`),name:`@lexical/html/br`},pde=[dde,{$import:(e,t)=>{let n=j_();if(Ty(n,t),Cy(t,n),n.getFormatType()===``){let e=t.getAttribute(`align`);e&&MS(e)&&n.setFormat(e)}return wy(n,t),[n.splice(0,0,e.$importChildren(t))]},match:jS.tag(`p`),name:`@lexical/html/p`},{$import:(e,t,n)=>gy().hasNode(Kx)?[qx()]:n(),match:jS.tag(`hr`),name:`@lexical/html/hr`},{$import:(e,t,n)=>my(t)?kS(e.$importChildren(t,{schema:rde}),t):n(),match:jS.any(),name:`@lexical/html/transparent-block`},ude,fde,lde];function mde(e,t){let n=[],r=0,i=0;for(;r<e.length&&i<t.length;)e[r]<=t[i]?n.push(e[r++]):n.push(t[i++]);for(;r<e.length;)n.push(e[r++]);for(;i<t.length;)n.push(t[i++]);return n}function IS(e){let t=[],n=new Map,r=[],i=[],a=[],o=new Set;e.forEach((e,s)=>{let c=function(e){let t=e[uS];return t===void 0&&Yx(360),t}(e.match),l=e.name||function(e,t){return e.kind===`text`?`#text@${t}`:e.kind===`comment`?`#comment@${t}`:e.tags.size===0?`*@${t}`:`${Array.from(e.tags).join(`,`).toLowerCase()}@${t}`}(c,s);if(e.name&&o.add(e.name),t.push({$import:e.$import,name:l,predicate:c.predicate}),c.kind===`text`)i.push(s);else if(c.kind===`comment`)a.push(s);else if(c.tags.size===0)r.push(s);else for(let e of c.tags){let t=n.get(e);t||(t=[],n.set(e,t)),t.push(s)}});let s=new Map;if(r.length===0)for(let[e,t]of n)s.set(e,t);else for(let[e,t]of n)s.set(e,mde(t,r));return{byTag:s,commentIndices:a,rules:t,textIndices:i,wildcardIndices:r}}function LS(e,t){return X_(t)?e.textIndices:t.nodeType===8?e.commentIndices:uy(t)?e.byTag.get(t.nodeName)||e.wildcardIndices:hde}var hde=Object.freeze([]);function RS(e){let t=[];for(let n of e)if(gde(n))for(let e of n.rules)t.push(e);else t.push(n);return t}function gde(e){return typeof e==`object`&&!!e&&`__type`in e&&e.__type===`CompiledOverlayRules`}function zS(e){let t=RS(e);return{__type:`CompiledOverlayRules`,dispatch:IS(t),rules:t}}var _de=Object.freeze({});function vde(e,t){return{$importChildren:(t,n)=>function(e,t,n){let r=n&&n.rules?n.rules.dispatch:void 0;r&&e.overlays.push(r);try{let r=()=>BS(e,t,n);return n&&n.context?DS(n.context,e.editor)(r):r()}finally{r&&e.overlays.pop()}}(e,t,n),$importOne:(t,n)=>VS(e,t,n),captures:t,get:t=>nde(t,e.editor),session:e.session}}function BS(e,t,n){let r=n&&n.$onChild,i=[];for(let n of Array.from(t.childNodes)){let t=VS(e,n,void 0);for(let e of t){let t=r?r(e):e;t!=null&&i.push(t)}}let a=n&&n.$after?n.$after(i):i,o=n&&n.schema;return o?function(e,t,n,r){let i=[],a=null,o=()=>{if(a===null)return;let t=a;if(a=null,e.$packageRun){let a=e.$packageRun(t,n,r);if(a.length>0){for(let e of a)i.push(e);return}}if(e.onReject===`hoist`)for(let e of t)i.push(e)};for(let r of t)e.$accepts(r,n)?(o(),i.push(r)):(a===null&&(a=[]),a.push(r));return o(),e.$finalize?e.$finalize(i,n):i}(o,a,null,t):a}function VS(e,t,n){let r=()=>function(e,t){let n=function(e,t){let n=[];for(let r=e.overlays.length-1;r>=0;r--){let i=e.overlays[r],a=LS(i,t);a.length>0&&n.push({dispatch:i,indices:a})}let r=LS(e.dispatch,t);return r.length>0&&n.push({dispatch:e.dispatch,indices:r}),n}(e,t);if(n.length===0)return HS(e,t);let r=0,i=0,a=()=>{for(;r<n.length;){let{dispatch:o,indices:s}=n[r];for(;i<s.length;){let n=s[i++],r=o.rules[n],c={};if(r.predicate(t,c)){let n=vde(e,Object.keys(c).length===0?_de:c);try{return r.$import(n,t,a)}catch(e){throw e}}}r++,i=0}return HS(e,t)};return a()}(e,t);return n&&n.context?DS(n.context,e.editor)(r):r()}function HS(e,t){if(t.childNodes.length===0)return[];let n=[];for(let r of Array.from(t.childNodes)){let t=VS(e,r,void 0);for(let e of t)n.push(e)}return n}var US={build(e,t){let n=IS(RS(t.rules)),r=eS(t.contextDefaults,void 0),i=t.preprocess;return{$generateNodesFromDOM:(t,a)=>{let o=$x(lS,e)||r,s=a&&a.context?eS(a.context,o):o,c=s!==void 0&&s!==o?s:Object.create(o||null),l=new tde(c),u={session:l};return function(e,t,n){let r=e.length-1,i=()=>{for(;r>=0;)return void(0,e[r--])(t,n,i)};i()}(a&&a.preprocess?[...i,...a.preprocess]:i,t,u),nS(lS,c,()=>function(e,t,n,r){return BS({dispatch:e,editor:t,overlays:r.get(TS).map(e=>e.dispatch),session:r},Z_(n)?n.body:n,{schema:ide})}(n,e,t,l),e)},defaults:r}},config:{contextDefaults:[],preprocess:[Bue],rules:[{$import:(e,t)=>e.$importChildren(t),match:bS.any(),name:`@lexical/html/default-hoist`}]},mergeConfig:(e,t)=>Ib(e,{...t,...t.contextDefaults&&{contextDefaults:[...e.contextDefaults,...t.contextDefaults]},...t.preprocess&&{preprocess:[...e.preprocess,...t.preprocess]},...t.rules&&{rules:[...t.rules,...e.rules]}}),name:cS},WS={dependencies:[[US,{rules:pde}]],name:`@lexical/html/CoreImport`},GS={any:gS,comment:_S,css:Zue,tag:vS,text:yS},KS=new Set([`STYLE`,`SCRIPT`]);function qS(e,t){aS(t);let n=Z_(t)?t.body.childNodes:t.childNodes,r=[],i=[];for(let t of n)if(!KS.has(t.nodeName)){let n=XS(t,e,i,!1);if(n!==null)for(let e of n)r.push(e)}return function(e){for(let t of e)t.getParent()&&t.getNextSibling()instanceof s_&&t.insertAfter(l_());for(let t of e){let e=t.getParent();e&&e.splice(t.getIndexWithinParent(),1,t.getChildren())}}(i),r}function yde(e,t=null,n=gy()){return Kue([tS(Hue,!0)],n)(()=>{let r=dv(),i=Gue(n),a=tb(t),o=e.append.bind(e);for(let e of($(a)?a:r).getChildren())YS(n,e,o,t,i);return e})}function JS(e,t=null){return(typeof document>`u`||typeof window>`u`&&global.window===void 0)&&Yx(338),qce(e),yde(ny().createElement(`div`),t,e).innerHTML}function YS(e,t,n,r=null,i=_y(e)){let a=i.$shouldInclude(t,r,e),o=i.$shouldExclude(t,r,e),s=t;r!==null&&X(t)&&(s=Kb(r,t,`clone`));let{element:c,after:l,append:u,$getChildNodes:d}=i.$exportDOM(s,e);if(!c)return!1;let f=ny().createDocumentFragment(),p=d?d():$(s)?s.getChildren():[],m=a&&Lh(r)&&$(t)?null:r,h=f.append.bind(f),g=null;for(let n of p){let o=YS(e,n,h,m,i);o&&(g=n),!a&&o&&i.$extractWithChild(t,n,r,`html`,e)&&(a=!0)}if(a&&!o){if((uy(c)||fy(c))&&(u?u(f):c.append(f),function(e,t){let n=e.lastChild;if(u_(t)&&uy(e)&&my(e)&&n!==null&&n.nodeName===`BR`){let t=ny().createElement(`br`);t.setAttribute(`data-lexical-managed-linebreak`,`true`),e.append(t)}}(c,g)),fy(c)){if(l){let e=l.call(s,c);e&&c.replaceChildren(e)}n(c)}else if(n(c),l){let e=l.call(s,c);e&&c.replaceWith(e)}}else n(f);return a}function XS(e,t,n,r,i=new Map,a){let o=[];if(KS.has(e.nodeName))return o;let s=null,c=function(e,t){let{nodeName:n}=e,r=t._htmlConversions.get(n.toLowerCase()),i=null;if(r!==void 0)for(let t of r){let n=t(e);n!==null&&(i===null||(i.priority||0)<=(n.priority||0))&&(i=n)}return i===null?null:i.conversion}(e,t),l=c?c(e):null,u=null;if(l!==null){u=l.after;let t=l.node;if(s=Array.isArray(t)?t[t.length-1]:t,s!==null){for(let[,e]of i)if(s=e(s,a),!s)break;s&&o.push(...Array.isArray(t)?t:[s])}l.forChild!=null&&i.set(e.nodeName,l.forChild)}let d=e.childNodes,f=[],p=(s==null||!Wv(s))&&(s!=null&&eg(s)||r);for(let e=0;e<d.length;e++)f.push(...XS(d[e],t,n,p,new Map(i),s));if(u!=null&&(f=u(f)),my(e)&&(f=function(e,t,n){let r=e.style.textAlign,i=[],a=[];for(let e=0;e<t.length;e++){let o=t[e];if(eg(o))r&&!o.getFormat()&&o.setFormat(r),i.push(o);else if(a.push(o),e===t.length-1||e<t.length-1&&eg(t[e+1])){let e=n();e.setFormat(r),e.append(...a),i.push(e),a=[]}}return i}(e,f,p?()=>{let e=new s_;return n.push(e),e}:j_)),s==null){if(f.length>0)for(let e of f)o.push(e);else my(e)&&function(e){return e.nextSibling!=null&&e.previousSibling!=null&&py(e.nextSibling)&&py(e.previousSibling)}(e)&&o.push(l_())}else $(s)&&s.append(...f);return o}function bde(e,t={}){let n={};for(let r in e){let i=t[r];n[r]=Px(i===void 0?e[r]:i)}return n}function xde(e){return()=>{}}function ZS(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function QS(e,t){let n=e;for(let r=yb(e,t);r&&(vC(r.origin)||Oh(r.origin));r=r.getAdjacentCaret())n=r.origin;return n}function $S(e){return QS(e,`previous`)}function eC(e){return QS(e,`next`)}function Sde(e){let t=$S(e),n=eC(e),r=t;for(;r!==null;){if(vC(r)){let e=ple(r.getTextContent());if(e!==null)return e}if(r===n)break;r=r.getNextSibling()}let i=t.getParent();if($(i)){let e=i.getDirection();if(e===`ltr`||e===`rtl`)return e}return null}function Cde(e,t){let n=null,r=null,i=e,a=t,o=e.getTextContent();for(;;){if(a===0){let e=i.getPreviousSibling();if(e===null){i=null;break}if(vC(e)||Oh(e)||u_(e)||ZS(167),i=e,u_(i)){n={node:i,offset:1};break}a=Math.max(0,i.getTextContentSize()-1),o=i.getTextContent()}else a--;let e=o[a];vC(i)&&e!==` `&&(r={node:i,offset:a})}if(r!==null)return r;let s=null;if(t<e.getTextContentSize())vC(e)&&(s=e.getTextContent()[t]);else{let t=e.getNextSibling();vC(t)&&(s=t.getTextContent()[0])}if(s!==null&&s!==` `)return n;{let r=function(e,t){let n=e,r=t,i=e.getTextContent(),a=e.getTextContentSize();for(;;){if(!vC(n)||r===a){if(n=n.getNextSibling(),n===null||u_(n))return null;vC(n)&&(r=0,i=n.getTextContent(),a=n.getTextContentSize())}if(vC(n)){if(i[r]!==` `)return{node:n,offset:r};r++}}}(e,t);return r===null?n:r}}function wde(e){let t=eC(e);return u_(t)&&ZS(168),t}function Tde(e){let t=[];return mg(e,{linebreak:()=>t.push(l_()),tab:()=>t.push(Dh()),text:e=>t.push(_C(e))}),t}function tC(e,t,n){if(!Number.isInteger(t)||t<=0)return!1;let r=e.getTextContent(),i=/^ +/.exec(r);if(!i)return!1;let a=Math.min(t,i[0].length),o=e.getKey(),s=n.anchor.key===o&&n.anchor.type===`text`?n.anchor.offset:null,c=n.focus.key===o&&n.focus.type===`text`?n.focus.offset:null;return e.spliceText(0,a,``),s!==null&&n.anchor.set(o,Math.max(0,s-a),`text`),c!==null&&n.focus.set(o,Math.max(0,c-a),`text`),!0}var Ede=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function nC(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Ede.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}var Dde=e=>{let t=Zd(e,`format`),n=Qd(e,`format`),r=ef(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],language:e.__language,theme:e.__theme,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__language;o!==void 0&&(a.language=o);let s=e.__theme;s!==void 0&&(a.theme=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=function(e){let t=nC(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=nC(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.language;e.setLanguage(s==null||typeof s==`string`?s:``);let c=t.theme;return e.setTheme(c===void 0?void 0:typeof c==`string`?c:``),e}}};function Ode(e,t){e.__highlightType=t.__highlightType}var kde=e=>{let t=Zd(e,`mode`),n=$d(e,`detail`,0),r=$d(e,`format`,0),i=Qd(e,`mode`),a=ef(e,`mode`);return{exportJSON:function(e){return{highlightType:e.__highlightType,detail:e.__detail,format:e.__format,mode:t[e.__mode],style:e.__style,text:e.__text,type:e.__type,version:1}},exportCompactJSON:function(e){let n={type:e.__type},r=e.__highlightType;r!==void 0&&(n.highlightType=r);let i=e.__detail;i!==void 0&&i!==0&&(n.detail=i);let a=e.__format;a!==void 0&&a!==0&&(n.format=a);let o=t[e.__mode];o!==void 0&&o!==`normal`&&(n.mode=o);let s=e.__style;s!==void 0&&s!==``&&(n.style=s);let c=e.__text;return c!==void 0&&c!==``&&(n.text=c),n},updateFromJSON:function(e,t){let o=t.detail;e.__detail=typeof o==`string`&&o in n?n[o]:nC(o,0);let s=t.format;e.setFormat(typeof s==`string`&&s in r?r[s]:nC(s,0));let c=t.mode;e.__mode=typeof c==`string`&&c in i?i[c]:a;let l=t.style;e.__style=typeof l==`string`?l:``;let u=t.text;e.__text=typeof u==`string`?u:``;let d=t.highlightType;return e.setHighlightType(d==null||typeof d==`string`?d:``),e},afterCloneFrom:Ode}},Ade=_f()({language:bf(gf(hf(df())),{getter:{field:`__language`}}),theme:bf(gf(df()),{getter:{field:`__theme`}})});function rC(e,t){for(let n of e.childNodes)if(uy(n)&&n.tagName===t||rC(n,t))return!0;return!1}var iC=`data-language`,aC=`data-highlight-language`,oC=`data-theme`,jde=xde(),sC=class extends Zg{__language;__theme;__isSyntaxHighlightSupported;$config(){return this.config(`code`,{extends:Zg,generated:Dde,importDOM:{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||rC(e,`BR`))?{conversion:uC,priority:1}:null,div:()=>({conversion:Mde,priority:1}),pre:()=>({conversion:uC,priority:0}),table:e=>pC(e)?{conversion:Nde,priority:3}:null,td:e=>{let t=e,n=t.closest(`table`);return t.classList.contains(`js-file-line`)||n&&pC(n)?{conversion:dC,priority:3}:null},tr:e=>{let t=e.closest(`table`);return t&&pC(t)?{conversion:dC,priority:3}:null}},json:Ade})}constructor(e=void 0,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),function(e,t){e.__language=t.__language,e.__theme=t.__theme}(this,e),this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){let t=ny().createElement(`code`);Rb(t,e.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(iC,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(aC,n));let r=this.getTheme();r&&t.setAttribute(oC,r);let i=this.getStyle();return i&&fh(t.style,i),t}updateDOM(e,t,n){let r=this.__language,i=e.__language;r?r!==i&&t.setAttribute(iC,r):i&&t.removeAttribute(iC);let a=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&i?a&&r?r!==i&&t.setAttribute(aC,r):t.removeAttribute(aC):a&&r&&t.setAttribute(aC,r);let o=this.__theme,s=e.__theme;o?o!==s&&t.setAttribute(oC,o):s&&t.removeAttribute(oC);let c=this.__style,l=e.__style;return c!==l&&fh(t.style,c,l),!1}exportDOM(e){let t=ny().createElement(`pre`);Rb(t,e._config.theme.code),t.setAttribute(`spellcheck`,`false`);let n=this.getLanguage();n&&(t.setAttribute(iC,n),this.getIsSyntaxHighlightSupported()&&t.setAttribute(aC,n));let r=this.getTheme();r&&t.setAttribute(oC,r);let i=this.getStyle();return i&&fh(t.style,i),{element:t}}insertNewAfter(e,t=!0){if(!xx(gy(),`@lexical/code`)){jde();let t=mC(e);if(t)return t}let{anchor:n,focus:r}=e,i=(n.isBefore(r)?n:r).getNode();if(X(i)){let e=$S(i),t=[];for(;;)if(Oh(e))t.push(Dh()),e=e.getNextSibling();else{if(!vC(e))break;{let n=0,r=e.getTextContent(),i=e.getTextContentSize();for(;n<i&&r[n]===` `;)n++;if(n!==0&&t.push(_C(` `.repeat(n))),n!==i)break;e=e.getNextSibling()}}let r=i.splitText(n.offset)[0],a=n.offset===0?0:1,o=r.getIndexWithinParent()+a,s=i.getParentOrThrow(),c=[l_(),...t];s.splice(o,0,c);let l=t[t.length-1];l?l.select():n.offset===0?r.selectPrevious():r.getNextSibling().selectNext(0,0)}if(lC(i)){let{offset:t}=e.anchor;i.splice(t,0,[l_()]),i.select(t+1,t+1)}return null}canIndent(){return!1}collapseAtStart(){let e=j_();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){let t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){let t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){let t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function cC(e,t){return Gy(sC).setLanguage(e).setTheme(t)}function lC(e){return e instanceof sC}function uC(e){return{node:cC(e.getAttribute(iC),e.getAttribute(oC))}}function Mde(e){let t=e,n=fC(t);return n||function(e){let t=e.parentElement;for(;t!==null;){if(fC(t))return!0;t=t.parentElement}return!1}(t)?{node:n?cC():null}:{node:null}}function Nde(){return{node:cC()}}function dC(){return{node:null}}function fC(e){return e.style.fontFamily.match(`monospace`)!==null}function pC(e){return e.classList.contains(`js-file-line-container`)}function mC(e){let{anchor:t}=e;if(e.isCollapsed()&&t.type===`element`){let e=t.getNode();if(lC(e)){let n=e.getChildrenSize();if(n>=2&&t.offset===n){let t=e.getLastChild();if(u_(t)&&u_(t.getPreviousSibling())){let t=j_();return e.splice(n-2,2,[]).insertAfter(t,!1),t.select(),t}}}}return null}var Pde=_f()({highlightType:bf(gf(hf(df())),{getter:{field:`__highlightType`}})}),hC=class extends bh{__highlightType;constructor(e=``,t,n){super(e,n),this.__highlightType=t}$config(){return this.config(`code-highlight`,{extends:bh,generated:kde,json:Pde})}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){let t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){let t=super.createDOM(e);return Rb(t,gC(e.theme,this.__highlightType)),t}updateDOM(e,t,n){let r=super.updateDOM(e,t,n),i=gC(n.theme,e.__highlightType),a=gC(n.theme,this.__highlightType);return i!==a&&(i&&zb(t,i),a&&Rb(t,a)),r}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return cC()}};function gC(e,t){return t&&e&&e.codeHighlight&&e.codeHighlight[t]}function _C(e=``,t){return Kv(new hC(e,t))}function vC(e){return e instanceof hC}var yC=`data-language`,bC=`data-theme`;function xC(e){return e.style.fontFamily.match(`monospace`)!==null}function SC(e){let t=e.parentElement;for(;t!==null;){if(xC(t))return!0;t=t.parentElement}return!1}var Fde=zS([{$import:(e,t)=>e.$importChildren(t),match:GS.tag(`tr`,`td`),name:`@lexical/code/github-code-table/unwrap`}]),Ide={$import:(e,t)=>[cC(t.getAttribute(yC),t.getAttribute(bC)).splice(0,0,e.$importChildren(t))],match:GS.tag(`pre`),name:`@lexical/code/pre`},Lde={$import:(e,t,n)=>{let r=t.textContent||``;return/\r?\n/.test(r)||t.querySelector(`br`)!==null?[cC(t.getAttribute(yC),t.getAttribute(bC)).splice(0,0,e.$importChildren(t))]:n()},match:GS.tag(`code`),name:`@lexical/code/code-multiline`};function CC(e){if(!uy(e))return!1;let t=e.style.fontFamily,n=e.style.whiteSpace;return typeof t==`string`&&/monospace/i.test(t)&&typeof n==`string`&&n.startsWith(`pre`)}function wC(e){let t=!1,n=[],r=``,i=!1,a=()=>{i&&=(n.push(r),r=``,!1)};for(let o of Array.from(e.childNodes))if(uy(o))o.tagName===`DIV`?(a(),n.push(o.textContent||``),t=!0):o.tagName===`BR`?(a(),n.push(``),t=!0):(r+=o.textContent||``,i=!0);else if(X_(o)){let e=o.textContent||``;e.length>0&&(r+=e,i=!0)}return a(),t?n:null}function TC(e){for(let t of Array.from(e.children))if(uy(t)&&CC(t)){if(wC(t)!==null)return!0;let e=t.nextElementSibling;if(e&&CC(e))return!0}else if(TC(t))return!0;return!1}var Rde=zS([{$import:(e,t,n)=>{if(!CC(t)||SC(t))return n();let r=wC(t);return r===null||r.length===0?n():[cC().splice(0,0,hg(r.join(`
`)))]},match:GS.tag(`div`),name:`@lexical/code/vscode-wrapper`},{$import:(e,t,n)=>{if(!CC(t)||SC(t))return n();let r=t.previousElementSibling;if(r&&CC(r))return[];let i=[],a=t;for(;a&&CC(a);)i.push(a.tagName===`BR`?``:a.textContent||``),a=a.nextElementSibling;return i.length<2?n():[cC().splice(0,0,hg(i.join(`
`)))]},match:GS.tag(`div`,`br`),name:`@lexical/code/vscode-line-run`}]),zde={$import:(e,t,n)=>xC(t)?[cC().splice(0,0,e.$importChildren(t))]:SC(t)?e.$importChildren(t):n(),match:GS.tag(`div`),name:`@lexical/code/div`},Bde={dependencies:[WS,[US,{preprocess:[(e,t,n)=>{TC(Z_(e)?e.body:e)&&t.session.update(TS,e=>[...e,Rde]),n()}],rules:[{$import:(e,t)=>[cC().splice(0,0,e.$importChildren(t,{rules:Fde}))],match:GS.tag(`table`).classAll(`js-file-line-container`),name:`@lexical/code/github-code-table`},{$import:(e,t)=>e.$importChildren(t),match:GS.tag(`td`).classAll(`js-file-line`),name:`@lexical/code/github-code-cell-by-class`},Lde,Ide,zde]}]],name:`@lexical/code`,nodes:()=>[sC,hC],register:e=>Bb(e.registerCommand(im,e=>{let t=Q();return!(!Z(t)||!mC(t)||(e!==null&&e.preventDefault(),0))},1),e.registerNodeTransform(Eh,e=>{e.getFormat()!==0&&lC(e.getParent())&&e.setFormat(0)}))};function EC(e){if(!Z(e))return!1;let t=e.anchor.getNode(),n=lC(t)?t:t.getParent(),r=e.focus.getNode(),i=lC(r)?r:r.getParent();return lC(n)&&n.is(i)}function DC(e){let t=e.getNodes(),n=[];if(t.length===1&&lC(t[0]))return n;let r=[];for(let e=0;e<t.length;e++){let i=t[e];vC(i)||Oh(i)||u_(i)||ZS(169),u_(i)?r.length>0&&(n.push(r),r=[]):r.push(i)}if(r.length>0){let t=e.isBackward()?e.anchor:e.focus,i=kh(r[0].getKey(),0,`text`);t.is(i)||n.push(r)}return n}function OC(e,t){let n=Q();if(!Z(n)||!EC(n))return!1;let r=DC(n),i=r.length;if(i===0&&n.isCollapsed())return e===dm?n.insertNodes([Dh()]):function(e,t){let n=e.anchor.getNode();if(!vC(n)&&!Oh(n))return;let r=$S(n);Oh(r)?r.remove():t!==void 0&&vC(r)&&tC(r,t,e)}(n,t),!0;if(i===0&&e===dm&&n.getTextContent()===`
`){let e=Dh(),t=l_(),r=n.isBackward()?`previous`:`next`;return n.insertNodes([e,t]),g_(w_(kb(bb(e,`next`,0),S_(yb(t,`next`))),r)),!0}for(let a=0;a<i;a++){let i=r[a];if(i.length>0){let r=i[0];if(a===0&&(r=$S(r)),e===dm){let e=Dh();if(r.insertBefore(e),a===0){let t=n.isBackward()?`focus`:`anchor`,i=kh(r.getKey(),0,`text`);n[t].is(i)&&n[t].set(e.getKey(),0,`text`)}}else Oh(r)?r.remove():t!==void 0&&vC(r)&&tC(r,t,n)}}return!0}function kC(e,t){let n=Q();if(!Z(n))return!1;let{anchor:r,focus:i}=n,a=r.offset,o=i.offset,s=r.getNode(),c=i.getNode(),l=e===nm;if(!EC(n)||!vC(s)&&!Oh(s)||!vC(c)&&!Oh(c))return!1;if(!t.altKey){if(n.isCollapsed()){let e=s.getParentOrThrow();if(l&&a===0&&s.getPreviousSibling()===null){if(e.getPreviousSibling()===null)return e.selectPrevious(),t.preventDefault(),!1}else if(!l&&a===s.getTextContentSize()&&s.getNextSibling()===null&&e.getNextSibling()===null)return e.selectNext(),t.preventDefault(),!1}return!1}let u,d;if(s.isBefore(c)?(u=$S(s),d=eC(c)):(u=$S(c),d=eC(s)),u==null||d==null)return!1;let f=u.getNodesBetween(d);for(let e=0;e<f.length;e++){let t=f[e];if(!vC(t)&&!Oh(t)&&!u_(t))return!1}t.preventDefault(),t.stopPropagation();let p=l?u.getPreviousSibling():d.getNextSibling();if(!u_(p))return!0;let m=l?p.getPreviousSibling():p.getNextSibling();if(m==null)return!0;let h=u_(m),g=(h||!vC(m)&&!Oh(m)?null:l?$S(m):eC(m))??m;return p.remove(),f.forEach(e=>e.remove()),h?(f.forEach(e=>{g.insertAfter(e),g=e}),g.insertAfter(p)):e===nm?(f.forEach(e=>g.insertBefore(e)),g.insertBefore(p)):(g.insertAfter(p),g=p,f.forEach(e=>{g.insertAfter(e),g=e})),n.setTextNodeRange(s,a,c,o),!0}function AC(e,t){let n=Q();if(!Z(n))return!1;let{anchor:r,focus:i}=n,a=r.getNode(),o=i.getNode(),s=e===tm;if(!EC(n)||!vC(a)&&!Oh(a)||!vC(o)&&!Oh(o))return!1;let c=o,l=Sde(c)===`rtl`?!s:s,u=r.key,d=r.offset,f=r.type;if(l){let e=Cde(c,i.offset);if(e!==null){let{node:t,offset:r}=e;u_(t)?t.selectNext(0,0):n.setTextNodeRange(t,r,t,r)}else c.getParentOrThrow().selectStart()}else wde(c).select();return t.shiftKey&&n.anchor.set(u,d,f),t.preventDefault(),t.stopPropagation(),!0}function Vde(e,t,n){return Bb(...n?[e.registerCommand(rm,e=>!e.altKey&&ux(lC,e),1),e.registerCommand(Qp,e=>ux(lC,e),1),e.registerCommand(nm,e=>!e.altKey&&lx(lC,e),1),e.registerCommand(em,e=>lx(lC,e),1)]:[],e.registerCommand(lm,t=>{let n=function(e){let t=Q();if(!Z(t)||!EC(t))return null;let n=e?fm:dm,r=e?fm:um,i=t.anchor,a=t.focus;if(i.is(a))return r;let o=DC(t);if(o.length!==1)return n;let s=o[0],c,l;s.length===0&&ZS(285),t.isBackward()?(c=a,l=i):(c=i,l=a);let u=$S(s[0]),d=eC(s[0]),f=kh(u.getKey(),0,`text`),p=kh(d.getKey(),d.getTextContentSize(),`text`);return c.isBefore(f)||p.isBefore(l)?n:f.isBefore(c)||l.isBefore(p)?r:n}(t.shiftKey);return n!==null&&(t.preventDefault(),e.dispatchCommand(n),!0)},1),e.registerCommand(um,()=>!!EC(Q())&&(pg([Dh()]),!0),1),e.registerCommand(dm,()=>OC(dm),1),e.registerCommand(fm,()=>OC(fm,t),1),e.registerCommand(nm,e=>{let t=Q();if(!Z(t))return!1;let{anchor:n}=t,r=n.getNode();if(!EC(t))return!1;let i=r.getParent();return t.isCollapsed()&&n.offset===0&&r.getPreviousSibling()===null&&lC(i)&&i.getPreviousSibling()===null?(e.preventDefault(),!0):kC(nm,e)},1),e.registerCommand(rm,e=>{let t=Q();if(!Z(t))return!1;let{anchor:n}=t,r=n.getNode();return!!EC(t)&&(t.isCollapsed()&&n.offset===r.getTextContentSize()&&r.getNextSibling()===null&&lC(r.getParentOrThrow())&&r.getParentOrThrow().getNextSibling()===null?(e.preventDefault(),!0):kC(rm,e))},1),e.registerCommand(tm,e=>AC(tm,e),1),e.registerCommand($p,e=>AC($p,e),1))}var Hde=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function jC(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Hde.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function MC(e,t,n,r,i){let a=jC(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Ude(e,t){e.__rel=t.__rel,e.__target=t.__target,e.__title=t.__title,e.__url=t.__url}var Wde=e=>{let t=Zd(e,`format`),n=Qd(e,`format`),r=ef(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],rel:e.__rel,target:e.__target,title:e.__title,url:e.__url,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__rel;o!=null&&(a.rel=o);let s=e.__target;s!=null&&(a.target=s);let c=e.__title;c!=null&&(a.title=c);let l=e.__url;l!==void 0&&l!==``&&(a.url=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=MC(t.indent,0,0,1/0),e.__textFormat=jC(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.rel;e.__rel=typeof s==`string`&&s!==``?s:null;let c=t.target;e.__target=typeof c==`string`&&c!==``?c:null;let l=t.title;e.__title=typeof l==`string`&&l!==``?l:null;let u=t.url;return e.__url=typeof u==`string`?u:``,e},afterCloneFrom:Ude}};function Gde(e,t){e.__isUnlinked=t.__isUnlinked}var Kde=e=>{let t=Zd(e,`format`),n=Qd(e,`format`),r=ef(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title,url:e.__url,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__isUnlinked;o!==void 0&&!1!==o&&(a.isUnlinked=o);let s=e.__rel;s!=null&&(a.rel=s);let c=e.__target;c!=null&&(a.target=c);let l=e.__title;l!=null&&(a.title=l);let u=e.__url;u!==void 0&&u!==``&&(a.url=u);let d=e.__dir;d!=null&&(a.direction=d);let f=t[e.__format];f!==void 0&&f!==``&&(a.format=f);let p=e.__indent;return p!==void 0&&p!==0&&(a.indent=p),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=MC(t.indent,0,0,1/0),e.__textFormat=jC(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.rel;e.__rel=typeof s==`string`&&s!==``?s:null;let c=t.target;e.__target=typeof c==`string`&&c!==``?c:null;let l=t.title;e.__title=typeof l==`string`&&l!==``?l:null;let u=t.url;e.__url=typeof u==`string`?u:``;let d=t.isUnlinked;return e.__isUnlinked=typeof d==`boolean`&&d,e},afterCloneFrom:Gde}},NC=new Set([`http:`,`https:`,`mailto:`,`sms:`,`tel:`]),qde=_f()({rel:yf(hf(df(),{defaultAsNull:!0}),{field:`__rel`}),target:yf(hf(df(),{defaultAsNull:!0}),{field:`__target`}),title:yf(hf(df(),{defaultAsNull:!0}),{field:`__title`}),url:yf(df(),{field:`__url`,getter:`getURL`,setter:`setURL`})}),PC=class extends Zg{__url;__target;__rel;__title;$config(){return this.config(`link`,{extends:Zg,generated:Wde,importDOM:{a:()=>({conversion:Jde,priority:1})},json:qde})}constructor(e=``,t={},n){super(n);let{target:r=null,rel:i=null,title:a=null}=t;this.__url=e,this.__target=r,this.__rel=i,this.__title=a}createDOM(e){let t=ny().createElement(`a`);return this.updateLinkDOM(null,t,e),Rb(t,e.theme.link),t}updateLinkDOM(e,t,n){if(ly(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(let n of[`target`,`rel`,`title`]){let r=`__${n}`,i=this[r];e&&e[r]===i||(i?t[n]=i:t.removeAttribute(n))}}}updateDOM(e,t,n){return this.updateLinkDOM(e,t,n),!1}sanitizeUrl(e){let t=e;e=BC(e);try{let t=new URL(BC(e));if(!NC.has(t.protocol))return`about:blank`}catch{let e=t.replace(/[\u0000-\u001F\u007F\s]/g,``).match(/^([a-z][a-z0-9+.-]*):/i);if(e!=null&&!NC.has(`${e[1].toLowerCase()}:`))return`about:blank`}return e}getURL(){return this.getLatest().__url}setURL(e){let t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){let t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){let t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){let t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){let n=Gv(this);return this.insertAfter(n,t),n}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,n){if(!Z(t))return!1;let r=t.anchor.getNode(),i=t.focus.getNode();return(this.is(r)||this.isParentOf(r))&&(this.is(i)||this.isParentOf(i))&&t.getTextContent().length>0}isEmailURI(){return this.getURL().startsWith(`mailto:`)}isWebSiteURI(){let e=this.getURL();return e.startsWith(`https://`)||e.startsWith(`http://`)}shouldMergeAdjacentLink(e){return this.getType()===e.getType()&&this.getURL()===e.getURL()&&this.getTarget()===e.getTarget()&&this.getRel()===e.getRel()&&this.getTitle()===e.getTitle()}};function Jde(e){let t=null;if(ly(e)){let n=e.textContent;(n!==null&&n!==``||e.children.length>0)&&(t=FC(e.getAttribute(`href`)||``,{rel:e.getAttribute(`rel`),target:e.getAttribute(`target`),title:e.getAttribute(`title`)}))}return{node:t}}function FC(e=``,t){return Kv(new PC(e,t))}function IC(e){return e instanceof PC}var Yde=_f()({isUnlinked:yf(pf(),{field:`__isUnlinked`})}),Xde=class extends PC{__isUnlinked;constructor(e=``,t={},n){super(e,t,n),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}$config(){return this.config(`autolink`,{extends:PC,generated:Kde,json:Yde})}shouldMergeAdjacentLink(e){return!1}getIsUnlinked(){return this.getLatest().__isUnlinked}setIsUnlinked(e){let t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?ny().createElement(`span`):super.createDOM(e)}updateDOM(e,t,n){return super.updateDOM(e,t,n)||e.__isUnlinked!==this.__isUnlinked}};function LC(e){return e instanceof Xde}var RC=Mp(`TOGGLE_LINK_COMMAND`);function zC(e,t){if(e.type===`element`){let n=e.getNode();return $(n)||function(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}(252),n.getChildren()[e.offset+t]||null}return null}function Zde(e,t={}){let n;if(e&&typeof e==`object`){let{url:r,...i}=e;n=r,t={...i,...t}}else n=e;let{target:r,title:i}=t,a=t.rel===void 0?`noreferrer`:t.rel,o=Q();if(o===null||!Z(o)&&!Lh(o))return;if(Lh(o)){let e=o.getNodes();if(e.length===0)return;e.forEach(e=>{if(n===null){let t=Ky(e,e=>!LC(e)&&IC(e));t&&(t.insertBefore(e),t.getChildren().length===0&&t.remove())}else{let t=Ky(e,e=>!LC(e)&&IC(e));if(t)t.setURL(n),r!==void 0&&t.setTarget(r),a!==void 0&&t.setRel(a),i!==void 0&&t.setTitle(i);else{let t=FC(n,{rel:a,target:r,title:i});e.insertBefore(t),t.append(e)}}});return}if(o.isCollapsed()&&n===null)for(let e of o.getNodes()){let t=Ky(e,e=>!LC(e)&&IC(e));t!==null&&(t.getParentOrThrow().splice(t.getIndexWithinParent(),0,t.getChildren()),t.remove());return}let s=o.extract();if(n===null){let e=new Set;s.forEach(t=>{let n=Ky(t,e=>!LC(e)&&IC(e));if(n!==null){let t=n.getKey();if(e.has(t))return;(function(e,t){let n=new Set(t.filter(t=>e.isParentOf(t)).map(e=>e.getKey())),r=e.getChildren(),i=r=>n.has(r.getKey())||$(r)&&t.some(t=>e.isParentOf(t)&&r.isParentOf(t)),a=r.filter(i);if(a.length===r.length)return r.forEach(t=>e.insertBefore(t)),void e.remove();let o=r.findIndex(i),s=r.findLastIndex(i),c=o===0,l=s===r.length-1;if(c)a.forEach(t=>e.insertBefore(t));else if(l)for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);else{for(let t=a.length-1;t>=0;t--)e.insertAfter(a[t]);let t=r.slice(s+1);if(t.length>0){let n=Gv(e);a[a.length-1].insertAfter(n),t.forEach(e=>n.append(e))}}})(n,s),e.add(t)}});return}let c=new Set,l=e=>{c.has(e.getKey())||(c.add(e.getKey()),e.setURL(n),r!==void 0&&e.setTarget(r),a!==void 0&&e.setRel(a),i!==void 0&&e.setTitle(i))};if(s.length===1){let e=s[0],t=Ky(e,IC);if(t!==null)return l(t)}(function(e){let t=Q();if(!Z(t))return e();let n=Ff(t),r=n.isBackward(),i=zC(n.anchor,r?-1:0),a=zC(n.focus,r?0:-1);if(e(),i||a){let e=Q();if(Z(e)){let t=e.clone();if(i){let e=i.getParent();e&&t.anchor.set(e.getKey(),i.getIndexWithinParent()+ +!!r,`element`)}if(a){let e=a.getParent();e&&t.focus.set(e.getKey(),a.getIndexWithinParent()+ +!r,`element`)}pv(Ff(t))}}})(()=>{let e=null;for(let t of s){if(!t.isAttached())continue;let o=Ky(t,IC);if(o){l(o);continue}if($(t)){if(!t.isInline())continue;if(IC(t)){if(!(LC(t)||e!==null&&e.getParentOrThrow().isParentOf(t))){l(t),e=t;continue}for(let e of t.getChildren())t.insertBefore(e);t.remove();continue}}let s=t.getPreviousSibling();IC(s)&&s.is(e)?s.append(t):(e=FC(n,{rel:a,target:r,title:i}),t.insertAfter(e),e.append(t))}})}var Qde=/^\+?[0-9\s()-]{5,}$/;function BC(e){return e.match(/^[a-z][a-z0-9+.-]*:/i)||e.match(/^[/#.]/)?e:e.includes(`@`)?`mailto:${e}`:Qde.test(e)?`tel:${e}`:`https://${e}`}function VC(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function $de(e){let t=1,n=e.getParent();for(;n!=null;){if(ew(n)){let e=n.getParent();if(ow(e)){t++,n=e.getParent();continue}VC(40)}return t}return t}function efe(e){let t=e.getParent();ow(t)||VC(40);let n=t,r=t;for(;r!==null;)r=r.getParent(),ow(r)&&(n=r);return n}function HC(e){return ew(e)&&ow(e.getFirstChild())}function UC(e,t){return t.getValue()}function tfe(e,t){return ew(e)&&(t.length===0||t.length===1&&e.is(t[0])&&e.getChildrenSize()===0)}function WC(e,t){return ow(e)?Gv(e).setListType(t):aw(t)}function nfe(e){let t=Q();if(t!==null){let n=t.getNodes();if(Z(t)){let[r]=t.getStartEndPoints(),i=r.getNode(),a=i.getParent();if(Wv(i)){let e=i.getFirstChild();if(e)n=e.selectStart().getNodes();else{let e=j_();i.append(e),n=e.select().getNodes()}}else if(tfe(i,n)){if(Wv(a)){let t=aw(e);i.replace(t);let n=$C();$(i)&&(n.setFormat(i.getFormatType()),n.setIndent(i.getIndent())),t.append(n)}else if(ew(i)){let t=i.getParentOrThrow();if($y(t)===null){let n=WC(t,e);GC(n,t.getChildren()),t.replace(n)}}return}}let r=new Set;for(let t=0;t<n.length;t++){let i=n[t];if($(i)&&i.isEmpty()&&!ew(i)&&$y(i)===null&&!r.has(i.getKey())){KC(i,e);continue}let a=hle(i)?i.getParent():ew(i)&&i.isEmpty()?i:null;for(;a!=null;){let t=a.getKey();if(ow(a)){if(!r.has(t)&&$y(a)===null){let n=WC(a,e);GC(n,a.getChildren()),a.replace(n),r.add(t)}break}{let n=a.getParent();if(Wv(n)&&!r.has(t)){r.add(t),KC(a,e);break}a=n}}}}}function GC(e,t){e.splice(e.getChildrenSize(),0,t)}function KC(e,t){if(ow(e))return e;let n=e.getPreviousSibling(),r=e.getNextSibling(),i=$C(),a;if(GC(i,e.getChildren()),ow(n)&&t===n.getListType())n.append(i),ow(r)&&t===r.getListType()&&(GC(n,r.getChildren()),r.remove()),a=n;else if(ow(r)&&t===r.getListType())r.getFirstChildOrThrow().insertBefore(i),a=r;else{let n=aw(t);n.append(i),e.replace(n),a=n}i.setFormat(e.getFormatType()),i.setIndent(e.getIndent());let o=Q();return Z(o)&&(a.getKey()===o.anchor.key&&o.anchor.set(i.getKey(),o.anchor.offset,`element`),a.getKey()===o.focus.key&&o.focus.set(i.getKey(),o.focus.offset,`element`)),e.remove(),a}function qC(e,t){let n=e.getLastChild(),r=t.getFirstChild();n&&r&&HC(n)&&HC(r)&&n.getFirstChild().getListType()===r.getFirstChild().getListType()&&(qC(n.getFirstChild(),r.getFirstChild()),r.remove());let i=t.getChildren();i.length>0&&e.append(...i),t.remove()}function rfe(e){let t=e.getListType()!==`check`,n=e.getStart();for(let r of e.getChildren())ew(r)&&(r.getValue()!==n&&r.setValue(n),t&&r.getLatest().__checked!=null&&r.setChecked(void 0),ow(r.getFirstChild())||n++)}function ife(e){let t=new Set;if(HC(e)||t.has(e.getKey()))return;let n=e.getParent(),r=e.getNextSibling(),i=e.getPreviousSibling();if(HC(r)&&HC(i)){let n=i.getFirstChild();if(ow(n)){n.append(e);let i=r.getFirstChild();ow(i)&&n.getListType()===i.getListType()&&(GC(n,i.getChildren()),r.remove(),t.add(r.getKey()))}}else if(HC(r)){let t=r.getFirstChild();if(ow(t)){let n=t.getFirstChild();n!==null&&n.insertBefore(e)}}else if(HC(i)){let t=i.getFirstChild();ow(t)&&t.append(e)}else if(ow(n)){let t=Gv(e),a=Gv(n);t.append(a),a.append(e),i?i.insertAfter(t):r?r.insertBefore(t):n.append(t)}}function JC(e){if(HC(e))return;let t=e.getParent(),n=t?t.getParent():void 0;if(ow(n?n.getParent():void 0)&&ew(n)&&ow(t)){let r=t?t.getFirstChild():void 0,i=t?t.getLastChild():void 0;if(e.is(r))n.insertBefore(e),t.isEmpty()&&n.remove();else if(e.is(i))n.insertAfter(e),t.isEmpty()&&n.remove();else{let r=Gv(e),i=Gv(t);r.append(i),e.getPreviousSiblings().forEach(e=>i.append(e));let a=Gv(e),o=Gv(t);a.append(o),GC(o,e.getNextSiblings()),n.insertBefore(r),n.insertAfter(a),n.replace(e)}}}function afe(e=!1){let t=Q();if(!Z(t)||!t.isCollapsed())return!1;let n=t.anchor.getNode(),r=null;if(ew(n)&&n.getChildrenSize()===0)r=n;else if(X(n)){let e=n.getParent();ew(e)&&e.getChildren().every(e=>X(e)&&e.getTextContent().trim()===``)&&(r=e)}if(r===null)return!1;let i=efe(r),a=r.getParent();ow(a)||VC(40);let o=a.getParent(),s;if(Wv(o))s=j_(),i.insertAfter(s);else{if(!ew(o))return!1;s=Gv(o),o.insertAfter(s)}s.setTextStyle(t.style).setTextFormat(t.format).select();let c=r.getNextSiblings();if(c.length>0){let t=e?UC(0,r):1,n=Gv(a).setStart(t);if(ew(s)){let e=Gv(s);e.append(n),s.insertAfter(e)}else s.insertAfter(n);n.append(...c)}return function(e){let t=e;for(;t.getNextSibling()==null&&t.getPreviousSibling()==null;){let e=t.getParent();if(e==null||!ew(e)&&!ow(e))break;t=e}t.remove()}(r),!0}var ofe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function YC(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!ofe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function sfe(e,t){e.__listType=t.__listType,e.__start=t.__start,e.__tag=t.__tag}var cfe=e=>{let t=Zd(e,`format`),n=Qd(e,`format`),r=ef(e,`format`),i=$d(e,`listType`,0);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],listType:e.__listType,start:e.__start,tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__listType;o!==void 0&&o!==`number`&&(a.listType=o);let s=e.__start;s!==void 0&&s!==1&&(a.start=s);let c=e.__dir;c!=null&&(a.direction=c);let l=t[e.__format];l!==void 0&&l!==``&&(a.format=l);let u=e.__indent;return u!==void 0&&u!==0&&(a.indent=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let a=t.direction;e.__dir=a===null||a===`ltr`||a===`rtl`?a:null;let o=t.format;e.__format=typeof o==`string`&&o in n?n[o]:r,e.__indent=function(e){let t=YC(e,0);return t>=0&&t<=1/0&&Number.isInteger(t)?t:0}(t.indent),e.__textFormat=YC(t.textFormat,0);let s=t.textStyle;e.__textStyle=typeof s==`string`?s:``;let c=t.listType;return e.setListType(typeof c==`string`&&c in i?i[c]:c===`number`||c===`bullet`||c===`check`?c:`number`),e.__start=YC(t.start,1),e},afterCloneFrom:sfe}};function lfe(e,t){e.__checked=t.__checked,e.__value=t.__value}var ufe=e=>{let t=Zd(e,`format`),n=Qd(e,`format`),r=ef(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],checked:e.getChecked(),indent:e.getIndent(),value:e.__value,direction:e.__dir,format:t[e.__format],textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.getChecked();o!==void 0&&(a.checked=o);let s=e.getIndent();s!==void 0&&s!==0&&(a.indent=s);let c=e.__value;c!==void 0&&c!==1&&(a.value=c);let l=e.__dir;l!=null&&(a.direction=l);let u=t[e.__format];return u!==void 0&&u!==``&&(a.format=u),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.setIndent(function(e){let t=YC(e,NaN);return Number.isFinite(t)&&Number.isInteger(t)?t<0?0:t>128?128:t:0}(t.indent)),e.__textFormat=YC(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.checked;return e.__checked=s===void 0?void 0:typeof s==`boolean`&&s,e.__value=YC(t.value,1),e},afterCloneFrom:lfe}},dfe=_f()({checked:bf(gf(pf()),{setter:{field:`__checked`}}),indent:ff(0,{clamp:!0,integer:!0,max:128,min:0}),value:yf(ff(1),{field:`__value`})}),XC=class extends Zg{__value;__checked;$config(){return this.config(`listitem`,{$transform:e=>{let t=e.getParent();if(ow(t))t.getListType()!==`check`&&e.getChecked()!=null&&e.setChecked(void 0);else if(t){let n=e.createParentElementNode();ow(n)||VC(340);let r=[e];for(let t of[`previous`,`next`]){r.reverse();for(let{origin:n}of yb(e,t)){if(!ew(n))break;r.push(n)}}e.insertBefore(n),n.splice(0,0,r),Wv(t)||(O_(n,y_(yb(n,`next`)),{$shouldSplit:()=>!1,removeEmptyDestination:!0}),t.isEmpty()&&t.isAttached()&&t.remove())}},extends:Zg,generated:ufe,importDOM:rh({li:()=>({conversion:ffe,priority:0})}),json:dfe})}constructor(e=1,t=void 0,n){super(n),this.__value=e===void 0?1:e,this.__checked=t}createDOM(e){let t=ny().createElement(`li`);return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,n){(function(e,t){let n=t.getParent();!ow(n)||n.getListType()!==`check`||ow(t.getFirstChild())?(e.removeAttribute(`role`),e.removeAttribute(`tabIndex`),e.removeAttribute(`aria-checked`)):(e.setAttribute(`role`,`checkbox`),e.setAttribute(`tabIndex`,`-1`),e.setAttribute(`aria-checked`,t.getChecked()?`true`:`false`))})(t,this),t.value=this.__value,function(e,t,n){let r=t.list;if(!r)return;let i=r.listitem,a=r.nested&&r.nested.listitem,o=n.getParent(),s=ow(o)&&o.getListType()===`check`,c=n.getChecked(),l=n.getChildren().some(e=>ow(e)),u=[];r.listitemChecked!==void 0&&u.push(r.listitemChecked),r.listitemUnchecked!==void 0&&u.push(r.listitemUnchecked),a!==void 0&&u.push(...Lb(a)),u.length>0&&zb(e,...u);let d=[];if(i!==void 0&&d.push(...Lb(i)),s){let e=c?r.listitemChecked:r.listitemUnchecked;e!==void 0&&d.push(e)}a!==void 0&&l&&d.push(...Lb(a)),d.length>0&&Rb(e,...d)}(t,n.theme,this);let r=e?e.__style:``,i=this.__style;r!==i&&fh(t.style,i,r),function(e,t,n){let r=t.__textStyle,i=n?n.__textStyle:``;if(n!==null&&i===r)return;let a=dh(r);for(let t in a)e.style.setProperty(`--listitem-marker-${t}`,a[t]);if(i!==``)for(let t in dh(i))t in a||e.style.removeProperty(`--listitem-marker-${t}`)}(t,this,e)}updateDOM(e,t,n){let r=t;return this.updateListItemDOM(e,r,n),!1}exportDOM(e){let t=this.createDOM(e._config),n=this.getFormatType();n&&(t.style.textAlign=n);let r=this.getDirection();return r&&(t.dir=r),HC(this)?{after(e){if(uy(e)){let t=e.previousElementSibling;if(uy(t)&&t.nodeName===`LI`){for(;e.firstChild;)t.append(e.firstChild);e.remove()}}return e},element:t}:{element:t}}append(...e){for(let t=0;t<e.length;t++){let n=e[t];if($(n)&&this.canMergeWith(n)){let e=n.getChildren();this.append(...e),n.remove()}else super.append(n)}return this}replace(e,t){if(ew(e))return super.replace(e);this.setIndent(0);let n=this.getParentOrThrow();if(!ow(n))return e;if(n.__first===this.getKey())n.insertBefore(e);else if(n.__last===this.getKey())n.insertAfter(e);else{let t=Gv(n),r=this.getNextSibling();for(;r;){let e=r;r=r.getNextSibling(),t.append(e)}n.insertAfter(e),e.insertAfter(t)}let r=this.__key,i=0;if(t&&($(e)||VC(139),i=e.getChildrenSize(),e.splice(i,0,this.getChildren())),t&&$(e)){let t=Q();if(Z(t))for(let n of t.getStartEndPoints())n.key===r&&n.type===`element`&&n.set(e.getKey(),i+n.offset,`element`)}return this.remove(),n.getChildrenSize()===0&&n.remove(),e}insertAfter(e,t=!0){let n=this.getParentOrThrow();if(ow(n)||VC(39),ew(e))return super.insertAfter(e,t);let r=this.getNextSiblings();if(n.insertAfter(e,t),r.length!==0){let i=Gv(n),a=r[0];i.getListType()===`number`&&ew(a)&&i.setStart(UC(0,a)),r.forEach(e=>i.append(e)),e.insertAfter(i,t)}return e}remove(e){let t=this.getPreviousSibling(),n=this.getNextSibling();super.remove(e),t&&n&&HC(t)&&HC(n)&&t.getFirstChild().getListType()===n.getFirstChild().getListType()&&(qC(t.getFirstChild(),n.getFirstChild()),n.remove())}resetOnCopyNodeFrom(e){super.resetOnCopyNodeFrom(e),e.getChecked()&&this.setChecked(!1)}insertNewAfter(e,t=!0){let n=Gv(this);return this.insertAfter(n,t),n}collapseAtStart(e){if(HC(this))return!1;let t=this.getParentOrThrow();if(ew(t.getParentOrThrow()))return JC(this),!0;let n=j_().append(...this.getChildren()),r=this.getNextSiblings();if(r.length>0){let e=Gv(t);e.append(...r),t.insertAfter(e)}return t.insertAfter(n),this.remove(),t.getChildrenSize()===0&&t.remove(),n.selectStart(),!0}getValue(){return this.getLatest().__value}setValue(e){let t=this.getWritable();return t.__value=e,t}getChecked(){let e=this.getLatest(),t,n=this.getParent();return ow(n)&&(t=n.getListType()),t===`check`?!!e.__checked:void 0}setChecked(e){let t=this.getWritable();return t.__checked=e,t}toggleChecked(){let e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){let e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),n=0;for(;ew(t);)t=t.getParentOrThrow().getParentOrThrow(),n++;return n}setIndent(e){typeof e!=`number`&&VC(117),(e=Math.floor(e))>=0||VC(199);let t=e,n=this.getIndent();for(;n!==t;)n<t?(ife(this),n++):(JC(this),n--);return this}canInsertAfter(e){return ew(e)}canReplaceWith(e){return ew(e)}canMergeWith(e){return ew(e)||M_(e)}extractWithChild(e,t){if(!Z(t))return!1;let n=t.anchor.getNode(),r=t.focus.getNode();return this.isParentOf(n)&&this.isParentOf(r)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return aw(`bullet`)}canMergeWhenEmpty(){return!0}};function ffe(e){if(e.classList.contains(`task-list-item`)){for(let t of e.children)if(t.tagName===`INPUT`)return ZC(t)}if(e.classList.contains(`joplin-checkbox`)){for(let t of e.children)if(t.classList.contains(`checkbox-wrapper`)&&t.children.length>0&&t.children[0].tagName===`INPUT`)return ZC(t.children[0])}let t=e.getAttribute(`aria-checked`),n=$C(t===`true`||t!==`false`&&void 0);return Ty(n,e),{after:QC.bind(null,n),node:wy(n,e)}}function ZC(e){if(e.getAttribute(`type`)!==`checkbox`)return{node:null};let t=$C(e.hasAttribute(`checked`));return{after:QC.bind(null,t),node:t}}function QC(e,t){let n=t[0];return t.length===1&&M_(n)&&!e.getFormatType()&&n.getFormatType()?(e.setFormat(n.getFormatType()),n.getChildren()):t}function $C(e){return Kv(new XC(void 0,e))}function ew(e){return e instanceof XC}var tw={ol:`number`,ul:`bullet`},pfe=_f()({listType:bf(vf(mf([`number`,`bullet`,`check`]),tw),{getter:{field:`__listType`}}),start:yf(ff(1),{field:`__start`}),tag:bf(mf([`ul`,`ol`]),{getter:{field:`__tag`},setter:null})}),nw=class extends Zg{__tag;__start;__listType;$config(){return this.config(`list`,{$transform:e=>{(function(e){let t=e.getNextSibling();ow(t)&&e.getListType()===t.getListType()&&qC(e,t)})(e),rfe(e)},extends:Zg,generated:cfe,importDOM:rh({ol:()=>({conversion:iw,priority:0}),ul:()=>({conversion:iw,priority:0})}),json:pfe})}constructor(e=`number`,t=1,n){super(n);let r=tw[e]||e;this.__listType=r,this.__tag=r===`number`?`ol`:`ul`,this.__start=t}getTag(){return this.getLatest().__tag}setListType(e){let t=this.getWritable();return t.__listType=e,t.__tag=e===`number`?`ol`:`ul`,t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){let t=this.getWritable();return t.__start=e,t}createDOM(e,t){let n=this.__tag,r=ny().createElement(n);return this.__start!==1&&r.setAttribute(`start`,String(this.__start)),r.__lexicalListType=this.__listType,rw(r,e.theme,this),r}updateDOM(e,t,n){return e.__tag!==this.__tag||e.__listType!==this.__listType||(rw(t,n.theme,this),e.__start!==this.__start&&t.setAttribute(`start`,String(this.__start)),!1)}exportDOM(e){let t=this.createDOM(e._config,e);if(uy(t)){this.__start!==1&&t.setAttribute(`start`,String(this.__start)),this.__listType===`check`&&t.setAttribute(`__lexicalListType`,`check`);let e=this.getDirection();e&&(t.dir=e)}return{element:t}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,n){let r=n;for(let e=0;e<n.length;e++){let t=n[e];if(!ew(t)){r===n&&(r=[...n]);let i=this.createListItemNode();!$(t)||ow(t)||t.isInline()?i.append(t):i.append(...t.getChildren()),r[e]=i}}return super.splice(e,t,r)}extractWithChild(e){return ew(e)}createListItemNode(){return $C()}};function rw(e,t,n){let r=[],i=[],a=t.list;if(a!==void 0){let e=a[`${n.__tag}Depth`]||[],t=$de(n)-1,o=t%e.length,s=e[o],c=a[n.__tag],l,u=a.nested,d=a.checklist;if(u!==void 0&&u.list&&(l=u.list),c!==void 0&&r.push(c),d!==void 0&&n.__listType===`check`&&r.push(d),s!==void 0){r.push(...Lb(s));for(let t=0;t<e.length;t++)t!==o&&i.push(...Lb(e[t]))}if(l!==void 0){let e=Lb(l);t>1?r.push(...e):i.push(...e)}}i.length>0&&zb(e,...i),r.length>0&&Rb(e,...r)}function iw(e){let t;if(function(e){return uy(e)&&e.nodeName.toLowerCase()===`ol`}(e)){let n=e.start;t=aw(`number`,n)}else t=function(e){if(e.getAttribute(`__lexicallisttype`)===`check`||e.classList.contains(`contains-task-list`)||e.getAttribute(`data-is-checklist`)===`1`)return!0;for(let t of e.childNodes)if(uy(t)&&t.hasAttribute(`aria-checked`))return!0;return!1}(e)?aw(`check`):aw(`bullet`);return wy(t,e),{after:e=>function(e,t){let n=t.createListItemNode.bind(t),r=[];for(let t=0;t<e.length;t++){let i=e[t];if(ew(i)){r.push(i);let e=i.getChildren();e.length>1&&e.forEach(e=>{ow(e)&&r.push(n().append(e))})}else r.push(n().append(i))}return r}(e,t),node:t}}function aw(e=`number`,t=1){return Kv(new nw(e,t))}function ow(e){return e instanceof nw}var sw=Mp(`INSERT_UNORDERED_LIST_COMMAND`),cw=Mp(`INSERT_ORDERED_LIST_COMMAND`);function lw(e,t,n=null){let r=ty(n),i=n?$v(n):[],a=n!==null&&i.length>0;if(a&&typeof r.caretPositionFromPoint==`function`){let a=r.caretPositionFromPoint(e,t,{shadowRoots:i});if(a!==null&&function(e,t){for(let n=e;n!==null;){if(n===t)return!0;n=Mv(n)}return!1}(a.offsetNode,n))return{node:a.offsetNode,offset:a.offset}}if(a){let i=n.getRootNode();if(Qv(i)){let a=i.elementFromPoint(e,t);if(a!==null&&n.contains(a)){let n=function(e,t,n,r){let i=r.createRange(),a=e=>t<e.top?e.top-t:t>e.bottom?t-e.bottom:0,o=t=>e<t.left?t.left-e:e>t.right?e-t.right:0,s=r.createTreeWalker(n,NodeFilter.SHOW_TEXT),c=null,l=1/0,u=1/0;for(let e=s.nextNode();e;e=s.nextNode()){i.selectNodeContents(e);for(let t of i.getClientRects()){let n=a(t),r=o(t);(n<l||n===l&&r<u)&&(l=n,u=r,c=e)}}if(c===null)return null;let d=0,f=1/0,p=1/0;for(let t=0;t<=c.length;t++){i.setStart(c,t),i.collapse(!0);let n=i.getBoundingClientRect(),r=a(n),o=Math.abs(e-n.left);(r<f||r===f&&o<p)&&(f=r,p=o,d=t)}return{node:c,offset:d}}(e,t,a,r);if(n!==null)return n}}}if(typeof r.caretRangeFromPoint==`function`){let n=r.caretRangeFromPoint(e,t);return n===null?null:{node:n.startContainer,offset:n.startOffset}}if(typeof r.caretPositionFromPoint==`function`){let n=r.caretPositionFromPoint(e,t);return n===null?null:{node:n.offsetNode,offset:n.offset}}return null}function uw(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var dw={"application/x-lexical-editor":0,"text/html":10,"text/plain":20,"text/uri-list":30};function mfe(e){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy(`lexical`,{createHTML:e=>e}).createHTML(e):e}var fw=(e,t)=>{if(!Z(t))return t.insertRawText(e),!0;t!==Q()&&pv(t);let n=e=>{let t=Q();Z(t)&&e(t)};return mg(e,{linebreak:()=>n(e=>e.insertParagraph()),tab:()=>n(e=>e.insertNodes([Dh()])),text:e=>n(t=>t.insertText(e))}),!0},pw={"application/x-lexical-editor":[(e,t,n)=>{try{let n=gy(),r=JSON.parse(e);if(r&&r.namespace===n._config.namespace&&Array.isArray(r.nodes))return bw(n,Sfe(r.nodes),t),!0}catch(e){console.error(e)}return n()}],"text/html":[(e,t,n)=>{try{let n=gy();return bw(n,qS(n,new DOMParser().parseFromString(mfe(e),`text/html`)),t),!0}catch(e){return console.error(e),n()}}],"text/plain":[fw],"text/uri-list":[fw]};function hfe(e,t,n,r){if(!e)return!1;let i=a=>!!e[a]&&e[a](t,n,i.bind(null,a-1),r);return i(e.length-1)}function mw(e,t,n){let r=t.getData(`text/plain`);for(let i of function(e){return Object.keys(e.$importMimeType).filter(t=>e.$importMimeType[t]!==void 0).sort((t,n)=>{let r=e.priority[t],i=e.priority[n];return r===void 0&&i===void 0?t<n?-1:+(t>n):r===void 0?1:i===void 0?-1:r-i})}(e)){let a=t.getData(i);if(a&&(i!==`text/html`||a!==r)&&hfe(e.$importMimeType[i],a,n,t))return!0}return!1}var gfe={$importMimeType:pw,$insertDataTransfer:(e,t)=>mw({$importMimeType:pw,priority:dw},e,t),priority:dw},_fe={build:(e,t)=>({$importMimeType:t.$importMimeType,$insertDataTransfer:(e,n)=>mw(t,e,n),priority:t.priority}),config:{$importMimeType:pw,priority:dw},mergeConfig(e,t){let n=Ib(e,t);if(t.$importMimeType){let r={...e.$importMimeType};for(let[e,n]of Object.entries(t.$importMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$importMimeType=r}return t.priority&&(n.priority={...e.priority,...t.priority}),n},name:`@lexical/clipboard/Import`};function hw(e,t=Q()){return t??uw(166),Z(t)&&t.isCollapsed()||t.getNodes().length===0?``:JS(e,t)}function gw(e,t=Q()){return t??uw(166),Z(t)&&t.isCollapsed()||t.getNodes().length===0?null:JSON.stringify(xfe(e,t))}function _w(e,t,n){(function(){let e=Lue(_fe.name);return e?e.output:gfe})().$insertDataTransfer(e,t)}var vw=`application/x-lexical-drag`;function vfe(e,t){let n={editorKey:t.getKey()};e.setData(vw,JSON.stringify(n))}function yw(e){let t=e;if(gb(t)){if(t.offset===0)t=y_(t.getSiblingCaret());else{if(t.offset!==t.origin.getTextContentSize())return t;t=t.getSiblingCaret()}}for(;;){let e=t.getParentAtCaret();if(e===null||!e.isInline()||e.isShadowRoot())return t;if(vb(t))t=y_(yb(e,`next`));else{if(t.getNodeAtCaret()!==null)return t;t=yb(e,`next`)}}}function yfe(e,t,n){let r=e.dataTransfer;if(r===null)return!1;let i=function(e){let t=e.getData(vw);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}return(r=n)!==null&&typeof r==`object`&&`editorKey`in r&&typeof r.editorKey==`string`?n:null;var r}(r);if(i===null)return!1;let a=function(e,t){let n=lw(e.clientX,e.clientY,t.getRootElement());if(n===null)return null;let r=cv(n.node);if(r===null)return null;if(X(r))return bb(r,`next`,n.offset);if($(r))return T_(r,n.offset,`next`);let i=r.getParent();return i===null?null:T_(i,r.getIndexWithinParent()+1,`next`)}(e,t);if(a===null)return!1;let o=i.editorKey===t.getKey(),s=Q();if(o){if(!Z(s)||s.isCollapsed())return!1;if(function(e,t){let{anchor:n,focus:r}=w_(v_(t),`next`),i=yw(e);return jb(yw(n),i)<=0&&jb(i,yw(r))<=0}(a,s))return e.preventDefault(),!0}let c=S_(a),l=gb(c)?D_(c):c;if(l===null)return!1;let u=l.getFlipped();o&&Z(s)&&s.removeText();let d=l.origin.isAttached()?l:u;if(d.origin.isAttached()||uw(438),n(r,g_(Ob(d)),t),!o){let e=t.getRootElement(),n=e?e.ownerDocument:null,r=n?function(e,t){for(let n of ey(t)){let t=q_(n);if(G_(t)&&t.getKey()===e&&uy(n))return n}return null}(i.editorKey,n):null;r!==null&&r.dispatchEvent(new InputEvent(`beforeinput`,{bubbles:!0,cancelable:!0,inputType:`deleteByDrag`}))}return e.preventDefault(),!0}function bfe(e,t){return yfe(e,t,_w)}function bw(e,t,n){e.dispatchCommand(Pp,{nodes:t,selection:n})||(n.insertNodes(t),function(e){if(Z(e)&&e.isCollapsed()){let t=e.anchor,n=null,r=m_(t,`previous`);if(r){if(gb(r))n=r.origin;else{let e=kb(r,Cb(dv(),`next`).getFlipped());for(let t of e){if(X(t.origin)){n=t.origin;break}if($(t.origin)&&!t.origin.isInline())break}}}if(n&&X(n)){let t=n.getFormat(),r=n.getStyle();e.format===t&&e.style===r||(e.format=t,e.style=r,e.dirty=!0)}}}(n))}function xw(e,t,n,r=[]){let i=t===null||n.isSelected(t),a=$(n)&&n.excludeFromCopy(`clone`),o=n;t!==null&&X(o)&&(o=Kb(t,o,`clone`));let s=Bd(o),c=$(o)?o.getChildren():[],l=s.children||[];X(o)&&o.getTextContentSize()===0&&(i=!1);let u=i&&Lh(t)&&$(n)?null:t;for(let r=0;r<c.length;r++){let a=c[r],o=xw(e,u,a,l);!i&&$(n)&&o&&n.extractWithChild(a,t,`clone`)&&(i=!0)}if(i&&!a){let t=rb(o);if(t.length>0){let n={};for(let r of t){let t=ib(o,r);t===null&&uw(366,o.constructor.name,r);let i=[];xw(e,null,t,i),(i.length!==1||$(t)&&t.excludeFromCopy(`clone`))&&uw(435,r,o.constructor.name,String(i.length)),n[r]=i[0]}s.$slots=n}}if(i&&!a)r.push(s);else for(let e=0;e<l.length;e++)r.push(l[e]);return i}function xfe(e,t){let n=[],r=dv(),i=tb(t),a=($(i)?i:r).getChildren();for(let r=0;r<a.length;r++)xw(e,t,a[r],n);return{namespace:e._config.namespace,nodes:n}}function Sfe(e){let t=[];for(let n of e)t.push(Jce(n));return t}var Sw=null;async function Cw(e,t,n){if(Sw!==null)return!1;if(t!==null)return new Promise((r,i)=>{e.update(()=>{r(ww(e,t,n))})});let r=e.getRootElement(),i=e._window||window,a=i.document,o=Zv(i);if(r===null||o===null)return!1;let s=a.createElement(`span`);s.style.position=`fixed`,s.style.top=`-1000px`,s.append(a.createTextNode(`#`)),r.append(s);let c=a.createRange();return c.setStart(s,0),c.setEnd(s,1),o.removeAllRanges(),o.addRange(c),new Promise((t,r)=>{let o=e.registerCommand(_m,r=>(nx(r,ClipboardEvent)&&(o(),Sw!==null&&(i.clearTimeout(Sw),Sw=null),t(ww(e,r,n))),!0),4);Sw=i.setTimeout(()=>{o(),Sw=null,t(!1)},50),a.execCommand(`copy`),s.remove()})}function ww(e,t,n){if(n===void 0){let t=Zv(e._window),r=Q();if(!r||r.isCollapsed()||!t)return!1;let i=ay(t,e.getRootElement()),a=i.anchorNode,o=i.focusNode;if(a!==null&&o!==null&&!W_(e,a,o))return!1;n=Tw(r)}t.preventDefault();let r=t.clipboardData;return r!==null&&(Ew(r,n),!0)}var Cfe=[[`text/html`,hw],[`application/x-lexical-editor`,gw]];function Tw(e=Q()){return function(e,t){let n={"text/plain":``};for(let[r,i]of Object.entries(e))if(i){let e=Tfe(i,t);e!==null&&(n[r]=e)}return n}(wfe(),e)}function Ew(e,t){for(let[n]of Cfe)t[n]===void 0&&e.setData(n,``);for(let n in t){let r=t[n];r!==void 0&&e.setData(n,r)}}function wfe(e=gy()){let t=xx(e,Efe.name);return t?t.output:Dw}var Dw={"application/x-lexical-editor":[(e,t)=>e?gw(gy(),e):t()],"text/html":[(e,t)=>e?hw(gy(),e):t()],"text/plain":[(e,t)=>e?e.getTextContent():t()]};function Tfe(e,t){let n=r=>e[r]?e[r](t,n.bind(null,r-1)):null;return n(e.length-1)}var Efe={build:(e,t,n)=>t.$exportMimeType,config:{$exportMimeType:Dw},mergeConfig(e,t){let n=Ib(e,t);if(t.$exportMimeType){let r={...e.$exportMimeType};for(let[e,n]of Object.entries(t.$exportMimeType))if(n){let t=r[e];r[e]=t?[...t,...n]:n}n.$exportMimeType=r}return n},name:`@lexical/clipboard/GetClipboardData`},Dfe={bold:`bold`,italic:`italic`,strikeThrough:`strikethrough`,subscript:`subscript`,superscript:`superscript`,underline:`underline`},Ow=Symbol.for(`@lexical/dragon/WindowState`);function Ofe(e,t,n){let r=function(e){let t=e[Ow];return t===void 0&&(t={dispose:()=>{},editors:new Map,installs:new Set},e[Ow]=t),t}(e);if(r.installs.size===0){let t=jfe.bind(e);e.addEventListener(`message`,t,!0),r.dispose=()=>{e.removeEventListener(`message`,t,!0)}}if(r.installs.add(t),n){let e=r.editors.get(n)||new Set;e.add(t),r.editors.set(n,e)}return kfe.bind(null,e,r,t,n)}function kfe(e,t,n,r){if(r){let e=t.editors.get(r);e&&e.delete(n)&&e.size===0&&t.editors.delete(r)}t.installs.delete(n)&&t.installs.size===0&&(t.dispose(),delete e[Ow])}function kw(e){return e&&e.ownerDocument.defaultView}function Afe(e){let t=Ux(()=>kw(e.getRootElement()),t=>e.registerRootListener(e=>{t.value=kw(e)}));return Hx(()=>{let n=t.value;if(n)return Ofe(n,Symbol(`@lexical/dragon/editorInstall`),e)})}function jfe(e){if(e.origin!==this.location.origin)return;let t=function(e){let t=e[Ow];if(t===void 0)return null;let n=q_(sy(e.document));return G_(n)&&t.editors.has(n)?n:null}(this);if(t===null)return;let n=e.data;if(typeof n==`string`){let r;try{r=JSON.parse(n)}catch{return}if(r&&r.protocol===`nuanria_messaging`&&r.type===`request`){let n=r.payload;if(n&&n.functionId===`makeChanges`){let r=n.args;if(Array.isArray(r)){let[n,i,a,o,s,c]=r;if(![n,i,o,s].every(Number.isFinite)||typeof a!=`string`&&a!==-1)return;t.update(()=>{let t=Q();if(Z(t)){let r=t.anchor,l=r.getNode(),u=0,d=0;if(X(l)&&n>=0&&i>=0&&(u=n,d=n+i,t.setTextNodeRange(l,u,l,d)),typeof a!=`string`||u===d&&a===``||(t.insertRawText(a),l=r.getNode()),X(l)){let e=l.getTextContentSize();u=Math.min(Math.max(o,0),e),d=o<0||s<0?u:Math.min(o+s,e),t.setTextNodeRange(l,u,l,d)}if(typeof c==`string`&&s>0&&!t.isCollapsed()){let e=Dfe[c];e!==void 0&&t.formatText(e)}e.stopImmediatePropagation()}})}}}}}var Mfe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function Aw(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Mfe.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function jw(e,t,n,r,i){let a=Aw(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function Nfe(e,t){e.__tag=t.__tag}var Pfe=e=>{let t=Zd(e,`format`),n=Qd(e,`format`),r=ef(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],tag:e.__tag,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__tag;o!==void 0&&o!==`h1`&&(a.tag=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=jw(t.indent,0,0,1/0),e.__textFormat=Aw(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.tag;return e.__tag=s===`h1`||s===`h2`||s===`h3`||s===`h4`||s===`h5`||s===`h6`?s:`h1`,e},afterCloneFrom:Nfe}},Ffe=e=>{let t=Zd(e,`format`),n=Qd(e,`format`),r=ef(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__dir;o!=null&&(a.direction=o);let s=t[e.__format];s!==void 0&&s!==``&&(a.format=s);let c=e.__indent;return c!==void 0&&c!==0&&(a.indent=c),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=jw(t.indent,0,0,1/0),e.__textFormat=Aw(t.textFormat,0);let o=t.textStyle;return e.__textStyle=typeof o==`string`?o:``,e}}},Mw=Mp(`DRAG_DROP_PASTE_FILE`),Nw=Sf(`shadowRoot`,{parse:pf()}),Pw=class extends Zg{$config(){return this.config(`quote`,{extends:Zg,generated:Ffe,importDOM:{blockquote:()=>({conversion:Lfe,priority:0})},stateConfigs:[{flat:!0,stateConfig:Nw}]})}isShadowRoot(){return Cf(this,Nw)}setIsShadowRoot(e){return wf(this,Nw,e)}createDOM(e){let t=ny().createElement(`blockquote`);return Rb(t,e.theme.quote),t}updateDOM(e,t,n){return!1}exportDOM(e){let{element:t}=super.exportDOM(e);if(uy(t)){this.isEmpty()&&t.append(ny().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}static importJSON(e){return Fw().updateFromJSON(e)}insertNewAfter(e,t){let n=j_();n.setTextFormat(e.format),n.setTextStyle(e.style);let r=this.getDirection();return n.setDirection(r),n.setFormat(this.getFormatType()),n.setStyle(this.getStyle()),this.insertAfter(n,t),n}collapseAtStart(){if(this.isShadowRoot()){for(let e of this.getChildren())this.insertBefore(e);return this.remove(),!0}let e=j_();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function Fw(e){let t=Kv(new Pw);return e&&e.shadowRoot?t.setIsShadowRoot(!0):t}function Iw(e){return e instanceof Pw}var Ife=_f()({tag:yf(mf([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`]),{field:`__tag`})}),Lw=class extends Zg{__tag;$config(){return this.config(`heading`,{extends:Zg,generated:Pfe,importDOM:{h1:()=>({conversion:zw,priority:0}),h2:()=>({conversion:zw,priority:0}),h3:()=>({conversion:zw,priority:0}),h4:()=>({conversion:zw,priority:0}),h5:()=>({conversion:zw,priority:0}),h6:()=>({conversion:zw,priority:0}),p:e=>{let t=e.firstChild;return t!==null&&Rw(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Rw(e)?{conversion:()=>({node:Bw(`h1`)}),priority:3}:null},json:Ife})}constructor(e=`h1`,t){super(t),this.__tag=e}getTag(){return this.getLatest().__tag}setTag(e){let t=this.getWritable();return t.__tag=e,t}createDOM(e){let t=this.__tag,n=ny().createElement(t),r=e.theme.heading;if(r!==void 0){let e=r[t];Rb(n,e)}return n}updateDOM(e,t,n){return e.__tag!==this.__tag}exportDOM(e){let{element:t}=super.exportDOM(e);if(uy(t)){this.isEmpty()&&t.append(ny().createElement(`br`));let e=this.getFormatType();e&&(t.style.textAlign=e);let n=this.getDirection();n&&(t.dir=n)}return{element:t}}insertNewAfter(e,t=!0){let n=e?e.anchor.offset:0,r=this.getLastDescendant(),i=!r||e&&e.anchor.key===r.getKey()&&n===r.getTextContentSize()||!e?j_():Bw(this.getTag()).setFormat(this.getFormatType()).setStyle(this.getStyle()),a=this.getDirection();if(i.setDirection(a),this.insertAfter(i,t),n===0&&!this.isEmpty()&&e){let e=j_();e.select(),this.replace(e,!0)}return i}collapseAtStart(){if(this.isEmpty()){let e=j_();this.getChildren().forEach(t=>e.append(t)),this.replace(e)}return!0}extractWithChild(){return!0}};function Rw(e){return e.nodeName.toLowerCase()===`span`&&e.style.fontSize===`26pt`}function zw(e){let t=e.nodeName.toLowerCase(),n=null;return t!==`h1`&&t!==`h2`&&t!==`h3`&&t!==`h4`&&t!==`h5`&&t!==`h6`||(n=Bw(t),Cy(e,n),Ty(n,e),wy(n,e)),{node:n}}function Lfe(e){let t=Fw();return Ty(t,e),Cy(e,t),wy(t,e),{node:t}}function Bw(e=`h1`){return Kv(new Lw(e))}function Vw(e){return e instanceof Lw}function Hw(e){return e_(cv(e))}function Rfe(e){let t=e.focus;return t.key===`root`&&t.offset===dv().getChildrenSize()}function zfe(e){let t=e.focus;return t.key===`root`&&t.offset===0}function Bfe(e,t){if(!e.isCollapsed())return!1;let n=t===`next`;if(!(n?Rfe(e):zfe(e)))return!1;let r=e.focus.offset;return Yv(dv().getChildAtIndex(n?r-1:r))}function Uw(e,t,n,r){let i=!1,a=null;if(e.isCollapsed()&&e.anchor.type===`text`){let t=e.anchor.getNode();if(X(t)){a=t;let r=e.anchor.offset,o=r===t.getTextContentSize()&&t.getNextSibling()===null,s=r===0&&t.getPreviousSibling()===null;i=n===`end`&&o||n===`start`&&s||n===`both`&&(o||s)}}let o=!1;for(let[n,s]of Object.entries(r)){if(s==null||!s[t])continue;let r=n;if(s.onlyAtBoundary){if(!(i&&a&&X(a)&&a.hasFormat(r)))continue;o=!0}e.hasFormat(r)&&e.toggleFormat(r)}o&&e.setStyle(``)}var Vfe={capitalize:{enter:!0,space:!0,tab:!0},lowercase:{enter:!0,space:!0,tab:!0},uppercase:{enter:!0,space:!0,tab:!0}};function Ww(e,t){return function(e,t){if(!e.isCollapsed())return!1;let n=m_(e.focus,t),r=Ky(n.origin,Uv);if(!r)return!1;let i=e.focus.getNode();if(!r.is(i)&&!Rv(i,r))return!1;let a=kb(n,yb(r,t));if(a.getTextSlices().some(e=>e&&e.getTextContentSize()>0))return!1;let o=kb(a.anchor.getSiblingCaret(),a.focus),s=o.anchor.origin;for(let e of o){if(!_b(e)||!e.origin.is(s.getParent()))return!1;s=e.origin}let c=r;for(let e of Db(yb(r,t))){if(!e.origin.is(c.getParent())){if(Yv(e.origin)){let e=yb(c,t);return g_(kb(e,e)),!0}break}if(!Uv(e.origin))break;c=e.origin}return!1}(e,t)||function(e,t){if(!e.isCollapsed()||e.anchor.type!==`element`)return!1;let n=m_(e.anchor,t).getNodeAtCaret();return!(!Uv(n)||n.isInline()||(g_(Ob(S_(Cb(n,t)))),0))}(e,t)}function Hfe(e){return e_(e)&&!e.isInline()&&!e.isIsolated()&&e.isKeyboardSelectable()}function Gw(e){let t=rg();t.add(e),pv(t)}function Ufe(e,t){if(!e.isCollapsed())return!1;let n=e.focus,r=n.getNode(),i=t?`previous`:`next`,a=m_(n,i);if(n.type===`element`&&$(r)&&Wv(r)){let e=a.getNodeAtCaret();return!(e===null||!Hfe(e)||(Gw(e.__key),0))}let o=Ky($(r)?r:r.getParentOrThrow(),e=>$(e)&&!e.isInline()&&Wv(e.getParent()));if(o===null)return!1;let s=yb(o,i).getNodeAtCaret();if(s===null||!Hfe(s))return!1;if(o.getTextContentSize()===0)return Gw(s.__key),!0;let c=gy().getRootElement();if(c===null)return!1;let l=Zv(c.ownerDocument.defaultView);if(l===null||l.rangeCount===0)return!1;let u=l.anchorNode,d=l.anchorOffset,f=l.focusNode,p=l.focusOffset;l.modify(`move`,t?`backward`:`forward`,`line`);let m=l.anchorNode,h=l.anchorOffset;if(m===null)return Wfe(l,u,d,f,p),!1;let g=cv(m);return Wfe(l,u,d,f,p),g!==null&&(m===u&&h===d||!g.is(o)&&!Rv(g,o))&&(Gw(s.__key),!0)}function Wfe(e,t,n,r,i){t!==null&&r!==null&&e.setBaseAndExtent(t,n,r,i)}function Gfe(e,t){if(!e.isCollapsed())return!1;let n=e.focus.getNode(),r=Ky($(n)?n:n.getParentOrThrow(),e=>$(e)&&!e.isInline());if(r===null)return!1;let i=gy(),a=i.getRootElement();if(a===null)return!1;let o=a.ownerDocument.defaultView;if(o===null)return!1;let s=!1;for(let e of r.getChildren())if($(e)&&e.isInline()){let t=i.getElementByKey(e.getKey());if(t!==null){let e=o.getComputedStyle(t).display;if(e===`inline-grid`||e===`inline-flex`){s=!0;break}}}if(!s)return!1;let c=yb(r,t?`previous`:`next`).getNodeAtCaret();if(c===null||!$(c)){if(t){let e=r.getFirstDescendant();X(e)?e.select(0,0):r.select(0,0)}else{let e=r.getLastDescendant();if(X(e)){let t=e.getTextContentSize();e.select(t,t)}else{let e=r.getChildrenSize();r.select(e,e)}}return!0}let l=i.getElementByKey(c.getKey());if(l===null)return!1;let u=Zv(o);if(u===null||u.rangeCount===0)return!1;let d=u.getRangeAt(0).cloneRange();d.collapse(!0);let f=d.getBoundingClientRect(),p=l.getBoundingClientRect(),m=p.top+p.height/2;if(f.height>0){let t=lw(f.left,m,a);if(t!==null&&l.contains(t.node)){let n=a.ownerDocument.createRange();return n.setStart(t.node,t.offset),n.collapse(!0),e.applyDOMRange(n),e.dirty=!0,!0}}let h=t?c.getLastDescendant():c.getFirstDescendant();if(X(h)){let e=t?h.getTextContentSize():0;h.select(e,e)}else{let e=c.getChildrenSize();c.select(t?e:0,t?e:0)}return!0}function Kw(e,t){let n=yb(e,t),r=n.getAdjacentCaret();r!==null&&$(r.origin)&&!r.origin.isInline()&&r.origin.isShadowRoot()?g_(Ob(n)):t===`next`?e.selectNext(0,0):e.selectPrevious()}function qw(e,t){let n=e.getNodes().map(e=>yb(e,`next`)).sort(jb),r=n[0],i=n[n.length-1];if(!r||!i)return!1;for(let e=0;e<n.length-1;e++)if(!n[e+1].origin.is(n[e].getNodeAtCaret()))return!1;return g_(w_(kb(y_(r),i),t)),Yce(),!0}function Kfe(e,t,n){n.preventDefault(),n.stopPropagation();let r=e.getNodes();if(r.length===0)return!0;let i=r.map(e=>yb(e,`next`)).sort(jb),a=(t?i[0]:i[i.length-1]).origin,o=Ky(a,e=>e!==a&&$(e)&&!e.isInline())??dv(),s=t?0:o.getChildrenSize();return o.select(s,s),!0}function qfe(e,t){return e.length>0&&!t}function Jfe(e,t=Px(Vfe),n=Px(qfe)){return Bb(e.registerCommand(Fp,n=>{let r=Q();if(Lh(r)){let t=n.target;if(uy(t))for(let n of r.getNodes()){let r=e.getElementByKey(n.getKey());if(r!==null&&r.contains(t))return!1}return r.clear(),!0}return Z(r)&&Uw(r,`click`,`both`,t.peek()),!1},0),e.registerCommand(Bp,e=>{let t=Q();return Z(t)?(t.deleteCharacter(e),!0):!!Lh(t)&&(t.deleteNodes(),!0)},0),e.registerCommand(Kp,e=>{let t=Q();return!!Z(t)&&(t.deleteWord(e),!0)},0),e.registerCommand(qp,e=>{let t=Q();return!!Z(t)&&(t.deleteLine(e),!0)},0),e.registerCommand(Up,t=>{let n=Q();if(typeof t==`string`)n!==null&&n.insertText(t);else{if(n===null)return!1;let r=t.dataTransfer;if(r!=null)_w(r,n,e);else if(Z(n)){let e=t.data;return e&&n.insertText(e),!0}}return!0},0),e.registerCommand(Gp,()=>{let e=Q();return!!Z(e)&&(e.removeText(),!0)},0),e.registerCommand(Jp,e=>{let t=Q();return!(!Z(t)&&!Lh(t)||(zh(t,e),0))},0),e.registerCommand(rce,e=>{let t=Q();return!(!Z(t)&&!Lh(t)||(Bce(t,e),0))},0),e.registerCommand(mm,e=>{let t=Q();if(!Z(t)&&!Lh(t))return!1;let n=t.getNodes();for(let t of n){let n=Ky(t,e=>$(e)&&!e.isInline());n!==null&&n.setFormat(e)}return!0},0),e.registerCommand(Vp,e=>{let t=Q();return!!Z(t)&&(t.insertLineBreak(e),!0)},0),e.registerCommand(Hp,()=>{let e=Q();return!!Z(e)&&(e.insertParagraph(),!0)},0),e.registerCommand(um,()=>{let e=Dh(),t=Q();return Z(t)&&(e.setFormat(t.format),e.setStyle(t.style)),pg([e]),!0},0),e.registerCommand(dm,()=>ix(e=>{let t=e.getIndent();e.setIndent(t+1)}),0),e.registerCommand(fm,()=>ix(e=>{let t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),0),e.registerCommand(nm,e=>{let t=Q();if(Lh(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!qw(t,`previous`))return e.preventDefault(),Kw(n[0],`previous`),!0;t=Q()}}return Z(t)&&(zfe(t)||!e.shiftKey&&Ww(t,`previous`)||!e.shiftKey&&Ufe(t,!0)||!e.shiftKey&&Gfe(t,!0))?(e.preventDefault(),!0):!1},0),e.registerCommand(rm,e=>{let t=Q();if(Lh(t)){let n=t.getNodes();if(n.length>0){if(!e.shiftKey||!qw(t,`next`))return e.preventDefault(),Kw(n[0],`next`),!0;t=Q()}}return Z(t)&&(Rfe(t)||!e.shiftKey&&Ww(t,`next`)||!e.shiftKey&&Ufe(t,!1)||!e.shiftKey&&Gfe(t,!1))?(e.preventDefault(),!0):!1},0),e.registerCommand(em,e=>{let n=Q();if(Lh(n)){let t=n.getNodes();if(t.length>0){let r=Gb(t[0])?`next`:`previous`;if(!e.shiftKey||!qw(n,r))return e.preventDefault(),Kw(t[0],r),!0;n=Q()}}if(!Z(n))return!1;let r=Gb(n.anchor.getNode())?`next`:`previous`;if(Bfe(n,r)||!e.shiftKey&&Ww(n,r))return e.preventDefault(),!0;if(e.shiftKey||Uw(n,`arrow`,`start`,t.peek()),Xb(n,!0)){let t=e.shiftKey;return e.preventDefault(),Qb(n,t,!0),!0}return!1},0),e.registerCommand(Qp,e=>{let n=Q();if(Lh(n)){let t=n.getNodes();if(t.length>0){let r=Gb(t[0])?`previous`:`next`;if(!e.shiftKey||!qw(n,r))return e.preventDefault(),Kw(t[0],r),!0;n=Q()}}if(!Z(n))return!1;let r=Gb(n.anchor.getNode())?`previous`:`next`;if(Bfe(n,r)||!e.shiftKey&&Ww(n,r))return e.preventDefault(),!0;if(e.shiftKey||Uw(n,`arrow`,`end`,t.peek()),Xb(n,!1)){let t=e.shiftKey;return e.preventDefault(),Qb(n,t,!1),!0}return!1},0),e.registerCommand(om,t=>{let n=Q();if(!Lh(n)&&Hw(t.target))return!1;if(Z(n)){if(function(e){if(!e.isCollapsed())return!1;let{anchor:t}=e;if(t.offset!==0)return!1;let n=t.getNode();if(n_(n))return!1;let r=fue(n);return r.getIndent()>0&&(r.is(n)||n.is(r.getFirstDescendant()))}(n))return t.preventDefault(),e.dispatchCommand(fm);if(od&&ad)return!1}else if(!Lh(n))return!1;return t.preventDefault(),e.dispatchCommand(Bp,!0)},0),e.registerCommand(cm,t=>{let n=Q();return!(!Lh(n)&&Hw(t.target))&&!(!Z(n)&&!Lh(n))&&(t.preventDefault(),e.dispatchCommand(Bp,!1))},0),e.registerCommand(im,n=>{let r=Q();if(Lh(r)){let e=r.getNodes();e.length===1&&e_(e[0])&&!e[0].isInline()&&(r=e[0].selectNext())}if(!Z(r))return!1;if(Uw(r,`enter`,`both`,t.peek()),n!==null){if((od||cd||dd)&&ad)return!1;if(n.preventDefault(),n.shiftKey)return e.dispatchCommand(Vp,!1)}return e.dispatchCommand(Hp)},0),e.registerCommand(sm,()=>!!Z(Q())&&(e.blur(),!0),0),e.registerCommand(pm,t=>{let[,n]=rx(t);if(n.length>0){let r=t.clientX,i=t.clientY,a=lw(r,i,e.getRootElement());if(a!==null){let{offset:e,node:t}=a,n=cv(t);if(n!==null){let t=ng();if(X(n))t.anchor.set(n.getKey(),e,`text`),t.focus.set(n.getKey(),e,`text`);else{let e=n.getParentOrThrow().getKey(),r=n.getIndexWithinParent()+1;t.anchor.set(e,r,`element`),t.focus.set(e,r,`element`)}pv(Ff(t))}}return e.dispatchCommand(Mw,n),t.preventDefault(),!0}return bfe(t,e)},0),e.registerCommand(hm,t=>{let[n]=rx(t),r=Q();return!(n&&!Z(r)||(Z(r)&&!r.isCollapsed()&&t.dataTransfer!==null&&(Ew(t.dataTransfer,Tw(r)),vfe(t.dataTransfer,e)),0))},0),e.registerCommand(gm,t=>{let[n]=rx(t),r=Q();if(n&&!Z(r))return!1;let i=t.clientX,a=t.clientY,o=lw(i,a,e.getRootElement());return o!==null&&e_(cv(o.node))&&t.preventDefault(),!0},0),e.registerCommand(ym,()=>{let e=Q();return gle(Z(e)&&eb(e.anchor.getNode())!==null?e:null),!0},0),e.registerCommand(_m,t=>(Cw(e,nx(t,ClipboardEvent)?t:null),!0),0),e.registerCommand(vm,t=>(async function(e,t){t.update(()=>{let e=Q();Z(e)&&!e.isCollapsed()&&Hh(e)},{discrete:!0,tag:`cut`}),await Cw(t,nx(e,ClipboardEvent)?e:null),t.update(()=>{let e=Q();Z(e)?e.removeText():Lh(e)&&e.getNodes().forEach(e=>e.remove())},{tag:`cut`})}(t,e),!0),0),e.registerCommand(Wp,t=>{let[,r,i]=rx(t);return!(!n.peek()(r,i)||!e.dispatchCommand(Mw,r))||(!dy(t.target)||!U_(t.target))&&Q()!==null&&(function(e,t){e.preventDefault(),t.update(()=>{let n=Q(),r=nx(e,InputEvent)||nx(e,KeyboardEvent)?null:e.clipboardData;r!=null&&n!==null&&_w(r,n,t)},{tag:`paste`})}(t,e),!0)},0),e.registerCommand(am,()=>{let e=Q();return Z(e)&&Uw(e,`space`,`both`,t.peek()),!1},0),e.registerCommand(lm,()=>{let e=Q();return Z(e)&&Uw(e,`tab`,`both`,t.peek()),!1},0),e.registerCommand($p,e=>{let t=Q();if(Lh(t))return Kfe(t,!1,e);if(!Z(t))return!1;let{anchor:n}=t;if(n.type!==`element`||n.offset!==0)return!1;let r=n.getNode();if(!$(r))return!1;let i=r.getFirstChild();if(!e_(i)||!i.isInline())return!1;let a=r.getKey(),o=r.selectEnd();return e.shiftKey&&o.anchor.set(a,0,`element`),e.preventDefault(),e.stopPropagation(),!0},0),e.registerCommand(tm,e=>{let t=Q();if(Lh(t))return Kfe(t,!0,e);if(!Z(t))return!1;let{anchor:n,focus:r}=t,i=Ky(r.getNode(),e=>$(e)&&!e.isInline());if(i===null)return!1;let a=i.getFirstChild();if(!e_(a)||!a.isInline()||Ky(n.getNode(),e=>$(e)&&!e.isInline())!==i)return!1;let o=i.getKey();return(r.type!==`element`||r.key!==o||r.offset!==0)&&(t.focus.set(o,0,`element`),e.shiftKey||t.anchor.set(o,0,`element`),e.preventDefault(),e.stopPropagation(),!0)},0))}function Jw(e,t){let n={};for(let r of e){let e=t(r);e&&(n[e]?n[e].push(r):n[e]=[r])}return n}function Yw(e){let t=Jw(e,e=>e.type);return{element:t.element||[],multilineElement:t[`multiline-element`]||[],textFormat:t[`text-format`]||[],textMatch:t[`text-match`]||[]}}var Yfe=/[!-/:-@[-`{-~\s]/,Xfe=/\s/,Xw=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,Zfe=/^\s{0,3}$/;function Zw(e){if(!M_(e))return!1;let t=e.getFirstChild();return t==null||e.getChildrenSize()===1&&X(t)&&Zfe.test(t.getTextContent())}function Qw(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`).replace(/&#(\d+);/g,(e,t)=>String.fromCodePoint(Number(t)))}var Qfe=/^(\s*)(\d{1,})\.\s/,$fe=/^(\s*)[-*+]\s/,epe=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,$w=/^(#{1,6})\s/,tpe=/^>\s/,npe=/^([ \t]*`{3,})([\w-]+)?[ \t]?/,eT=/^[ \t]*`{3,}$/,rpe=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,ipe=/^(?:\|)(.+)(?:\|)\s?$/;function ape(e){if(e[0]!==`|`)return!1;let{length:t}=e,n=1,r=0;for(;n<t;){let t=n;for(e[t]===` `&&t++,e[t]===`:`&&t++;e[t]===`-`;)t++;if(e[t]===`:`&&t++,e[t]===` `&&t++,e[t]!==`|`)break;r++,n=t+1}return r>0&&(n===t||n===t-1&&/\s/.test(e[n]))}var ope=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,spe=/^<\/[a-z_][\w-]*\s*>/i,cpe=e=>RegExp(`(?:${e.source})$`,e.flags),tT=Sf(`mdListMarker`,{parse:e=>typeof e==`string`&&/^[-*+]$/.test(e)?e:`-`,resetOnCopyNode:!0}),lpe=Sf(`mdCodeFence`,{parse:e=>typeof e==`string`&&/^`{3,}$/.test(e)?e:"```",resetOnCopyNode:!0}),upe=Sf(`mdCodeMeta`,{parse:e=>typeof e==`string`?e:``,resetOnCopyNode:!0}),dpe=Sf(`mdHardLineBreak`,{parse:e=>typeof e==`string`&&/^(\\| {2,})$/.test(e)?e:``,resetOnCopyNode:!0});function nT(e){if(e.endsWith(`\\`)){let t=0;for(let n=e.length-1;n>=0&&e[n]===`\\`;n--)t++;return t%2==1?[e.slice(0,-1),`\\`]:null}let t=e.match(/^(.*?\S)( {2,})$/);return t?[t[1],t[2]]:null}function fpe(e){let t=l_(),n=function(e){let t=e.getChildren(),n=t.length-1,r=t[n];if(!X(r))return null;let i=r.getTextContent(),a=nT(i);if(a!==null){let[e,t]=a;return r.setTextContent(e),t}return/^ {2,}$/.test(i)&&function(e,t){for(let n=t-1;n>=0;n--){if(u_(e[n]))return!1;if(/\S/.test(e[n].getTextContent()))return!0}return!1}(t,n)?(r.setTextContent(``),i):null}(e);return n!==null&&wf(t,dpe,n),t}function rT(e){return Iw(e)}function ppe(e,t){let n=0;for(;n<t&&(e[n]===` `||e[n]===` `);)n++;return e.slice(n)}function mpe(e,t){let n=e.getLastChild();t&&lC(n)&&wf(n,upe,t)}var hpe=e=>(t,n,r,i)=>{let a=e(r);a.append(...n),t.replace(a),i||a.select(0,0)};function iT(e){let t=0;for(let n of e)t+=n===` `?4-t%4:1;return t}var aT=null,oT=!1,gpe=e=>(t,n,r,i)=>{if(Vw(t)||!i&&rT(t))return!1;let a=t.getPreviousSibling(),o=t.getNextSibling(),s=$C(e===`check`?/^x$/i.test(r[3]||``):void 0),c=r[0].trim()[0],l=e!==`bullet`&&e!==`check`||c!==tT.parse(c)?void 0:c,u=aT,d=a;if(u!==null){if(oT)for(;d!==null&&Zw(d);)d=d.getPreviousSibling();ow(d)||(u.length=0)}let f=u===null||u.length===0?function(e){let t=e.match(/\t/g),n=e.match(/ /g),r=0;return t&&(r+=t.length),n&&(r+=Math.floor(n.length/4)),r}(r[1]):function(e,t){let n=iT(t);for(let t=e.length-1;t>=0;t--)if(n>=e[t])return t+1;return 0}(u,r[1]);if(ow(o)&&o.getListType()===e){let n=o.getFirstChild();n===null?o.append(s):n.insertBefore(s),e===`number`&&f===0&&o.setStart(Number(r[2])),t.remove()}else if(ow(d)&&(d.getListType()===e||f>0))d.append(s),t.remove();else{let n=aw(e,e===`number`?Number(r[2]):void 0);n.append(s),t.replace(n)}s.append(...n),i||s.select(0,0),f&&(s.setIndent(f),function(e,t,n){let r=e.getParent();if(!ow(r)||r.getListType()===t)return;let i=r.getParent();if(!ew(i))return;let a=aw(t,t===`number`?Number(n[2]):void 0),o=e.getPreviousSibling()===null;a.append(e);let s=$C();s.append(a),o?i.insertBefore(s):i.insertAfter(s),r.getChildrenSize()===0&&i.remove()}(s,e,r));let p=s.getParent();l&&ow(p)&&wf(p,tT,l),u!==null&&function(e,t,n,r){for(let n=e.length;n<t;n++)e[n]=4*(n+1);e.length=t,e[t]=function(e,t){let n=e[0];if(t===`check`){let t=n.slice(e[1].length).match(/^[-*+]\s/);t&&(n=e[1]+t[0])}return Math.min(iT(n),iT(e[1])+4)}(n,r)}(u,f,r,e)},sT=(e,t,n,r)=>{let i=[],a=e.getChildren(),o=0;for(let s of a)if(ew(s)){if(s.getChildrenSize()===1){let e=s.getFirstChild();if(ow(e)){let a=sT(e,t,n+1,r);a&&i.push(a);continue}}if(r&&!s.getChildren().some(e=>e.isSelected(r)))continue;let a=` `.repeat(4*n),c=e.getListType(),l=Cf(e,tT),u=c===`number`?`${e.getStart()+o}. `:c===`check`?`${l} [${s.getChecked()?`x`:` `}] `:l+` `,d=t(s);c!==`number`&&(d=d.replace(/^(\s{0,3}\d+)(\.\s)/,`$1\\$2`)),i.push(a+u+d),o++}return i.join(`
`)},_pe=hpe(e=>Bw(`h`+e[1].length)),cT={dependencies:[Lw],export:(e,t)=>{if(!Vw(e))return null;let n=Number(e.getTag().slice(1));return`#`.repeat(n)+` `+t(e)},regExp:$w,replace:(e,t,n,r)=>!(!r&&rT(e))&&_pe(e,t,n,r),triggerOnEnter:!0,type:`element`},vpe={dependencies:[Pw],export:(e,t)=>{if(!Iw(e))return null;let n=t(e).split(`
`),r=[];for(let e of n)r.push(`> `+e);return r.join(`
`)},regExp:tpe,replace:(e,t,n,r)=>{if(r){let n=e.getPreviousSibling();if(Iw(n))return n.splice(n.getChildrenSize(),0,[fpe(n),...t]),void e.remove()}let i=Fw();i.append(...t),e.replace(i),r||i.select(0,0)},triggerOnEnter:!0,type:`element`},lT={dependencies:[sC],export:e=>{if(!lC(e))return null;let t=e.getTextContent(),n=Cf(e,lpe);if(t.indexOf(n)>-1){let e=t.match(/`{3,}/g);if(e){let t=Math.max(...e.map(e=>e.length));n="`".repeat(t+1)}}let r=e.getLanguage()||``,i=r?Cf(e,upe):``;return n+r+(i?` `+i:``)+(t?`
`+t:``)+`
`+n},handleImportAfterStartMatch:({lines:e,rootNode:t,startLineIndex:n,startMatch:r})=>{let i=r[1],a=i.trim().length,o=e[n],s=r.index+i.length,c=o.slice(s),l=RegExp(`\`{${a},}$`);if(l.test(c)){let e=c.match(l),i=c.slice(0,c.lastIndexOf(e[0])),a=[...r];return a[2]=``,lT.replace(t,null,a,e,[i],!0),[!0,n]}let u=RegExp(`^[ \\t]*\`{${a},}$`);for(let i=n+1;i<e.length;i++){let a=e[i];if(u.test(a)){let s=a.match(u),c=e.slice(n+1,i),l=r[2]?o.slice(r[0].length).trim():``;return c.unshift(l?``:o.slice(r[0].length)),lT.replace(t,null,r,s,c,!0),mpe(t,l),[!0,i]}}let d=e.slice(n+1);return d.unshift(o.slice(r[0].length)),lT.replace(t,null,r,null,d,!0),[!0,e.length-1]},regExpEnd:{optional:!0,regExp:eT},regExpStart:npe,replace:(e,t,n,r,i,a)=>{let o,s,c=n[1]?n[1].trim():"```",l=n[2]||void 0,u=n[1]?n[1].length-n[1].trimStart().length:0;if(!t&&i){if(i.length===1)r?(o=cC(l),s=ppe(i[0],u)):(o=cC(l),s=i[0].startsWith(` `)?i[0].slice(1):i[0]);else{for(o=cC(l),i.length>0&&(i[0].trim().length===0?i.shift():i[0].startsWith(` `)&&(i[0]=i[0].slice(1)));i.length>0&&!i[i.length-1].length;)i.pop();s=i.map(e=>ppe(e,u)).join(`
`)}wf(o,lpe,c);let t=wh(s);o.append(t),e.append(o)}else if(t){if(!a&&rT(e))return!1;hpe(e=>cC(e?e[2]:void 0))(e,t,n,a)}},type:`multiline-element`},ype={dependencies:[nw,XC],export:(e,t,n)=>ow(e)?sT(e,t,0,n):null,regExp:$fe,replace:gpe(`bullet`),triggerOnEnter:!0,type:`element`},bpe={dependencies:[nw,XC],export:(e,t,n)=>ow(e)?sT(e,t,0,n):null,regExp:Qfe,replace:gpe(`number`),triggerOnEnter:!0,type:`element`},xpe={format:[`code`],tag:"`",type:`text-format`},Spe={format:[`highlight`],tag:`==`,type:`text-format`},uT={format:[`bold`,`italic`],tag:`***`,type:`text-format`},dT={format:[`bold`,`italic`],intraword:!1,tag:`___`,type:`text-format`},Cpe={format:[`bold`],tag:`**`,type:`text-format`},wpe={format:[`bold`],intraword:!1,tag:`__`,type:`text-format`},Tpe={format:[`strikethrough`],tag:`~~`,type:`text-format`},Epe={format:[`italic`],tag:`*`,type:`text-format`},Dpe={format:[`italic`],intraword:!1,tag:`_`,type:`text-format`};function Ope(e){return e.replace(/&(?=#\d+;|#[Xx][\dA-Fa-f]+;|[A-Za-z][\dA-Za-z]*;)/g,`&#38;`)}var fT={dependencies:[PC],export:(e,t,n)=>{if(!IC(e)||LC(e))return null;let r=t(e),i=e.getTitle();i!=null&&(i=Ope(i).replace(/([\\"])/g,`\\$1`));let a=e.getURL(),o=Ope(a),s=a===``||/\s/.test(a)?`<${o.replace(/([\\<>])/g,`\\$1`).replace(/\r/g,`&#13;`).replace(/\n/g,`&#10;`)}>`:o.replace(/([\\()])/g,`\\$1`).replace(/^</,`\\<`);return i?`[${r}](${s} "${i}")`:`[${r}](${s})`},importRegExp:/(?:\[(.+?)\])(?:\(\s*(?:(?:<((?:\\.|[^<>\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))/,regExp:/(?:\[([^[\]]*(?:\[[^[\]]*\][^[\]]*)*)\])(?:\(\s*(?:(?:<((?:\\.|[^<>\n\\])*)>|((?!<)(?:\\[^\s]|\\(?=\s)|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\]|\((?:\\[^\s]|[^\s()\\])*\))*\))*\)|[^\s()\\])+))(?:\s+(?:"((?:[^"]*\\")*[^"]*)"|'((?:[^']*\\')*[^']*)'|\(((?:\\.|[^()\\])*)\)))?\s*)?\))$/,replace:(e,t)=>{if(Ky(e,IC))return;let[,n,r,i,a,o,s]=t,c=Qw(r??i??``),l=a??o??s,u=FC(c,{title:l==null?void 0:Qw(l)}),d=n.split(`[`).length-1,f=n.split(`]`).length-1,p=n,m=``;if(d<f)return;if(d>f){let e=n.split(`[`);m=`[`+e[0],p=e.slice(1).join(`[`)}let h=e.getFormat(),g=wh(p);return g.setFormat(h),u.append(g),e.replace(u),m&&u.insertBefore(wh(m).setFormat(h)),g},trigger:`)`,type:`text-match`},kpe=[cT,vpe,ype,bpe],Ape=[lT],jpe=[xpe,uT,dT,Cpe,wpe,Spe,Epe,Dpe,Tpe],Mpe=[fT];function Npe(...e){return e.flat()}var pT=Npe(kpe,Ape,jpe,Mpe);function Ppe(e,t=!1){let n=e.split(`
`),r=0,i=[];for(let e=0;e<n.length;e++){let a=n[e],o=a.trimEnd(),s=i[i.length-1],c=e<n.length-1?nT(a):null,l=s!==void 0&&nT(s)!==null;if(rpe.test(o))i.push(o);else if(r===0){{let e=o.match(npe);if(e){r=e[1].trim().length,i.push(o);continue}}o===``||s===``||!s||$w.test(s)||$w.test(o)||tpe.test(o)||Qfe.test(o)||$fe.test(o)||epe.test(o)||ipe.test(o)||ape(o)||l||!t||ope.test(o)||spe.test(o)||cpe(spe).test(s)||cpe(ope).test(s)||eT.test(s)?i.push(!t&&o!==``||c!==null?a:o):i[i.length-1]=s+` `+(c===null?o:a).trimStart()}else{if(eT.test(o)&&o.trim().length>=r){r=0,i.push(o);continue}i.push(a)}}return i.join(`
`)}function Fpe(e,t,n,r,i){for(let a of t){if(!a.export)continue;let t=a.export(e,e=>mT(e,n,r,void 0,void 0,i));if(t!=null)return t}return $(e)?mT(e,n,r,void 0,void 0,i):e_(e)?e.getTextContent():null}function mT(e,t,n,r,i,a=!1){let o=[],s=e.getChildren();r||=[],i||=[];t:for(let e of s){for(let s of n){if(!s.export)continue;let c=s.export(e,e=>mT(e,t,n,r,[...i,...r],a),(e,n)=>Lpe(e,n,t,r,i,a));if(c!=null){o.push(c);continue t}}u_(e)?o.push(Ipe(e)):X(e)?o.push(Lpe(e,e.getTextContent(),t,r,i,a)):$(e)?o.push(mT(e,t,n,r,i,a)):e_(e)&&o.push(e.getTextContent())}return o.join(``)}function Ipe(e){return Cf(e,dpe)+`
`}function Lpe(e,t,n,r,i,a=!1){let o=e.hasFormat(`code`),s,c,l,u,d=t;if(o||(d=a?d.replace(/([*_`~])/g,`\\$1`):d.replace(/([*_`~\\])/g,`\\$1`)),o){let{fence:e,padded:n}=function(e){let t=e.match(/`+/g),n=t?Math.max(...t.map(e=>e.length)):0;return{fence:"`".repeat(n+1),padded:e.length===0||e.includes("`")||/^\s/.test(e)&&/\s$/.test(e)?` ${e} `:e}}(t);s=``,l=``,c=e+n+e,u=!1}else{let e=d.match(/^(\s*)(.*?)(\s*)$/s)||[``,``,d,``];s=e[1],c=e[2],l=e[3],u=c===``}let f=``,p=``,m=``,h=Rpe(e,!0),g=Rpe(e,!1),_=new Set;for(let t of n){let n=t.format[0],i=t.tag;n!==`code`&&(u||!zpe(e,n)||_.has(n)||(_.add(n),zpe(h,n)&&r.find(e=>e.tag===i)||(r.push({format:n,tag:i}),f+=i)))}for(let t=0;t<r.length;t++){let n=hT(e,r[t].format),a=hT(g,r[t].format);if(n&&a)continue;let o=[...r];for(;o.length>t;){let e=o.pop();i&&e&&i.find(t=>t.tag===e.tag)||(e&&typeof e.tag==`string`&&(n?a||(m+=e.tag):p+=e.tag),r.pop())}break}return u&&!e.hasFormat(`code`)?p+d:p+s+f+c+m+l}function Rpe(e,t){let n=t?e.getPreviousSibling():e.getNextSibling();return X(n)?n:null}function hT(e,t){return X(e)&&e.hasFormat(t)}function zpe(e,t){return!(!hT(e,t)||t!==`code`&&e&&/^\s*$/.test(e.getTextContent()))}function Bpe(e,t,n,r,i){if(!Vpe(t,n,r,i))return!1;if(e===`*`)return!0;if(e===`_`){if(!Vpe(t,n,r,!i))return!0;let e=i?t[n-1]:t[n+r];return e!==void 0&&Xw.test(e)}return!0}function Vpe(e,t,n,r){let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o!==void 0&&!Xfe.test(o)&&(!Xw.test(o)||s===void 0||Xfe.test(s)||Xw.test(s))}function gT(e){return X(e)&&!e.hasFormat(`code`)}function _T(e,t,n){let r=function(e,t){let n=e.getTextContent(),r=t.transformersByTag["`"],i=[],a=null;if(r){let e=function(e){let t=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},n=[],r=0;for(;r<e.length;)if(e[r]==="`"){let t=1;for(;r+t<e.length&&e[r+t]==="`";)t++;n.push({index:r,length:t}),r+=t}else r++;let i=[],a=0;for(;a<n.length;){let r=n[a];if(t(r.index)){a++;continue}let o=-1;for(let e=a+1;e<n.length;e++)if(n[e].length===r.length){o=e;break}if(o===-1){a++;continue}let s=n[o],c=e.slice(r.index+r.length,s.index);c.length>=2&&c.startsWith(` `)&&c.endsWith(` `)&&/[^ ]/.test(c)&&(c=c.slice(1,-1)),i.push({content:c,endIndex:s.index+s.length,startIndex:r.index}),a=o+1}return i}(n);for(let t of e)a||={content:t.content,endIndex:t.endIndex,startIndex:t.startIndex,tag:"`"},i.push({end:t.endIndex,start:t.startIndex})}let o=function(e,t,n=[]){let r=[],i=new Set(Object.keys(t.transformersByTag).filter(e=>e[0]!=="`").map(e=>e[0])),a=t=>{let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;return n%2==1},o=e=>n.some(t=>e>=t.start&&e<t.end),s=0;for(;s<e.length;){let t=e[s];if(!i.has(t)||a(s)||o(s)){s++;continue}let n=1;for(;s+n<e.length&&e[s+n]===t;)n++;let c=Bpe(t,e,s,n,!0),l=Bpe(t,e,s,n,!1);(c||l)&&r.push({active:!0,canClose:l,canOpen:c,char:t,index:s,length:n}),s+=n}return r}(n,t,i),s=o.length>0?function(e,t,n){let r={},i=0,a=null;for(;i<t.length;){let o=t[i];if(!o.active||!o.canClose||o.length===0){i++;continue}let s=`${o.char}${o.canOpen}${o.length%3}`,c=r[s]??-1,l=!1;for(let r=i-1;r>c;r--){let s=t[r];if(!s.active||!s.canOpen||s.length===0||s.char!==o.char||(s.canClose||o.canOpen)&&(s.length+o.length)%3==0&&s.length%3!=0&&o.length%3!=0)continue;let c=Math.min(s.length,o.length),u=Object.keys(n.transformersByTag).filter(e=>e[0]===s.char&&e.length<=c).sort((e,t)=>t.length-e.length)[0];if(!u)continue;l=!0;let d=u.length,f={content:e.slice(s.index+s.length,o.index),endIndex:o.index+d,startIndex:s.index+(s.length-d),tag:u};(!a||f.startIndex<a.startIndex||f.startIndex===a.startIndex&&f.endIndex>a.endIndex)&&(a=f);for(let e=r+1;e<i;e++)t[e].active=!1;s.length-=d,o.length-=d,s.active=s.length>0,o.length>0?o.index+=d:(o.active=!1,i++);break}l||(r[s]=i-1,o.canOpen||(o.active=!1),i++)}return a}(n,o,t):null,c=null,l=null;if(a&&s?s.startIndex<=a.startIndex&&s.endIndex>=a.endIndex?(c=s,l=t.transformersByTag[s.tag]):(c=a,l=r):a?(c=a,l=r):s&&(c=s,l=t.transformersByTag[s.tag]),!c||!l)return null;let u=[n.slice(c.startIndex,c.endIndex),c.tag,c.content];return u.index=c.startIndex,u.input=n,{endIndex:c.endIndex,isCodeSpan:l===r,match:u,startIndex:c.startIndex,transformer:l}}(e,t),i=function(e,t){let n=e,r,i,a,o;for(let e of t){if(!e.replace||!e.importRegExp)continue;let t=n.getTextContent().match(e.importRegExp);if(!t)continue;let s=t.index||0,c=e.getEndIndex?e.getEndIndex(n,t):s+t[0].length;!1!==c&&(r===void 0||i===void 0||s<r&&(c>i||c<=r))&&(r=s,i=c,a=e,o=t)}return r===void 0||i===void 0||a===void 0||o===void 0?null:{endIndex:i,match:o,startIndex:r,transformer:a}}(e,n);if(r&&i&&(r.isCodeSpan?i.startIndex<=r.startIndex&&i.endIndex>=r.endIndex?r=null:i=null:r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){let i=function(e,t,n,r,i){let a=e.getTextContent(),o,s,c;if(i[0]===a?o=e:t===0?[o,s]=e.splitText(n):[c,o,s]=e.splitText(t,n),o.setTextContent(i[2]),r)for(let e of r.format)o.hasFormat(e)||o.toggleFormat(e);return{nodeAfter:s,nodeBefore:c,transformedNode:o}}(e,r.startIndex,r.endIndex,r.transformer,r.match);gT(i.nodeAfter)&&_T(i.nodeAfter,t,n),gT(i.nodeBefore)&&_T(i.nodeBefore,t,n),gT(i.transformedNode)&&_T(i.transformedNode,t,n)}else if(i){let r=function(e,t,n,r,i){let a,o,s;return t===0?[a,o]=e.splitText(n):[s,a,o]=e.splitText(t,n),r.replace?{nodeAfter:o,nodeBefore:s,transformedNode:r.replace(a,i)||void 0}:null}(e,i.startIndex,i.endIndex,i.transformer,i.match);if(!r)return;gT(r.nodeAfter)&&_T(r.nodeAfter,t,n),gT(r.nodeBefore)&&_T(r.nodeBefore,t,n),gT(r.transformedNode)&&_T(r.transformedNode,t,n)}let a=Qw(e.getTextContent());e.setTextContent(a)}function Hpe(e,t,n,r=!1){let i=Yw(n),a=function(e){let t={},n={},r=[];for(let i of e){let{tag:e}=i;t[e]=i;let a=e.replace(/(\*|\^|\+)/g,`\\$1`);r.push(a),n[e]=e.length===1?RegExp(e==="`"?"(^|[^\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)":`(^|[^\\\\${a}])(${a})((\\\\${a})?.*?[^${a}\\s](\\\\${a})?)(${a})(?![\\\\${a}])`):RegExp(`(^|[^\\\\])(${a})((\\\\${a})?.*?[^\\s](\\\\${a})?)(${a})(?!\\\\)`)}return{fullMatchRegExpByTag:n,openTagsRegExp:RegExp(`(${r.join(`|`)})`,`g`),transformersByTag:t}}(i.textFormat),o=e.split(`
`),s=o.length;(function(e){let n=aT,c=oT;aT=[],oT=e;try{return(()=>{for(let e=0;e<s;e++){let n=o[e],[s,c]=Upe(o,e,i.multilineElement,t);s?e=c:Wpe(n,t,i.element,a,i.textMatch,r)}})()}finally{aT=n,oT=c}})(!r);let c=t.getChildren();for(let e of c)if(!r&&Zw(e)&&t.getChildrenSize()>1)e.remove();else if($(e))for(let t of e.getAllTextNodes())Gpe(t)}function Upe(e,t,n,r){for(let i of n){let{handleImportAfterStartMatch:n,regExpEnd:a,regExpStart:o,replace:s}=i,c=e[t].match(o);if(!c)continue;if(n){let a=n({lines:e,rootNode:r,startLineIndex:t,startMatch:c,transformer:i});if(a===null)continue;if(a)return a}let l=typeof a==`object`&&`regExp`in a?a.regExp:a,u=a&&typeof a==`object`&&`optional`in a?a.optional:!a,d=t,f=e.length;for(;d<f;){let n=l?e[d].match(l):null;if(!n&&(!u||u&&d<f-1)||n&&t===d&&n.index===c.index){d++;continue}let i=[];if(n&&t===d)i.push(e[t].slice(c[0].length,-n[0].length));else for(let r=t;r<=d;r++)if(r===t){let t=e[r].slice(c[0].length);i.push(t)}else if(r===d&&n){let t=e[r].slice(0,-n[0].length);i.push(t)}else i.push(e[r]);if(!1!==s(r,null,c,n,i,!0))return[!0,d];break}}return[!1,t]}function Wpe(e,t,n,r,i,a){let o=wh(e),s=j_();s.append(o),t.append(s);for(let{regExp:t,replace:r}of n){let n=e.match(t);if(n&&(o.setTextContent(e.slice(n[0].length)),!1!==r(s,[o],n,!0)))break}if(_T(o,r,i),s.getParent()!==null&&e.length>0){let e=s.getPreviousSibling();if(!a&&(M_(e)||Iw(e)||ow(e))){let t=e;if(ow(e)){let n=e.getLastDescendant();t=n==null?null:Ky(n,ew)}t!=null&&t.getTextContentSize()>0&&(t.splice(t.getChildrenSize(),0,[fpe(t),...s.getChildren()]),s.remove())}}}function Gpe(e){if(Oh(e))return;let t=e.getTextContent();if(!t.includes(` `))return;let n=e.getFormat(),r=e.getStyle(),i=[],a=0;for(let e=t.indexOf(` `);e!==-1;e=t.indexOf(` `,e+1))e>a&&i.push(wh(t.slice(a,e)).setFormat(n).setStyle(r)),i.push(Dh()),a=e+1;a<t.length&&i.push(wh(t.slice(a)).setFormat(n).setStyle(r)),e.getParentOrThrow().splice(e.getIndexWithinParent(),1,i)}function Kpe(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}function qpe(e,t,n,r,i){if(!Wv(e.getParent())||e.getFirstChild()!==t)return!1;let a=t.getTextContent();if(!i&&a[n-1]!==` `)return!1;for(let{regExp:o,replace:s}of r){let r=a.match(o),c=i||r&&r[0].endsWith(` `)?n:n-1;if(r&&r[0].length===c){let i=t.getNextSiblings(),[a,o]=t.splitText(n);if(!1!==s(e,o?[o,...i]:i,r,!1))return a.remove(),!0}}return!1}function Jpe(e,t,n,r,i){if(!Wv(e.getParent())||e.getFirstChild()!==t)return!1;let a=t.getTextContent();if(!i&&a[n-1]!==` `)return!1;for(let{regExpStart:o,replace:s,regExpEnd:c}of r){if(c&&!(`optional`in c)||c&&`optional`in c&&!c.optional)continue;let r=a.match(o);if(r){let a=i||r[0].endsWith(` `)?n:n-1;if(r[0].length!==a)continue;let o=t.getNextSiblings(),[c,l]=t.splitText(n);if(!1!==s(e,l?[l,...o]:o,r,null,null,!1))return c.remove(),!0}}return!1}function Ype(e,t){let n=0,r=e.getTextContent();for(let e=0;e<t;e++)r[e]==="`"&&n++;return n%2!=0}function Xpe(e,t,n){let r=n.length;for(let i=t;i>=r;i--){let t=i-r;if(Qpe(e,t,n,0,r)&&e[t+r]!==` `)return t}return-1}function Zpe(e){let t=e.getNode(),n=0;if(X(t))n=e.offset;else if($(t))for(let r of t.getChildren().slice(0,e.offset))n+=r.getTextContentSize();for(let e=t.getPreviousSibling();e!==null;e=e.getPreviousSibling())n+=e.getTextContentSize();return n}function Qpe(e,t,n,r,i){for(let a=0;a<i;a++)if(e[t+a]!==n[r+a])return!1;return!0}function $pe(e,t=pT){let n=Yw(t),r=n.element.filter(e=>e.triggerOnEnter),i=Jw(n.textFormat,({tag:e})=>e[e.length-1]),a=Jw(n.textMatch,({trigger:e})=>e),o=new Set([` `]);for(let e of n.textFormat)o.add(e.tag.slice(-1));for(let e of n.textMatch)e.trigger!==void 0&&o.add(e.trigger);for(let n of t){let t=n.type;if(t===`element`||t===`text-match`||t===`multiline-element`){let t=n.dependencies;for(let n of t)e.hasNode(n)||Kpe(173,n.getType())}}return Bb(e.registerUpdateListener(({tags:t,dirtyLeaves:r,editorState:s,prevEditorState:c})=>{if(t.has(`collaboration`)||t.has(`historic`)||e.isComposing())return;let l=t.has(`composition-end`),u=s.read(Q),d=c.read(Q);if(!Z(d)||!Z(u)||!u.isCollapsed()||u.is(d)&&!l)return;let f=u.anchor.key,p=u.anchor.offset,m=s._nodeMap.get(f);if(X(m)&&r.has(f)&&(l||p===1||!(s.read(()=>Zpe(u.anchor))>c.read(()=>Zpe(d.anchor))+1))){if(l){let e=s.read(()=>m.getTextContent())[p-1];if(!o.has(e))return}e.update(()=>{if(!gT(m))return;let e=m.getParent();e===null||lC(e)||((e,t,r)=>!!(qpe(e,t,r,n.element)||Jpe(e,t,r,n.multilineElement)||function(e,t,n){let r=e.getTextContent(),i=n[r[t-1]];if(i==null)return!1;t<r.length&&(r=r.slice(0,t));for(let t of i){if(!t.replace||!t.regExp)continue;let n=r.match(t.regExp);if(n===null)continue;let i=n.index||0,a=i+n[0].length,o;return i===0?[o]=e.splitText(a):[,o]=e.splitText(i,a),o.selectNext(0,0),t.replace(o,n),!0}return!1}(t,r,a)||function(e,t,n){let r=e.getTextContent(),i=t-1,a=r[i],o=n[a];if(!o)return!1;for(let t of o){let{tag:n}=t,o=n.length,s=i-o+1;if(o>1&&!Qpe(r,s,n,0,o)||r[s-1]===` `)continue;let c=r[i+1];if(!1===t.intraword&&c&&!Yfe.test(c))continue;let l=e,u=l,d=Xpe(r,s,n),f=u;for(;d<0&&(f=f.getPreviousSibling())&&!u_(f);)if(X(f)){if(f.hasFormat(`code`))continue;let e=f.getTextContent();u=f,d=Xpe(e,e.length,n)}if(d<0||u===l&&d+o===s)continue;let p=u.getTextContent();if(d>0&&p[d-1]===a)continue;let m=p[d-1];if(!1===t.intraword&&m&&!Yfe.test(m)||!t.format.includes(`code`)&&Ype(u,d))continue;let h=l.getTextContent(),g=h.slice(0,s)+h.slice(i+1);l.setTextContent(g);let _=u===l?g:p;u.setTextContent(_.slice(0,d)+_.slice(d+o));let v=Q(),y=ng();pv(y);let b=i-o*(u===l?2:1)+1;y.anchor.set(u.__key,d,`text`),y.focus.set(l.__key,b,`text`);for(let e of t.format)y.formatText(e,vd[e]);y.anchor.set(y.focus.key,y.focus.offset,y.focus.type);for(let e of t.format)y.hasFormat(e)&&y.toggleFormat(e);return Z(v)&&(y.format=v.format),!0}return!1}(t,r,i)))(e,m,u.anchor.offset)&&Iv(`history-push`)})}}),e.registerCommand(im,e=>{if(e!==null&&e.shiftKey)return!1;let t=Q();if(!Z(t)||!t.isCollapsed())return!1;let i=t.anchor.offset,a=t.anchor.getNode();if(!X(a)||!gT(a))return!1;let o=a.getParent();return o!==null&&!lC(o)&&!(i!==a.getTextContent().length||!Jpe(o,a,i,n.multilineElement,!0)&&!qpe(o,a,i,r,!0)||(e!==null&&e.preventDefault(),0))},1))}function eme(e,t=pT,n,r=!1,i=!1){let a=r?e:Ppe(e,i),o=n||dv();o.clear(),Hpe(a,o,t,r),Q()!==null&&o.selectStart()}function tme(e=pT,t,n=!1){return function(e,t=!1){let n=Yw(e),r=[...n.multilineElement,...n.element],i=!t,a=n.textFormat.filter(e=>e.format.length===1).sort((e,t)=>Number(e.format.includes(`code`))-Number(t.format.includes(`code`)));return e=>{let o=[],s=(e||dv()).getChildren();for(let e=0;e<s.length;e++){let c=s[e],l=Fpe(c,r,a,n.textMatch,t);l!=null&&o.push(i&&e>0&&!Zw(c)&&!Zw(s[e-1])?`
${l}`:l)}return o.join(`
`)}}(e,n)(t)}var nme=/^([ \t]*`{3,})[ \t]*([\w-]+)?[ \t]*/,vT={...lT,export:(e,t)=>{let n=lT.export?.(e,t)??null,[r]=n?.split(`
`,1)??[];if(!n||!r.includes(``))return n;let i=n.slice(r.length,n.lastIndexOf(`
`)),a=Math.max(2,...(i.match(/^[ \t]*~+/gm)??[]).map(e=>e.trim().length)),o=`~`.repeat(a+1);return`${r.replace(/^`+/,o).replaceAll(``,"`")}${i}\n${o}`},handleImportAfterStartMatch:({lines:e,startLineIndex:t,...n})=>{let r=e[t].match(nme),i=r[1].trim(),a=RegExp(`^[ \\t]*\`{${i.length},}$`),o=e.slice(t+1).some(e=>a.test(e)),s=lT.handleImportAfterStartMatch?.({...n,lines:o?e:[...e,i],startLineIndex:t,startMatch:r});return s&&[s[0],Math.min(s[1],e.length-1)]},regExpStart:RegExp(`${lT.regExpStart.source}(?=[^\`]*$)`)},yT=e=>X(e)&&e.hasFormat(`code`)&&/^\s+$/.test(e.getTextContent()),bT=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();if(![e,t,n].some(yT))return e;let r=e=>yT(e)?Object.create(e,{getTextContent:{value:()=>``}}):e;return Object.create(r(e),{getPreviousSibling:{value:()=>r(t)},getNextSibling:{value:()=>r(n)}})},xT=e=>{if(!M_(e))return!1;let t=e.getFirstChild();return!t||e.getChildrenSize()===1&&X(t)&&/^\s{0,3}$/.test(t.getTextContent())},rme=e=>{let t=e.getParent();if(!xT(t)||!n_(t?.getParent()))return[``,``];let n=t?.getPreviousSibling()??null,r=t?.getNextSibling()??null;return[n&&!xT(n)?`
`:``,r&&!(e=>{let t=e?.getFirstChild();return xT(e)&&!(X(t)&&t.hasFormat(`code`))})(r)?`
`:``]},ime={dependencies:[],export:(e,t,n)=>{if(!X(e)||!e.hasFormat(`code`))return null;let r=e.getTextContent(),i=bT(e),[a,o]=yT(e)?rme(e):[``,``],s=!r.includes("`")&&/^\s/.test(r)&&/\s$/.test(r)&&!(r.startsWith(` `)&&r.endsWith(` `)&&/[^ ]/.test(r));if(!s&&i===e&&!a&&!o)return null;let c=n(i,r);return`${a}${s?c.replace(`\` ${r} \``,()=>`\`${r}\``):c}${o}`},importRegExp:/^(`+)(?!`)([^]*?[^`])\1(?!`)/,regExp:/(?!)/,replace:(e,[,,t])=>{let n=wh(/^ .*[^ ].* $/s.test(t)?t.slice(1,-1):t).setFormat(e.getFormat()).setStyle(e.getStyle()).toggleFormat(`code`);return e.replace(n),n},type:`text-match`},ame={bold:[`**`,`__`],italic:[`_`,`*`],strikethrough:[`~~`]},ome=/^(?:\*\*|__|~~|\*|_)/,ST=e=>X(e)&&e.hasFormat(`code`)?"`":e?.getTextContent()??``,sme=e=>{let t=e.getChildren();if(!t.length||!t.every(e=>X(e)&&/\S/.test(ST(e)))||/^\s/.test(ST(t[0]))||/\s$/.test(ST(t.at(-1))))return[];let n=Object.keys(ame).filter(e=>t.every(t=>t.hasFormat(e))),r=(e,t)=>{if(!e||u_(e))return!0;if(!X(e))return!1;let r=t(ST(e))??``;return n.some(t=>e.hasFormat(t))?/\s/.test(r):/[\s\p{P}\p{S}]/u.test(r)};return n.length&&r(e.getPreviousSibling(),e=>e.at(-1))&&r(e.getNextSibling(),e=>e[0])?n:[]},cme=(e,t)=>{let n=[...t],r=``;for(;n.length;){let[t]=e.slice(r.length).match(ome)??[],i=n.findIndex(e=>ame[e]?.includes(t??``));if(!t||i===-1)return;n.splice(i,1),r+=t}let i=[...r].reverse().join(``);if(!(e.length<r.length*2||!e.endsWith(i)))return{text:e.slice(r.length,-i.length),delimiters:r}},lme={...fT,export:(e,t,n)=>{let r=IC(e)?sme(e):[],i,a=fT.export?.(e,e=>{let n=t(e),a=r.length?cme(n,r):void 0;return i=a?.delimiters,a?.text??n},n);return a&&i?`${i}${a}${[...i].reverse().join(``)}`:a??null}},ume={text:{italic:`italic`,strikethrough:`strikethrough`},list:{nested:{listitem:`nested`}},code:`code-block`,tableScrollableWrapper:`table-wrapper`,tableCellSelected:`selected`,tableSelection:`table-selection`},CT={bold:{labelKey:`bold`,icon:`format_bold`,inline:!0},italic:{labelKey:`italic`,icon:`format_italic`,inline:!0},strikethrough:{labelKey:`strikethrough`,icon:`strikethrough_s`,inline:!0},code:{labelKey:`code`,icon:`code`,inline:!0},link:{labelKey:`link`,icon:`link`,inline:!0},paragraph:{labelKey:`paragraph`,icon:`format_paragraph`,inline:!1},"heading-1":{labelKey:`heading_1`,icon:`format_h1`,inline:!1},"heading-2":{labelKey:`heading_2`,icon:`format_h2`,inline:!1},"heading-3":{labelKey:`heading_3`,icon:`format_h3`,inline:!1},"heading-4":{labelKey:`heading_4`,icon:`format_h4`,inline:!1},"heading-5":{labelKey:`heading_5`,icon:`format_h5`,inline:!1},"heading-6":{labelKey:`heading_6`,icon:`format_h6`,inline:!1},"bulleted-list":{labelKey:`bulleted_list`,icon:`format_list_bulleted`,inline:!1},"numbered-list":{labelKey:`numbered_list`,icon:`format_list_numbered`,inline:!1},blockquote:{labelKey:`blockquote`,icon:`format_quote`,inline:!1},"code-block":{labelKey:`code_block`,icon:`code_blocks`,inline:!1},table:{labelKey:`insert_table`,icon:`table`,inline:!1},"horizontal-rule":{labelKey:`insert_horizontal_rule`,icon:`horizontal_rule`,inline:!1}},dme=[`bold`,`italic`,`strikethrough`,`code`],fme=[...dme,`link`],wT=[`paragraph`,`heading-1`,`heading-2`,`heading-3`,`heading-4`,`heading-5`,`heading-6`,`bulleted-list`,`numbered-list`,`blockquote`,`code-block`],pme={"heading-1":[Lw],"heading-2":[Lw],"heading-3":[Lw],"heading-4":[Lw],"heading-5":[Lw],"heading-6":[Lw],"bulleted-list":[nw,XC],"numbered-list":[nw,XC],blockquote:[Pw],"code-block":[sC,hC],link:[PC]},mme={"heading-1":[cT],"heading-2":[cT],"heading-3":[cT],"heading-4":[cT],"heading-5":[cT],"heading-6":[cT],"bulleted-list":[ype],"numbered-list":[bpe],blockquote:[vpe],"code-block":[vT],code:[xpe,ime],bold:[Cpe,wpe,uT,dT],italic:[Dpe,Epe,uT,dT],strikethrough:[Tpe],link:[lme]},hme=[`*`,`__`,`***`,`___`],gme=Mp(`OPEN_LINK_EDITOR_COMMAND`),_me=[{type:`left`,labelKey:`align_left`,icon:`format_align_left`},{type:`center`,labelKey:`align_center`,icon:`format_align_center`},{type:`right`,labelKey:`align_right`,icon:`format_align_right`},{type:`justify`,labelKey:`align_justify`,icon:`format_align_justify`}];function vme(e,t,n){let r=n(),i=0,a=r,o=0,s=null;return(c,l,u,d,f,p)=>{let m=n();if(p.has(`composition-start`)&&(a=r,o=i,s=c),p.has(`historic`))return i=0,r=m,2;p.has(`composition-end`)&&s&&(r=a,i=o,c=s);let h=p.has(`paste`)||p.has(`cut`)?0:function(e,t,n,r,i){if(e===null||n.size===0&&r.size===0&&!i)return 0;let a=t._selection,o=e._selection;if(i)return 1;if(!(Z(a)&&Z(o)&&o.isCollapsed()&&a.isCollapsed()))return 0;let s=function(e,t,n){let r=e._nodeMap,i=[];for(let e of t){let t=r.get(e);t!==void 0&&i.push(t)}for(let[e,t]of n){if(!t)continue;let n=r.get(e);n===void 0||n_(n)||i.push(n)}return i}(t,n,r);if(s.length===0)return 0;if(s.length>1){let n=t._nodeMap,r=n.get(a.anchor.key),i=n.get(o.anchor.key);return r&&i&&!e._nodeMap.has(r.__key)&&X(r)&&r.__text.length===1&&a.anchor.offset===1?2:0}let c=s[0],l=e._nodeMap.get(c.__key);if(!X(l)||!X(c)||l.__mode!==c.__mode)return 0;let u=l.__text,d=c.__text;if(u===d)return 0;let f=a.anchor,p=o.anchor;if(f.key!==p.key||f.type!==`text`)return 0;let m=f.offset,h=p.offset,g=d.length-u.length;return g===1&&h===m-1?2:g===-1&&h===m+1?3:g===-1&&h===m?4:0}(c,l,d,f,e.isComposing()),g=(()=>{let n=u===null||u.editor===e,a=p.has(`history-push`);if(!a&&n&&p.has(`history-merge`))return 0;if(h===1)return 2;if(c===null)return 1;let o=l._selection;if(!(d.size>0||f.size>0))return o===null?2:0;let s=typeof t==`number`?t:t.peek();return!1===a&&h!==0&&h===i&&m<r+s&&n||d.size===1&&function(e,t,n){let r=t._nodeMap.get(e),i=n._nodeMap.get(e),a=t._selection,o=n._selection;return!(Z(a)&&Z(o)&&a.anchor.type===`element`&&a.focus.type===`element`&&o.anchor.type===`text`&&o.focus.type===`text`||!X(r)||!X(i)||r.__parent!==i.__parent)&&JSON.stringify(t.read(()=>r.exportJSON()))===JSON.stringify(n.read(()=>i.exportJSON()))}(Array.from(d)[0],c,l)?0:1})();return r=m,i=h,g}}function yme(e,t){if(t!==null&&t.editor===e.editor)return t;let{editor:n}=e,r=n.getEditorState();return r.isEmpty()?null:{editor:n,editorState:r}}function bme(e,t){e.undoStack=[],e.redoStack=[],e.current=null,t&&t(e)}function xme(e,t,n,r=Date.now,i,a=null){let o=vme(e,n,r),s=()=>{i&&i(t)};return s(),Bb(e.registerCommand(Yp,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(i.length!==0){let a=t.current,o=i.pop();if(o){let t=yme(o,a);t!==null&&(r.push(t),e.dispatchCommand(bm,!0))}i.length===0&&e.dispatchCommand(xm,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(Xp,()=>(function(e,t,n){let r=t.redoStack,i=t.undoStack;if(r.length!==0){let a=t.current,o=r.pop();if(o){let t=yme(o,a);t!==null&&(i.push(t),e.dispatchCommand(xm,!0))}r.length===0&&e.dispatchCommand(bm,!1),t.current=o||null,n&&n(t),o&&o.editor.setEditorState(o.editorState,{tag:`historic`})}}(e,t,i),!0),0),e.registerCommand(ace,()=>(bme(t,i),!1),0),e.registerCommand(oce,()=>(bme(t,i),e.dispatchCommand(bm,!1),e.dispatchCommand(xm,!1),!0),0),e.registerUpdateListener(({editorState:n,prevEditorState:r,dirtyLeaves:i,dirtyElements:c,tags:l})=>{let u=t.current,d=t.redoStack,f=t.undoStack,p=u===null?null:u.editorState;if(u!==null&&n===p)return;let m=o(r,n,u,i,c,l);if(m===1){d.length!==0&&(t.redoStack=[],e.dispatchCommand(bm,!1));let n=function(e,t,n){return n===null?null:n.editor===e?{...n}:t.isEmpty()?null:{editor:e,editorState:t}}(e,r,u);if(n!==null){f.push(n);let t=typeof a==`number`||a===null?a:a.peek();t!==null&&f.length>t&&f.splice(0,f.length-t),e.dispatchCommand(xm,!0)}}else if(m===2)return;t.current={editor:e,editorState:n},s()}))}function Sme(){return{current:null,redoStack:[],undoStack:[]}}var TT=/^(\d+(?:\.\d+)?)px$/,Cme=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;function ET(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`||!Cme.test(e))return t;let n=Number(e);return Number.isFinite(n)?n:t}function DT(e,t,n,r,i){let a=ET(e,t);return a>=n&&a<=r&&Number.isInteger(a)?a:t}function wme(e,t){e.__colWidths=t.__colWidths,e.__frozenColumnCount=t.__frozenColumnCount,e.__frozenRowCount=t.__frozenRowCount,e.__rowStriping=t.__rowStriping}var Tme=e=>{let t=Zd(e,`format`),n=Qd(e,`format`),r=ef(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],colWidths:e.__colWidths,frozenColumnCount:e.getSerializedFrozenColumnCount(),frozenRowCount:e.getSerializedFrozenRowCount(),rowStriping:e.getSerializedRowStriping(),direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__colWidths;o!==void 0&&(a.colWidths=o);let s=e.getSerializedFrozenColumnCount();s!==void 0&&s!==0&&(a.frozenColumnCount=s);let c=e.getSerializedFrozenRowCount();c!==void 0&&c!==0&&(a.frozenRowCount=c);let l=e.getSerializedRowStriping();l!==void 0&&!1!==l&&(a.rowStriping=l);let u=e.__dir;u!=null&&(a.direction=u);let d=t[e.__format];d!==void 0&&d!==``&&(a.format=d);let f=e.__indent;return f!==void 0&&f!==0&&(a.indent=f),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=DT(t.indent,0,0,1/0),e.__textFormat=ET(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.colWidths;e.setColWidths(s===void 0?void 0:Array.isArray(s)?Array.from(s,e=>ET(e,0)):[]),e.__frozenColumnCount=ET(t.frozenColumnCount,0),e.__frozenRowCount=ET(t.frozenRowCount,0);let c=t.rowStriping;return e.__rowStriping=typeof c==`boolean`&&c,e},afterCloneFrom:wme}};function Eme(e,t){e.__height=t.__height}var Dme=e=>{let t=Zd(e,`format`),n=Qd(e,`format`),r=ef(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],height:e.__height,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__height;o!==void 0&&(a.height=o);let s=e.__dir;s!=null&&(a.direction=s);let c=t[e.__format];c!==void 0&&c!==``&&(a.format=c);let l=e.__indent;return l!==void 0&&l!==0&&(a.indent=l),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=DT(t.indent,0,0,1/0),e.__textFormat=ET(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.height;return e.__height=s===void 0?void 0:ET(s,0),e},afterCloneFrom:Eme}};function Ome(e,t){e.__backgroundColor=t.__backgroundColor,e.__colSpan=t.__colSpan,e.__headerState=t.__headerState,e.__rowSpan=t.__rowSpan,e.__verticalAlign=t.__verticalAlign,e.__width=t.__width}var kme=e=>{let t=Zd(e,`format`),n=Qd(e,`format`),r=ef(e,`format`);return{exportJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles();return{children:[],backgroundColor:e.__backgroundColor,colSpan:e.__colSpan,headerState:e.__headerState,rowSpan:e.__rowSpan,verticalAlign:e.getSerializedVerticalAlign(),width:e.__width,direction:e.__dir,format:t[e.__format],indent:e.__indent,textFormat:n!==0&&i?n:void 0,textStyle:r!==``&&i?r:void 0,type:e.__type,version:1}},exportCompactJSON:function(e){let n=e.__textFormat,r=e.__textStyle,i=(n!==0||r!==``)&&e.shouldSerializeTextStyles(),a={type:e.__type,children:[]},o=e.__backgroundColor;o!=null&&(a.backgroundColor=o);let s=e.__colSpan;s!==void 0&&s!==1&&(a.colSpan=s);let c=e.__headerState;c!==void 0&&c!==0&&(a.headerState=c);let l=e.__rowSpan;l!==void 0&&l!==1&&(a.rowSpan=l);let u=e.getSerializedVerticalAlign();u!==void 0&&(a.verticalAlign=u);let d=e.__width;d!==void 0&&(a.width=d);let f=e.__dir;f!=null&&(a.direction=f);let p=t[e.__format];p!==void 0&&p!==``&&(a.format=p);let m=e.__indent;return m!==void 0&&m!==0&&(a.indent=m),n!==void 0&&n!==0&&i&&(a.textFormat=n),r!==void 0&&r!==``&&i&&(a.textStyle=r),a},updateFromJSON:function(e,t){let i=t.direction;e.__dir=i===null||i===`ltr`||i===`rtl`?i:null;let a=t.format;e.__format=typeof a==`string`&&a in n?n[a]:r,e.__indent=DT(t.indent,0,0,1/0),e.__textFormat=ET(t.textFormat,0);let o=t.textStyle;e.__textStyle=typeof o==`string`?o:``;let s=t.backgroundColor;e.__backgroundColor=typeof s==`string`&&s!==``?s:null,e.__colSpan=DT(t.colSpan,1,1,1/0),e.setHeaderStyles(ET(t.headerState,0)),e.__rowSpan=DT(t.rowSpan,1,1,1/0);let c=t.verticalAlign;e.__verticalAlign=c===`middle`||c===`bottom`?c:void 0;let l=t.width;return e.__width=l===void 0||ET(l,0)===0?void 0:ET(l,0),e},afterCloneFrom:Ome}},OT={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},Ame=_f()({backgroundColor:yf(hf(df(),{defaultAsNull:!0}),{field:`__backgroundColor`}),colSpan:yf(ff(1,{integer:!0,min:1}),{field:`__colSpan`}),headerState:bf(ff(0),{getter:{field:`__headerState`,method:`getHeaderStyles`},setter:`setHeaderStyles`}),rowSpan:yf(ff(1,{integer:!0,min:1}),{field:`__rowSpan`}),verticalAlign:bf(mf([void 0,`middle`,`bottom`]),{getter:`getSerializedVerticalAlign`,setter:{field:`__verticalAlign`}}),width:yf(gf(ff(),{omitDefault:!0}),{field:`__width`})}),kT=class extends Zg{__colSpan;__rowSpan;__headerState;__width;__backgroundColor;__verticalAlign;$config(){return this.config(`tablecell`,{extends:Zg,generated:kme,importDOM:{td:()=>({conversion:jme,priority:0}),th:()=>({conversion:jme,priority:0})},json:Ame})}constructor(e=OT.NO_STATUS,t=1,n,r){super(r),this.__colSpan=t,this.__rowSpan=1,this.__headerState=e,this.__width=n,this.__backgroundColor=null,this.__verticalAlign=void 0}createDOM(e){let t=ny().createElement(this.getTag());return this.__width&&(t.style.width=`${this.__width}px`),this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(t.style.backgroundColor=this.__backgroundColor),AT(this.__verticalAlign)&&(t.style.verticalAlign=this.__verticalAlign),Rb(t,e.theme.tableCell,this.hasHeader()&&e.theme.tableCellHeader),t}exportDOM(e){let t=super.exportDOM(e);if(uy(t.element)){let e=t.element;e.setAttribute(`data-temporary-table-cell-lexical-key`,this.getKey()),e.style.border=`1px solid black`,this.__colSpan>1&&(e.colSpan=this.__colSpan),this.__rowSpan>1&&(e.rowSpan=this.__rowSpan),e.style.width=`${this.getWidth()||75}px`,e.style.verticalAlign=this.getVerticalAlign()||`top`,e.style.textAlign=`start`,this.__backgroundColor===null&&this.hasHeader()&&(e.style.backgroundColor=`#f2f3f5`)}return t}getColSpan(){return this.getLatest().__colSpan}setColSpan(e){let t=this.getWritable();return t.__colSpan=e,t}getRowSpan(){return this.getLatest().__rowSpan}setRowSpan(e){let t=this.getWritable();return t.__rowSpan=e,t}getTag(){return this.hasHeader()?`th`:`td`}setHeaderStyles(e,t=OT.BOTH){let n=this.getWritable();return n.__headerState=e&t|n.__headerState&~t,n}getHeaderStyles(){return this.getLatest().__headerState}setWidth(e){let t=this.getWritable();return t.__width=e,t}getWidth(){return this.getLatest().__width}getSerializedVerticalAlign(){let e=this.getLatest().__verticalAlign;return AT(e)?e:void 0}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(e){let t=this.getWritable();return t.__backgroundColor=e,t}getVerticalAlign(){return this.getLatest().__verticalAlign}setVerticalAlign(e){let t=this.getWritable();return t.__verticalAlign=e||void 0,t}toggleHeaderStyle(e){let t=this.getWritable();return(t.__headerState&e)===e?t.__headerState&=~e:t.__headerState|=e,t}hasHeaderState(e){return(this.getHeaderStyles()&e)===e}hasHeader(){return this.getLatest().__headerState!==OT.NO_STATUS}updateDOM(e){return e.__headerState!==this.__headerState||e.__width!==this.__width||e.__colSpan!==this.__colSpan||e.__rowSpan!==this.__rowSpan||e.__backgroundColor!==this.__backgroundColor||e.__verticalAlign!==this.__verticalAlign}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}};function AT(e){return e===`middle`||e===`bottom`}function jme(e){let t=e,n=e.nodeName.toLowerCase(),r;TT.test(t.style.width)&&(r=parseFloat(t.style.width));let i=OT.NO_STATUS;if(n===`th`){let e=t.getAttribute(`scope`);if(e===`col`)i=OT.COLUMN;else if(e===`row`)i=OT.ROW;else{let e=t.parentElement,n=uy(e)&&e.nodeName.toLowerCase()===`tr`&&uy(e.parentElement)&&(e.parentElement.nodeName.toLowerCase()===`thead`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=OT.ROW),r&&(i|=OT.COLUMN),i===OT.NO_STATUS&&(i=OT.ROW)}}let a=jT(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;AT(s)&&(a.__verticalAlign=s),wy(a,t);let c=t.style,l=(c&&c.textDecoration||``).split(` `),u=c.fontWeight===`700`||c.fontWeight===`bold`,d=l.includes(`line-through`),f=c.fontStyle===`italic`,p=l.includes(`underline`),m=c.color;return{after:e=>{let t=[],n=null,r=()=>{if(n){let e=n.getFirstChild();u_(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)if(Vv(i)||X(i)||u_(i)){if(X(i)&&(u&&i.toggleFormat(`bold`),d&&i.toggleFormat(`strikethrough`),f&&i.toggleFormat(`italic`),p&&i.toggleFormat(`underline`),m)){let e=i.getStyle();e.includes(`color:`)||i.setStyle(e+`color: ${m};`)}n?n.append(i):(n=j_().append(i),t.push(n))}else t.push(i),r(),n=null;return r(),t.length===0&&t.push(j_()),t},node:a}}function jT(e=OT.NO_STATUS,t=1,n){return Kv(new kT(e,t,n))}function MT(e){return e instanceof kT}var Mme=Mp(`INSERT_TABLE_COMMAND`);function NT(e,...t){throw function(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);return n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}(e,...t)}var Nme=_f()({height:yf(gf(ff()),{field:`__height`})}),PT=class extends Zg{__height;$config(){return this.config(`tablerow`,{extends:Zg,generated:Dme,importDOM:{tr:()=>({conversion:Pme,priority:0})},json:Nme})}constructor(e=void 0,t){super(t),this.__height=e}createDOM(e){let t=ny().createElement(`tr`);return this.__height&&(t.style.height=`${this.__height}px`),Rb(t,e.theme.tableRow),t}extractWithChild(e,t,n){return n===`html`}isShadowRoot(){return!0}setHeight(e){let t=this.getWritable();return t.__height=e,t}getHeight(){return this.getLatest().__height}updateDOM(e){return e.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}};function Pme(e){let t=e,n;return TT.test(t.style.height)&&(n=parseFloat(t.style.height)),{after:e=>sx(e,MT),node:wy(FT(n),t)}}function FT(e){return Kv(new PT(e))}function IT(e){return e instanceof PT}function Fme(e,t,n=!0){let r=yE();for(let i=0;i<e;i++){let e=FT();for(let r=0;r<t;r++){let t=OT.NO_STATUS;typeof n==`object`?(i===0&&n.rows&&(t|=OT.ROW),r===0&&n.columns&&(t|=OT.COLUMN)):n&&(i===0&&(t|=OT.ROW),r===0&&(t|=OT.COLUMN));let a=jT(t),o=j_();o.append(wh()),a.append(o),e.append(a)}r.append(e)}return r}function Ime(e){let t=Ky(e,e=>bE(e));if(bE(t))return t;throw Error(`Expected table cell to be inside of table.`)}var LT=(e,t)=>e===OT.BOTH||e===t?t:OT.NO_STATUS;function Lme(e=!0){let t=Q();Z(t)||qT(t)||NT(188);let n=t.anchor.getNode(),r=t.focus.getNode(),[i]=WT(n),[a,,o]=WT(r),[,s,c]=HT(o,a,i),{startRow:l}=c,{startRow:u}=s;return e?RT(l+i.__rowSpan>u+a.__rowSpan?i:a,!0):RT(u<l?a:i,!1)}function RT(e,t=!0){let[,,n]=WT(e),[r,i]=HT(n,e,e),a=r[0].length,{startRow:o}=i,s=null;if(t){let t=o+e.__rowSpan-1,i=r[t],c=FT();for(let e=0;e<a;e++){let{cell:n,startRow:r}=i[e];if(r+n.__rowSpan-1<=t){let t=i[e].cell.__headerState,n=LT(t,OT.COLUMN);c.append(jT(n).append(j_()))}else n.setRowSpan(n.__rowSpan+1)}let l=n.getChildAtIndex(t);IT(l)||NT(256),l.insertAfter(c),s=c}else{let e=o,t=r[e],i=FT();for(let n=0;n<a;n++){let{cell:r,startRow:a}=t[n];if(a===e){let e=t[n].cell.__headerState,r=LT(e,OT.COLUMN);i.append(jT(r).append(j_()))}else r.setRowSpan(r.__rowSpan+1)}let c=n.getChildAtIndex(e);IT(c)||NT(257),c.insertBefore(i),s=i}return s}function Rme(e=!0){let t=Q();Z(t)||qT(t)||NT(188);let n=t.anchor.getNode(),r=t.focus.getNode(),[i]=WT(n),[a,,o]=WT(r),[,s,c]=HT(o,a,i),{startColumn:l}=c,{startColumn:u}=s;return e?zT(l+i.__colSpan>u+a.__colSpan?i:a,!0):zT(u<l?a:i,!1)}function zT(e,t=!0,n=!0){let[,,r]=WT(e),[i,a]=HT(r,e,e),o=i.length,{startColumn:s}=a,c=t?s+e.__colSpan-1:s-1,l=r.getFirstChild();IT(l)||NT(120);let u=null;function d(e=OT.NO_STATUS){let t=jT(e).append(j_());return u===null&&(u=t),t}let f=l;for(let e=0;e<o;e++){if(e!==0){let e=f.getNextSibling();IT(e)||NT(121),f=e}let t=i[e],n=t[c<0?0:c].cell.__headerState,r=LT(n,OT.ROW);if(c<0){VT(f,d(r));continue}let{cell:a,startColumn:o}=t[c];if(o+a.__colSpan-1<=c){let n=null;for(let r=0;r<=c;r++){let i=t[r];i.startRow===e&&(n=i.cell),i.cell.__colSpan>1&&(r+=i.cell.__colSpan-1)}n===null?VT(f,d(r)):n.insertAfter(d(r))}else a.setColSpan(a.__colSpan+1)}u!==null&&n&&BT(u);let p=r.getColWidths();if(p){let e=[...p],t=c<0?0:c,n=e[t];e.splice(t,0,n),r.setColWidths(e)}return u}function zme(){let e=Q();Z(e)||qT(e)||NT(188);let[t,n]=e.isBackward()?[e.focus.getNode(),e.anchor.getNode()]:[e.anchor.getNode(),e.focus.getNode()],[r,,i]=WT(t),[a]=WT(n),[o,s,c]=HT(i,r,a),{startRow:l}=s,{startRow:u}=c,d=u+a.__rowSpan-1;if(o.length===d-l+1)return i.selectPrevious(),void i.remove();let f=o[0].length,p=o[d+1],m=i.getChildAtIndex(d+1);for(let e=d;e>=l;e--){for(let t=f-1;t>=0;t--){let{cell:n,startRow:r,startColumn:i}=o[e][t];if(i===t){if(r<l||r+n.__rowSpan-1>d){let e=Math.max(r,l),t=Math.min(n.__rowSpan+r-1,d),i=e<=t?t-e+1:0;n.setRowSpan(n.__rowSpan-i)}if(r>=l&&r+n.__rowSpan-1>d&&e===d){IT(m)||NT(387);let r=null;for(let n=0;n<t;n++){let t=p[n],i=t.cell;t.startRow===e+1&&(r=i),i.__colSpan>1&&(n+=i.__colSpan-1)}r===null?VT(m,n):r.insertAfter(n)}}}let t=i.getChildAtIndex(e);IT(t)||NT(206,String(e)),t.remove()}if(p!==void 0){let{cell:e}=p[0];BT(e)}else{let{cell:e}=o[l-1][0];BT(e)}}function Bme(){let e=Q();Z(e)||qT(e)||NT(188);let t=e.anchor.getNode(),n=e.focus.getNode(),[r,,i]=WT(t),[a]=WT(n),[o,s,c]=HT(i,r,a),{startColumn:l}=s,{startRow:u,startColumn:d}=c,f=Math.min(l,d),p=Math.max(l+r.__colSpan-1,d+a.__colSpan-1),m=p-f+1;if(o[0].length===p-f+1)return i.selectPrevious(),void i.remove();let h=o.length;for(let e=0;e<h;e++)for(let t=f;t<=p;t++){let{cell:n,startColumn:r}=o[e][t];if(r<f){if(t===f){let e=f-r;n.setColSpan(n.__colSpan-Math.min(m,n.__colSpan-e))}}else if(r+n.__colSpan-1>p){if(t===p){let e=p-r+1;n.setColSpan(n.__colSpan-e)}}else n.remove()}let g=o[u],_=l>d?g[l+r.__colSpan]:g[d+a.__colSpan];if(_!==void 0){let{cell:e}=_;BT(e)}else{let{cell:e}=d<l?g[d-1]:g[l-1];BT(e)}let v=i.getColWidths();if(v){let e=[...v];e.splice(f,m),i.setColWidths(e)}}function BT(e){let t=e.getFirstDescendant();t==null?e.selectStart():t.getParentOrThrow().selectStart()}function VT(e,t){let n=e.getFirstChild();n===null?e.append(t):n.insertBefore(t)}function Vme(e){if(e.length===0)return null;let[t]=UT(Ime(e[0]),null,null),n=1/0,r=-1/0,i=1/0,a=-1/0,o=new Set;for(let s of t)for(let t of s){if(!t||!t.cell)continue;let s=t.cell.getKey();if(!o.has(s)&&e.some(e=>e.is(t.cell))){o.add(s);let e=t.startRow,c=t.startColumn,l=t.cell.__rowSpan||1,u=t.cell.__colSpan||1;n=Math.min(n,e),r=Math.max(r,e+l-1),i=Math.min(i,c),a=Math.max(a,c+u-1)}}if(n===1/0||i===1/0)return null;let s=r-n+1,c=a-i+1,l=t[n][i];if(!l.cell)return null;let u=l.cell;u.setColSpan(c),u.setRowSpan(s);let d=new Set([u.getKey()]);for(let e=n;e<=r;e++)for(let n=i;n<=a;n++){let r=t[e][n];if(!r.cell)continue;let i=r.cell,a=i.getKey();d.has(a)||(d.add(a),Hme(i)||(Hme(u)&&u.clear(),u.append(...i.getChildren())),i.remove())}return u.getChildrenSize()===0&&u.append(j_()),u}function Hme(e){if(e.getChildrenSize()!==1)return!1;let t=e.getFirstChildOrThrow();return!(!M_(t)||!t.isEmpty())}function Ume(e){let[t,n,r]=WT(e),i=t.__colSpan,a=t.__rowSpan;if(i===1&&a===1)return;let[o,s]=HT(r,t,t),{startColumn:c,startRow:l}=s,u=t.__headerState&OT.COLUMN,d=Array.from({length:i},(e,t)=>{let n=u;for(let e=0;n!==0&&e<o.length;e++)n&=o[e][t+c].cell.__headerState;return n}),f=t.__headerState&OT.ROW,p=Array.from({length:a},(e,t)=>{let n=f;for(let e=0;n!==0&&e<o[0].length;e++)n&=o[t+l][e].cell.__headerState;return n}),m=e=>Gv(t).setColSpan(1).setRowSpan(1).setHeaderStyles(e).setWidth(void 0).append(j_());if(i>1){for(let e=1;e<i;e++)t.insertAfter(m(d[e]|p[0]));t.setColSpan(1)}if(a>1){let e;for(let t=1;t<a;t++){let r=l+t,a=o[r];e=(e||n).getNextSibling(),IT(e)||NT(125);let s=null;for(let e=0;e<c;e++){let t=a[e],n=t.cell;t.startRow===r&&(s=n),n.__colSpan>1&&(e+=n.__colSpan-1)}if(s===null)for(let n=i-1;n>=0;n--)VT(e,m(d[n]|p[t]));else for(let e=i-1;e>=0;e--)s.insertAfter(m(d[e]|p[t]))}t.setRowSpan(1)}}function HT(e,t,n){let[r,i,a]=UT(e,t,n);return i===null&&NT(207),a===null&&NT(208),[r,i,a]}function UT(e,t,n){let r=[],i=null,a=null;function o(e){let t=r[e];return t===void 0&&(r[e]=t=[]),t}let s=e.getChildren();for(let e=0;e<s.length;e++){let r=s[e];IT(r)||NT(209);let c=o(e);for(let l=r.getFirstChild(),u=0;l!=null;l=l.getNextSibling()){for(MT(l)||NT(147);c[u]!==void 0;)u++;let r={cell:l,startColumn:u,startRow:e},{__rowSpan:d,__colSpan:f}=l;for(let t=0;t<d&&!(e+t>=s.length);t++){let n=o(e+t);for(let e=0;e<f;e++)n[u+e]=r}t!==null&&i===null&&t.is(l)&&(i=r),n!==null&&a===null&&n.is(l)&&(a=r)}}return[r,i,a]}function WT(e){let t;if(e instanceof kT)t=e;else if(`__type`in e){let n=Ky(e,MT);MT(n)||NT(148),t=n}else{let n=Ky(e.getNode(),MT);MT(n)||NT(148),t=n}let n=t.getParent();IT(n)||NT(149);let r=n.getParent();return bE(r)||NT(210),[t,n,r]}function GT(e,t,n){let r,i=Math.min(t.startColumn,n.startColumn),a=Math.min(t.startRow,n.startRow),o=Math.max(t.startColumn+t.cell.__colSpan-1,n.startColumn+n.cell.__colSpan-1),s=Math.max(t.startRow+t.cell.__rowSpan-1,n.startRow+n.cell.__rowSpan-1);do{r=!1;for(let t=0;t<e.length;t++)for(let n=0;n<e[0].length;n++){let c=e[t][n];if(!c)continue;let l=c.startColumn+c.cell.__colSpan-1,u=c.startRow+c.cell.__rowSpan-1,d=c.startColumn<=o&&l>=i,f=c.startRow<=s&&u>=a;if(d&&f){let e=Math.min(i,c.startColumn),t=Math.max(o,l),n=Math.min(a,c.startRow),d=Math.max(s,u);e===i&&t===o&&n===a&&d===s||(i=e,o=t,a=n,s=d,r=!0)}}}while(r);return{maxColumn:o,maxRow:s,minColumn:i,minRow:a}}function Wme(e){let[t,,n]=WT(e),r=n.getChildren().filter(IT),i=r.length,a=r[0].getChildren().length,o=Array(i);for(let e=0;e<i;e++)o[e]=Array(a);for(let e=0;e<i;e++){let n=r[e].getChildren().filter(MT),i=0;for(let r=0;r<n.length;r++){for(;o[e][i];)i++;let a=n[r],s=a.__rowSpan||1,c=a.__colSpan||1;for(let t=0;t<s;t++)for(let n=0;n<c;n++)o[e+t][i+n]=a;if(t===a)return{colSpan:c,columnIndex:i,rowIndex:e,rowSpan:s};i+=c}}return null}function Gme(e,t){let n=t.getStartEndPoints(),r=qT(t);if(n===null)return!1;let[i,a]=n,[o,s,c]=WT(i),l=Ky(a.getNode(),e=>MT(e));if(!(MT(o)&&MT(l)&&IT(s)&&bE(c)))return!1;let[u,d,f]=HT(c,o,l),[p]=UT(e,null,null),m=u.length,h=m>0?u[0].length:0,g=d.startRow,_=d.startColumn,v=p.length,y=v>0?p[0].length:0;if(r){let e=GT(u,d,f),t=e.maxRow-e.minRow+1,n=e.maxColumn-e.minColumn+1;g=e.minRow,_=e.minColumn,v=Math.min(v,t),y=Math.min(y,n)}let b=!1,x=Math.min(m,g+v)-1,S=Math.min(h,_+y)-1,C=new Set;for(let e=g;e<=x;e++)for(let t=_;t<=S;t++){let n=u[e][t];C.has(n.cell.getKey())||n.cell.__rowSpan===1&&n.cell.__colSpan===1||(Ume(n.cell),C.add(n.cell.getKey()),b=!0)}let[w]=UT(c.getWritable(),null,null),T=v-m+g;for(let e=0;e<T;e++)RT(w[m-1][0].cell);let ee=y-h+_;for(let e=0;e<ee;e++)zT(w[0][h-1].cell,!0,!1);[w]=UT(c.getWritable(),null,null);for(let e=g;e<g+v;e++)for(let t=_;t<_+y;t++){let n=e-g,r=t-_,i=p[n][r];if(i.startRow!==n||i.startColumn!==r)continue;let a=i.cell;if(a.__rowSpan!==1||a.__colSpan!==1){let n=[],r=Math.min(e+a.__rowSpan,g+v)-1,i=Math.min(t+a.__colSpan,_+y)-1;for(let a=e;a<=r;a++)for(let e=t;e<=i;e++){let t=w[a][e];n.push(t.cell)}Vme(n),b=!0}let{cell:o}=w[e][t],s=a.getBackgroundColor();s!=null&&o.setBackgroundColor(s);let c=a.getVerticalAlign();c!==void 0&&o.setVerticalAlign(c);let l=o.getChildren();a.getChildren().forEach(e=>{X(e)&&j_().append(e),o.append(e)}),l.forEach(e=>e.remove())}if(r&&b){let[e]=UT(c.getWritable(),null,null);e[d.startRow][d.startColumn].cell.selectEnd()}return!0}function KT(e){let[[t,n,r,i],[a,o,s,c]]=[`anchor`,`focus`].map(t=>{let n=e[t].getNode(),r=Ky(n,MT);MT(r)||NT(238,t,n.getKey(),n.getType());let i=r.getParent();IT(i)||NT(239,t);let a=i.getParent();return bE(a)||NT(240,t),[n,r,i,a]});return i.is(c)||NT(241),{anchorCell:n,anchorNode:t,anchorRow:r,anchorTable:i,focusCell:o,focusNode:a,focusRow:s,focusTable:c}}var Kme=class e{tableKey;anchor;focus;_cachedNodes;dirty;constructor(e,t,n){this.anchor=t,this.focus=n,t._selection=this,n._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=e}getStartEndPoints(){return[this.anchor,this.focus]}isValid(){if(this.tableKey===`root`||this.anchor.key===`root`||this.anchor.type!==`element`||this.focus.key===`root`||this.focus.type!==`element`)return!1;let e=iv(this.tableKey),t=iv(this.anchor.key),n=iv(this.focus.key);return e!==null&&t!==null&&n!==null}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return qT(e)&&this.tableKey===e.tableKey&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)}set(e,t,n){this.dirty=this.dirty||e!==this.tableKey||t!==this.anchor.key||n!==this.focus.key,this.tableKey=e,this.anchor.key=t,this.focus.key=n,this._cachedNodes=null}clone(){return new e(this.tableKey,kh(this.anchor.key,this.anchor.offset,this.anchor.type),kh(this.focus.key,this.focus.offset,this.focus.type))}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(e){if(e===``)return;let t=(e.endsWith(`
`)?e.slice(0,-1):e).split(`
`).map(e=>e.split(` `)),n=yE();for(let e of t){let t=FT();for(let n of e){let e=jT(OT.NO_STATUS),r=j_();n&&r.append(wh(n)),e.append(r),t.append(e)}n.append(t)}let{anchorCell:r}=KT(this);Gme(n,r.select(0,r.getChildrenSize()))}insertText(){}hasFormat(e){let t=0;this.getNodes().filter(MT).forEach(e=>{let n=e.getFirstChild();M_(n)&&(t|=n.getTextFormat())});let n=vd[e];return(t&n)!==0}insertNodes(e){let t=this.focus.getNode();$(t)||NT(151),Ff(t.select(0,t.getChildrenSize())).insertNodes(e)}getShape(){let{anchorCell:e,focusCell:t}=KT(this),n=Wme(e);n===null&&NT(153);let r=Wme(t);r===null&&NT(155);let i=Math.min(n.columnIndex,r.columnIndex),a=Math.max(n.columnIndex+n.colSpan-1,r.columnIndex+r.colSpan-1),o=Math.min(n.rowIndex,r.rowIndex),s=Math.max(n.rowIndex+n.rowSpan-1,r.rowIndex+r.rowSpan-1);return{fromX:Math.min(i,a),fromY:Math.min(o,s),toX:Math.max(i,a),toY:Math.max(o,s)}}getNodes(){if(!this.isValid())return[];let e=this._cachedNodes;if(e!==null)return e;let{anchorTable:t,anchorCell:n,focusCell:r}=KT(this),i=r.getParents()[1];if(i!==t){if(t.isParentOf(r)){let e=i.getParent();e??NT(159),this.set(this.tableKey,r.getKey(),e.getKey())}else{let e=t.getParent();e??NT(158),this.set(this.tableKey,e.getKey(),r.getKey())}return this.getNodes()}let[a,o,s]=HT(t,n,r),{minColumn:c,maxColumn:l,minRow:u,maxRow:d}=GT(a,o,s),f=new Map([[t.getKey(),t]]),p=null;for(let e=u;e<=d;e++)for(let t=c;t<=l;t++){let{cell:n}=a[e][t],r=n.getParent();IT(r)||NT(160),r!==p&&(f.set(r.getKey(),r),p=r),f.has(n.getKey())||qme(n,e=>{f.set(e.getKey(),e)})}let m=Array.from(f.values());return Ag()||(this._cachedNodes=m),m}getTextContent(){let e=this.getNodes().filter(e=>MT(e)),t=``;for(let n=0;n<e.length;n++){let r=e[n],i=r.__parent,a=(e[n+1]||{}).__parent;t+=r.getTextContent()+(a===i?` `:`
`)}return t}};function qT(e){return e instanceof Kme}function JT(e,t,n){e.getKey(),t.getKey(),n.getKey();let r=Q(),i=qT(r)?r.clone():new Kme(`root`,kh(`root`,0,`element`),kh(`root`,0,`element`));return i.set(e.getKey(),t.getKey(),n.getKey()),i}function qme(e,t){let n=[[e]];for(let e=n.at(-1);e!==void 0&&n.length>0;e=n.at(-1)){let r=e.pop();r===void 0?n.pop():!1!==t(r)&&$(r)&&n.push(r.getChildren())}}function Jme(e,t=gy()){let n=iv(e);bE(n)||NT(231,e);let r=$T(n,t.getElementByKey(e));return r===null&&NT(232,e),{tableElement:r,tableNode:n}}var Yme=class{observers;nextFocus;shouldCheckSelectionForTable;constructor(){this.observers=new Map,this.nextFocus=null,this.shouldCheckSelectionForTable=null}setNextFocus(e){this.nextFocus=e}getAndClearNextFocus(){let{nextFocus:e}=this;return e!==null&&(this.nextFocus=null),e}setShouldCheckSelectionForTable(e){this.shouldCheckSelectionForTable=e}getAndClearShouldCheckSelectionForTable(){let{shouldCheckSelectionForTable:e}=this;return e?(this.shouldCheckSelectionForTable=null,e):null}removeObserver(e){let t=this.observers.get(e);return t!==void 0&&(t[0].removeListeners(),this.observers.delete(e),!0)}removeAllObservers(){for(let e of Array.from(this.observers.keys()))this.removeObserver(e)}$getTableNodesAndObservers(){let e=[];for(let[t,[n]]of Array.from(this.observers.entries())){let r=iv(t);bE(r)?e.push([r,n]):this.removeObserver(t)}return e}},Xme=class{focusX;focusY;listenersToRemove;table;isHighlightingCells;anchorX;anchorY;tableNodeKey;anchorCell;focusCell;anchorCellNodeKey;focusCellNodeKey;editor;tableSelection;hasHijackedSelectionStyles;isSelecting;isPointerDrag;pointerStartCell;pointerType;abortController;listenerOptions;constructor(e,t){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=t,this.editor=e,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.isSelecting=!1,this.isPointerDrag=!1,this.pointerStartCell=null,this.pointerType=null,this.abortController=new AbortController,this.listenerOptions={signal:this.abortController.signal},this.trackTable()}getTable(){return this.table}removeListeners(){this.abortController.abort(`removeListeners`),Array.from(this.listenersToRemove).forEach(e=>e()),this.listenersToRemove.clear()}$lookup(){return Jme(this.tableNodeKey,this.editor)}trackTable(){let e=new MutationObserver(e=>{this.editor.read(`latest`,()=>{let t=!1;for(let n=0;n<e.length;n++){let r=e[n].target.nodeName;if(r===`TABLE`||r===`TBODY`||r===`THEAD`||r===`TR`){t=!0;break}}if(!t)return;let{tableNode:n,tableElement:r}=this.$lookup();this.table=rE(n,r)})});this.listenersToRemove.add(()=>e.disconnect()),this.editor.read(`latest`,()=>{let{tableNode:t,tableElement:n}=this.$lookup();this.table=rE(t,n),e.observe(n,{attributes:!0,childList:!0,subtree:!0})})}$clearHighlight(e=!0){let t=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.$enableHighlightStyle();let{tableNode:n,tableElement:r}=this.$lookup();iE(t,rE(n,r),null),e&&Q()!==null&&(pv(null),t.dispatchCommand(Np))}$enableHighlightStyle(){let e=this.editor,{tableElement:t}=this.$lookup();zb(t,e._config.theme.tableSelection),t.classList.remove(`disable-selection`),this.hasHijackedSelectionStyles=!1}$disableHighlightStyle(){let{tableElement:e}=this.$lookup();Rb(e,this.editor._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0}$updateTableTableSelection(e){if(e!==null){e.tableKey!==this.tableNodeKey&&NT(233,e.tableKey,this.tableNodeKey);let t=this.editor;this.tableSelection=e,this.isHighlightingCells=!0,this.$disableHighlightStyle(),this.updateDOMSelection(),iE(t,this.table,this.tableSelection)}else this.$clearHighlight()}updateDOMSelection(){if(this.anchorCell!==null&&this.focusCell!==null){let e=Zv(this.editor._window);e&&e.rangeCount>0&&e.removeAllRanges()}}$setFocusCellForSelection(e,t=!1){let n=this.editor,{tableNode:r}=this.$lookup(),i=e.x,a=e.y;if(this.focusCell=e,this.isHighlightingCells||(t||this.anchorX!==i||this.anchorY!==a||this.tableSelection!=null&&this.anchorCellNodeKey!=null)&&(this.isHighlightingCells=!0,this.$disableHighlightStyle()),this.focusX!==-1&&this.focusY!==-1&&i===this.focusX&&a===this.focusY)return!1;if(this.focusX=i,this.focusY=a,this.isHighlightingCells){let o=pE(r,e.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null){let e=o;if(e===null&&t&&(e=r.getCellNodeFromCords(i,a,this.table)),e!==null){let t=this.$getAnchorTableCellOrThrow();return this.focusCellNodeKey=e.getKey(),this.tableSelection=JT(r,t,e),pv(this.tableSelection),n.dispatchCommand(Np),iE(n,this.table,this.tableSelection),!0}}}return!1}$getAnchorTableCell(){let e=this.anchorCellNodeKey?iv(this.anchorCellNodeKey):null;return MT(e)?e:null}$getAnchorTableCellOrThrow(){let e=this.$getAnchorTableCell();return e===null&&NT(234),e}$getFocusTableCell(){let e=this.focusCellNodeKey?iv(this.focusCellNodeKey):null;return MT(e)?e:null}$getFocusTableCellOrThrow(){let e=this.$getFocusTableCell();return e===null&&NT(235),e}$setAnchorCellForSelection(e){this.isHighlightingCells=!1,this.anchorCell=e,this.anchorX=e.x,this.anchorY=e.y,this.focusX=-1,this.focusY=-1,this.focusCell=null,this.focusCellNodeKey=null;let{tableNode:t}=this.$lookup(),n=pE(t,e.elem);if(n!==null){let e=n.getKey();this.tableSelection==null?this.tableSelection=JT(t,n,n):(this.tableSelection=this.tableSelection.clone(),this.tableSelection.set(t.getKey(),e,e)),this.anchorCellNodeKey=e}}$formatCells(e){let t=Q();qT(t)||NT(236);let n=ng(),r=n.anchor,i=n.focus,a=t.getNodes().filter(MT);a.length>0||NT(237);let o=a[0].getFirstChild(),s=M_(o)?o.getFormatFlags(e,null):null;a.forEach(t=>{r.set(t.getKey(),0,`element`),i.set(t.getKey(),t.getChildrenSize(),`element`),n.formatText(e,s)}),pv(t),this.editor.dispatchCommand(Np)}$clearText(){let{editor:e}=this,t=iv(this.tableNodeKey);if(!bE(t))throw Error(`Expected TableNode.`);let n=Q();qT(n)||NT(253);let r=n.getNodes().filter(MT),i=t.getFirstChild(),a=t.getLastChild();if(r.length>0&&i!==null&&a!==null&&IT(i)&&IT(a)&&r[0]===i.getFirstChild()&&r[r.length-1]===a.getLastChild()){t.selectPrevious();let n=t.getParent();t.remove(),n_(n)&&n.isEmpty()&&e.dispatchCommand(Hp)}else r.forEach(e=>{if($(e)){let t=e.getFirstChild(),n=M_(t)?Gv(t):j_(),r=wh();n.append(r),e.append(n),e.getChildren().forEach(e=>{e!==n&&e.remove()})}}),iE(e,this.table,null),pv(null),e.dispatchCommand(Np)}},YT=`__lexicalTableSelection`;function Zme(e){let t=Jv(e);return bE(t)||NT(386,e),t}var XT=40;function ZT(e,t,n){let r=e=>Math.max(1,Math.ceil(Math.min(XT,e)/XT*18));return e<=t+XT?-r(t+XT-e):e>=n-XT?r(e-(n-XT)):0}function QT(e){return uy(e)&&e.nodeName===`TABLE`}function $T(e,t){if(!t)return t;let n=QT(t)?t:t.querySelector(`table`);return QT(n)||NT(341,e.constructor.name,e.getType(),e.getKey(),t.nodeName),n}function eE(e){return e._window}function tE(e,t){for(let n=t,r=null;n!==null;n=n.getParent()){if(e.is(n))return r;MT(n)&&(r=n)}return null}var Qme=[[rm,`down`],[nm,`up`],[em,`backward`],[Qp,`forward`]],$me=[Kp,qp,Bp],ehe=[om,cm];function the(e,t){return e.registerRootListener(n=>{if(n===null)return;let r=e._window;return r===null?void 0:Om(r,`pointerdown`,r=>{let i=cy(r);if(r.button!==0||!dy(i)||!n.contains(i))return;let a=K_(i)===e?function(e){let t=nE(e);if(t===null)return null;let n=t.elem;for(;n!=null;){if(n.nodeName===`TABLE`&&YT in n&&n[YT])return{cellElement:t,tableElement:n,tableObserver:n[YT]};n=n.parentNode}return null}(i):null;e.update(()=>{if(qT(Q())){for(let[e]of t.observers.values())e.$clearHighlight(!1);pv(null),e.dispatchCommand(Np)}if(!a)return;let{tableObserver:n,tableElement:i,cellElement:o}=a;(function(e,t,n,r,i,a){let o=e._window;if(!o)return;i.pointerType=t.pointerType;let s=Zme(i.tableNodeKey),c=ag(),l=Z(c)||qT(c)?lE(c.anchor.getNode()):null,u=l!==null&&l.isParentOf(s);if(id&&t.shiftKey&&(Z(c)||qT(c))&&(sE(c,s)||u)){let e=c.anchor.getNode(),r=tE(s,c.anchor.getNode());if(r){let e=fE(i,r);e.elem===n.elem?t.pointerType!==`touch`&&i.$setAnchorCellForSelection(n):(i.$setAnchorCellForSelection(e),i.$setFocusCellForSelection(n),dE(t))}else(s.isBefore(e)?s.selectStart():s.selectEnd()).anchor.set(c.anchor.key,c.anchor.offset,c.anchor.type),dE(t)}else t.pointerType!==`touch`&&i.$setAnchorCellForSelection(n);(n=>{if(i.isSelecting)return;i.isSelecting=!0,i.isPointerDrag=!1,i.pointerStartCell=n;let s=t.pointerType===`touch`,c=t.pointerId,l=t.clientX,u=t.clientY,d=!s;s||i.anchorCell!==null||e.update(()=>{i.$setAnchorCellForSelection(n)});let f=t.clientX,p=t.clientY,m=null,h=null,g=e=>e.pointerId===c,_=()=>{i.isSelecting=!1,i.isPointerDrag=!1,i.pointerStartCell=null,m!==null&&(o.cancelAnimationFrame(m),m=null),h!==null&&(h(),h=null)},v=(e,t)=>{let n=r.getRootNode();if(!Z_(n)&&!Qv(n))return null;for(let i of n.elementsFromPoint(e,t)){let e=ahe(r,i);if(e)return e}return null},y=(t,r)=>{if(d||i.isPointerDrag&&t.elem!==n.elem){if(i.anchorCell===null||!d){let r=d?t:n;e.update(()=>{i.$setAnchorCellForSelection(r)})}d=!0,i.focusCell!==null&&t.elem===i.focusCell.elem||(a.setNextFocus({focusCell:t,override:r,tableKey:i.tableNodeKey}),e.dispatchCommand(Np))}},b=e=>{for(let t=r.parentElement;t;t=t.parentElement)if(e===`x`?t.scrollWidth>t.clientWidth:t.scrollHeight>t.clientHeight){let n=o.getComputedStyle(t),r=e===`x`?n.overflowX:n.overflowY;if(r===`auto`||r===`scroll`)return t}return null},x=(e,t,n)=>{let r,i;if(e===null)r=0,i=n===`x`?o.innerWidth:o.innerHeight;else{let t=e.getBoundingClientRect();r=n===`x`?t.left:t.top,i=n===`x`?t.right:t.bottom}let a=ZT(t,r,i);if(a===0)return!1;if(e===null){let e=n===`x`?o.scrollX:o.scrollY;return o.scrollBy(n===`x`?a:0,n===`x`?0:a),(n===`x`?o.scrollX:o.scrollY)!==e}if(n===`x`){let t=e.scrollLeft;return e.scrollLeft+=a,e.scrollLeft!==t}let s=e.scrollTop;return e.scrollTop+=a,e.scrollTop!==s},S=()=>{if(m=null,!i.isSelecting)return;let e=b(`x`),t=b(`y`),n=e!==null&&x(e,f,`x`),r=x(t,p,`y`);if(n||r){let[n,r]=((e,t)=>{let n=f,r=p;if(e===null)n=Math.min(Math.max(n,1),o.innerWidth-1);else{let t=e.getBoundingClientRect();n=Math.min(Math.max(n,t.left+1),t.right-1)}if(t===null)r=Math.min(Math.max(r,1),o.innerHeight-1);else{let e=t.getBoundingClientRect();r=Math.min(Math.max(r,e.top+1),e.bottom-1)}return[n,r]})(e,t),i=v(n,r);i&&y(i,!1),m=o.requestAnimationFrame(S)}},C=()=>{m!==null||s&&!i.isPointerDrag||!(()=>{let e=b(`x`);if(e!==null){let t=e.getBoundingClientRect();if(ZT(f,t.left,t.right)!==0)return!0}let t=b(`y`),n=t===null?0:t.getBoundingClientRect().top,r=t===null?o.innerHeight:t.getBoundingClientRect().bottom;return ZT(p,n,r)!==0})()||(m=o.requestAnimationFrame(S))},w=e=>{g(e)&&_()};h=nue(o,{lostpointercapture:w,pointercancel:w,pointermove:e=>{if(!g(e))return;if(!(e=>!(1&~e.buttons))(e)&&i.isSelecting)return void _();let t=cy(e);if(!dy(t))return;var n,a;f=e.clientX,p=e.clientY,!i.isPointerDrag&&(n=f,a=p,!(Math.abs(n-l)<=10&&Math.abs(a-u)<=10))&&(i.isPointerDrag=!0);let o=null,s=!(id||r.contains(t));o=s?ahe(r,t):v(e.clientX,e.clientY),o&&y(o,s),C()},pointerup:e=>{g(e)&&_()}},i.listenerOptions)})(n)})(e,r,o,i,n,t)})})})}function nhe(e,t,n,r,i){let a=n.getRootElement(),o=eE(n);a!==null&&o!==null||NT(246);let s=new Xme(n,e.getKey()),c=$T(e,t);(function(e,t){ihe(e)!==null&&NT(205),e[YT]=t})(c,s),s.listenersToRemove.add(()=>function(e,t){ihe(e)===t&&delete e[YT]}(c,s)),s.listenersToRemove.add(Om(c,`mousedown`,e=>{let t=cy(e);e.detail>=3&&dy(t)&&nE(t)!==null&&e.preventDefault()},s.listenerOptions));for(let[t,r]of Qme)s.listenersToRemove.add(n.registerCommand(t,t=>fhe(n,t,r,e,s,i),3));s.listenersToRemove.add(n.registerCommand(sm,t=>{let n=Q();if(qT(n)){let r=tE(e,n.focus.getNode());if(r!==null)return dE(t),r.selectEnd(),!0}return!1},3));let l=()=>{let t=Q();return!!sE(t,e)&&!!qT(t)&&(s.$clearText(),!0)};for(let e of $me)s.listenersToRemove.add(n.registerCommand(e,l,3));let u=t=>{let n=Q();if(!qT(n)&&!Z(n))return!1;let r=e.isParentOf(n.anchor.getNode());if(r!==e.isParentOf(n.focus.getNode())){let t=r?`anchor`:`focus`,i=r?`focus`:`anchor`,{key:a,offset:o,type:s}=n[i];return e[n[t].isBefore(n[i])?`selectPrevious`:`selectNext`]()[i].set(a,o,s),!1}return!!sE(n,e)&&!!qT(n)&&(t&&(t.preventDefault(),t.stopPropagation()),s.$clearText(),!0)};for(let e of ehe)s.listenersToRemove.add(n.registerCommand(e,u,3));s.listenersToRemove.add(n.registerCommand(vm,e=>{let t=Q();if(t){if(!qT(t)&&!Z(t))return!1;Cw(n,nx(e,ClipboardEvent)?e:null,Tw(t));let r=u(e);return Z(t)?(t.removeText(),!0):r}return!1},3));let d=a.ownerDocument;return s.listenersToRemove.add(Om(d,`paste`,t=>{t.defaultPrevented||n.read(`latest`,()=>{let t=Q();return a.contains(d.activeElement)&&qT(t)&&sE(t,e)})&&(t.preventDefault(),n.dispatchCommand(Wp,t))})),s.listenersToRemove.add(Om(d,`copy`,t=>{if(t.defaultPrevented)return;let r=cy(t);r===a||dy(r)&&a.contains(r)||n.read(`latest`,()=>{let t=Q();return a.contains(oy(a))&&qT(t)&&sE(t,e)})&&(t.preventDefault(),n.dispatchCommand(_m,t))})),s.listenersToRemove.add(n.registerCommand(Jp,t=>{let n=Q();return!!sE(n,e)&&!!qT(n)&&(s.$formatCells(t),!0)},3)),s.listenersToRemove.add(n.registerCommand(mm,t=>{let n=Q();if(!qT(n)||!sE(n,e))return!1;let r=n.anchor.getNode(),i=n.focus.getNode();if(!MT(r)||!MT(i))return!1;let[a,o,s]=HT(e,r,i),{minColumn:c,maxColumn:l,minRow:u,maxRow:d}=GT(a,o,s);if(u===0&&c===0&&d===a.length-1&&l===a[0].length-1)return e.setFormat(t),!0;let f=new Set;for(let e=u;e<=d;e++)for(let n=c;n<=l;n++){let r=a[e][n].cell;if(f.has(r))continue;f.add(r),r.setFormat(t);let i=r.getChildren();for(let e=0;e<i.length;e++){let n=i[e];$(n)&&!n.isInline()&&n.setFormat(t)}}return!0},3)),s.listenersToRemove.add(n.registerCommand(Up,t=>{let r=Q();if(!sE(r,e))return!1;if(qT(r))return s.$clearHighlight(),!1;if(Z(r)){if(!MT(Ky(r.anchor.getNode(),e=>MT(e))))return!1;if(typeof t==`string`){let i=mhe(n,r,e);if(i)return phe(i,e,[wh(t)]),!0}}return!1},3)),r&&s.listenersToRemove.add(n.registerCommand(lm,t=>{let n=Q();if(!Z(n)||!n.isCollapsed()||!sE(n,e))return!1;let r=lE(n.anchor.getNode());return!(r===null||!e.is(uE(r))||(dE(t),function(e,t){let n=t===`next`?`getNextSibling`:`getPreviousSibling`,r=t===`next`?`getFirstChild`:`getLastChild`,i=e[n]();if($(i))return i.selectEnd();let a=Ky(e,IT);a===null&&NT(247);for(let e=a[n]();IT(e);e=e[n]()){let t=e[r]();if($(t))return t.selectEnd()}let o=Ky(a,bE);o===null&&NT(248),t===`next`?o.selectNext():o.selectPrevious()}(r,t.shiftKey?`previous`:`next`),0))},3)),s.listenersToRemove.add(n.registerCommand(Sm,t=>e.isSelected(),3)),s.listenersToRemove.add(n.registerCommand(Hp,()=>{let t=Q();if(!Z(t)||!t.isCollapsed()||!sE(t,e))return!1;let r=mhe(n,t,e);return!!r&&(phe(r,e),!0)},3)),s}function rhe(e,t,n){let r=Q(),i=t.isSelected();if(!(qT(r)&&r.tableKey===t.getKey()||n.isHighlightingCells||n.hasHijackedSelectionStyles||i))return;let{tableElement:a}=n.$lookup();if(n.table=rE(t,a),qT(r)&&r.tableKey===t.getKey()){let e=iv(r.anchor.key),t=iv(r.focus.key);if(MT(e)&&MT(t)){let r=fE(n,e),i=fE(n,t);n.anchorCell=r,n.anchorCellNodeKey=e.getKey(),n.anchorX=r.x,n.anchorY=r.y,n.focusCell=i,n.focusCellNodeKey=t.getKey(),n.focusX=i.x,n.focusY=i.y}n.$updateTableTableSelection(r)}else n.isHighlightingCells&&n.$clearHighlight(!1);n.hasHijackedSelectionStyles&&!i?function(e,t){t.$enableHighlightStyle(),aE(t.table,t=>{let n=t.elem;t.highlighted=!1,dhe(e,t),n.getAttribute(`style`)||n.removeAttribute(`style`)})}(e,n):!n.hasHijackedSelectionStyles&&i&&function(e,t){t.$disableHighlightStyle(),aE(t.table,t=>{t.highlighted=!0,uhe(e,t)})}(e,n)}function ihe(e){return e[YT]||null}function nE(e){let t=e;for(;t!=null;){let e=t.nodeName;if(e===`TD`||e===`TH`){let e=t._cell;return e===void 0?null:e}t=t.parentNode}return null}function ahe(e,t){if(!e.contains(t))return null;let n=null;for(let r=t;r!=null;r=r.parentNode){if(r===e)return n;let t=r.nodeName;t!==`TD`&&t!==`TH`||(n=r._cell||null)}return null}function rE(e,t){let n=[],r={columns:0,domRows:n,rows:0},i=$T(e,t).querySelector(`tr`),a=0,o=0;for(n.length=0;i!=null;){let e=i.nodeName;if(e===`TD`||e===`TH`){let e={elem:i,hasBackgroundColor:i.style.backgroundColor!==``,highlighted:!1,x:a,y:o};i._cell=e;let t=n[o];t===void 0&&(t=n[o]=[]),t[a]=e}else{let e=i.firstChild;if(e!=null){i=e;continue}}let t=i.nextSibling;if(t!=null){a++,i=t;continue}let r=i.parentNode;if(r!=null){let e=r.nextSibling;if(e==null)break;o++,a=0,i=e}}return r.columns=a+1,r.rows=o+1,r}function iE(e,t,n){let r=new Set(n?n.getNodes():[]);aE(t,(t,n)=>{let i=t.elem;r.has(n)?(t.highlighted=!0,uhe(e,t)):(t.highlighted=!1,dhe(e,t),i.getAttribute(`style`)||i.removeAttribute(`style`))})}function aE(e,t){let{domRows:n}=e;for(let e=0;e<n.length;e++){let r=n[e];if(r)for(let n=0;n<r.length;n++){let i=r[n];if(!i)continue;let a=cv(i.elem);a!==null&&t(i,a,{x:n,y:e})}}}var ohe=(e,t,n,r,i)=>{let a=i===`forward`;switch(i){case`backward`:case`forward`:return n===(a?e.table.columns-1:0)?r===(a?e.table.rows-1:0)?a?t.selectNext():t.selectPrevious():cE(t.getCellNodeFromCordsOrThrow(a?0:e.table.columns-1,r+(a?1:-1),e.table),a):cE(t.getCellNodeFromCordsOrThrow(n+(a?1:-1),r,e.table),a),!0;case`up`:return r===0?t.selectPrevious():cE(t.getCellNodeFromCordsOrThrow(n,r-1,e.table),!1),!0;case`down`:return r===e.table.rows-1?t.selectNext():cE(t.getCellNodeFromCordsOrThrow(n,r+1,e.table),!0),!0;default:return!1}};function she(e,t){let n,r;if(t.startColumn===e.minColumn)n=`minColumn`;else{if(t.startColumn+t.cell.__colSpan-1!==e.maxColumn)return null;n=`maxColumn`}if(t.startRow===e.minRow)r=`minRow`;else{if(t.startRow+t.cell.__rowSpan-1!==e.maxRow)return null;r=`maxRow`}return[n,r]}function che(e,t,n){let r=she(e,t);if(r)return r;let i=she(e,n);return i?oE(i):[`minColumn`,`minRow`]}function oE([e,t]){return[e===`minColumn`?`maxColumn`:`minColumn`,t===`minRow`?`maxRow`:`minRow`]}function lhe(e,t,[n,r]){let i=t[r],a=e[i];a===void 0&&NT(250,r,String(i));let o=t[n],s=a[o];return s===void 0&&NT(250,n,String(o)),s}function sE(e,t){if(Z(e)||qT(e)){let n=t.isParentOf(e.anchor.getNode()),r=t.isParentOf(e.focus.getNode());return n&&r}return!1}function cE(e,t){t?e.selectStart():e.selectEnd()}function uhe(e,t){let n=t.elem,r=e._config.theme;MT(cv(n))||NT(131),Rb(n,r.tableCellSelected)}function dhe(e,t){let n=t.elem;MT(cv(n))||NT(131);let r=e._config.theme;zb(n,r.tableCellSelected)}function lE(e){let t=Ky(e,MT);return MT(t)?t:null}function uE(e){let t=Ky(e,bE);return bE(t)?t:null}function fhe(e,t,n,r,i,a){if((n===`up`||n===`down`)&&function(e){let t=e.getRootElement();return!!t&&t.hasAttribute(`aria-controls`)&&t.getAttribute(`aria-controls`)===`typeahead-menu`}(e))return!1;let o=Q();if(!sE(o,r)){if(Z(o)){if(n===`backward`){if(o.focus.offset>0)return!1;let e=function(e){for(let t=e,n=e;n!==null;t=n,n=n.getParent())if($(n)){if(n!==t&&n.getFirstChild()!==t)return null;if(!n.isInline())return n}return null}(o.focus.getNode());if(!e)return!1;let n=e.getPreviousSibling();return!!bE(n)&&(dE(t),t.shiftKey?o.focus.set(n.getParentOrThrow().getKey(),n.getIndexWithinParent(),`element`):n.selectEnd(),!0)}if(t.shiftKey&&(n===`up`||n===`down`)){let e=o.focus.getNode();if(!o.isCollapsed()&&(n===`up`&&!o.isBackward()||n===`down`&&o.isBackward())){let i=Ky(e,e=>bE(e));if(MT(i)&&(i=Ky(i,bE)),i!==r||!i)return!1;let a=n===`down`?i.getNextSibling():i.getPreviousSibling();if(!a)return!1;let s=0;n===`up`&&$(a)&&(s=a.getChildrenSize());let c=a;n===`up`&&$(a)&&(c=a.getLastChild()||a,s=X(c)?c.getTextContentSize():0);let l=o.clone();return l.focus.set(c.getKey(),s,X(c)?`text`:`element`),pv(l),dE(t),!0}if(Wv(e)){let e=n===`up`?o.getNodes()[o.getNodes().length-1]:o.getNodes()[0];if(e&&tE(r,e)!==null){let e=r.getFirstDescendant(),t=r.getLastDescendant();if(!e||!t)return!1;let[n]=WT(e),[a]=WT(t),o=r.getCordsFromCellNode(n,i.table),s=r.getCordsFromCellNode(a,i.table),c=r.getDOMCellFromCordsOrThrow(o.x,o.y,i.table),l=r.getDOMCellFromCordsOrThrow(s.x,s.y,i.table);return i.$setAnchorCellForSelection(c),i.$setFocusCellForSelection(l,!0),!0}return!1}{let r=Ky(e,e=>$(e)&&!e.isInline());if(MT(r)&&(r=Ky(r,bE)),!r)return!1;let a=n===`down`?r.getNextSibling():r.getPreviousSibling();if(bE(a)&&i.tableNodeKey===a.getKey()){let e=a.getFirstDescendant(),r=a.getLastDescendant();if(!e||!r)return!1;let[i]=WT(e),[s]=WT(r),c=o.clone();return c.focus.set((n===`up`?i:s).getKey(),n===`up`?0:s.getChildrenSize(),`element`),dE(t),pv(c),!0}}}}return n===`down`&&_E(e)&&function(e,t){if(!Z(e))return!1;let n=m_(e.focus,`next`),r=Cb(t,`next`);return Fb(n.origin,r.origin)!==null&&jb(n,r)<0}(o,r)&&a.setShouldCheckSelectionForTable(r.getKey()),!1}if(Z(o)){if(n===`backward`||n===`forward`)return function(e,t,n,r,i,a,o){let s=m_(n.focus,i?`previous`:`next`);if(C_(s))return!1;let c=s;for(let e of Db(s).iterNodeCarets(`shadowRoot`)){if(!_b(e)||!$(e.origin))return!1;c=e}let l=c.getParentAtCaret();if(!MT(l))return!1;let u=l,d=function(e){for(let t of Db(e).iterNodeCarets(`root`)){let{origin:n}=t;if(MT(n)){if(vb(t))return Cb(n,e.direction)}else if(!IT(n))break}return null}(yb(u,c.direction)),f=Ky(u,bE);if(!f||!f.is(a))return!1;let p=e.getElementByKey(u.getKey()),m=nE(p);if(!p||!m)return!1;if(o.table=Che(e,f),d){if(r===`extend`){let t=nE(e.getElementByKey(d.origin.getKey()));if(!t)return!1;o.$setAnchorCellForSelection(m),o.$setFocusCellForSelection(t,!0)}else{let e=S_(d);h_(n.anchor,e),h_(n.focus,e)}}else if(r===`extend`)o.$setAnchorCellForSelection(m),o.$setFocusCellForSelection(m,!0);else{let e=function(e){let t=Tb(e);return vb(t)?S_(t):e}(yb(f,s.direction));h_(n.anchor,e),h_(n.focus,e)}return dE(t),!0}(e,t,o,t.shiftKey?`extend`:`move`,n===`backward`,r,i);if(o.isCollapsed()){let{anchor:s,focus:c}=o,l=Ky(s.getNode(),MT),u=Ky(c.getNode(),MT);if(!MT(l)||!l.is(u))return!1;let d=uE(l);if(d!==r&&d!=null){let r=$T(d,e.getElementByKey(d.getKey()));if(r!=null)return i.table=rE(d,r),fhe(e,t,n,d,i,a)}let f=e.getElementByKey(l.__key),p=e.getElementByKey(s.key);if(p==null||f==null)return!1;let m;if(s.type===`element`)m=p.getBoundingClientRect();else{let t=Zv(eE(e));if(t===null||t.rangeCount===0)return!1;let n=iy(t,e.getRootElement());if(n===null)return!1;m=n.getBoundingClientRect()}let h=n===`up`?l.getFirstChild():l.getLastChild();if(h==null)return!1;let g=e.getElementByKey(h.__key);if(g==null)return!1;let _=g.getBoundingClientRect();if(n===`up`?_.top>m.top-m.height:m.bottom+m.height>_.bottom){dE(t);let e=r.getCordsFromCellNode(l,i.table);if(!t.shiftKey)return ohe(i,r,e.x,e.y,n);{let t=r.getDOMCellFromCordsOrThrow(e.x,e.y,i.table);i.$setAnchorCellForSelection(t),i.$setFocusCellForSelection(t,!0)}return!0}}}else if(qT(o)){let{anchor:a,focus:s,tableKey:c}=o;if(c!==r.getKey())return!1;let l=Ky(a.getNode(),MT),u=Ky(s.getNode(),MT),[d]=o.getNodes();bE(d)||NT(251);let f=$T(d,e.getElementByKey(d.getKey()));if(!MT(l)||!MT(u)||!bE(d)||f==null)return!1;i.$updateTableTableSelection(o);let p=rE(d,f),m=r.getCordsFromCellNode(l,p),h=r.getDOMCellFromCordsOrThrow(m.x,m.y,p);if(i.$setAnchorCellForSelection(h),dE(t),t.shiftKey){let[e,t,a]=HT(r,l,u);return function(e,t,n,r,i){let a=GT(t,n,r),{topSpan:o,leftSpan:s,bottomSpan:c,rightSpan:l}=function(e,t){let{minColumn:n,maxColumn:r,minRow:i,maxRow:a}=t,o=1,s=1,c=1,l=1,u=e[i],d=e[a];for(let e=n;e<=r;e++)o=Math.max(o,u[e].cell.__rowSpan),l=Math.max(l,d[e].cell.__rowSpan);for(let t=i;t<=a;t++)s=Math.max(s,e[t][n].cell.__colSpan),c=Math.max(c,e[t][r].cell.__colSpan);return{bottomSpan:l,leftSpan:s,rightSpan:c,topSpan:o}}(t,a),[u,d]=oE(che(a,n,r)),f=a[u],p=a[d];i===`forward`?f+=u===`maxColumn`?1:s:i===`backward`?f-=u===`minColumn`?1:l:i===`down`?p+=d===`maxRow`?1:o:i===`up`&&(p-=d===`minRow`?1:c);let m=t[p];if(m===void 0)return!1;let h=m[f];if(h===void 0)return!1;let[g,_]=function(e,t,n){let r=GT(e,t,n),i=che(r,t,n);return[lhe(e,r,i),lhe(e,r,oE(i))]}(t,n,h),v=fE(e,g.cell),y=fE(e,_.cell);return e.$setAnchorCellForSelection(v),e.$setFocusCellForSelection(y,!0),!0}(i,e,t,a,n)}return u.selectEnd(),!0}return!1}function dE(e){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation()}function phe(e,t,n){let r=j_();e===`first`?t.insertBefore(r):t.insertAfter(r),r.append(...n||[]),r.selectEnd()}function mhe(e,t,n){let r=n.getParent();if(!r)return;let i=Zv(eE(e));if(!i)return;let a=ay(i,e.getRootElement()).anchorNode,o=e.getElementByKey(r.getKey()),s=$T(n,e.getElementByKey(n.getKey()));if(!a||!o||!s||!o.contains(a)||s.contains(a))return;let c=Ky(t.anchor.getNode(),e=>MT(e));if(!c)return;let l=Ky(c,e=>bE(e));if(!bE(l)||!l.is(n))return;let[u,d]=HT(n,c,c),f=u[0][0],p=u[u.length-1][u[0].length-1],{startRow:m,startColumn:h}=d,g=m===f.startRow&&h===f.startColumn,_=m===p.startRow&&h===p.startColumn;return g?`first`:_?`last`:void 0}function fE(e,t){let{tableNode:n}=e.$lookup(),r=n.getCordsFromCellNode(t,e.table);return n.getDOMCellFromCordsOrThrow(r.x,r.y,e.table)}function pE(e,t,n){return tE(e,cv(t,n))}function mE(e){return uy(e)&&e.nodeName===`DIV`}var hhe=_f()({colWidths:bf(gf(Jse(ff())),{getter:{field:`__colWidths`}}),frozenColumnCount:bf(ff(),{getter:`getSerializedFrozenColumnCount`,setter:{field:`__frozenColumnCount`,method:`setFrozenColumns`}}),frozenRowCount:bf(ff(),{getter:`getSerializedFrozenRowCount`,setter:{field:`__frozenRowCount`,method:`setFrozenRows`}}),rowStriping:bf(pf(),{getter:`getSerializedRowStriping`,setter:{field:`__rowStriping`}})});function ghe(e,t,n){let r=e.querySelector(`:scope > colgroup`);if(!n)return void(r&&r.remove());r||(r=ny().createElement(`colgroup`),Ey(r),e.insertBefore(r,e.firstChild));let i=[];for(let e=0;e<t;e++){let t=ny().createElement(`col`),r=n[e];r&&(t.style.width=`${r}px`),i.push(t)}r.replaceChildren(...i)}function _he(e,t,n){if(!t.theme.tableAlignment)return;let r=[],i=[];for(let e of[`center`,`right`]){let a=t.theme.tableAlignment[e];a&&(e===n?i:r).push(a)}zb(e,...r),Rb(e,...i)}var vhe=new WeakSet;function yhe(e){let{scrollable:t,scrollbar:n,tableElement:r}=e;if(n.classList.length===0&&function(e){let t=e.style.display;e.style.display=``;let n=e.offsetHeight-e.clientHeight;return e.style.display=t,n}(n)===0)return vhe.add(n),n.style.display=`none`,t.style.scrollbarWidth=`auto`,()=>{};let i=()=>{n.scrollLeft!==t.scrollLeft&&(n.scrollLeft=t.scrollLeft)},a=()=>{t.scrollLeft!==n.scrollLeft&&(t.scrollLeft=n.scrollLeft)};t.addEventListener(`scroll`,i,{passive:!0}),n.addEventListener(`scroll`,a,{passive:!0});let o=null;return typeof ResizeObserver<`u`&&(o=new ResizeObserver(()=>{hE(t,n)}),o.observe(t),o.observe(r)),hE(t,n),()=>{t.removeEventListener(`scroll`,i),n.removeEventListener(`scroll`,a),o&&o.disconnect()}}function hE(e,t){if(vhe.has(t))return;let n=t.firstElementChild;if(!n||!uy(n)||!e.isConnected)return;let r=e.ownerDocument.defaultView;if(!r)return void(t.style.display=`none`);let i=r.getComputedStyle(e).overflowX,a=i===`auto`||i===`scroll`,o=e.scrollWidth,s=e.clientWidth,c=o+`px`;n.style.width!==c&&(n.style.width=c);let l=a&&o>s;t.style.display=l?``:`none`}function bhe(e){if(!e.hasAttribute(`data-lexical-sticky-scrollbar`))return null;let t=e.firstElementChild;if(!mE(t))return null;let n=t.querySelector(`:scope > table`);if(!QT(n))return null;let r=t.nextElementSibling;return mE(r)?{scrollable:t,scrollbar:r,tableElement:n}:null}var gE=new WeakSet;function _E(e=gy()){return gE.has(e)}function xhe(e=gy()){let t=xx(e,`@lexical/table/Table`);return!!t&&t.output.hasStickyScrollbar.peek()&&t.output.hasHorizontalScroll.peek()}function She(e,t){t?gE.add(e):gE.delete(e)}var vE=class extends Zg{__rowStriping=!1;__frozenColumnCount=0;__frozenRowCount=0;__colWidths=void 0;$config(){return this.config(`table`,{extends:Zg,generated:Tme,importDOM:{table:()=>({conversion:whe,priority:1})},json:hhe})}getSerializedFrozenColumnCount(){return this.getLatest().__frozenColumnCount||void 0}getSerializedFrozenRowCount(){return this.getLatest().__frozenRowCount||void 0}getSerializedRowStriping(){return this.getLatest().__rowStriping||void 0}getColWidths(){return this.getLatest().__colWidths}setColWidths(e){let t=this.getWritable();return t.__colWidths=e,t}extractWithChild(e,t,n){return n===`html`}getDOMSlot(e){let t=QT(e)?e:e.querySelector(`table`);return QT(t)||NT(229),super.getDOMSlot(e).withElement(t).withAfter(t.querySelector(`:scope > colgroup`))}createDOM(e,t){let n=ny().createElement(`table`);if(this.__style&&fh(n.style,this.__style),this.getColWidths()){let e=ny().createElement(`colgroup`);n.appendChild(e),Ey(e)}if(Rb(n,e.theme.table),this.updateTableElement(null,n,e),_E(t)){let r=xhe(t),i=function(e,t,n){let r=ny().createElement(`div`),i=t.theme.tableScrollableWrapper;return i?Rb(r,i):r.style.overflowX=`auto`,n&&(r.style.scrollbarWidth=`none`),r.appendChild(e),r}(n,e,r);if(this.updateTableWrapper(null,i,n,e),r){let t=function(e){let t=ny(),n=t.createElement(`div`),r=e.theme.tableStickyScrollbar;r?Rb(n,r):(n.style.position=`sticky`,n.style.bottom=`0`,n.style.overflowX=`scroll`,n.style.overflowY=`hidden`),n.style.display=`none`,n.setAttribute(`aria-hidden`,`true`),n.tabIndex=-1;let i=t.createElement(`div`);return i.style.height=`1px`,i.style.width=`0px`,n.appendChild(i),n}(e),n=ny().createElement(`div`);return n.setAttribute(`data-lexical-sticky-scrollbar`,`true`),n.appendChild(i),n.appendChild(t),Ey(t),n}return i}return n}updateTableWrapper(e,t,n,r){this.__frozenColumnCount!==(e?e.__frozenColumnCount:0)&&function(e,t,n,r){r>0?(Rb(e,n.theme.tableFrozenColumn),t.setAttribute(`data-lexical-frozen-column`,`true`)):(zb(e,n.theme.tableFrozenColumn),t.removeAttribute(`data-lexical-frozen-column`))}(t,n,r,this.__frozenColumnCount),this.__frozenRowCount!==(e?e.__frozenRowCount:0)&&function(e,t,n,r){r>0?(Rb(e,n.theme.tableFrozenRow),t.setAttribute(`data-lexical-frozen-row`,`true`)):(zb(e,n.theme.tableFrozenRow),t.removeAttribute(`data-lexical-frozen-row`))}(t,n,r,this.__frozenRowCount)}updateTableElement(e,t,n){this.__style!==(e?e.__style:``)&&fh(t.style,this.__style,e?e.__style:``),this.__rowStriping!==(!!e&&e.__rowStriping)&&function(e,t,n){n?(Rb(e,t.theme.tableRowStriping),e.setAttribute(`data-lexical-row-striping`,`true`)):(zb(e,t.theme.tableRowStriping),e.removeAttribute(`data-lexical-row-striping`))}(t,n,this.__rowStriping);let r=e?e.getColumnCount():0,i=e?e.__colWidths:void 0;this.getColumnCount()===r&&this.getColWidths()===i||ghe(t,this.getColumnCount(),this.getColWidths()),_he(t,n,this.getFormatType())}updateDOM(e,t,n){let r=$T(this,t);if(t===r===_E())return!0;if(mE(t)){if(t.hasAttribute(`data-lexical-sticky-scrollbar`)!==xhe())return!0;let i=r.parentElement;mE(i)&&this.updateTableWrapper(e,i,r,n)}return this.updateTableElement(e,r,n),!1}scaleDOMColWidths(e,t){let n=this.getColWidths();n&&ghe($T(this,e),this.getColumnCount(),n.map(e=>e*t))}exportDOM(e){let t=super.exportDOM(e),{element:n}=t,r=!QT(n)&&uy(n)?n.querySelector(`table`):n;if(uy(n)&&QT(r)&&r!==n){n.dir&&(r.dir=n.dir);let{paddingInlineStart:e}=n.style;e&&(r.style.paddingInlineStart=e);let t=n.getAttribute(`data-lexical-indent`);t!==null&&r.setAttribute(`data-lexical-indent`,t)}return{after:n=>{if(t.after&&(n=t.after(n)),!QT(n)&&uy(n)&&(n=n.querySelector(`table`)),!QT(n))return null;_he(n,e._config,this.getFormatType());let[r]=UT(this,null,null),i=new Map;for(let e of r)for(let t of e){let e=t.cell.getKey();i.has(e)||i.set(e,{colSpan:t.cell.getColSpan(),startColumn:t.startColumn})}let a=new Set;for(let e of n.querySelectorAll(`:scope > tr > [data-temporary-table-cell-lexical-key]`)){let t=e.getAttribute(`data-temporary-table-cell-lexical-key`);if(t){let n=i.get(t);if(e.removeAttribute(`data-temporary-table-cell-lexical-key`),n){i.delete(t);for(let e=0;e<n.colSpan;e++)a.add(e+n.startColumn)}}}let o=n.querySelector(`:scope > colgroup`);if(o){let e=Array.from(n.querySelectorAll(`:scope > colgroup > col`)).filter((e,t)=>a.has(t));o.replaceChildren(...e)}let s=n.querySelectorAll(`:scope > tr`);if(s.length>0){let e=ny().createElement(`tbody`);for(let t of s)e.appendChild(t);n.append(e)}return n},element:r}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(e,t){let{rows:n,domRows:r}=t;for(let t=0;t<n;t++){let n=r[t];if(n!=null)for(let r=0;r<n.length;r++){let i=n[r];if(i==null)continue;let{elem:a}=i,o=pE(this,a);if(o!==null&&e.is(o))return{x:r,y:t}}}throw Error(`Cell not found in table.`)}getDOMCellFromCords(e,t,n){let{domRows:r}=n,i=r[t];return i==null?null:i[e<i.length?e:i.length-1]??null}getDOMCellFromCordsOrThrow(e,t,n){let r=this.getDOMCellFromCords(e,t,n);if(!r)throw Error(`Cell not found at cords.`);return r}getCellNodeFromCords(e,t,n){let r=this.getDOMCellFromCords(e,t,n);if(r==null)return null;let i=cv(r.elem);return MT(i)?i:null}getCellNodeFromCordsOrThrow(e,t,n){let r=this.getCellNodeFromCords(e,t,n);if(!r)throw Error(`Node at cords not TableCellNode.`);return r}getRowStriping(){return!!this.getLatest().__rowStriping}setRowStriping(e){let t=this.getWritable();return t.__rowStriping=e,t}setFrozenColumns(e){let t=this.getWritable();return t.__frozenColumnCount=e,t}getFrozenColumns(){return this.getLatest().__frozenColumnCount}setFrozenRows(e){let t=this.getWritable();return t.__frozenRowCount=e,t}getFrozenRows(){return this.getLatest().__frozenRowCount}canSelectBefore(){return!0}canIndent(){return!1}getColumnCount(){let e=this.getFirstChild();if(!IT(e))return 0;let t=0;return e.getChildren().forEach(e=>{MT(e)&&(t+=e.getColSpan())}),t}};function Che(e,t){let n=e.getElementByKey(t.getKey());return n===null&&NT(230),rE(t,n)}function whe(e){let t=yE();e.hasAttribute(`data-lexical-row-striping`)&&t.setRowStriping(!0),e.hasAttribute(`data-lexical-frozen-column`)&&t.setFrozenColumns(1),e.hasAttribute(`data-lexical-frozen-row`)&&t.setFrozenRows(1);let n=e.querySelector(`:scope > colgroup`);if(n){let e=[];for(let t of n.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!TT.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&t.setColWidths(e)}return wy(t,e),{after:e=>sx(e,IT),node:t}}function yE(){return Kv(new vE)}function bE(e){return e instanceof vE}function The(e){IT(e.getParent())?e.isEmpty()&&e.append(j_()):e.remove()}function Ehe(e){bE(e.getParent())?ax(e,MT):e.remove()}function Dhe(e){ax(e,IT);let[t]=UT(e,null,null),n=t.reduce((e,t)=>Math.max(e,t.length),0),r=e.getChildren();for(let e=0;e<t.length;++e){let i=r[e];if(!i)continue;IT(i)||NT(254,i.constructor.name,i.getType());let a=t[e].reduce((e,t)=>t?1+e:e,0);if(a===n)continue;let o=i.getLastChild(),s=MT(o)?o.getHeaderStyles()&OT.ROW:OT.NO_STATUS;for(let e=a;e<n;++e){let e=jT(s);e.append(j_()),i.append(e)}}let i=e.getColWidths(),a=e.getColumnCount();if(i&&i.length!==a){let t;if(a<i.length)t=i.slice(0,a);else if(i.length>0){let e=i[i.length-1];t=[...i,...Array(a-i.length).fill(e)]}e.setColWidths(t)}}function Ohe(e){if(e.detail<3||!dy(e.target))return!1;let t=cv(e.target);if(t===null)return!1;let n=Ky(t,e=>$(e)&&!e.isInline());return n!==null&&!!MT(n.getParent())&&(n.select(0),!0)}function khe(){let e=Q();if(!Z(e))return!1;let t=uE(e.anchor.getNode());if(t===null)return!1;let n=dv();if(!n.is(t.getParent())||n.getChildrenSize()!==1)return!1;let[r]=UT(t,null,null);if(r.length===0||r[0].length===0)return!1;let i=r[0][0];if(!i||!i.cell)return!1;let a=r[r.length-1],o=a[a.length-1];return!o||!o.cell?!1:(pv(JT(t,i.cell,o.cell)),!0)}function Ahe(e){return e.registerNodeTransform(kT,e=>{if(e.getColSpan()>1||e.getRowSpan()>1){let[,,t]=WT(e),[n]=HT(t,e,e),r=n.length,i=n[0].length,a=t.getFirstChild();IT(a)||NT(175);let o=[];for(let e=0;e<r;e++){e!==0&&(a=a.getNextSibling(),IT(a)||NT(175));let t=null;for(let r=0;r<i;r++){let i=n[e][r],s=i.cell;if(i.startRow===e&&i.startColumn===r)t=s,o.push(s);else if(s.getColSpan()>1||s.getRowSpan()>1){MT(s)||NT(176);let e=jT(s.__headerState);t===null?pue(a,e):t.insertAfter(e)}}}for(let e of o)e.setColSpan(1),e.setRowSpan(1)}})}function jhe(e,t=!0){let n=new Yme,r=!1,i=(r,i,a)=>{let o=$T(r,a),s=nhe(r,o,e,t,n);n.observers.set(i,[s,o])};return Bb(the(e,n),e.registerCommand(Np,()=>e.getRootElement()!==null&&(r=!0,function(e,t){let n=Q(),r=ag(),i=e.getAndClearNextFocus();if(i!==null&&bE(iv(i.tableKey))){let{tableKey:t,focusCell:r}=i,a=e.observers.get(t);a||NT(335,t);let[o]=a;if(qT(n)&&n.tableKey===o.tableNodeKey)return(r.x!==o.focusX||r.y!==o.focusY)&&(o.$setFocusCellForSelection(r),!0);if(o.anchorCell!==null&&o.anchorCellNodeKey!==null&&r.elem!==o.anchorCell.elem&&o.tableSelection!==null)return o.$setFocusCellForSelection(r,!0),!0}let a=e.getAndClearShouldCheckSelectionForTable();if(a&&Z(r)&&Z(n)&&n.isCollapsed()){let e=iv(a);if(bE(e)){let t=n.anchor.getNode(),r=e.getFirstChild(),i=lE(t);if(i!==null&&IT(r)){let t=r.getFirstChild();if(MT(t)&&e.is(Ky(i,n=>n.is(e)||n.is(t))))return t.selectStart(),!0}}}return qT(n)&&function(e,t){let n=eE(e),r=ag();if(!t.is(r))return;let i=Zme(t.tableKey),a=Zv(n),o=a&&ay(a,e.getRootElement());if(a&&o&&o.anchorNode&&o.focusNode){let n=cv(o.focusNode),r=n&&!i.isParentOf(n),s=cv(o.anchorNode),c=s&&i.isParentOf(s);if(r&&c&&a.rangeCount>0){let n=Uce(a,e);n&&(n.anchor.set(i.getKey(),t.isBackward()?i.getChildrenSize():0,`element`),a.removeAllRanges(),pv(n))}}}(t,n),Z(n)&&function(e,t){let n=ag(),{anchor:r,focus:i}=e,a=r.getNode(),o=i.getNode(),s=lE(a),c=lE(o),l=s?uE(s):null,u=c?uE(c):null,d=e.isBackward(),f=s&&c&&l&&u&&l.is(u),p=u&&(!l||l.isParentOf(u)),m=l&&(!u||u.isParentOf(l));if(p){let t=e.clone(),[n]=HT(u,c,c),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.focus.set(d?r.getKey():i.getKey(),d?0:i.getChildrenSize(),`element`),pv(t)}else if(m){let t=e.clone(),[n]=HT(l,s,s),r=n[0][0].cell,i=n[n.length-1].at(-1).cell;t.anchor.set(d?i.getKey():r.getKey(),d?i.getChildrenSize():0,`element`),pv(t)}else if(f){if(!s.is(c))return void pv(JT(l,s,c));let r=t.observers.get(l.getKey());if(r===void 0)return;let[i]=r;if(i.pointerType===`touch`&&i.isSelecting&&i.isPointerDrag&&e.isCollapsed()&&Z(n)&&n.isCollapsed()){let e=iv(n.anchor.key),t=e&&lE(e),{pointerStartCell:r}=i,a=r&&cv(r.elem);a!==null&&!a.is(c)&&t&&l.is(uE(t))&&!t.is(c)&&(pv(JT(l,t,c)),i.pointerType=null)}}}(n,e),!1}(n,e)),3),e.registerUpdateListener(({dirtyElements:t})=>{if(!r){for(let e of t.keys())if(n.observers.has(e)){r=!0;break}}r&&(r=!1,e.getRootElement()!==null&&e.read(`latest`,()=>{(function(e,t){for(let[n,r]of e.$getTableNodesAndObservers())rhe(t,n,r)})(n,e)}))}),e.registerMutationListener(vE,t=>{r=!0,e.read(`latest`,()=>{for(let[e,r]of t){let t=n.observers.get(e);if(r===`created`||r===`updated`){let{tableNode:r,tableElement:a}=Jme(e);t===void 0?i(r,e,a):a!==t[1]&&(n.removeObserver(e),i(r,e,a))}else r===`destroyed`&&n.removeObserver(e)}})},{skipInitialization:!1}),()=>{n.removeAllObservers()})}function Mhe(e,t){e.hasNodes([vE])||NT(255);let{hasNestedTables:n=Px(!1)}=t??{};return Bb(e.registerCommand(Mme,e=>function({rows:e,columns:t,includeHeaders:n},r){let i=Q()||ag();if(!i||!Z(i)||!r&&uE(i.anchor.getNode()))return!1;let a=Fme(Number(e),Number(t),n);tx(a);let o=a.getFirstDescendant();return X(o)&&o.select(),!0}(e,n.peek()),0),e.registerCommand(Pp,(t,r)=>e===r&&function(e,t){let{nodes:n,selection:r}=e;if(!n.some(e=>bE(e)||cue(e).some(e=>bE(e.node)))){if(qT(r)){let e=``,t=!1;for(let r of n){let n=$(r)&&!r.isInline();e.length>0&&(n||t)&&(e+=`
`),e+=r.getTextContent(),t=n}return r.insertRawText(e),!0}return!1}let i=qT(r),a=Z(r);return!!(a&&Ky(r.anchor.getNode(),e=>MT(e))!==null&&Ky(r.focus.getNode(),e=>MT(e))!==null||i)&&(n.length===1&&bE(n[0])?Gme(n[0],r):!(a&&t.peek()&&!function(e){return!(!qT(e)||e.focus.getNode().is(e.anchor.getNode()))||!(!Z(e)||!MT(e.anchor.getNode())||e.anchor.getNode().is(e.focus.getNode()))}(r)))}(t,n),0),e.registerCommand(ym,khe,1),e.registerCommand(Fp,Ohe,0),e.registerNodeTransform(vE,Dhe),e.registerNodeTransform(PT,Ehe),e.registerNodeTransform(kT,The))}var Nhe={build:(e,t,n)=>bde(t),config:{hasCellBackgroundColor:!0,hasCellMerge:!0,hasHorizontalScroll:!0,hasNestedTables:!1,hasStickyScrollbar:!1,hasTabHandler:!0},dependencies:[WS,[US,{rules:[{$import:(e,t)=>{let n=yE();t.hasAttribute(`data-lexical-row-striping`)&&n.setRowStriping(!0),t.hasAttribute(`data-lexical-frozen-column`)&&n.setFrozenColumns(1),t.hasAttribute(`data-lexical-frozen-row`)&&n.setFrozenRows(1);let r=t.querySelector(`:scope > colgroup`);if(r){let e=[];for(let t of r.querySelectorAll(`:scope > col`)){let n=t.style.width||``;if(!TT.test(n)&&(n=t.getAttribute(`width`)||``,!/^\d+$/.test(n))){e=void 0;break}e.push(parseFloat(n))}e&&n.setColWidths(e)}return[n.splice(0,0,sx(e.$importChildren(t),IT))]},match:GS.tag(`table`),name:`@lexical/table/table`},{$import:(e,t)=>[FT(TT.test(t.style.height)?parseFloat(t.style.height):void 0).splice(0,0,sx(e.$importChildren(t),MT))],match:GS.tag(`tr`),name:`@lexical/table/tr`},{$import:(e,t)=>{let n=t.nodeName===`TH`,r=TT.test(t.style.width)?parseFloat(t.style.width):void 0,i=OT.NO_STATUS;if(n){let e=t.getAttribute(`scope`);if(e===`col`)i=OT.COLUMN;else if(e===`row`)i=OT.ROW;else{let e=t.parentElement,n=wle(e)&&(e.parentElement&&e.parentElement.nodeName===`THEAD`||e.rowIndex===0),r=t.cellIndex===0;n&&(i|=OT.ROW),r&&(i|=OT.COLUMN),i===OT.NO_STATUS&&(i=OT.ROW)}}let a=jT(i,t.colSpan,r);a.__rowSpan=t.rowSpan;let o=t.style.backgroundColor;o!==``&&(a.__backgroundColor=o);let s=t.style.verticalAlign;(function(e){return e===`middle`||e===`bottom`})(s)&&(a.__verticalAlign=s);let c=e.get(CS),l=c|function(e){let t=0,n=e.fontWeight;n!==`700`&&n!==`bold`||(t|=1),e.fontStyle===`italic`&&(t|=2);let r=(e.textDecoration||``).split(` `);return r.includes(`underline`)&&(t|=8),r.includes(`line-through`)&&(t|=4),t}(t.style),u=e.get(wS),d=t.style.color,f=d?{...u,color:d}:u,p=[];l!==c&&p.push(tS(CS,l)),f!==u&&p.push(tS(wS,f));let m=function(e){let t=[],n=null,r=()=>{if(n!==null){let e=n.getFirstChild();u_(e)&&n.getChildrenSize()===1&&e.remove()}};for(let i of e)Vv(i)||X(i)||u_(i)?n===null?(n=j_().append(i),t.push(n)):n.append(i):(r(),n=null,t.push(i));return r(),t.length===0&&t.push(j_()),t}(e.$importChildren(t,{context:p})),h=n?m:kS(m,t);return[a.splice(0,0,h)]},match:GS.tag(`td`,`th`),name:`@lexical/table/cell`}]}]],name:`@lexical/table/Table`,nodes:()=>[vE,PT,kT],register(e,t,n){let r=n.getOutput(),i=!1;return Bb(Hx(()=>{let t=r.hasHorizontalScroll.value,n=r.hasStickyScrollbar.value&&t,a=_E(e);a!==t&&She(e,t),a===t&&i===n||e.update(Fg),i=n}),Mhe(e,r),Hx(()=>jhe(e,r.hasTabHandler.value)),Hx(()=>{if(r.hasStickyScrollbar.value&&r.hasHorizontalScroll.value)return e.registerRootListener(t=>{if(t)return function(e){let t=new Map;return Bb(()=>{for(let{cleanup:e}of t.values())e();t.clear()},e.registerMutationListener(vE,n=>{for(let[r,i]of n){let n=t.get(r);if(i===`destroyed`){n&&(n.cleanup(),t.delete(r));continue}let a=e.getElementByKey(r),o=a&&uy(a)?bhe(a):null;n&&o&&n.parts.scrollable===o.scrollable&&n.parts.scrollbar===o.scrollbar&&n.parts.tableElement===o.tableElement?hE(o.scrollable,o.scrollbar):(n&&(n.cleanup(),t.delete(r)),o&&t.set(r,{cleanup:yhe(o),parts:o}))}},{skipInitialization:!1}))}(e)})}),Hx(()=>r.hasCellMerge.value?void 0:Ahe(e)),Hx(()=>r.hasCellBackgroundColor.value?void 0:e.registerNodeTransform(kT,e=>{e.getBackgroundColor()!==null&&e.setBackgroundColor(null)})))}},xE=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),SE=(e,t,{ellipsis:n=`…`}={})=>{let r=e.trim();if(r.length<=t)return r;let i=[...r.slice(0,t*2)];return`${i.slice(0,t).join(``).trim()}${i.length>t||r.length>t*2?n:``}`},CE=e=>e.replace(/^\/+|\/+$/g,``),Phe,Fhe=e=>(Phe??=new DOMParser,Phe.parseFromString(e,`text/html`).body.textContent),wE=e=>!/\s/.test(e)&&URL.canParse(e),TE=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}).compare,EE=(e,t=[])=>e.getRootElement()?.contains(document.activeElement)?t:[...t,`skip-dom-selection`],DE=class e{#e;#t;#n=``;#r=``;#i={};#a=[];constructor(e,t,{keyPath:n,autoIncrement:r,indexes:i=[]}={}){this.#e=void 0,this.#n=e,this.#r=t,this.#i={keyPath:n,autoIncrement:r},this.#a=i}async#o(e){return new Promise((t,n)=>{let r=globalThis.indexedDB.open(this.#n,e);r.onupgradeneeded=()=>{let e=r.result,t=this.#r,n=e.objectStoreNames.contains(t)?r.transaction.objectStore(t):e.createObjectStore(t,this.#i);this.#a.forEach(({name:e,keyPath:t,options:r})=>{n.indexNames.contains(e)||n.createIndex(e,t,r)})},r.onsuccess=()=>{t(r.result)},r.onerror=()=>{n(r.error)}})}#s(e){let t=this.#r;if(!e.objectStoreNames.contains(t))return!0;let n=e.transaction(t).objectStore(t);return this.#a.some(({name:e})=>!n.indexNames.contains(e))}async#c(){let e=await this.#o();for(;this.#s(e);){let{version:t}=e;e.close();try{e=await this.#o(t+1)}catch(t){if(t?.name!==`VersionError`)throw t;e=await this.#o()}}return e.onversionchange=()=>{e.close(),this.#e=void 0},e.onclose=()=>{this.#e=void 0},e}async#l(e,{mode:t=`readonly`}={}){if(!this.#e){this.#t??=this.#c();try{this.#e=await this.#t}finally{this.#t=void 0}}let n=this.#e,r=this.#r,i=n.transaction(r,t),a=e(i.objectStore(r));return new Promise((e,n)=>{if(i.onerror=()=>{n(i.error)},i.onabort=()=>{n(i.error)},t===`readwrite`){let t;a&&(a.onsuccess=()=>{t=a.result}),i.oncomplete=()=>{e(t)}}else a?a.onsuccess=()=>{e(a.result)}:i.oncomplete=()=>{e(void 0)}})}async set(e,t){return this.#l(n=>n.put(t,e),{mode:`readwrite`})}async put(e){return this.#l(t=>t.put(e),{mode:`readwrite`})}async saveEntries(e){return this.#l(t=>{e.forEach(([e,n])=>{t.put(n,e)})},{mode:`readwrite`})}async get(e){return this.#l(t=>t.get(e))}async keys(){return this.#l(e=>e.getAllKeys())}async values(){return this.#l(e=>e.getAll())}async entries(){let e=[],t=await this.#l(t=>{let n=t.getAllKeys();return n.onsuccess=()=>{e=n.result},t.getAll()});return e.map((e,n)=>[e,t[n]])}static#u(e,t){return t?e.index(t):e}async#d({callback:t=void 0,index:n=void 0,query:r=void 0,direction:i=`next`}){return new Promise((a,o)=>{this.#l(o=>{let s=e.#u(o,n).openCursor(r,i);s.onsuccess=()=>{let e=s.result;if(e){let{value:n}=e;typeof t!=`function`||t(n)?a(n):e.continue()}else a(void 0)}}).catch(o)})}async find(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n})}async findLast(e,{index:t,query:n}={}){return this.#d({callback:e,index:t,query:n,direction:`prev`})}async filter(t,{index:n,query:r}={}){let i=await this.#l(t=>e.#u(t,n).getAll(r));return typeof t==`function`?i.filter(e=>t(e)):i}async delete(e){await this.#l(t=>t.delete(e),{mode:`readwrite`})}async deleteEntries(e){await this.#l(t=>{e.forEach(e=>{t.delete(e)})},{mode:`readwrite`})}async clear(){await this.#l(e=>e.clear(),{mode:`readwrite`})}},OE=e=>{try{return JSON.parse(e)}catch{return null}},kE=class{static async set(e,t){t===void 0?globalThis.localStorage.removeItem(e):globalThis.localStorage.setItem(e,JSON.stringify(t))}static async get(e){let t=globalThis.localStorage.getItem(e);return t?OE(t):null}static async delete(e){globalThis.localStorage.removeItem(e)}static async clear(){globalThis.localStorage.clear()}static async keys(){return Object.keys(globalThis.localStorage)}static async values(){return Object.values(globalThis.localStorage).map(OE)}static async entries(){return Object.entries(globalThis.localStorage).map(([e,t])=>[e,OE(t)])}},Ihe=[{id:`bsl`,name:`1C (Enterprise)`,aliases:[`1c`]},{id:`sdbl`,name:`1C (Query)`,aliases:[`1c-query`]},{id:`abap`,name:`ABAP`},{id:`actionscript-3`,name:`ActionScript`,aliases:[`actionscript`,`as3`]},{id:`ada`,name:`Ada`},{id:`angular-html`,name:`Angular HTML`},{id:`angular-ts`,name:`Angular TypeScript`},{id:`apache`,name:`Apache Conf`},{id:`apex`,name:`Apex`},{id:`apl`,name:`APL`},{id:`applescript`,name:`AppleScript`},{id:`ara`,name:`Ara`},{id:`asciidoc`,name:`AsciiDoc`,aliases:[`adoc`]},{id:`razor`,name:`ASP.NET Razor`},{id:`asm`,name:`Assembly`},{id:`astro`,name:`Astro`},{id:`ahk`,name:`AutoHotkey`,aliases:[`ahk1`]},{id:`ahk2`,name:`AutoHotkey2`},{id:`awk`,name:`AWK`},{id:`ballerina`,name:`Ballerina`},{id:`bat`,name:`Batch File`,aliases:[`batch`,`cmd`]},{id:`beancount`,name:`Beancount`},{id:`berry`,name:`Berry`,aliases:[`be`]},{id:`bibtex`,name:`BibTeX`},{id:`bicep`,name:`Bicep`},{id:`bird2`,name:`BIRD2 Configuration`,aliases:[`bird`]},{id:`blade`,name:`Blade`},{id:`c`,name:`C`},{id:`csharp`,name:`C#`,aliases:[`c#`,`cs`]},{id:`cpp`,name:`C++`,aliases:[`c++`]},{id:`c3`,name:`C3`},{id:`cadence`,name:`Cadence`,aliases:[`cdc`]},{id:`cairo`,name:`Cairo`},{id:`chapel`,name:`Chapel`,aliases:[`chpl`]},{id:`clarity`,name:`Clarity`},{id:`clojure`,name:`Clojure`,aliases:[`clj`]},{id:`soy`,name:`Closure Templates`,aliases:[`closure-templates`]},{id:`cmake`,name:`CMake`},{id:`cobol`,name:`COBOL`},{id:`codeowners`,name:`CODEOWNERS`},{id:`codeql`,name:`CodeQL`,aliases:[`ql`]},{id:`coffee`,name:`CoffeeScript`,aliases:[`coffeescript`]},{id:`common-lisp`,name:`Common Lisp`,aliases:[`lisp`]},{id:`crystal`,name:`Crystal`},{id:`css`,name:`CSS`},{id:`csv`,name:`CSV`},{id:`cue`,name:`CUE`},{id:`cypher`,name:`Cypher`,aliases:[`cql`]},{id:`d`,name:`D`},{id:`dart`,name:`Dart`},{id:`dax`,name:`DAX`},{id:`desktop`,name:`Desktop`},{id:`diff`,name:`Diff`},{id:`docker`,name:`Dockerfile`,aliases:[`dockerfile`]},{id:`dotenv`,name:`dotEnv`},{id:`dream-maker`,name:`Dream Maker`},{id:`edge`,name:`Edge`},{id:`elixir`,name:`Elixir`},{id:`elm`,name:`Elm`},{id:`emacs-lisp`,name:`Emacs Lisp`,aliases:[`elisp`]},{id:`erb`,name:`ERB`},{id:`erlang`,name:`Erlang`,aliases:[`erl`]},{id:`fsharp`,name:`F#`,aliases:[`f#`,`fs`]},{id:`fennel`,name:`Fennel`},{id:`fish`,name:`Fish`},{id:`fluent`,name:`Fluent`,aliases:[`ftl`]},{id:`fortran-fixed-form`,name:`Fortran (Fixed Form)`,aliases:[`f`,`for`,`f77`]},{id:`fortran-free-form`,name:`Fortran (Free Form)`,aliases:[`f90`,`f95`,`f03`,`f08`,`f18`]},{id:`gdresource`,name:`GDResource`,aliases:[`tscn`,`tres`]},{id:`gdscript`,name:`GDScript`,aliases:[`gd`]},{id:`gdshader`,name:`GDShader`},{id:`genie`,name:`Genie`},{id:`po`,name:`Gettext PO`,aliases:[`pot`,`potx`]},{id:`gherkin`,name:`Gherkin`},{id:`git-commit`,name:`Git Commit Message`},{id:`git-rebase`,name:`Git Rebase Message`},{id:`gleam`,name:`Gleam`},{id:`glimmer-js`,name:`Glimmer JS`,aliases:[`gjs`]},{id:`glimmer-ts`,name:`Glimmer TS`,aliases:[`gts`]},{id:`glsl`,name:`GLSL`},{id:`gn`,name:`GN`},{id:`smalltalk`,name:`GNU Smalltalk`},{id:`gnuplot`,name:`Gnuplot`},{id:`go`,name:`Go`},{id:`graphql`,name:`GraphQL`,aliases:[`gql`]},{id:`groovy`,name:`Groovy`},{id:`hack`,name:`Hack`},{id:`handlebars`,name:`Handlebars`,aliases:[`hbs`]},{id:`hcl`,name:`HashiCorp HCL`},{id:`haskell`,name:`Haskell`,aliases:[`hs`]},{id:`haxe`,name:`Haxe`},{id:`hjson`,name:`Hjson`},{id:`hlsl`,name:`HLSL`},{id:`html`,name:`HTML`},{id:`html-derivative`,name:`HTML (Derivative)`},{id:`http`,name:`HTTP`},{id:`hurl`,name:`Hurl`},{id:`hxml`,name:`HXML`},{id:`hy`,name:`Hy`},{id:`imba`,name:`Imba`},{id:`ini`,name:`INI`,aliases:[`properties`]},{id:`java`,name:`Java`},{id:`javascript`,name:`JavaScript`,aliases:[`js`,`cjs`,`mjs`]},{id:`jinja`,name:`Jinja`},{id:`jison`,name:`Jison`},{id:`json`,name:`JSON`},{id:`jsonl`,name:`JSON Lines`},{id:`jsonc`,name:`JSON with Comments`},{id:`json5`,name:`JSON5`},{id:`jsonnet`,name:`Jsonnet`},{id:`jssm`,name:`JSSM`,aliases:[`fsl`]},{id:`jsx`,name:`JSX`},{id:`julia`,name:`Julia`,aliases:[`jl`]},{id:`just`,name:`Just`,aliases:[`justfile`]},{id:`kdl`,name:`KDL`},{id:`kotlin`,name:`Kotlin`,aliases:[`kt`,`kts`]},{id:`kusto`,name:`Kusto`,aliases:[`kql`]},{id:`latex`,name:`LaTeX`},{id:`lean`,name:`Lean 4`,aliases:[`lean4`]},{id:`less`,name:`Less`},{id:`liquid`,name:`Liquid`},{id:`llvm`,name:`LLVM IR`},{id:`log`,name:`Log file`},{id:`logo`,name:`Logo`},{id:`lua`,name:`Lua`},{id:`luau`,name:`Luau`},{id:`make`,name:`Makefile`,aliases:[`makefile`]},{id:`markdown`,name:`Markdown`,aliases:[`md`]},{id:`marko`,name:`Marko`},{id:`matlab`,name:`MATLAB`},{id:`mdc`,name:`MDC`},{id:`mdx`,name:`MDX`},{id:`mermaid`,name:`Mermaid`,aliases:[`mmd`]},{id:`mipsasm`,name:`MIPS Assembly`,aliases:[`mips`]},{id:`mojo`,name:`Mojo`},{id:`moonbit`,name:`MoonBit`,aliases:[`mbt`,`mbti`]},{id:`move`,name:`Move`},{id:`narrat`,name:`Narrat Language`,aliases:[`nar`]},{id:`nextflow`,name:`Nextflow`,aliases:[`nf`]},{id:`nextflow-groovy`,name:`Nextflow Groovy`},{id:`nginx`,name:`Nginx`},{id:`nim`,name:`Nim`},{id:`nix`,name:`Nix`},{id:`nsis`,name:`NSIS`},{id:`nushell`,name:`nushell`,aliases:[`nu`]},{id:`objective-c`,name:`Objective-C`,aliases:[`objc`]},{id:`objective-cpp`,name:`Objective-C++`},{id:`ocaml`,name:`OCaml`},{id:`odin`,name:`Odin`},{id:`openscad`,name:`OpenSCAD`,aliases:[`scad`]},{id:`org`,name:`Org Markup`},{id:`pascal`,name:`Pascal`},{id:`perl`,name:`Perl`},{id:`php`,name:`PHP`},{id:`pkl`,name:`Pkl`},{id:`plsql`,name:`PL/SQL`},{id:`polar`,name:`Polar`},{id:`postcss`,name:`PostCSS`},{id:`powerquery`,name:`PowerQuery`},{id:`powershell`,name:`PowerShell`,aliases:[`ps`,`ps1`,`pwsh`]},{id:`prisma`,name:`Prisma`},{id:`prolog`,name:`Prolog`},{id:`proto`,name:`Protocol Buffer 3`,aliases:[`protobuf`]},{id:`pug`,name:`Pug`,aliases:[`jade`]},{id:`puppet`,name:`Puppet`},{id:`purescript`,name:`PureScript`},{id:`python`,name:`Python`,aliases:[`py`]},{id:`qml`,name:`QML`},{id:`qmldir`,name:`QML Directory`},{id:`qss`,name:`Qt Style Sheets`},{id:`r`,name:`R`},{id:`racket`,name:`Racket`},{id:`raku`,name:`Raku`,aliases:[`perl6`]},{id:`rbs`,name:`RBS`,aliases:[`ruby-signature`]},{id:`regexp`,name:`RegExp`,aliases:[`regex`]},{id:`rel`,name:`Rel`},{id:`rst`,name:`reStructuredText`},{id:`riscv`,name:`RISC-V`},{id:`coq`,name:`Rocq`},{id:`ron`,name:`RON`},{id:`rosmsg`,name:`ROS Interface`},{id:`ruby`,name:`Ruby`,aliases:[`rb`]},{id:`haml`,name:`Ruby Haml`},{id:`rust`,name:`Rust`,aliases:[`rs`]},{id:`sas`,name:`SAS`},{id:`sass`,name:`Sass`},{id:`scala`,name:`Scala`},{id:`scheme`,name:`Scheme`},{id:`scss`,name:`SCSS`},{id:`shaderlab`,name:`ShaderLab`,aliases:[`shader`]},{id:`shellscript`,name:`Shell`,aliases:[`bash`,`sh`,`shell`,`zsh`]},{id:`shellsession`,name:`Shell Session`,aliases:[`console`]},{id:`smithy`,name:`Smithy`},{id:`solidity`,name:`Solidity`},{id:`sparql`,name:`SPARQL`},{id:`splunk`,name:`Splunk Query Language`,aliases:[`spl`]},{id:`sql`,name:`SQL`},{id:`ssh-config`,name:`SSH Config`},{id:`stata`,name:`Stata`},{id:`stylus`,name:`Stylus`,aliases:[`styl`]},{id:`surrealql`,name:`SurrealQL`,aliases:[`surql`]},{id:`svelte`,name:`Svelte`},{id:`swift`,name:`Swift`},{id:`systemd`,name:`Systemd Units`},{id:`system-verilog`,name:`SystemVerilog`},{id:`talonscript`,name:`TalonScript`,aliases:[`talon`]},{id:`tasl`,name:`Tasl`},{id:`tcl`,name:`Tcl`},{id:`templ`,name:`Templ`},{id:`terraform`,name:`Terraform`,aliases:[`tf`,`tfvars`]},{id:`tex`,name:`TeX`},{id:`toml`,name:`TOML`},{id:`tsv`,name:`TSV`},{id:`tsx`,name:`TSX`},{id:`turtle`,name:`Turtle`},{id:`twig`,name:`Twig`},{id:`typescript`,name:`TypeScript`,aliases:[`ts`,`cts`,`mts`]},{id:`ts-tags`,name:`TypeScript with Tags`,aliases:[`lit`]},{id:`typespec`,name:`TypeSpec`,aliases:[`tsp`]},{id:`typst`,name:`Typst`,aliases:[`typ`]},{id:`v`,name:`V`},{id:`vala`,name:`Vala`},{id:`verilog`,name:`Verilog`},{id:`vhdl`,name:`VHDL`},{id:`viml`,name:`Vim Script`,aliases:[`vim`,`vimscript`]},{id:`vb`,name:`Visual Basic`},{id:`vue`,name:`Vue`},{id:`vue-html`,name:`Vue HTML`},{id:`vue-vine`,name:`Vue Vine`},{id:`vyper`,name:`Vyper`,aliases:[`vy`]},{id:`wasm`,name:`WebAssembly`},{id:`wit`,name:`WebAssembly Interface Types`},{id:`wenyan`,name:`Wenyan`,aliases:[`文言`]},{id:`wgsl`,name:`WGSL`},{id:`wikitext`,name:`Wikitext`,aliases:[`mediawiki`,`wiki`]},{id:`reg`,name:`Windows Registry Script`},{id:`wolfram`,name:`Wolfram`,aliases:[`wl`]},{id:`xml`,name:`XML`},{id:`xsl`,name:`XSL`},{id:`yaml`,name:`YAML`,aliases:[`yml`]},{id:`zenscript`,name:`ZenScript`},{id:`zig`,name:`Zig`}],Lhe=[{id:`andromeeda`,displayName:`Andromeeda`,type:`dark`},{id:`aurora-x`,displayName:`Aurora X`,type:`dark`},{id:`ayu-dark`,displayName:`Ayu Dark`,type:`dark`},{id:`ayu-light`,displayName:`Ayu Light`,type:`light`},{id:`ayu-mirage`,displayName:`Ayu Mirage`,type:`dark`},{id:`catppuccin-frappe`,displayName:`Catppuccin Frappé`,type:`dark`},{id:`catppuccin-latte`,displayName:`Catppuccin Latte`,type:`light`},{id:`catppuccin-macchiato`,displayName:`Catppuccin Macchiato`,type:`dark`},{id:`catppuccin-mocha`,displayName:`Catppuccin Mocha`,type:`dark`},{id:`dark-plus`,displayName:`Dark Plus`,type:`dark`},{id:`dracula`,displayName:`Dracula Theme`,type:`dark`},{id:`dracula-soft`,displayName:`Dracula Theme Soft`,type:`dark`},{id:`everforest-dark`,displayName:`Everforest Dark`,type:`dark`},{id:`everforest-light`,displayName:`Everforest Light`,type:`light`},{id:`github-dark`,displayName:`GitHub Dark`,type:`dark`},{id:`github-dark-default`,displayName:`GitHub Dark Default`,type:`dark`},{id:`github-dark-dimmed`,displayName:`GitHub Dark Dimmed`,type:`dark`},{id:`github-dark-high-contrast`,displayName:`GitHub Dark High Contrast`,type:`dark`},{id:`github-light`,displayName:`GitHub Light`,type:`light`},{id:`github-light-default`,displayName:`GitHub Light Default`,type:`light`},{id:`github-light-high-contrast`,displayName:`GitHub Light High Contrast`,type:`light`},{id:`gruvbox-dark-hard`,displayName:`Gruvbox Dark Hard`,type:`dark`},{id:`gruvbox-dark-medium`,displayName:`Gruvbox Dark Medium`,type:`dark`},{id:`gruvbox-dark-soft`,displayName:`Gruvbox Dark Soft`,type:`dark`},{id:`gruvbox-light-hard`,displayName:`Gruvbox Light Hard`,type:`light`},{id:`gruvbox-light-medium`,displayName:`Gruvbox Light Medium`,type:`light`},{id:`gruvbox-light-soft`,displayName:`Gruvbox Light Soft`,type:`light`},{id:`horizon`,displayName:`Horizon`,type:`dark`},{id:`horizon-bright`,displayName:`Horizon Bright`,type:`light`},{id:`houston`,displayName:`Houston`,type:`dark`},{id:`kanagawa-dragon`,displayName:`Kanagawa Dragon`,type:`dark`},{id:`kanagawa-lotus`,displayName:`Kanagawa Lotus`,type:`light`},{id:`kanagawa-wave`,displayName:`Kanagawa Wave`,type:`dark`},{id:`laserwave`,displayName:`LaserWave`,type:`dark`},{id:`light-plus`,displayName:`Light Plus`,type:`light`},{id:`material-theme`,displayName:`Material Theme`,type:`dark`},{id:`material-theme-darker`,displayName:`Material Theme Darker`,type:`dark`},{id:`material-theme-lighter`,displayName:`Material Theme Lighter`,type:`light`},{id:`material-theme-ocean`,displayName:`Material Theme Ocean`,type:`dark`},{id:`material-theme-palenight`,displayName:`Material Theme Palenight`,type:`dark`},{id:`min-dark`,displayName:`Min Dark`,type:`dark`},{id:`min-light`,displayName:`Min Light`,type:`light`},{id:`monokai`,displayName:`Monokai`,type:`dark`},{id:`night-owl`,displayName:`Night Owl`,type:`dark`},{id:`night-owl-light`,displayName:`Night Owl Light`,type:`light`},{id:`nord`,displayName:`Nord`,type:`dark`},{id:`one-dark-pro`,displayName:`One Dark Pro`,type:`dark`},{id:`one-light`,displayName:`One Light`,type:`light`},{id:`plastic`,displayName:`Plastic`,type:`dark`},{id:`poimandres`,displayName:`Poimandres`,type:`dark`},{id:`red`,displayName:`Red`,type:`dark`},{id:`rose-pine`,displayName:`Rosé Pine`,type:`dark`},{id:`rose-pine-dawn`,displayName:`Rosé Pine Dawn`,type:`light`},{id:`rose-pine-moon`,displayName:`Rosé Pine Moon`,type:`dark`},{id:`slack-dark`,displayName:`Slack Dark`,type:`dark`},{id:`slack-ochin`,displayName:`Slack Ochin`,type:`light`},{id:`snazzy-light`,displayName:`Snazzy Light`,type:`light`},{id:`solarized-dark`,displayName:`Solarized Dark`,type:`dark`},{id:`solarized-light`,displayName:`Solarized Light`,type:`light`},{id:`synthwave-84`,displayName:`Synthwave '84`,type:`dark`},{id:`tokyo-night`,displayName:`Tokyo Night`,type:`dark`},{id:`vesper`,displayName:`Vesper`,type:`dark`},{id:`vitesse-black`,displayName:`Vitesse Black`,type:`dark`},{id:`vitesse-dark`,displayName:`Vitesse Dark`,type:`dark`},{id:`vitesse-light`,displayName:`Vitesse Light`,type:`light`}],Rhe=`sveltia-ui`,zhe=`shiki`,AE,Bhe,Vhe=!0,Hhe=(e,t)=>`4.5.0/${e}/${t}`,jE=()=>(AE===void 0&&(AE=typeof indexedDB>`u`?null:new DE(Rhe,zhe)),AE),Uhe=async e=>(Bhe??=(async()=>{let t=(await e.keys()).filter(e=>typeof e==`string`&&!e.startsWith(`4.5.0/`));t.length&&await e.deleteEntries(t)})(),Bhe),Whe=async(e,t)=>{let n=Vhe?jE():null;if(n)try{return await Uhe(n),await n.get(Hhe(e,t))}catch{return}},Ghe=async(e,t,n)=>{let r=Vhe?jE():null;if(r)try{await r.set(Hhe(e,t),n)}catch{}},ME=`https://unpkg.com/@shikijs`,Khe=`https://unpkg.com/@sveltia/ui`,qhe=()=>`${Khe}@0.87.4/dist/shiki-engine.js`,Jhe=e=>`${ME}/langs@4.5.0/dist/${e}.mjs`,Yhe=e=>`${ME}/themes@4.5.0/dist/${e}.mjs`,Xhe={loadEngine:async()=>import(qhe()),loadLanguage:async e=>import(Jhe(e)),loadTheme:async e=>import(Yhe(e))},NE=()=>Xhe,PE=()=>{if(typeof document>`u`)return`github-light`;let{theme:e}=document.documentElement.dataset;return e?e===`dark`?`github-dark`:`github-light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`github-dark`:`github-light`},FE=e=>{if(typeof document>`u`)return()=>void 0;let t=new MutationObserver(e);t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]});let n=window.matchMedia(`(prefers-color-scheme: dark)`);return n.addEventListener(`change`,e),()=>{t.disconnect(),n.removeEventListener(`change`,e)}},Zhe=e=>FE(()=>{let t=PE();e.update(()=>{dv().getChildren().forEach(e=>{lC(e)&&e.getTheme()!==t&&(e.setTheme(t),e.markDirty())})},{tag:EE(e,[`history-merge`])})}),Qhe=[``,`plain`,`plaintext`,`text`,`txt`],$he=/^diff-([\w-]+)/i,IE=null,LE=null,RE=!1,zE=e=>$he.exec(e)?.[1]??null,BE=e=>Qhe.includes(e??``),VE=()=>!!LE,ege=()=>RE,HE=e=>{if(!LE)return!1;let t=zE(e)??e;return IE.isSpecialLang(t)?!0:LE.getLoadedLanguages().includes(t)},tge=(e,t)=>{e.update(()=>{let e=iv(t);if(!lC(e))return;let n=e.getLanguage();n&&HE(n)&&!e.getIsSyntaxHighlightSupported()&&e.setIsSyntaxHighlightSupported(!0),e.markDirty()},{tag:EE(e,[`history-merge`])})},UE=new Map,WE=(e,t,n,r)=>{let i=UE.get(e);if(!i){let n=new Map;i={promise:(async()=>{try{await t()}catch{}UE.delete(e),n.forEach((e,t)=>tge(e,t))})(),targets:n},UE.set(e,i)}return n&&r&&i.targets.set(r,n),i.promise},GE=(e,t)=>{if(!(LE||RE))return WE(`engine`,async()=>{try{IE=await NE().loadEngine(),LE=IE.createHighlighterCoreSync({engine:IE.createJavaScriptRegexEngine(),langs:[],themes:[]})}catch{RE=!0}},e,t)},nge=async(e,t,n)=>{let r=await Whe(e,t);if(r)return r;let i=await n();if(!i)return;let a=i.default??i;return await Ghe(e,t,a),a},KE=(e,t,n,r)=>{let i=e===`lang`?`loadLanguage`:`loadTheme`;return WE(`${e}/${t}`,async()=>{let n=await nge(e,t,()=>NE()[i](t));n&&await LE[i](n)},n,r)},qE=e=>Ihe.find(({id:t,aliases:n})=>t===e||n?.includes(e)),JE=e=>qE(e)?.id??e,YE=(e,t,n)=>{let r=zE(e)??e;if(!LE||HE(r))return;let i=qE(r);if(i)return KE(`lang`,i.id,t,n)},XE=e=>LE?IE.isSpecialTheme(e)||LE.getLoadedThemes().includes(e):!1,ZE=(e,t,n)=>{if(LE&&!XE(e)&&Lhe.some(({id:t})=>t===e))return KE(`theme`,e,t,n)},rge=(e,t)=>{let n=[];return e.forEach((e,r)=>{r&&n.push(l_()),e.forEach((e,r)=>{let{content:i}=e;if(t&&r===0&&i.length>0){let e=[`+`,`-`,`>`,`<`,` `],t=[`inserted`,`deleted`,`inserted`,`deleted`,`unchanged`],r=e.indexOf(i[0]);r!==-1&&(n.push(_C(e[r],t[r])),i=i.slice(1))}let a=IE.stringifyTokenStyle(e.htmlStyle||IE.getTokenStyleObject(e));mg(i,{linebreak:()=>n.push(l_()),tab:()=>n.push(Dh()),text:e=>{let t=_C(e);t.setStyle(a),n.push(t)}})})}),n},ige=(e,t)=>{let n=zE(t),{tokens:r}=LE.codeToTokens(e.getTextContent(),{lang:n??t,theme:e.getTheme()});return rge(r,!!n)},QE=(e,t)=>{if(!LE||BE(e)||!HE(e))return;let n=t??PE();return XE(n)?n:void 0},age=(e,t,{theme:n}={})=>{let r=JE(zE(t)??t),i=QE(r,n);if(i!==void 0)return LE.codeToHtml(e,{lang:r,theme:i})},oge=(e,t,{theme:n}={})=>{let r=JE(t),i=QE(r,n);if(i===void 0)return;let{tokens:a,fg:o=``}=LE.codeToTokens(e,{lang:r,theme:i});return a.map(e=>e.map(({content:e,color:t,fontStyle:n=0})=>{let r={content:e};return t&&t.toLowerCase()!==o.toLowerCase()&&(r.color=t),n&2&&(r.bold=!0),n&4&&(r.underline=!0),n&8&&(r.strikethrough=!0),r}))},sge={a:[`href`,`rel`,`target`,`title`],ol:[`start`],td:[`colspan`,`rowspan`],th:[`colspan`,`rowspan`]},cge=[[`code`,`code`],[`subscript`,`sub`],[`superscript`,`sup`],[`highlight`,`mark`],[`underline`,`u`],[`strikethrough`,`s`],[`italic`,`em`],[`bold`,`strong`]],lge=[`tbody`,`thead`,`tfoot`,`colgroup`,`col`],uge=[`html`,`head`,`body`],$E=e=>e.className.match(/(?:^|\s)(?:lang|language)-(\S+)/)?.[1],dge=[`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`blockquote`,`li`],eD=e=>{let t=sge[e.localName]??[],n=dge.includes(e.localName)?e.style.textAlign:``;[...e.attributes].forEach(({name:n})=>{t.includes(n)||e.removeAttribute(n)}),n&&(e.style.textAlign=n)},tD=(e,t)=>{let{after:n,...r}=t.exportDOM(e);return uy(r.element)&&eD(r.element),{...r,after:e=>{let r=n?n.call(t,e):void 0,i=r??e;return uy(i)&&(eD(i),i.querySelectorAll(`:scope > br`).forEach(eD)),r===e?void 0:r}}},fge=(e,t)=>{let n=t.getParent();return n instanceof kT&&n.getChildrenSize()===1&&!t.getFormatType()?{element:document.createDocumentFragment()}:t.isEmpty()&&t.getNextSiblings().every(e=>M_(e)&&e.isEmpty())?{element:null}:tD(e,t)},nD=(e,t)=>{let n=document.createTextNode(t.getTextContent());return cge.forEach(([e,r])=>{if(t.hasFormat(e)){let e=document.createElement(r);e.append(n),n=e}}),{element:n}},pge=(e,t)=>({element:document.createElement(`pre`),after:e=>{if(!uy(e))return;let n=document.createElement(`code`),r=t.getLanguage();r&&!BE(r)&&(n.className=`language-${r}`),n.textContent=[...e.childNodes].map(e=>e.nodeName===`BR`?uy(e)&&e.hasAttribute(`data-lexical-managed-linebreak`)?``:`
`:e.textContent).join(``),e.replaceChildren(n)}}),mge=`:scope > :is(thead, tbody, tfoot), :scope > :is(thead, tbody, tfoot) > tr, :scope > :is(thead, tbody, tfoot) > tr > :is(th, td), :scope > tr, :scope > tr > :is(th, td)`,hge=new Map([[bh,nD],[Eh,nD],[hC,nD],[A_,fge],[Lw,tD],[Pw,tD],[nw,tD],[XC,tD],[PC,tD],[Kx,tD],[sC,pge],[vE,(e,t)=>{let{after:n,...r}=t.exportDOM(e);return{...r,after:e=>{let r=n?n.call(t,e):void 0,i=r??e;return uy(i)&&(i.querySelectorAll(`:scope > colgroup`).forEach(e=>e.remove()),[i,...i.querySelectorAll(mge)].forEach(eD)),r===e?void 0:r}}}]]),gge=e=>{let t=document.createTreeWalker(e,NodeFilter.SHOW_ALL),n=``;for(let e=t.nextNode();e;e=t.nextNode())e.nodeType===Node.TEXT_NODE?n+=e.data:e.nodeName===`BR`&&(n+=`
`);return n},_ge=e=>{let t=e.querySelector(`:scope > code`),n=cC((t?$E(t):void 0)??e.getAttribute(`data-language`)),r=gge(e).replace(/\n$/,``);return r&&n.append(wh(r)),{node:n,after:()=>[]}},rD=new WeakMap,iD=new WeakMap,aD=e=>{let t=iD.get(e);return t||(t=e.importDOM?.()??{},iD.set(e,t)),t},oD=new WeakMap,sD=(e,t)=>{let n=oD.get(t);return n===void 0&&(n=rD.get(e)?.find(({node:e})=>!!aD(e)[t.localName]?.(t))??null,oD.set(t,n)),n??void 0},cD=e=>{let t=sD(gy(),e);return!!t&&!!t.node.prototype.isInline?.()},lD=(e,t)=>{let n=e;for(;;){let e=t?n.nextSibling:n.previousSibling;for(;!e;){let{parentElement:r}=n;if(!r)return null;n=r,e=t?n.nextSibling:n.previousSibling}if(n=e,uy(n)){if(cD(n))return n;let{display:e}=n.style;if(e?!e.startsWith(`inline`):!py(n))return null}let r=t?n.firstChild:n.lastChild;for(;r;){if(n=r,uy(n)&&cD(n))return n;r=t?n.firstChild:n.lastChild}if(X_(n))return n;if(n.nodeName===`BR`)return null}},vge=e=>{for(let t=e.parentElement;t;t=t.parentElement)if(t.localName===`pre`||t.style.whiteSpace.startsWith(`pre`))return!0;return!1},yge=e=>{let t=e.data.replace(/\r/g,``).replace(/[ \t\n]+/g,` `);if(t.startsWith(` `)){let n=lD(e,!1),r=!0;for(;n;n=lD(n,!1)){if(!X_(n)){r=!1;break}let e=n.data;if(e){r=/[ \t\n]$/.test(e);break}}r&&(t=t.slice(1))}if(t.endsWith(` `)){let n=lD(e,!0),r=!0;for(;n;n=lD(n,!0))if(!X_(n)||n.data.replace(/^[ \t\n]+/,``)){r=!1;break}r&&(t=t.slice(0,-1))}return{node:t?wh(t):null}},bge={"#text":e=>vge(e)?null:{conversion:e=>yge(e),priority:1}},xge={pre:()=>({conversion:_ge,priority:2})},Sge=e=>{let t=rD.get(e)??[],n=new Set(t.map(({node:e})=>e)),r=new Set([...e._nodes.values()].filter(({klass:e})=>!n.has(e)).flatMap(({klass:e})=>Object.keys(e.importDOM?.()??{})));return new Set(t.flatMap(({node:e})=>Object.keys(aD(e))).filter(e=>!r.has(e)))},Cge=(e,t)=>{let n=Sge(e),r=i=>{let a;return[...i.childNodes].some(i=>{if(i.nodeType===Node.COMMENT_NODE)return a=i,!0;if(i.nodeType!==Node.ELEMENT_NODE)return!1;let o=i,s=o.localName;return sD(e,o)?!1:!uge.includes(s)&&!lge.includes(s)&&(!e._htmlConversions.has(s)||n.has(s))?(a=o,!0):(a=s===`pre`?t.createTreeWalker(o,NodeFilter.SHOW_COMMENT).nextNode()??void 0:r(o),!!a)}),a};return r(t)},uD=e=>JS(e),dD=`[ \\t\\uE005]`;`${dD}${dD}${dD}${dD}${dD}`;var fD=new RegExp([String.raw`(?=<)(?<!(?:^|[^\\])(?:\\\\)*\\)(?:`,[`<[A-Za-z][A-Za-z0-9-]*(?:[ \\t\\uE005]+[A-Za-z_:][\\w.:-]*(?:[ \\t\\uE005]*=[ \\t\\uE005]*(?:[^\\s"'=<>\`\\uE005]+|'[^'\\n]*'|"[^"\\n]*"))?)*[ \\t\\uE005]*/?>|</[A-Za-z][A-Za-z0-9-]*[ \\t\\uE005]*>`,String.raw`<!-->|<!--->|<!--.*?-->`,String.raw`<\?.*?\?>`,String.raw`<![A-Za-z][^>]*>`,String.raw`<!\[CDATA\[.*?\]\]>`].join(`|`),`)`].join(``)),wge=[/([-*_])(?:[ \t]*\1){2,}[ \t]*$/,/(?:=+|-{2,})[ \t]*$/,/(?:#{1,6}|[-+*]|\d{1,9}[.)])(?=[ \t]|$)/,/>|`{3,}|~{3,}/].map(({source:e})=>e).join(`|`),Tge=RegExp(`^ {0,3}(?:${wge})`),pD=Sf(`suiRawSyntax`,{parse:e=>typeof e==`string`?e:``}),Ege=e=>Cf(e,pD)||void 0,Dge=e=>{if(Cf(e,pD))return e.getTextContent()},mD={dependencies:[],export:()=>null,importRegExp:Tge,regExp:/(?!)/,replace:e=>{wf(e,pD,e.getTextContent())},type:`text-match`},hD={dependencies:[],export:()=>null,importRegExp:RegExp(`(?<=^).+|${fD.source}`),regExp:/(?!)/,replace:mD.replace,type:`text-match`},gD=e=>{let t=[],n;return e.forEach((e,r)=>{let i=e.match(/^[ \t]*(`{3,}(?=[^`]*$)|~{3,})/)?.[1];n?i?.[0]===n.fence[0]&&i.length>=n.fence.length&&!e.trim().slice(i.length)&&(t.push({...n,end:r,closed:!0}),n=void 0):i&&(n={start:r,fence:i})}),n&&t.push({...n,end:e.length-1,closed:!1}),t},_D=(e,t)=>{let n=e.split(`
`),r=[],i=0,a=e=>{if(e>i){let a=i>0?`
`:``,o=e<n.length?`
`:``,s=t(`${a}${n.slice(i,e).join(`
`)}${o}`);r.push(s.slice(a.length,s.length-o.length))}};return gD(n).forEach(({start:e,end:t})=>{a(e),r.push(n.slice(e,t+1).join(`
`)),i=t+1}),a(n.length),r.join(`
`)},vD=(e,t)=>{let n=e.split(`
`),r=new Set(gD(n).flatMap(({start:e,end:t})=>Array.from({length:t-e+1},(t,n)=>e+n)));return n.map((e,n)=>r.has(n)?e:t(e)).join(`
`)},yD=/^ {0,3}(=+|-+)[ \t]*$/,bD=/^ {0,3}#{1,6}(?:[ \t]|$)/,xD=[[`(?:script|pre|style|textarea)(?:[ \\t>]|$)`,/<\/(?:pre|script|style|textarea)>/i],[`!--`,/-->/],[`\\?`,/\?>/],[`![A-Za-z]`,/>/],[`!\\[CDATA\\[`,/\]\]>/],[`/?(?:${`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h[1-6].head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`).join(`|`)})(?:[ \\t>]|/>|$)`,null]],Oge=RegExp(`<(?:${xD.map(([e])=>e).join(`|`)})`,`i`),kge=xD.map(([e,t])=>[RegExp(`^ {0,3}<(?:${e})`,`i`),t]),Age=new RegExp(fD,`g`),jge=RegExp(`^ {0,3}(?!</?(?:pre|script|style|textarea)\\b)(?:<[A-Za-z][A-Za-z0-9-]*(?:[ \\t\\uE005]+[A-Za-z_:][\\w.:-]*(?:[ \\t\\uE005]*=[ \\t\\uE005]*(?:[^\\s"'=<>\`\\uE005]+|'[^'\\n]*'|"[^"\\n]*"))?)*[ \\t\\uE005]*/?>|</[A-Za-z][A-Za-z0-9-]*[ \\t\\uE005]*>)[ \\t]*$`,`i`),SD=new RegExp([bD.source,"^ {0,3}(?:>|[-+*](?:[ \\t]|$)|\\d{1,9}[.)](?:[ \\t]|$)|`{3,}|~{3,}|\\|)",`^ {0,3}${Oge.source}`,`^(?: {4}|\\t)`,`^ {0,3}([-*_])(?:[ \\t]*\\1){2,}[ \\t]*$`,yD.source].join(`|`),`i`),Mge=new RegExp(SD.source.replace(`|^(?: {4}|\\t)`,``),`i`),CD=(e,t)=>{let n=`[${e}]`.repeat(t),r=String.raw`(?:\\[^\s]|[^${e}\\\n])`,i=String.raw`(?:\\[^\s]|[^${e}\s\\])`,a=`${i}(?:${r}*?${i})?`,o=String.raw`[\s\p{P}\p{S}]`,s=e===`*`,c=s?`(?:(?<=^|${o})${n}|${n}(?!${o}))`:`(?<=^|${o})${n}`,l=s?`(?:(?<!${o})${n}|${n}(?=${o}|$))`:`${n}(?=${o}|$)`,u=String.raw`(?:\\|[ \t]*)\n[ \t]*`;return new RegExp(String.raw`(?<![${e}\\])${c}(${a}(?:${u}${a})+)${l}(?![${e}])`,`gu`)},wD=[[`***`,CD(`*`,3)],[`___`,CD(`_`,3)],[`**`,CD(`*`,2)],[`__`,CD(`_`,2)],[`~~`,CD(`~`,2)],[`*`,CD(`*`,1)],[`_`,CD(`_`,1)]],Nge=e=>e.split(`
`).map(e=>{let t=e.length-e.trimStart().length,n=e.length,r=0;for(;n>t&&/[ \t]/.test(e[n-1]);)--n;for(;e[n-r-1]===`\\`;)r+=1;return r%2&&--n,{indent:e.slice(0,t),text:e.slice(t,n),lineEnd:e.slice(n)}}),Pge=e=>wD.some(([,t])=>e.search(t)!==-1),Fge=e=>_D(e,e=>{let t=e,n;for(;t!==n;)n=t,t=wD.reduce((e,[t,n])=>e.replace(n,(e,n)=>{if(Pge(n))return e;let r=Nge(n);return r.some(({text:e})=>/^[*_~]+$/.test(e))||r.slice(1).some(({indent:e,text:t})=>Mge.test(`${e}${t}`))?e:r.map(({indent:e,text:n,lineEnd:r})=>`${e}${t}${n}${t}${r}`).join(`
`)}),t);return t.replace(/(?<=^|[\s\p{P}\p{S}])(?<![`\\])`([^`\n]+?)\n([^`\n]+?)`(?=[\s\p{P}\p{S}]|$)(?!`)/gu,"`$1`\n`$2`")}),TD=``,ED=``,DD=``,OD=``,kD=e=>{let t=[...e.matchAll(/`+/g)].map(({0:{length:t},index:n})=>{let r=0;for(;e[n-r-1]===`\\`;)r+=1;return{index:n,length:t,escaped:r%2==1}}),n=[];for(let e=0;e<t.length;e+=1){let r=e+1;for(;r<t.length&&t[r].length!==t[e].length;)r+=1;if(!t[e].escaped&&r<t.length){let{index:i,length:a}=t[r];n.push({start:t[e].index,end:i+a,fenceLength:a}),e=r}}return n},Ige=e=>{if(!/[\\`][*_~]*$/.test(e))return e;let t=kD(e).findLast(({end:t})=>/^[*_~]*$/.test(e.slice(t)));if(t){let n=t.end-t.fenceLength;return e[n-1]===`\\`?`${e.slice(0,n)}${TD}${e.slice(n)}`:e}let n=[!0,!1].map(t=>{let n=e.length-(t&&e.endsWith(`\\`)?1:0),r=0;for(;n>0&&`*_~`.includes(e[n-1]);)--n;for(;e[n-r-1]===`\\`;)r+=1;return r&&r%2==0?n:-1}).find(e=>e!==-1);return n===void 0?e:`${e.slice(0,n)}${TD}${e.slice(n)}`},Lge=/(?=\\)(?<=(?:^|[^\\])(?:\\\\)*[*_~])|(?=[*_~])(?<=(?:^|[^\\])(?:\\\\)+)/g,Rge=e=>/[*_~]\\|\\[*_~]/.test(e)?e.replace(Lge,(t,n)=>`*_~`.includes(e[n])?`${ED}.`:`.${ED}`):e,zge=/(?<=[*_~])(?=(?![\0-\x7F])[\p{P}\p{S}])|(?<=(?![\0-\x7F])[\p{P}\p{S}])(?=[*_~])/gu,Bge=e=>/[^\0-\x7F]/.test(e)?e.replace(zge,(t,n)=>`*_~`.includes(e[n-1])?`.${ED}`:`${ED}.`):e,Vge=e=>{if(!/`[ \t]|\t/.test(e))return e;let t=``,n=0;return kD(e).forEach(({start:r,end:i,fenceLength:a})=>{let o=e.slice(r+a,i-a);t+=`${e.slice(n,r+a)}${/^ +$/.test(o)?OD.repeat(o.length):o.replaceAll(` `,DD)}`,n=i-a}),t+e.slice(n)},Hge=e=>{let t,n=!1;return e.split(`
`).map(e=>{let r=!e.trim();if(t===null&&r&&(t=void 0),t===void 0){let i=kge.find(([t])=>t.test(e));if(i)[,t]=i;else if(!n&&jge.test(e))t=null;else return n=!r,e.includes(` `)?e.replace(Age,e=>e.replaceAll(` `,DD)):e}return t?.test(e)&&(t=void 0),n=!1,`${e.replaceAll(` `,DD)}`}).join(`
`)},Uge=e=>vD(e.includes(`<`)?_D(e,Hge):e,e=>Vge(Bge(Rge(Ige(e))))),AD=e=>e.replace(RegExp(`\\.${ED}|${ED}\\.`,`g`),``).replaceAll(TD,``).replaceAll(``,``).replaceAll(DD,` `).replaceAll(OD,` `),Wge=e=>{if(!/^[ \t]*~{3,}/m.test(e))return e;let t=e.split(`
`);return gD(t).filter(({fence:e})=>e.startsWith(`~`)).forEach(({start:e,end:n,closed:r})=>{let i=t.slice(e+1,r?n:n+1),a=Math.max(2,...i.map(e=>e.match(/^[ \t]*(`*)/)[1].length)),o="`".repeat(a+1);t[e]=t[e].replace(/^([ \t]*)~+([ \t]*[\w-]+)?(.*)$/,(e,t,n,r)=>`${t}${o}${n??``}${r.replaceAll("`",n?``:``)}`),r&&(t[n]=t[n].replace(/^([ \t]*)~+[ \t]*$/,`$1${o}`))}),t.join(`
`)},Gge=e=>!!e.trim()&&!SD.test(e),Kge=e=>/^ {0,3}(?:=+|-+)[ \t]*$/m.test(e)?_D(e,e=>{let t=[];return e.split(`
`).forEach(e=>{let[,n]=e.match(yD)??[],r=t.length;for(;r>0&&Gge(t[r-1]);)--r;let i=t[r-1];if(!n||r===t.length||i!==void 0&&i.trim()&&!bD.test(i)){t.push(e);return}let a=t.splice(r).map(e=>e.trim()).join(` `);t.push(`${n.startsWith(`=`)?`#`:`##`} ${a}`)}),t.join(`
`)}):e,qge=e=>/^>$/m.test(e)?vD(e,e=>e===`>`?`> `:e):e,Jge=e=>/^> $/m.test(e)?vD(e,e=>e===`> `?`>`:e):e,jD={defaultLanguage:`javascript`,defaultTheme:`github-light`,tokenize(e,t){let n=t||this.defaultLanguage;return n===null||BE(n)||!VE()?Tde(e.getTextContent()):ige(e,n)}},Yge=(e,t)=>{let n=t.getElementByKey(e.getKey());if(n===null)return;let r=e.getChildren(),i=r.length;if(i===n.__cachedChildrenLength)return;n.__cachedChildrenLength=i;let a=`1`,o=1;for(let e=0;e<i;e+=1)u_(r[e])&&(o+=1,a+=`\n${o}`);n.setAttribute(`data-gutter`,a)},MD=(e,t)=>vC(e)&&vC(t)&&e.__text===t.__text&&e.__highlightType===t.__highlightType&&e.__style===t.__style||Oh(e)&&Oh(t)||u_(e)&&u_(t),Xge=(e,t)=>{let n=0;for(;n<e.length&&MD(e[n],t[n]);)n+=1;let r=e.length,i=t.length,a=Math.min(r,i)-n,o=0;for(;o<a;)if(o+=1,!MD(e[r-o],t[i-o])){--o;break}return{from:n,to:r-o,nodesForReplacement:t.slice(n,i-o)}},Zge=(e,t)=>{let n=iv(e);if(!lC(n)||!n.isAttached())return;let r=Q();if(!Z(r)){t();return}let{anchor:i}=r,a=i.getNode();if(a!==n&&!n.isParentOf(a)){t();return}let o=i.offset,s=i.type===`element`&&u_(n.getChildAtIndex(i.offset-1)),c=0;if(s||(c=o+a.getPreviousSiblings().reduce((e,t)=>e+t.getTextContentSize(),0)),!t())return;if(s){i.getNode().select(o,o);return}let l=n.getChildren();for(let e=0;e<l.length;e+=1){let t=l[e];if(X(t)){let e=t.getTextContentSize();if(e>=c){t.select(c,c);return}c-=e}else if(u_(t)){if(c===0){n.select(e,e);return}--c}}n.select(l.length,l.length)},ND=(e,t,n,r)=>{let i=r.getKey(),{nodesCurrentlyHighlighting:a}=n,o=r.getLanguage();!o&&t.defaultLanguage!==null&&(o=t.defaultLanguage,r.setLanguage(o));let s=r.getTheme();s||(s=t.defaultTheme,r.setTheme(s));let c=!o||BE(o),l=!1;c||!o||ege()?r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1):VE()?(XE(s)||(ZE(s,e,i),l=!0),HE(o)?r.getIsSyntaxHighlightSupported()||r.setIsSyntaxHighlightSupported(!0):(!YE(o,e,i)&&r.getIsSyntaxHighlightSupported()&&r.setIsSyntaxHighlightSupported(!1),l=!0)):(GE(e,i),l=!0),!l&&(a.has(i)?n.pendingRefresh.has(i)||(n.pendingRefresh.add(i),Lv(()=>{n.pendingRefresh.delete(i),e.update(()=>{let e=iv(i);lC(e)&&e.markDirty()},{tag:EE(e,[`history-merge`])})})):(a.add(i),n.didTransform||(n.didTransform=!0,Lv(()=>{n.didTransform=!1,a.clear()})),Zge(i,()=>{let e=iv(i);if(!lC(e)||!e.isAttached())return!1;let n=e.getLanguage()||t.defaultLanguage,a=t.tokenize(e,n??void 0),{from:o,to:s,nodesForReplacement:c}=Xge(e.getChildren(),a);return o!==s||c.length?(r.splice(o,s-o,c),!0):!1})))},PD=(e,t,n,r)=>{let i=r.getParent();lC(i)?ND(e,t,n,i):vC(r)&&r.replace(wh(r.__text))},Qge=(e,t=jD)=>{if(!e.hasNodes([sC,hC]))throw Error(`CodeNode or CodeHighlightNode not registered on editor`);let n=[];e._headless!==!0&&n.push(e.registerMutationListener(sC,t=>{e.read(`latest`,()=>{t.forEach((t,n)=>{if(t!==`destroyed`){let t=iv(n);t!==null&&Yge(t,e)}})})},{skipInitialization:!1}));let r={didTransform:!1,nodesCurrentlyHighlighting:new Set,pendingRefresh:new Set};return n.push(e.registerNodeTransform(sC,ND.bind(null,e,t,r)),e.registerNodeTransform(bh,PD.bind(null,e,t,r)),e.registerNodeTransform(hC,PD.bind(null,e,t,r)),Vde(e)),Bb(...n)},$ge=e=>e.replace(/^( {0,3})(#{1,6}(?=[ \t]|$)|[-+](?=[ \t]|$)|>|=+[ \t]*$|-{2,}[ \t]*$)/,`$1\\$2`).replace(/^( {0,3}\d{1,9})([.)])(?=[ \t]|$)/,`$1\\$2`),FD=e=>!!e&&/[^\s\p{P}\p{S}]/u.test(e),e_e=e=>e.replace(/((?:\\_)+)|\\(.)/gs,(e,t,n,r,i)=>{if(t)return FD(i[r-1])&&FD(i[r+e.length])?t.replaceAll(`\\`,``):e;if(n===`\\`){let t=i[r+2];return t&&!/[\n\r!-/:-@[-`{-~]/.test(t)?n:e}return e}).replace(/&#32;/g,` `),t_e=e=>{if(!e.hasFormat(`italic`))return!1;let t=e=>X(e)&&e.hasFormat(`italic`),n=e,r=e;for(;t(n.getPreviousSibling());)n=n.getPreviousSibling();for(;t(r.getNextSibling());)r=r.getNextSibling();let i=n.getTextContent(),a=r.getTextContent(),o=/^\s/.test(i)?` `:n.getPreviousSibling()?.getTextContent().at(-1),s=/\s$/.test(a)?` `:r.getNextSibling()?.getTextContent()[0];return FD(o)||FD(s)},ID=``,LD={dependencies:[],export:(e,t,n)=>{if(!X(e)||e.hasFormat(`code`))return null;let r=e.getTextContent();if(e.getFormat()&&/^\s+$/.test(r))return`${n(bT(e),ID).replace(ID,``)}${r}`;let i=Dge(e),a=n(bT(e),i===void 0?r:ID);if(t_e(e)&&(a=a.replace(/\\.|_/gs,e=>e===`_`?`*`:e)),i!==void 0)return a.replace(ID,()=>i);a=e_e(a);let o=e.getParent(),s=e.getPreviousSibling();return!o||o.isInline()||[`code`,`heading`].includes(o.getType())||s&&!u_(s)?a:$ge(a)},regExp:/(?!)/,type:`text-match`},RD=/\s/,zD=/[!"#$%&'()*+,\-./:;<=>?@[\]^_`{|}~]/,n_e=(e,t)=>{let n=0;for(;e[t-n-1]===`\\`;)n+=1;return n%2==1},BD=(e,t,n,r)=>{let i=e[t-1],a=e[t+n],[o,s]=r?[a,i]:[i,a];return o===void 0||RD.test(o)?!1:!zD.test(o)||s===void 0||RD.test(s)||zD.test(s)},VD=(e,t,n,r)=>{if(!BD(e,t,n,r))return!1;if(e[t]!==`_`||!BD(e,t,n,!r))return!0;let i=r?e[t-1]:e[t+n];return i!==void 0&&zD.test(i)},r_e=(e,t,n)=>{let r=[],i=0,a=0;for(;a<e.length;){for(;i<n.length&&n[i].end<=a;)i+=1;let o=e[a],s=n[i];if(s&&s.start<=a)a=s.end;else if(!t.has(o)||n_e(e,a))a+=1;else{let t=1;for(;e[a+t]===o;)t+=1;let n=VD(e,a,t,!0),i=VD(e,a,t,!1);(n||i)&&r.push({char:o,index:a,length:t,canOpen:n,canClose:i,active:!0}),a+=t}}return r},i_e=(e,t)=>{let n={},r=[],i=0;for(;i<e.length;){let a=e[i];if(!a.active||!a.canClose||!a.length)i+=1;else{let o=`${a.char}${a.canOpen}${a.length%3}`,s=n[o]??-1,c=!1;for(let n=i-1;n>s&&!c;--n){let o=e[n],s=o.active&&o.canOpen&&o.length>0&&o.char===a.char&&(!o.canClose&&!a.canOpen||(o.length+a.length)%3!=0||o.length%3==0||a.length%3==0),l=Math.min(o.length,a.length),u=s?t.filter(e=>e[0]===o.char&&e.length<=l).sort((e,t)=>t.length-e.length)[0]:void 0;if(u){c=!0,r.push({start:o.index+o.length-u.length,end:a.index+u.length});for(let t=n+1;t<i;t+=1)e[t].active=!1;o.length-=u.length,a.length-=u.length,o.active=o.length>0,a.length>0?a.index+=u.length:(a.active=!1,i+=1)}}c||(n[o]=i-1,a.active=a.canOpen,i+=1)}}return r},a_e=(e,t)=>{let n=new Set(e.map(e=>e[0])),r=t.flatMap(({importRegExp:e})=>e?[new RegExp(e.source,`${e.flags.replace(`g`,``)}g`)]:[]),i,a=t=>{let i=kD(t),[a]=i;if(!a)return;let o=i_e(r_e(t,n,i),e),s=({start:e,end:t})=>e<=a.start&&t>=a.end,[c]=[...o].sort((e,t)=>e.start-t.start||t.end-e.end);if(!c||s(c))return;let[l]=o.filter(s).sort((e,t)=>e.start-t.start);if(l&&!r.some(e=>[...t.matchAll(e)].some(({0:{length:e},index:t})=>t<l.start&&t+e>l.start)))return l.start};return e=>(i?.text!==e&&(i={text:e,index:a(e)}),i.index)},o_e=e=>{let t=e.filter(e=>e.type===`text-format`).map(e=>e.tag);if(!t.includes("`"))return e;let n=a_e(t.filter(e=>e!=="`"),e.filter(e=>e.type===`text-match`));return[{dependencies:[],export:()=>null,importRegExp:Object.assign(/(?!)/,{[Symbol.match]:e=>{let t=n(e);return t===void 0?null:Object.assign([e.slice(t)],{index:t,input:e})}}),regExp:/(?!)/,replace:e=>e,type:`text-match`},...e.map(e=>{if(e.type!==`text-match`)return e;let{getEndIndex:t}=e;return{...e,getEndIndex:(e,r)=>{let i=t?t(e,r):(r.index??0)+r[0].length,a=n(e.getTextContent());return i!==!1&&a!==void 0&&i<=a?!1:i}}})]},s_e={dependencies:[Kx],export:e=>Jx(e)?`***`:null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,t,n,r)=>{let i=qx();r||e.getNextSibling()!==null?e.replace(i):e.insertBefore(i),i.selectNext()},type:`element`},c_e=()=>{let e=Q();return Z(e)?Ky(e.anchor.getNode(),e=>$(e)&&!e.isInline())?.getFormatType()??``:``},HD=e=>{let t=Q()??ag();t&&!Q()&&pv(t.clone());let n=Z(t)?t.anchor.getNode():null;return M_(n)&&n.isEmpty()&&n_(n.getParent())?n.replace(e):tx(e)},l_e=()=>{let e=HD(qx()),t=e.getNextSibling();return $(t)?t.selectStart():e.insertAfter(j_()).selectStart(),e},UD=e=>{let t=Number(e);return Number.isInteger(t)&&t>=1&&t<=50?t:void 0},u_e=(e,t)=>{let n=`| ${Array(t).fill(``).join(` | `)} |`;return[n,`| ${Array(t).fill(`---`).join(` | `)} |`,...Array(e-1).fill(n)].join(`
`)},WD=e=>{let t=e.closest(`table`);return!!t&&getComputedStyle(t).direction===`rtl`},GD=e=>e?Ky(e,MT):null,KD=()=>{let e=Q();return!Z(e)&&!qT(e)?null:GD(e.focus.getNode())?.getKey()??null},d_e=(e,t)=>{let n=Q()??ag();return(Z(n)||qT(n))&&uE(n.anchor.getNode())?!1:(HD(Fme(e,t,{rows:!0,columns:!1})).getFirstChildOrThrow().getFirstChildOrThrow().selectStart(),!0)},f_e=e=>{!e.getNextSibling()&&n_(e.getParent())&&e.insertAfter(j_())},p_e=e=>{e.getChildren().forEach((e,t)=>{if(!IT(e))return;let n=t===0?OT.ROW:OT.NO_STATUS;e.getChildren().forEach(e=>{MT(e)&&e.getHeaderStyles()!==n&&e.setHeaderStyles(n)})})},m_e=e=>{let t=e.getPreviousSibling(),n=e.getNextSibling();$(t)?t.selectEnd():$(n)?n.selectStart():e.insertAfter(j_()).selectStart()},h_e=e=>e===`delete-row`||e===`delete-column`,g_e=(e,t)=>{let n=Q(),[r,i]=[n.anchor,n.focus].map(e=>GD(e.getNode())).map(e=>t===`delete-row`?e.getParentOrThrow().getIndexWithinParent():e.getIndexWithinParent()).sort((e,t)=>e-t);return i-r+1===(t===`delete-row`?e.getChildrenSize():e.getColumnCount())},__e=(e,t,{rtl:n=!1}={})=>{let r=iv(t);if(!MT(r))return!1;let i=uE(r),a=Q()??ag();return(Z(a)||qT(a))&&uE(a.anchor.getNode())?.is(i)&&uE(a.focus.getNode())?.is(i)?Q()||pv(a.clone()):r.selectStart(),e===`delete-table`||h_e(e)&&g_e(i,e)?(m_e(i),i.remove()):e===`delete-row`?zme():e===`delete-column`?Bme():e===`insert-row-above`||e===`insert-row-below`?Lme(e===`insert-row-below`):Rme(e===`insert-column-right`!==n),!0},qD=/^(?:\|)(.+)(?:\|)\s?$/,v_e=/^(?:\|[ \t]*:?-+:?[ \t]*)+\|\s?$/,y_e=e=>{let t=e.getFirstChild();return IT(t)?t.getChildrenSize():0},JD=(e,t)=>{e=e.trim().replace(/\\n/g,`
`).replace(/\\\|/g,`|`);let n=jT(OT.NO_STATUS);return eme(e,t,n),n},YD=(e,t)=>{let[,n]=e.match(qD)??[];return n?n.split(/(?<=(?<!\\)(?:\\\\)*)\|/).map(e=>JD(e,t)):null},b_e=(e=[])=>{let t=[...e,...pT.map(e=>e===fT?lme:e),ime,hD,mD],n=[...t,LD];return{dependencies:[vE,PT,kT],export:e=>{if(!bE(e))return null;let t=[];return e.getChildren().forEach(e=>{let r=[];if(!IT(e))return;let i=!1;e.getChildren().forEach(e=>{MT(e)&&(r.push(tme(n,e).replace(/\|/g,`\\|`).replace(/\n/g,`\\n`).trim()),e.__headerState===OT.ROW&&(i=!0))}),t.push(`| ${r.join(` | `)} |`),i&&t.push(`| ${r.map(()=>`---`).join(` | `)} |`)}),t.join(`
`)},regExp:qD,replace:(e,n,[r])=>{if(v_e.test(r)){let t=e.getPreviousSibling();if(!t||!bE(t))return;let n=t.getChildren(),r=n[n.length-1];if(!r||!IT(r))return;r.getChildren().forEach(e=>{MT(e)&&e.setHeaderStyles(OT.ROW,OT.ROW)}),e.remove();return}let i=YD(r,t);if(!i)return;let a=[i],o=e.getPreviousSibling(),s=i.length;for(;o&&M_(o)&&o.getChildrenSize()===1;){let e=o.getFirstChild();if(!X(e))break;let n=YD(e.getTextContent(),t);if(!n)break;s=Math.max(s,n.length),a.unshift(n);let r=o.getPreviousSibling();o.remove(),o=r}let c=yE();a.forEach(e=>{let n=FT();c.append(n);for(let r=0;r<s;r+=1)n.append(r<e.length?e[r]:JD(``,t))});let l=e.getPreviousSibling();bE(l)&&y_e(l)===s?(l.append(...c.getChildren()),e.remove()):e.replace(c),c.selectEnd()},type:`element`}},x_e=200,S_e=`input, textarea, select, button, a[href], label, summary, video[controls], audio[controls], [tabindex], [draggable="true"], [contenteditable]:not([contenteditable="false"])`,C_e=e=>{if(!(e instanceof Element))return!1;let t=e.closest(`[data-lexical-decorator]`);if(!t)return!1;let n=e.closest(S_e);return!n||!t.contains(n)},w_e=()=>{let e=Q();if(!Z(e)||!e.isCollapsed()||e.anchor.type!==`element`)return!1;let t=dv();if(!e.anchor.getNode().is(t))return!1;let{offset:n}=e.anchor,r=t.getChildAtIndex(n-1),i=t.getChildAtIndex(n);if($(i))i.selectStart();else if($(r))r.selectEnd();else{let e=j_();r?r.insertAfter(e):i?i.insertBefore(e):t.append(e),e.select()}return!0},XD=(e,t,n)=>{e.getRootElement()?.focus({preventScroll:!0}),e.update(()=>{n(cv(t))})},ZD=(e,t)=>{XD(e,t,e=>{e_(e)&&(e.selectNext(),w_e())})},T_e=(e,t)=>{XD(e,t,e=>{$(e)&&e.selectEnd()})},E_e=(e,t)=>{let{target:n,button:r,shiftKey:i,clientY:a}=t,o=e.getRootElement();if(!o||!e.isEditable()||t.defaultPrevented||r!==0||i||!(n instanceof Element))return!1;if(C_e(n)){let r=n.closest(`[data-lexical-decorator]`);return r.parentElement?.closest(`[data-lexical-editor]`)===o&&(t.preventDefault(),ZD(e,r),!0)}if(n!==o)return!1;let s=[...o.children].filter(e=>!e.hasAttribute(`data-lexical-decorator-boundary`)).findLast(e=>e.getBoundingClientRect().top<=a);return s?s.hasAttribute(`data-lexical-decorator`)?(t.preventDefault(),ZD(e,s),!0):a<=s.getBoundingClientRect().bottom?!1:(t.preventDefault(),T_e(e,s),!0):!1},D_e=[`http`,`https`,`mailto`,`sms`,`tel`],QD=e=>{let t=e.replace(/[\u0000-\u0020]/g,``);if(/^[^/?#]*[&\\]/.test(t))return!1;let n=/^([a-z][a-z\d+.-]*):/i.exec(t)?.[1];return!n||D_e.includes(n.toLowerCase())},$D=e=>e instanceof Zg?e:ex(e,Zg),O_e=()=>{let e=Q();if(!Z(e))return{blockNodeKey:null,blockType:`paragraph`,inlineTypes:[],tableCellKey:KD(),alignment:``};let t=e.anchor.getNode(),n=null,r=dme.filter(t=>e.hasFormat(t));t.getType()!==`root`&&(n=$D(t),IC(n)&&(r.push(`link`),n=n.getParent()),ew(n)&&(n=ex(n,nw)));let i=(()=>{if(!n)return`paragraph`;if(Vw(n))return`heading-${n.getTag().match(/\d/)?.[0]}`;if(ow(n))return n.getListType()===`bullet`?`bulleted-list`:`numbered-list`;if(Iw(n))return`blockquote`;if(lC(n)||vC(n))return`code-block`;let e=n.getType();return wT.includes(e)?e:`paragraph`})();return{blockNodeKey:n?.getKey()??null,blockType:i,inlineTypes:r,tableCellKey:KD(),alignment:c_e()}},eO=e=>Jge(tme([...e.filter(({tag:e})=>!hme.includes(e)),LD]).replace(/\n+$/,``)),tO=(e,t,n,r=`markdown`)=>{let i=n??(r===`html`?uD(e):eO(t));return e.getRootElement()?.dispatchEvent(new CustomEvent(`Update`,{detail:{value:i,selection:O_e()}})),i},k_e=({node:e,createNode:t,transformer:n,createMarkdown:r})=>{if(r)return r().trim();let i=F_({namespace:`component`,nodes:e?[e]:[],onError:e=>{throw e}}),a=``;try{i.update(()=>{let e=t();dv().append(e.isInline()?j_().append(e):e),a=tO(i,[n])},{discrete:!0})}catch{}return a.trim()},nO=(...e)=>{let t=e.filter(e=>typeof e==`function`);return()=>{t.forEach(e=>e())}},A_e=(e,t)=>nO(e.registerCommand(Bp,e=>{let t=Q();if(!e||!Z(t)||!t.isCollapsed())return!1;let{offset:n}=t.anchor,r=t.anchor.getNode(),i=lC(r)?r:ex(r,sC);return!!i&&n===0&&(r.is(i)||!!i.getFirstDescendant()?.is(r))},1),e.registerCommand(im,t=>Z(Q())?(t?.preventDefault(),e.dispatchCommand(Hp,void 0)):!1,2),e.registerNodeTransform(t_,e=>{let n=e.getChildren();if(n.length===1&&lC(n[0]))return;let[r]=n;if(n.length===1&&$(r)){let e=cC(t);r.replace(e,!0)}else if(n.length===0){let n=cC(t);e.append(n),n.selectStart()}})),j_e=e=>nO(e.registerNodeTransform(PC,e=>{QD(e.getURL())||hue(e)}),e.registerCommand(RC,e=>{let t=typeof e==`string`?e:e?.url??null;return t!==null&&!QD(t)||Zde(t===null?null:e),!0},2),e.registerCommand(Wp,t=>{let n=Q();if(!Z(n)||!nx(t,ClipboardEvent)||!t.clipboardData||t.target.matches(`input, textarea`))return!1;let r=t.clipboardData.getData(`text`).trim();return!wE(r)||!QD(r)?!1:(n.isCollapsed()&&pg([wh(r)]),!n.getNodes().some(e=>$(e)||X(e)&&!e.isSimpleText())&&(e.dispatchCommand(RC,r),t.preventDefault(),!0))},1)),M_e=[[`bulleted-list`,sw,`bullet`],[`numbered-list`,cw,`number`]],N_e=(e,t=[])=>{let n=M_e.filter(([e])=>t.includes(e));return nO(...n.map(([,t,n])=>e.registerCommand(t,()=>(nfe(n),!0),2)),n.length?e.registerCommand(Hp,()=>afe(),2):void 0)},P_e=(e,t,n)=>{let r=0,i=!0,a,o=!1;return nO(()=>{o=!0},e.registerUpdateListener(({dirtyElements:s,dirtyLeaves:c}={})=>{if(i||=!s||s.size>0||c.size>0,e?.isComposing())return;r+=1;let l=r;(async()=>{await pl(100),!(l!==r||o)&&e.update(()=>{a=tO(e,t,i?void 0:a,n),i=!1})})()}))},F_e=e=>e.registerRootListener(t=>{if(!t)return;let n=t=>{e.update(()=>{if(t.key===`Tab`){let n=Q();if(!Z(n))return;let r=$D(n.anchor.getNode());ew(r)&&r.canIndent()&&(t.shiftKey?r.getIndent()>0&&(t.preventDefault(),e.dispatchCommand(fm,void 0)):(t.preventDefault(),e.dispatchCommand(dm,void 0)))}})};return t.addEventListener(`keydown`,n),()=>{t.removeEventListener(`keydown`,n)}}),I_e=e=>{let t=e=>e===void 0?e:AD(e);return Object.assign(e.map(t),{index:e.index,input:e.input,groups:e.groups?Object.fromEntries(Object.entries(e.groups).map(([e,n])=>[e,t(n)])):void 0})},rO=(e,t)=>Object.assign(new RegExp(e),{[Symbol.match]:n=>{let r=+!!n.startsWith(``),i=n.slice(r).match(e);return!i||!r||(i.input=n,t&&i.index===0?i[0]=`${i[0]}`:i.index+=r),i}}),L_e=e=>Array.isArray(e)?`index`in e?I_e(e):e.every(e=>typeof e==`string`)?e.map(e=>AD(e)):e:e,R_e=e=>{let{type:t,handleImportAfterStartMatch:n,importRegExp:r,regExp:i,regExpStart:a,regExpEnd:o,replace:s}=e,c={};return n&&(c.handleImportAfterStartMatch=e=>n({...e,lines:e.lines.map(e=>AD(e))})),r&&(c.importRegExp=rO(r,!1)),t===`element`&&i&&(c.regExp=rO(i,!0)),a&&(c.regExpStart=rO(a,!0)),o instanceof RegExp?c.regExpEnd=rO(o,!0):o?.regExp&&(c.regExpEnd={...o,regExp:rO(o.regExp,!0)}),s&&(c.replace=(...e)=>s(...e.map(L_e))),{...e,...c}},z_e=({enabledButtons:e=[],components:t=[],useMarkdownShortcuts:n,isCodeEditor:r=!1,defaultLanguage:i=`plain`,format:a=`markdown`})=>{let o=e.includes(`code-block`)||r,s=e.includes(`table`)&&!r,c=e.includes(`horizontal-rule`)&&!r,l=eue({name:`@sveltia/ui/editor`,namespace:`editor`,dependencies:[...o?[Bde]:[],...s?[tue(Nhe,{hasCellMerge:!1,hasCellBackgroundColor:!1,hasHorizontalScroll:!0,hasTabHandler:!0})]:[],...c?[Iue]:[]],$initialEditorState:null,nodes:[...t.map(({node:e})=>e),...new Set(Object.entries(pme).filter(([t])=>e.includes(t)).flatMap(([,e])=>e)),...r?[sC,hC]:[Kx,vE,kT,PT]],theme:ume,html:a===`html`?{export:hge,import:{...bge,...o?xge:{}}}:void 0,onError:e=>{console.error(e)}}),u=t.map(({transformer:e})=>R_e(e)),d=[...u,...r?[]:[hD],...new Set(Object.entries(mme).filter(([t])=>e.includes(t)).flatMap(([,e])=>e)),...r?[vT]:[s_e,b_e(u.filter(({type:e})=>e===`text-match`)),mD]],f=Eue(l);rD.set(f,t);let p=nO(Jfe(f),Afe(f),xme(f,Sme(),1e3,void 0,void 0,x_e),r?A_e(f,i):void 0,n?$pe(f,d):void 0,o?Qge(f,{...jD,defaultLanguage:i,defaultTheme:PE()}):void 0,o?Zhe(f):void 0,e.includes(`link`)?j_e(f):void 0,s?f.registerNodeTransform(vE,e=>{f_e(e),a===`markdown`&&p_e(e)}):void 0,N_e(f,e),P_e(f,d,a),F_e(f));return{editor:f,enabledTransformers:d,dispose:()=>{p(),f.dispose()}}},iO=async e=>{BE(e)||(await GE(),await Promise.all([YE(JE(e)),ZE(PE())]))},aO=new WeakMap,oO=async(e,{languages:t,$import:n,$export:r,formatName:i})=>{let a=(aO.get(e)??0)+1;aO.set(e,a);let o=()=>aO.get(e)!==a;try{await Promise.all(t.map(async e=>iO(e)))}catch(e){if(o())return;throw e}if(o())return;let s=e.getEditorState().isEmpty(),c;if(e.update(()=>{try{n()}catch(e){c=e}},{tag:s?[`sui-import`,`history-merge`]:`sui-import`,discrete:!0}),c)throw Error(`Failed to convert ${i}`,{cause:c});return e.read(r)},B_e=()=>{dv().getAllTextNodes().forEach(e=>{let t=e.getTextContent(),n=AD(Ege(e)??t),r=e.getParent();if(n!==t&&e.setTextContent(n),IC(r)){let e=r.getURL(),t=r.getTitle();AD(e)!==e&&r.setURL(AD(e)),t&&AD(t)!==t&&r.setTitle(AD(t))}})},V_e=async(e,t,n)=>{let r=n.some(e=>`regExpStart`in e&&e.regExpStart===vT.regExpStart),i=n.some(e=>`regExp`in e&&e.regExp===cT.regExp),a=r?Wge(t):t,o=i?Kge(a):a;return oO(e,{languages:[...o.matchAll(/^`{3,}[ \t]*(?<lang>[\w-]+)/gm)].map(({groups:{lang:e=`plain`}={}})=>e),$import:()=>{let e=Fge(o),t=Uge(e);eme(qge(t),o_e(n)),(t!==e||fD.test(t))&&B_e()},$export:()=>eO(n),formatName:`Markdown`})},H_e=async(e,t)=>{let n=new DOMParser().parseFromString(t,`text/html`);return oO(e,{languages:[...n.querySelectorAll(`pre > code`)].map($E).filter(e=>e!==void 0),$import:()=>{let t=Cge(e,n);if(t)throw Error(t.nodeType===Node.COMMENT_NODE?`Unsupported comment`:`Unsupported element: <${t.localName}>`);let r=dv(),i=null;r.clear(),qS(e,n).forEach(e=>{($(e)||e_(e))&&!e.isInline()?(i=null,r.append(e)):(i||(i=j_(),r.append(i)),i.append(e))}),r.isEmpty()&&r.append(j_()),Q()!==null&&r.selectStart()},$export:()=>uD(e),formatName:`HTML`})},sO=async e=>new Promise(t=>{e.focus(()=>{t(void 0)})}),U_e=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`dir`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`]),W_e=B(`<div></div>`),G_e={hash:`svelte-cpk1dw`,code:`.lexical-root.svelte-cpk1dw {overflow:clip;border:1px solid var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius) !important;padding:var(--sui-textbox-multiline-padding);min-height:120px;color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-multiline-line-height);}.lexical-root.svelte-cpk1dw:not(:first-child) {border-start-start-radius:0 !important;border-start-end-radius:0 !important;}.lexical-root.code.svelte-cpk1dw {padding:0;}.lexical-root.code.svelte-cpk1dw .code-block {border-radius:0 !important;min-height:120px;}.lexical-root.svelte-cpk1dw:focus-visible {outline:0;}.lexical-root[aria-invalid=true].svelte-cpk1dw {border-color:var(--sui-error-border-color);}.lexical-root.svelte-cpk1dw :not(.sui):first-child {margin-top:0;}.lexical-root.svelte-cpk1dw :not(.sui):last-child {margin-bottom:0;}.lexical-root.svelte-cpk1dw strong.italic {font-style:italic;}.lexical-root.svelte-cpk1dw .strikethrough {text-decoration:line-through;}.lexical-root.svelte-cpk1dw li.nested {list-style-type:none;}.lexical-root.svelte-cpk1dw .code-block {position:relative;display:block;padding-block:8px;padding-inline-start:56px;padding-inline-end:8px;background-color:var(--sui-code-background-color);overflow-x:auto;white-space:pre;}.lexical-root.svelte-cpk1dw .code-block:not(:first-child) {margin-top:1em;}.lexical-root.svelte-cpk1dw .code-block:not(:last-child) {margin-bottom:1em;}.lexical-root.svelte-cpk1dw .code-block::before {position:absolute;inset-block:0;inset-inline-start:0;inset-inline-end:auto;content:attr(data-gutter);padding:8px;min-width:40px;color:var(--sui-tertiary-foreground-color);background-color:var(--sui-tertiary-background-color);text-align:end;}.lexical-root.svelte-cpk1dw [data-lexical-text=true] {cursor:text;}.lexical-root.svelte-cpk1dw :is(th, td) > p {margin:0;white-space:normal;word-break:normal;}.lexical-root.svelte-cpk1dw .table-wrapper {overflow-x:auto;}.lexical-root.svelte-cpk1dw .table-wrapper:not(:first-child) {margin-top:1em;}.lexical-root.svelte-cpk1dw .table-wrapper:not(:last-child) {margin-bottom:1em;}.lexical-root.svelte-cpk1dw :is(th, td) {min-width:80px;vertical-align:top;text-align:start;}.lexical-root.svelte-cpk1dw th {background-color:var(--sui-secondary-background-color);}.lexical-root.svelte-cpk1dw :is(th, td).selected {background-color:var(--sui-selected-background-color);}.lexical-root.svelte-cpk1dw .table-selection ::selection {background-color:transparent;}.lexical-root.svelte-cpk1dw hr {margin:var(--sui-paragraph-margin) 0;border:none;padding:0;}.lexical-root.svelte-cpk1dw hr.selected {outline:2px solid var(--sui-primary-accent-color);outline-offset:4px;}.lexical-root.svelte-cpk1dw hr::after {display:block;height:2px;background-color:var(--sui-control-border-color);line-height:2px;content:"";}`};function cO(e,t){O(t,!0),K(e,G_e);let n=J(t,`dir`,3,void 0),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`readonly`,3,!1),o=J(t,`required`,3,!1),s=J(t,`invalid`,3,!1),c=ks(t,U_e),l=si(`editorStore`),u=j(void 0),d=A(()=>!(i()||a()));L(()=>{l.editor?.setEditable(z(d))}),L(()=>{let{editor:e}=l,t=n()===`ltr`||n()===`rtl`?n():null;e&&e.getEditorState().read(()=>dv().getDirection())!==t&&e.update(()=>{dv().setDirection(t)},{tag:`history-merge`})});let f=e=>{let{hasConverterError:t,useRichText:n,inputValue:r}=l;if(l.pending=!1,t||!n||l.importing)return;let{value:i,selection:a}=e.detail,o=l.getImportedValue(i)??i;r!==o&&(l.useRichText=!1,l.inputValue=o,l.useRichText=!0),l.selection=a},p=e=>{e.target?.closest(`a`)&&e.preventDefault()},m=e=>{l.editor&&E_e(l.editor,e)},h=e=>!!e&&!e.contains(z(u)??null),g=({target:e})=>{let t=e;z(u)?.contains(t)?fo(()=>{l.componentHasFocus=t!==z(u)}):t instanceof Element&&h(t.closest(`dialog`))||fo(()=>{l.componentHasFocus=!1})},_=({relatedTarget:e})=>{e||queueMicrotask(()=>{document.activeElement===document.body&&![...document.querySelectorAll(`:modal`)].some(h)&&(l.componentHasFocus=!1)})};js(()=>{let{editor:e,enabledTransformers:t,dispose:n}=z_e(l.config);l.editor=e,l.enabledTransformers=t,z(u)?.addEventListener(`Update`,f),z(u)?.addEventListener(`click`,p),z(u)?.addEventListener(`mousedown`,m),document.addEventListener(`focusin`,g),document.addEventListener(`focusout`,_);let r=e.registerUpdateListener(({dirtyElements:e,dirtyLeaves:t,tags:n})=>{(e.size||t.size)&&!n.has(`sui-import`)&&!n.has(`history-merge`)&&(l.pending=!0)});return()=>{r(),z(u)?.removeEventListener(`Update`,f),z(u)?.removeEventListener(`click`,p),z(u)?.removeEventListener(`mousedown`,m),document.removeEventListener(`focusin`,g),document.removeEventListener(`focusout`,_),n(),e.setRootElement(null),l.initialized=!1,l.editor=void 0}}),L(()=>{l.editor&&z(u)&&(l.editor.setRootElement(z(u)),l.initialized=!0)});var v=W_e();bs(v,()=>({...c,role:`textbox`,"aria-multiline":`true`,"aria-hidden":r(),"aria-disabled":i(),"aria-readonly":a(),"aria-required":o(),"aria-invalid":s(),class:`lexical-root`,id:`${l.editorId}-lexical-root`,contenteditable:z(d),hidden:r(),[ms]:{code:l.config.isCodeEditor}}),void 0,void 0,void 0,`svelte-cpk1dw`),Ds(v,e=>M(u,e),()=>z(u)),U(e,v),k()}var lO=()=>{let e=bl(`editor`),t=j(!1),n=j(void 0),r=j(ta([])),i=j(ta({modes:[],enabledButtons:[],components:[],useMarkdownShortcuts:!0,isCodeEditor:!1,useEmojiAutocomplete:!1})),a=j(``),o=j(ta({blockNodeKey:null,blockType:`paragraph`,inlineTypes:[]})),s=j(!0),c=j(void 0),l=j(0),u=j(!1),d=j(!1),f=j(!1),p=j(!1),m=j(0),h,g=0,_=!1,v=e=>{M(d,e,!0),e&&(M(s,!1),M(f,!0))},y=async()=>{if(!z(n)||!z(t))return;let e=z(a);g+=1;let o=g;_=!0;try{let t=z(i).format===`html`?await H_e(z(n),z(a)||``):await V_e(z(n),z(a)||``,z(r));t!==void 0&&(h={source:e,exported:t})}catch(t){v(!0),M(a,e,!0),console.error(t)}finally{o===g&&(_=!1)}};return{get editor(){return z(n)},set editor(e){M(n,e,!0)},set enabledTransformers(e){M(r,e,!0)},get enabledTransformers(){return z(r)},get initialized(){return z(t)},set initialized(e){M(t,e,!0)},get config(){return z(i)},set config(e){M(i,e,!0),M(s,e.modes[0]===`rich-text`||e.isCodeEditor,!0)},get inputValue(){return z(a)},set inputValue(e){let t=z(a)!==e;t&&M(a,e,!0),z(s)&&(t||z(n)?.getEditorState().isEmpty())&&y()},get selection(){return z(o)},set selection(e){M(o,e,!0)},get controlId(){return z(s)?`${e}-lexical-root`:`${e}-plain-text`},get textArea(){return z(c)},set textArea(e){M(c,e,!0)},get toolbarHeight(){return z(l)},set toolbarHeight(e){M(l,e,!0)},get componentHasFocus(){return z(u)},set componentHasFocus(e){M(u,e,!0)},get useRichText(){return z(s)},set useRichText(e){M(s,e,!0)},get hasConverterError(){return z(d)},set hasConverterError(e){v(e)},get showConverterError(){return z(f)},set showConverterError(e){M(f,e,!0)},get pending(){return z(p)||z(m)>0},set pending(e){M(p,e,!0)},get importing(){return _},editorId:e,convertToLexical:y,startOperation:()=>{M(m,z(m)+1);let e=!1;return()=>{e||(e=!0,M(m,z(m)-1))}},getImportedValue:e=>h?.exported===e?h.source:void 0}},K_e=B(`<!> <!>`,1);function uO(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=Ihe.map(({id:e,name:t,aliases:n=[]})=>({key:e,label:t,aliases:n})),i=si(`editorStore`),a=j(`plain`),o=A(()=>r.find(({key:e,aliases:t})=>e===z(a)||t.includes(z(a)))?.key??`plain`),s=()=>{let{blockNodeKey:e}=i.selection,t=i.config.isCodeEditor?dv().getChildren()[0]:e?iv(e):null;return lC(t)?t:null},c=async e=>{let{editor:t}=i;if(!t||z(o)===e)return;let n=i.startOperation();try{await sO(t),await iO(e),t.update(()=>{let t=s();t&&(t.setLanguage(e),M(a,e,!0))},{tag:EE(t)})}finally{n()}};L(()=>{i.selection.blockNodeKey,i.editor?.read(()=>{let e=s();e&&M(a,e.getLanguage()??i.config.defaultLanguage??`plain`,!0)})});{let t=A(()=>Y(`_sui.text_editor.language`));Hu(e,{get disabled(){return n()},get ariaLabel(){return z(t)},get value(){return z(o)},onChange:({detail:{value:e}})=>{c(e)},children:(e,t)=>{var n=K_e(),i=P(n);{let e=A(()=>Y(`_sui.text_editor.plain_text`));Tu(i,{get label(){return z(e)},value:`plain`,dir:`ltr`})}Bo(I(i,2),17,()=>r,({key:e,label:t})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).label;{let t=A(()=>n()===z(o));Tu(e,{get label(){return r()},get value(){return n()},get selected(){return z(t)},dir:`ltr`})}}),U(e,n)},$$slots:{default:!0}})}k()}var q_e=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`orientation`,`variant`,`ariaLabel`,`children`]),J_e=B(`<div><div role="none" class="inner svelte-13z6f1m"><!></div></div>`),Y_e={hash:`svelte-13z6f1m`,code:`[role=toolbar].svelte-13z6f1m {--toolbar-size: var(--sui-secondary-toolbar-size);flex:none !important;display:flex;align-items:center;padding-inline:8px;background-color:var(--toolbar-background-color, transparent);}[role=toolbar].primary.svelte-13z6f1m {--toolbar-size: var(--sui-primary-toolbar-size);}
@media (width < 768px) {[role=toolbar].secondary.svelte-13z6f1m {padding-inline:0;}
}[role=toolbar][aria-orientation=horizontal].svelte-13z6f1m {height:var(--toolbar-size);}[role=toolbar][aria-orientation=vertical].svelte-13z6f1m {flex-direction:column;width:var(--toolbar-size);}[role=toolbar].svelte-13z6f1m button[role=button]:is([aria-pressed=true], [aria-checked=true]) {background-color:var(--sui-selected-background-color);}[role=toolbar].svelte-13z6f1m h2 {flex:auto;display:flex;align-items:center;gap:8px;margin:0;padding-inline-end:12px;min-width:0;font-size:var(--sui-font-size-x-large);}[role=toolbar].svelte-13z6f1m h2:first-child {padding-inline-start:12px;}[role=toolbar].svelte-13z6f1m h2 span:not(.sui.truncated-text) {font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-normal, normal);opacity:0.8;}[role=toolbar].svelte-13z6f1m .divider[aria-orientation=horizontal] {margin:0 4px;width:calc(100% - 8px);}[role=toolbar].svelte-13z6f1m .divider[aria-orientation=vertical] {margin:4px 0;height:calc(100% - 8px);}.inner.svelte-13z6f1m {display:contents;}`};function dO(e,t){K(e,Y_e);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`orientation`,3,`horizontal`),a=J(t,`variant`,3,void 0),o=J(t,`ariaLabel`,3,void 0),s=ks(t,q_e);var c=J_e();bs(c,()=>({...s,role:`toolbar`,class:[`sui`,`toolbar`,i(),a(),t.class],hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-orientation":i(),"aria-label":o()}),void 0,void 0,void 0,`svelte-13z6f1m`);var l=N(c);Go(N(l),()=>t.children??kr),D(l),D(c),R(()=>l.inert=r()),U(e,c)}var X_e=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`children`]),Z_e=B(`<div role="none" class="wrapper svelte-1ph2lw"><!></div>`),Q_e={hash:`svelte-1ph2lw`,code:`.wrapper.svelte-1ph2lw {display:contents;}.wrapper.svelte-1ph2lw [role=toolbar] {position:sticky;top:var(--sui-text-editor-toolbar-top, 0px);z-index:var(--sui-text-editor-toolbar-z-index, 100);display:flex;flex-wrap:wrap;gap:4px;border-width:1px 1px 0;border-style:solid;border-color:var(--sui-textbox-border-color);border-start-start-radius:var(--sui-textbox-border-radius);border-start-end-radius:var(--sui-textbox-border-radius);border-end-start-radius:0;border-end-end-radius:0;padding:0 4px;height:auto;min-height:40px;background-color:var(--sui-tertiary-background-color);}.wrapper.svelte-1ph2lw [role=toolbar][aria-disabled=true] {filter:none;}.wrapper.svelte-1ph2lw .sui.menu-button {padding:0 4px;}.wrapper.svelte-1ph2lw .sui.button {flex:none;margin:0 !important;}.wrapper.svelte-1ph2lw .sui.button-group {gap:4px;}`};function fO(e,t){O(t,!0),K(e,Q_e);let n=J(t,`disabled`,3,!1),r=ks(t,X_e),i=si(`editorStore`),a=e=>{let t=new ResizeObserver(([e])=>{i.toolbarHeight=e.borderBoxSize[0].blockSize});return t.observe(e),()=>{t.disconnect(),i.toolbarHeight=0}};var o=Z_e();dO(N(o),As(()=>r,{get disabled(){return n()},[po()]:a,children:(e,n)=>{var r=H();Go(P(r),()=>t.children??kr),U(e,r)},$$slots:{default:!0}})),D(o),U(e,o),k()}function $_e(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=J(t,`readonly`,3,!1);{let t=A(()=>n()||r()),i=A(()=>Y(`_sui.text_editor.code_editor`));fO(e,{get disabled(){return z(t)},get ariaLabel(){return z(i)},children:(e,t)=>{{let t=A(()=>n()||r());uO(e,{get disabled(){return z(t)}})}},$$slots:{default:!0}})}k()}var eve=new Set([`$$slots`,`$$events`,`$$legacy`,`code`,`lang`,`pending`,`showLanguageSwitcher`,`flex`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`ariaLabelledby`,`ariaDescribedby`,`aria-label`,`aria-labelledby`,`aria-describedby`,`children`]),tve=B(`<div><!> <!></div> <!>`,1),nve={hash:`svelte-14lqdrw`,code:`.code-editor.svelte-14lqdrw {margin:var(--sui-focus-ring-width);border-radius:var(--sui-textbox-border-radius);width:calc(100% - var(--sui-focus-ring-width) * 2);transition:all 200ms;}.code-editor.svelte-14lqdrw:focus-within {outline:var(--sui-focus-ring-width) solid var(--sui-focus-ring-color);}.code-editor.flex.svelte-14lqdrw:not([hidden]) {display:block;}.code-editor.svelte-14lqdrw {--sui-text-editor-toolbar-top: var(--sui-text-editor-inner-toolbar-top, 0px);--sui-text-editor-toolbar-z-index: var(--sui-text-editor-inner-toolbar-z-index, 100);}.code-editor.svelte-14lqdrw > * {--sui-text-editor-inner-toolbar-top: calc(
var(--sui-text-editor-toolbar-top) + var(--sui-text-editor-toolbar-height)
);--sui-text-editor-inner-toolbar-z-index: calc(var(--sui-text-editor-toolbar-z-index) - 1);}`};function rve(e,t){O(t,!0),K(e,nve);let n=J(t,`code`,15,``),r=J(t,`lang`,15,`plain`),i=J(t,`pending`,15,!1),a=J(t,`showLanguageSwitcher`,3,!1),o=J(t,`flex`,3,!1),s=J(t,`hidden`,3,!1),c=J(t,`disabled`,3,!1),l=J(t,`readonly`,3,!1),u=J(t,`required`,3,!1),d=J(t,`invalid`,3,!1),f=J(t,`ariaLabel`,3,void 0),p=J(t,`ariaLabelledby`,3,void 0),m=J(t,`ariaDescribedby`,3,void 0),h=J(t,`aria-label`,3,void 0),g=J(t,`aria-labelledby`,3,void 0),_=J(t,`aria-describedby`,3,void 0),v=ks(t,eve),y=A(()=>({"aria-label":f()??h(),"aria-labelledby":p()??g(),"aria-describedby":m()??_()})),b=lO();b.config={...b.config,useMarkdownShortcuts:!1,isCodeEditor:!0,defaultLanguage:r()},ci(`editorStore`,b),L(()=>{i(b.pending)}),L(()=>()=>{i(!1)}),L(()=>{b.initialized&&(n(),r(),fo(()=>{b.inputValue=wse(r(),n())}))}),L(()=>{b.initialized&&(b.inputValue,fo(()=>{let{lang:e,code:t}=Tse(b.inputValue);r()!==e&&r(e),n()!==t&&n(t)}))});var x=tve(),S=P(x);bs(S,()=>({...v,role:`none`,class:`sui code-editor`,hidden:s(),[ms]:{flex:o()},[hs]:{"--sui-text-editor-toolbar-height":`${b.toolbarHeight??``}px`}}),void 0,void 0,void 0,`svelte-14lqdrw`);var C=N(S),w=e=>{$_e(e,{get disabled(){return c()},get readonly(){return l()}})};G(C,e=>{a()&&e(w)}),cO(I(C,2),As(()=>z(y),{get hidden(){return s()},get disabled(){return c()},get readonly(){return l()},get required(){return u()},get invalid(){return d()}})),D(S);var T=I(S,2),ee=e=>{Xu(e,{get show(){return b.showConverterError},set show(e){b.showConverterError=e},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`_sui.text_editor.converter_error`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(T,e=>{b.showConverterError&&e(ee)}),U(e,x),k()}var ive=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`flex`,`dir`,`name`,`autoResize`,`useEmojiAutocomplete`,`highlight`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`]),ave=B(`<span> </span>`),ove=B(`<div aria-hidden="true"></div>`),sve=B(`<div class="clone auto-resize svelte-2z97ez" aria-hidden="true"> </div>`),cve=B(`<div role="none"><textarea></textarea> <!> <!></div>`),lve={hash:`svelte-2z97ez`,code:`.text-area.svelte-2z97ez {position:relative;display:inline-grid;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-multiline-min-width);}.text-area[hidden].svelte-2z97ez {display:none;}.text-area.flex.svelte-2z97ez:not([hidden]) {display:inline-grid;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}:is(textarea.svelte-2z97ez, .clone.svelte-2z97ez) {grid-area:1/1/2/2;display:block;margin:0;border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-multiline-padding);width:100%;min-height:8em;color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-multiline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));text-align:var(--sui-textbox-text-align, start);text-indent:var(--sui-textbox-text-indent, 0);text-transform:var(--sui-textbox-text-transform, none);letter-spacing:var(--sui-textbox-letter-spacing, normal);word-spacing:var(--sui-word-spacing-normal, normal);transition:all 200ms;}:is(textarea:where(.svelte-2z97ez), .clone:where(.svelte-2z97ez)).resizing.svelte-2z97ez {transition-duration:0ms;}.svelte-2z97ez:is(textarea:where(.svelte-2z97ez), .clone:where(.svelte-2z97ez)):focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.svelte-2z97ez:is(textarea:where(.svelte-2z97ez), .clone:where(.svelte-2z97ez)):is(:where(.svelte-2z97ez):disabled, :where(.svelte-2z97ez):read-only):not(.clone) {background-color:var(--sui-disabled-background-color);}textarea.svelte-2z97ez {resize:vertical;}textarea.auto-resize.svelte-2z97ez {overflow:hidden;resize:none;}textarea[aria-invalid=true].svelte-2z97ez {border-color:var(--sui-error-border-color);}.clone.svelte-2z97ez {overflow:hidden;visibility:hidden;}.clone.svelte-2z97ez:not(.auto-resize) {position:absolute;inset:0;min-height:0;scroll-behavior:auto;}.highlighted.svelte-2z97ez textarea:where(.svelte-2z97ez) {z-index:1;caret-color:var(--sui-textbox-foreground-color);color:transparent !important;background-color:transparent !important;}.highlighted.svelte-2z97ez textarea:where(.svelte-2z97ez):not(.auto-resize) {scrollbar-gutter:stable;}.highlighted.svelte-2z97ez textarea:where(.svelte-2z97ez)::placeholder {color:var(--sui-textbox-placeholder-foreground-color, var(--sui-textbox-foreground-color));opacity:var(--sui-textbox-placeholder-opacity, 1);}.highlighted.svelte-2z97ez .clone:where(.svelte-2z97ez) {visibility:visible;pointer-events:none;}.highlighted.svelte-2z97ez .clone:where(.svelte-2z97ez) .bold:where(.svelte-2z97ez) {-webkit-text-stroke:0.03em currentColor;}.highlighted.svelte-2z97ez .clone:where(.svelte-2z97ez) .underline:where(.svelte-2z97ez) {text-decoration-line:underline;}.highlighted.svelte-2z97ez .clone:where(.svelte-2z97ez) .strikethrough:where(.svelte-2z97ez) {text-decoration-line:line-through;}.highlighted.svelte-2z97ez .clone:where(.svelte-2z97ez) .underline.strikethrough:where(.svelte-2z97ez) {text-decoration-line:underline line-through;}.highlighted.svelte-2z97ez .clone:where(.svelte-2z97ez):not(.auto-resize) {scrollbar-gutter:stable;}.highlighted.svelte-2z97ez:focus-within .clone:where(.svelte-2z97ez) {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.highlighted.svelte-2z97ez:is(.disabled:where(.svelte-2z97ez), .readonly:where(.svelte-2z97ez)) .clone:where(.svelte-2z97ez) {background-color:var(--sui-disabled-background-color);}textarea.svelte-2z97ez,
.clone.svelte-2z97ez {white-space:pre-wrap;word-break:normal;overflow-wrap:anywhere;}`};function pO(e,t){O(t,!0),K(e,lve);let n=J(t,`value`,15,``),r=J(t,`element`,15),i=J(t,`flex`,3,!1),a=J(t,`dir`,3,void 0),o=J(t,`name`,3,void 0),s=J(t,`autoResize`,3,!1),c=J(t,`useEmojiAutocomplete`,3,!1),l=J(t,`highlight`,3,void 0),u=J(t,`hidden`,3,!1),d=J(t,`disabled`,3,!1),f=J(t,`readonly`,3,!1),p=J(t,`required`,3,!1),m=J(t,`invalid`,3,!1),h=ks(t,ive),g=A(()=>`${n()}\n`),_=A(()=>{let e=l()?.(n()??``);if(!e)return;let t=e.flatMap(e=>[...e,{content:`
`}]);return t.map(({content:e})=>e).join(``)===z(g)?t:void 0}),v=j(void 0);L(()=>{if(!r()||!z(v)||s())return;let e=r(),t=z(v),n=()=>{t.scrollTop=e.scrollTop,t.scrollLeft=e.scrollLeft};return n(),e.addEventListener(`scroll`,n),()=>{e.removeEventListener(`scroll`,n)}});var y=cve();let b;var x=N(y);Fee(x),bs(x,()=>({...h,dir:a(),name:o(),disabled:d()||void 0,readonly:f()||void 0,"aria-hidden":u(),"aria-disabled":d(),"aria-readonly":f(),"aria-required":p(),"aria-invalid":m(),[ms]:{"auto-resize":s()}}),void 0,void 0,void 0,`svelte-2z97ez`),Ds(x,e=>r(e),()=>r());var S=I(x,2),C=e=>{var t=ove();let n;Bo(t,21,()=>z(_),Ro,(e,t)=>{var n=ave();let r,i;var a=F(n,!0);R(()=>{r=os(n,1,`svelte-2z97ez`,null,r,{bold:z(t).bold,underline:z(t).underline,strikethrough:z(t).strikethrough}),i=cs(n,``,i,{color:z(t).color}),W(a,z(t).content)}),U(e,n)}),D(t),Ds(t,e=>M(v,e),()=>z(v)),R(()=>{n=os(t,1,`clone svelte-2z97ez`,null,n,{"auto-resize":s()}),q(t,`dir`,a()),t.dir=t.dir}),U(e,t)},w=e=>{var t=sve(),n=F(t,!0);R(()=>{q(t,`dir`,a()),W(n,z(g)),t.dir=t.dir}),U(e,t)};G(S,e=>{z(_)?e(C):s()&&e(w,1)});var T=I(S,2),ee=e=>{du(e,{get element(){return r()}})};G(T,e=>{c()&&!d()&&!f()&&e(ee)}),D(y),R(()=>{b=os(y,1,`sui text-area ${t.class??``}`,`svelte-2z97ez`,b,{flex:i(),disabled:d(),readonly:f(),highlighted:!!z(_)}),q(y,`hidden`,u()),x.dir=x.dir}),Vte(x,n),U(e,y),k()}function uve(e,t){O(t,!0);let n=si(`editorStore`),r=j(void 0),i=()=>{let e=Q();if(!Z(e)||!e.isCollapsed()||e.hasFormat(`code`))return;let t=e.anchor.getNode();if(!X(t)||!t.isSimpleText()||lC(t.getParent()))return;let{offset:n}=e.anchor,r=cu(t.getTextContent().slice(0,n));if(r===void 0)return;let i=t.getKey();return{id:`${i}:${n-r.length-1}`,query:r,nodeKey:i,offset:n}},a=({query:e})=>{let t=window.getSelection();if(!t?.rangeCount)return;let n=t.getRangeAt(0).cloneRange();try{n.setStart(n.startContainer,Math.max(0,n.startOffset-e.length-1))}catch{}let{top:r,bottom:i,left:a,right:o,width:s,height:c}=n.getBoundingClientRect();return r||i||a||s||c?{top:r,bottom:i,left:a,right:o}:void 0},o=(e,t)=>{let{editor:r}=n,{query:i,nodeKey:a,offset:o}=t,s=o-i.length-1;r?.update(()=>{let t=iv(a);if(!X(t)||t.getTextContent().slice(s,o)!==`:${i}`)return;let n=su(e.emoji,t.getTextContent().slice(o));t.spliceText(s,i.length+1,n,!0)})},s=()=>{let{editor:e}=n;if(!e)return[];let t=e=>t=>z(r)?.isOpen()?(t?.preventDefault(),e(),!0):!1;return[e.registerCommand(rm,t(()=>z(r)?.moveSelection(1)),4),e.registerCommand(nm,t(()=>z(r)?.moveSelection(-1)),4),e.registerCommand(im,t(()=>z(r)?.selectHighlighted()),4),e.registerCommand(lm,t(()=>z(r)?.selectHighlighted()),4),e.registerCommand(sm,t(()=>z(r)?.close(!0)),4),e.registerUpdateListener(({editorState:e})=>{let t;e.read(()=>{t=i()}),z(r)?.update(t)})]};L(()=>{if(!n.editor||!z(r))return;let e=s();return()=>{e.forEach(e=>e()),z(r)?.close()}}),L(()=>{n.useRichText||z(r)?.close()});{let t=A(()=>n.editor?.getRootElement()??void 0);Ds(uu(e,{getAnchorRect:a,onSelect:o,get ariaOwner(){return z(t)}}),e=>M(r,e,!0),()=>z(r))}k()}var dve=B(`<!> <!> <!> <!>`,1),fve=B(`<a class="url svelte-1jd1td2" target="_blank" rel="external noopener noreferrer" dir="ltr"> </a> <!> <!>`,1),pve=B(`<div role="group" class="sui floating-link-editor svelte-1jd1td2" popover="manual"><!></div>`),mve={hash:`svelte-1jd1td2`,code:`.floating-link-editor.svelte-1jd1td2 {position:fixed;inset:auto;z-index:1000;display:flex;align-items:center;gap:4px;margin:0;border-width:var(--sui-listbox-border-width, 1px);border-style:var(--sui-listbox-border-style, solid);border-color:var(--sui-listbox-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-listbox-border-radius, 4px);padding:4px;width:min(400px, 100vw - 16px);color:var(--sui-primary-foreground-color);background-color:var(--sui-secondary-background-color-translucent);box-shadow:0 8px 16px var(--sui-popup-shadow-color);-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}.floating-link-editor.svelte-1jd1td2 .sui.text-input {flex:auto;margin:0 !important;min-width:0;}.floating-link-editor.svelte-1jd1td2 .sui.button {flex:none;margin:0 !important;}.url.svelte-1jd1td2 {flex:auto;overflow:hidden;padding:0 8px;min-width:0;white-space:nowrap;text-overflow:ellipsis;}`};function hve(e,t){let n=Eo();O(t,!0),K(e,mve);let r=si(`editorStore`),i=j(void 0),a=j(!1),o=j(void 0),s=j(void 0),c=j(``),l=j(!1),u=!1,d=A(()=>r.config.format===`html`),f=j(void 0),p=j(0),m=j(void 0),h=j(void 0),g=A(()=>!!z(s)),_=A(()=>!!z(c).trim()&&QD(z(c))),v=A(()=>z(g)||!!z(i)&&z(a)&&z(o)!==z(i).key),y=A(()=>z(f)?lu({anchorRect:z(f),listMaxHeight:z(p)||48,viewport:{width:window.innerWidth,height:window.innerHeight},rtl:qc(),listWidth:Math.min(400,window.innerWidth-16)}):void 0),b=()=>{let e=Q();if(!Z(e))return null;let t=Ky(e.anchor.getNode(),IC);return t&&Ky(e.focus.getNode(),IC)===t?t:null},x=e=>{let t;if(z(s)&&`selection`in z(s)){let{selection:n}=z(s);e.getEditorState().read(()=>{let[r,i]=n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];r.getNode().isAttached()&&i.getNode().isAttached()&&(t=rue(e,r.getNode(),r.offset,i.getNode(),i.offset)?.getBoundingClientRect())})}else{let n=z(s)&&`linkKey`in z(s)?z(s).linkKey:z(i)?.key;t=n?e.getElementByKey(n)?.getBoundingClientRect():void 0}if(!t||!(t.top||t.bottom||t.left||t.width||t.height))return;let{top:n,bottom:r,left:a,right:o}=t;return{top:n,bottom:r,left:a,right:o}},S=()=>{let{editor:e}=r;M(f,e&&z(v)?x(e):void 0)},C=async(e,t,n=!1)=>{M(s,e),M(c,t,!0),M(l,n,!0),u=n,M(o,void 0),await co(),S(),await co(),z(h)?.focus(),z(h)?.select()},w=()=>{M(s,void 0),M(c,``),M(l,!1)},T=async()=>{r.editor&&await sO(r.editor)},ee=()=>{let e,t=``,n=!1;return r.editor?.getEditorState().read(()=>{let r=b();if(r){e={linkKey:r.getKey()},t=r.getURL(),n=r.getTarget()===`_blank`;return}let i=Q()??ag();if(Z(i)&&!i.isCollapsed()){let n=i.getTextContent().trim();n&&(e={selection:i.clone()},t=wE(n)&&QD(n)?n:``)}}),e?(C(e,t,n),!0):!1},te=async()=>{let{editor:e}=r,t=z(s),n=z(c).trim(),i=z(d)&&z(l)!==u?z(l)?`_blank`:null:void 0;e&&t&&z(_)&&(w(),`linkKey`in t?e.update(()=>{let e=iv(t.linkKey);IC(e)&&(e.setURL(n),i!==void 0&&e.setTarget(i))}):(e.update(()=>{pv(t.selection.clone())}),e.dispatchCommand(RC,i?{url:n,target:i}:n)),await T())},ne=async()=>{w(),await T()},re=async()=>{let e=z(i)?.key;e&&(r.editor?.update(()=>{let t=iv(e);IC(t)&&(t.getChildren().forEach(e=>{t.insertBefore(e)}),t.remove())}),await T())},ie=e=>{e.isComposing||(sl(e,`Enter`)?(e.preventDefault(),z(_)&&te()):sl(e,`Escape`)&&(e.preventDefault(),e.stopPropagation(),ne()))};L(()=>{let{editor:e}=r;if(!e)return;let t=e.registerCommand(gme,ee,2),n=e.registerCommand(sm,e=>!z(v)||z(g)||!z(i)?!1:(e?.preventDefault(),M(o,z(i).key,!0),!0),3),a=e.registerUpdateListener(({editorState:e})=>{e.read(()=>{let e=b();M(i,e?{key:e.getKey(),url:e.getURL(),target:e.getTarget()}:void 0,!0),z(s)&&(`linkKey`in z(s)?!IC(iv(z(s).linkKey)):[z(s).selection.anchor,z(s).selection.focus].some(({key:e})=>!iv(e)?.isAttached()))&&w()}),z(o)&&z(i)?.key!==z(o)&&M(o,void 0),S()}),c=e.registerEditableListener(e=>{e||w()});return()=>{t(),n(),a(),c()}}),L(()=>{r.useRichText||(w(),M(i,void 0))}),L(()=>{z(v),S()}),L(()=>{z(g),z(m)&&(z(m).matches(`:popover-open`)||z(m).showPopover?.(),M(p,z(m).getBoundingClientRect().height,!0))}),js(()=>{let e=e=>{let t=e,n=r.editor?.getRootElement();return!!t&&(!!n?.contains(t)||!!z(m)?.contains(t))},t=({target:t})=>{fo(()=>{M(a,e(t),!0),z(g)&&!z(m)?.contains(t)&&w()})},n=({relatedTarget:e})=>{e||fo(()=>{M(a,!1)})};return window.addEventListener(`scroll`,S,{capture:!0,passive:!0}),window.addEventListener(`resize`,S,{passive:!0}),document.addEventListener(`focusin`,t),document.addEventListener(`focusout`,n),()=>{window.removeEventListener(`scroll`,S,{capture:!0}),window.removeEventListener(`resize`,S),document.removeEventListener(`focusin`,t),document.removeEventListener(`focusout`,n)}});var ae=H(),oe=P(ae),se=e=>{var t=pve();let r;var a=N(t),o=e=>{var t=dve(),r=P(t);{let e=A(()=>!!z(c).trim()&&!QD(z(c))),t=A(()=>Y(`_sui.text_editor.url`));fu(r,{dir:`ltr`,get id(){return`${n}-url`},flex:!0,get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{ie(e)},get element(){return z(h)},set element(e){M(h,e,!0)},get value(){return z(c)},set value(e){M(c,e,!0)}})}var i=I(r,2),a=e=>{{let t=e=>{Xc(e,{name:`open_in_new`})},n=A(()=>Y(`_sui.text_editor.open_in_new_tab`));Al(e,{iconic:!0,variant:`ghost`,get pressed(){return z(l)},get"aria-label"(){return z(n)},onclick:()=>{M(l,!z(l))},startIcon:t,$$slots:{startIcon:!0}})}};G(i,e=>{z(d)&&e(a)});var o=I(i,2);{let e=e=>{Xc(e,{name:`check`})},t=A(()=>!z(_)),n=A(()=>z(s)&&`linkKey`in z(s)?Y(`_sui.update`):Y(`_sui.insert`));Al(o,{iconic:!0,variant:`ghost`,get disabled(){return z(t)},get"aria-label"(){return z(n)},onclick:()=>{te()},startIcon:e,$$slots:{startIcon:!0}})}var u=I(o,2);{let e=e=>{Xc(e,{name:`close`})},t=A(()=>Y(`_sui.cancel`));Al(u,{iconic:!0,variant:`ghost`,get"aria-label"(){return z(t)},onclick:()=>{ne()},startIcon:e,$$slots:{startIcon:!0}})}U(e,t)},u=e=>{var t=fve(),n=P(t),r=F(n,!0),a=I(n,2);{let e=e=>{Xc(e,{name:`edit`})},t=A(()=>Y(`_sui.text_editor.edit_link`));Al(a,{iconic:!0,variant:`ghost`,get"aria-label"(){return z(t)},onclick:()=>{z(i)&&C({linkKey:z(i).key},z(i).url,z(i).target===`_blank`)},startIcon:e,$$slots:{startIcon:!0}})}var o=I(a,2);{let e=e=>{Xc(e,{name:`link_off`})},t=A(()=>Y(`_sui.text_editor.remove_link`));Al(o,{iconic:!0,variant:`ghost`,get"aria-label"(){return z(t)},onclick:()=>{re()},startIcon:e,$$slots:{startIcon:!0}})}R(e=>{q(n,`href`,e),W(r,z(i).url),n.dir=n.dir},[()=>QD(z(i).url)?z(i).url:void 0]),U(e,t)};G(a,e=>{z(g)?e(o):z(i)&&e(u,1)}),D(t),Ds(t,e=>M(m,e),()=>z(m)),R(e=>{q(t,`aria-label`,e),r=cs(t,``,r,{top:z(y).top,bottom:z(y).bottom,left:z(y).left})},[()=>Y(`_sui.text_editor.link`)]),bo(`mousedown`,t,e=>{e.target===e.currentTarget&&e.preventDefault()}),U(e,t)};G(oe,e=>{z(v)&&z(y)&&e(se)}),U(e,ae),k()}xo([`mousedown`]);var gve=60,mO=async(e,t=0)=>e.closest(`dialog`)?.open&&t<gve?(await new Promise(e=>{window.requestAnimationFrame(e)}),mO(e,t+1)):new Promise(e=>{window.setTimeout(e)}),_ve=B(`<!> <!>`,1);function hO(e,t){O(t,!0);let n=si(`editorStore`),r=[[[`insert-row-above`,`insert_row_above`],[`insert-row-below`,`insert_row_below`]],[[`insert-column-left`,`insert_column_left`],[`insert-column-right`,`insert_column_right`]],[[`delete-row`,`delete_row`],[`delete-column`,`delete_column`],[`delete-table`,`delete_table`]]],i=async(e,r)=>{let{editor:i}=n;if(!i)return;let a=i.getElementByKey(t.cellKey),o=!!a&&WD(a);i.update(()=>{__e(e,t.cellKey,{rtl:o})}),await mO(r),await sO(i)};{let t=A(()=>Y(`_sui.text_editor.table_options`));Eu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();Bo(P(n),17,()=>r,Ro,(e,t,n)=>{var r=_ve(),a=P(r),o=e=>{mu(e,{})};G(a,e=>{n>0&&e(o)}),Bo(I(a,2),17,()=>z(t),([e,t])=>e,(e,t)=>{var n=A(()=>Nr(z(t),2));let r=()=>z(n)[0],a=()=>z(n)[1];{let t=A(()=>Y(`_sui.text_editor.${a()}`));Du(e,{get label(){return z(t)},onclick:e=>{i(r(),e.currentTarget)}})}}),U(e,r)}),U(e,n)},$$slots:{default:!0}})}k()}var vve=B(`<div role="none"><!></div>`),yve={hash:`svelte-fu9xvh`,code:`.table-cell-menu-button.svelte-fu9xvh {position:absolute;z-index:1;translate:-100% 0;}.table-cell-menu-button.rtl.svelte-fu9xvh {translate:0 0;}.table-cell-menu-button[hidden].svelte-fu9xvh {display:none;}.table-cell-menu-button.svelte-fu9xvh .sui.button {margin:0;border-radius:50%;background-color:var(--sui-secondary-background-color);}`};function bve(e,t){O(t,!0),K(e,yve);let n=si(`editorStore`),r=j(null),i=j(!1),a=j(void 0),o=j(void 0),s=A(()=>!!z(r)&&z(i)&&!!z(a)&&n.useRichText),c=A(()=>z(a)?`top: ${z(a).top}px; left: ${z(a).left}px`:void 0),l=()=>z(o)?.parentElement,u=()=>{let e=l(),t=z(r)?n.editor?.getElementByKey(z(r)):void 0;if(!z(i)||!e||!t){M(a,void 0);return}let o=t.getBoundingClientRect(),s=t.closest(`.table-wrapper`).getBoundingClientRect(),c=t.closest(`.lexical-root`).getBoundingClientRect(),u=e.getBoundingClientRect(),d=WD(t),f=Math.max(o.left,s.left),p=Math.min(o.right,s.right),m=Math.max(o.top,c.top),h=Math.min(o.bottom,c.bottom);p<=f||h<=m?M(a,void 0):M(a,{top:m-u.top+4,left:(d?f+4:p-4)-u.left,rtl:d,popupPosition:d?`bottom-right`:`bottom-left`})},d,f=()=>{window.clearTimeout(d),d=window.setTimeout(()=>{let e=l();M(i,!!e?.contains(document.activeElement)||!!z(o)?.querySelector(`[aria-expanded="true"]`),!0),u()})};L(()=>{let{editor:e}=n;if(!e)return;let t=e.registerUpdateListener(({editorState:e})=>{M(r,e.read(KD),!0),u()}),i=e.registerRootListener(e=>{if(!e)return;let t=new ResizeObserver(u);return e.addEventListener(`scroll`,u,{capture:!0}),t.observe(e),()=>{e.removeEventListener(`scroll`,u,{capture:!0}),t.disconnect()}});return()=>{t(),i()}}),js(()=>(window.addEventListener(`resize`,u),document.addEventListener(`focusin`,f),document.addEventListener(`focusout`,f),()=>{window.clearTimeout(d),window.removeEventListener(`resize`,u),document.removeEventListener(`focusin`,f),document.removeEventListener(`focusout`,f)}));var p=vve();let m;var h=N(p),g=e=>{let t=A(()=>z(r));{let r=e=>{Xc(e,{name:`expand_more`})},i=e=>{hO(e,{get cellKey(){return z(t)}})},o=A(()=>z(a)?.popupPosition),s=A(()=>Y(`_sui.text_editor.show_table_options`));Xl(e,{iconic:!0,size:`small`,variant:`tertiary`,get popupPosition(){return z(o)},get"aria-label"(){return z(s)},get"aria-controls"(){return n.controlId},endIcon:r,popup:i,$$slots:{endIcon:!0,popup:!0}})}};G(h,e=>{z(s)&&z(r)&&e(g)}),D(p),Ds(p,e=>M(o,e),()=>z(o)),R(()=>{m=os(p,1,`table-cell-menu-button svelte-fu9xvh`,null,m,{rtl:z(a)?.rtl}),q(p,`hidden`,!z(s)),cs(p,z(c))}),U(e,p),k()}var xve={bold:`**`,italic:`_`,strikethrough:`~~`,code:"`"},Sve=/^(?:#{1,6}[ \t]+|>[ \t]?|[-*+][ \t]+|\d+[.)][ \t]+)/,Cve=/^[ \t]*(?:```|~~~)/,wve=({value:e,start:t,end:n})=>{let r=e.lastIndexOf(`
`,t-1)+1,i=n>t&&e[n-1]===`
`?n-1:n,a=e.indexOf(`
`,i);return{lineStart:r,lineEnd:a===-1?e.length:a}},gO=({value:e,start:t})=>e.slice(0,t).split(`
`).length-1,_O=(e,t)=>{let n;for(let r=0;r<e.length;r+=1){if(Cve.test(e[r])){if(n===void 0)n=r;else{if(t>=n&&t<=r)return{open:n,close:r};n=void 0}}if(n===void 0&&r>=t)return}return n!==void 0&&t>=n?{open:n,close:e.length}:void 0},Tve=e=>{let t=e.value.split(`
`),n=gO(e),r=t[n];if(_O(t,n))return`code-block`;let[,i]=r.match(/^(#{1,6})[ \t]/)??[];return i?`heading-${i.length}`:/^[-*+][ \t]/.test(r)?`bulleted-list`:/^\d+[.)][ \t]/.test(r)?`numbered-list`:r.startsWith(`>`)?`blockquote`:`paragraph`},Eve=({value:e,start:t,end:n},r)=>{let i=xve[r],{length:a}=i,o=e.slice(t,n);if(o.length>=a*2&&o.startsWith(i)&&o.endsWith(i)){let e=o.slice(a,-a);return{start:t,end:n,text:e,selectionStart:t,selectionEnd:t+e.length}}if(e.slice(t-a,t)===i&&e.slice(n,n+a)===i)return{start:t-a,end:n+a,text:o,selectionStart:t-a,selectionEnd:n-a};let[,s,c,l]=o.match(/^(\s*)([\s\S]*?)(\s*)$/),u=`${s}${c.split(`
`).map(e=>e.trim()?`${i}${e}${i}`:e).join(`
`)}${l}`;if(!c){let e=t+s.length+a;return{start:t,end:n,text:`${s}${i}${i}${l}`,selectionStart:e,selectionEnd:e}}return{start:t,end:n,text:u,selectionStart:t+s.length+a,selectionEnd:t+u.length-l.length-a}},vO=(e,t)=>{let{value:n,start:r,end:i}=e,a=n.split(`
`),o=_O(a,gO(e));if(o){let{open:e,close:n}=o,s=a.slice(0,e).join(`
`).length+ +!!e,c=s+a.slice(e,n+1).join(`
`).length,l=a.slice(e+1,n).join(`
`),u=s+a[e].length+1,d=e=>Math.min(Math.max(e-u,0),l.length),f=vO({value:l,start:d(r),end:d(i)},t);return{start:s,end:c,text:`${l.slice(0,f.start)}${f.text}${l.slice(f.end)}`,selectionStart:s+f.selectionStart,selectionEnd:s+f.selectionEnd}}let{lineStart:s,lineEnd:c}=wve(e),l=n.slice(s,c).split(`
`);if(t===`code-block`)return{start:s,end:c,text:`\`\`\`\n${l.join(`
`)}\n\`\`\``,selectionStart:r+4,selectionEnd:i+4};let[,u]=t.match(/^heading-(\d)$/)??[],d=0,f=e=>u?e.trim()?`${`#`.repeat(Number(u))} `:``:t===`bulleted-list`?e.trim()?`- `:``:t===`numbered-list`?e.trim()?(d+=1,`${d}. `):``:t===`blockquote`?e.trim()?`> `:`>`:``,p=0,m=r,h=i,g=l.map((e,t)=>{let[n=``]=e.match(Sve)??[],a=e.slice(n.length),o=f(a),c=s+l.slice(0,t).join(`
`).length+ +!!t,u=c+n.length,d=c+e.length,g=u+p+o.length-n.length,_=e=>g+Math.max(e-u,0);return r>=c&&r<=d&&(m=_(r)),i>=c&&i<=d&&(h=_(i)),p+=o.length-n.length,`${o}${a}`});return i>c&&(h=i+p),{start:s,end:c,text:g.join(`
`),selectionStart:m,selectionEnd:Math.max(m,h)}},Dve=({value:e,start:t,end:n},{url:r,text:i})=>{let[,a,o,s]=e.slice(t,n).match(/^(\s*)([\s\S]*?)(\s*)$/),c=`[${((i??o).trim()||r).replace(/([[\]\\])/g,`\\$1`)}](${/[\s()<>]/.test(r)?`<${r.replace(/[<>]/g,encodeURIComponent)}>`:r})`,l=t+a.length+c.length;return{start:t,end:n,text:`${a}${c}${s}`,selectionStart:l,selectionEnd:l}},yO=({value:e,start:t,end:n},r,{block:i=!1}={})=>{if(!i){let e=t+r.length;return{start:t,end:n,text:r,selectionStart:e,selectionEnd:e}}let a=e.slice(0,t).replace(/[ \t]*$/,``),o=e.slice(n).replace(/^[ \t]*/,``),s=a.length,c=e.length-o.length,l=`${a?a.endsWith(`
`)?``:a.endsWith(`
`)?`
`:`
`:``}${r}${o.startsWith(`
`)?``:o.startsWith(`
`)?`
`:`
`}`,u=s+l.length;return{start:s,end:c,text:l,selectionStart:u,selectionEnd:u}},bO=({value:e,selectionStart:t,selectionEnd:n})=>({value:e,start:t,end:n}),Ove=async e=>{let t=Date.now()+1e3;for(;;){if(e.focus(),document.activeElement===e||Date.now()>t)return document.activeElement===e;await new Promise(e=>{window.setTimeout(e,20)})}},xO=({readOnly:e,disabled:t})=>!e&&!t,SO=async(e,{start:t,end:n,text:r,selectionStart:i,selectionEnd:a})=>{if(!xO(e))return;let o=await Ove(e);e.value.slice(t,n)!==r&&(e.setSelectionRange(t,n),o&&typeof document.execCommand==`function`&&(r?document.execCommand(`insertText`,!1,r):document.execCommand(`delete`,!1))&&e.value.slice(t,t+r.length)===r||(e.setRangeText(r,t,n),e.dispatchEvent(new Event(`input`,{bubbles:!0})))),e.setSelectionRange(i,a)},CO=async(e,t)=>{e&&await SO(e,t(bO(e)))},wO=(e,t,n)=>{let r=r=>{xO(e)&&sl(r,nl()?`Meta+${t}`:`Ctrl+${t}`)&&(r.preventDefault(),n())};return e.addEventListener(`keydown`,r),()=>{e.removeEventListener(`keydown`,r)}},kve=async(e,t)=>{let n=k_e(t);if(!n){e.focus();return}let r=t.transformer?.type!==`text-match`;await SO(e,yO(bO(e),n,{block:r}))},TO=e=>Array.isArray(e)&&e.every(E),EO=e=>[...new Set(e)],Ave=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`ariaLabel`,`children`]),jve=B(`<div><!></div>`),Mve={hash:`svelte-zsbmsy`,code:`.button-group.svelte-zsbmsy {flex:none;display:inline-flex;align-items:center;}`};function Nve(e,t){K(e,Mve);let n=J(t,`ariaLabel`,3,void 0),r=ks(t,Ave);var i=jve();bs(i,()=>({...r,role:`group`,class:`sui button-group ${t.class??``}`,"aria-label":n()}),void 0,void 0,void 0,`svelte-zsbmsy`),Go(N(i),()=>t.children??kr),D(i),U(e,i)}function Pve(e,t){O(t,!0);let n=si(`editorStore`),r=A(()=>n.selection.alignment??``),i=A(()=>_me.find(({type:e})=>e===z(r))?.icon??`format_align_left`),a=async(e,t)=>{let{editor:r}=n;r&&(r.dispatchCommand(mm,e),await mO(t),await sO(r))};{let t=e=>{Xc(e,{get name(){return z(i)}})},o=e=>{{let t=A(()=>Y(`_sui.text_editor.alignment_options`));Eu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var i=H();Io(P(i),()=>n.selection,e=>{var t=H();Bo(P(t),17,()=>_me,e=>e.type,(e,t)=>{{let n=e=>{Xc(e,{get name(){return z(t).icon}})},i=A(()=>Y(`_sui.text_editor.${z(t).labelKey}`)),o=A(()=>z(r)===z(t).type);Au(e,{get label(){return z(i)},get checked(){return z(o)},onclick:e=>{a(z(t).type,e.currentTarget)},startIcon:n,$$slots:{startIcon:!0}})}}),U(e,t)}),U(e,i)},$$slots:{default:!0}})}},s=A(()=>Y(`_sui.text_editor.show_alignment_options`));Xl(e,{get"aria-label"(){return z(s)},get"aria-controls"(){return n.controlId},startIcon:t,popup:o,$$slots:{startIcon:!0,popup:!0}})}k()}function Fve(e,t){O(t,!0);let n=si(`editorStore`),r=A(()=>n.selection.inlineTypes.includes(t.type)),i={bold:`B`,italic:`I`},a=async()=>{let{editor:e,textArea:r,useRichText:i}=n;i?e&&(await sO(e),e.dispatchCommand(Jp,t.type)):CO(r,e=>Eve(e,t.type))};L(()=>{let{textArea:e}=n,r=i[t.type];if(e&&r)return wO(e,r,()=>{a()})});{let i=e=>{Xc(e,{get name(){return CT[t.type].icon}})},o=A(()=>Y(`_sui.text_editor.${CT[t.type].labelKey}`));Al(e,{iconic:!0,get"aria-label"(){return z(o)},get"aria-controls"(){return n.controlId},get pressed(){return z(r)},onclick:()=>{a()},startIcon:i,$$slots:{startIcon:!0}})}k()}function Ive(e,t){O(t,!0);let n=si(`editorStore`),{labelKey:r,icon:i}=CT[`horizontal-rule`],a=async()=>{let{editor:e,textArea:t,useRichText:r}=n;r?e&&(e.update(()=>{l_e()}),await sO(e)):await CO(t,e=>yO(e,`***`,{block:!0}))};{let t=e=>{Xc(e,{get name(){return i}})},o=A(()=>Y(`_sui.text_editor.${r}`));Al(e,{iconic:!0,get"aria-label"(){return z(o)},get"aria-controls"(){return n.controlId},onclick:()=>{a()},startIcon:t,$$slots:{startIcon:!0}})}k()}var Lve=({transformer:e})=>e.type===`text-match`,DO=(e,t)=>{let{textArea:n,useRichText:r}=e;if(!r){n&&kve(n,t);return}let{createNode:i}=t;e.editor?.update(()=>{let e=i();pg(e.isInline()?[e]:[e,j_()])})};function Rve(e,t){O(t,!0);let n=si(`editorStore`),r=A(()=>t.component.label),i=A(()=>t.component.icon);{let a=e=>{var t=H(),n=P(t),r=e=>{Xc(e,{get name(){return z(i)}})};G(n,e=>{z(i)&&e(r)}),U(e,t)},o=A(()=>!!z(i)),s=A(()=>z(i)?void 0:z(r));Al(e,{get iconic(){return z(o)},get label(){return z(s)},get title(){return z(r)},get"aria-label"(){return z(r)},get"aria-controls"(){return n.controlId},onclick:()=>{DO(n,t.component)},startIcon:a,$$slots:{startIcon:!0}})}k()}var zve=B(`<div role="none"><label> </label> <!></div>`),Bve=B(`<div role="none"><!></div>`),Vve=B(`<div role="none"><label> </label> <!></div> <!> <!>`,1),Hve=B(`<!> <!>`,1);function Uve(e,t){let n=Eo();O(t,!0);let r=`link`,i=si(`editorStore`),a=A(()=>i.selection.inlineTypes.includes(r)),o=j(!1),s=j(!1),c=j(``),l=j(``),u=j(!1),d=A(()=>i.config.format===`html`&&i.useRichText),f=A(()=>!!z(c).trim()&&QD(z(c))),p=e=>{M(c,wE(e)&&QD(e)?e:``,!0),M(s,!!e),M(o,!0)},m=()=>{let{textArea:e,useRichText:t}=i;if(t)i.editor?.getEditorState().read(()=>{p(Gce().trim())});else if(e){let{value:t,start:n,end:r}=bO(e);p(t.slice(n,r).trim())}},h=()=>{i.useRichText&&i.editor?.dispatchCommand(gme,void 0)||m()},g=e=>{sl(e,`Enter`)&&z(f)&&M(o,!1)},_=async e=>{let{textArea:t,useRichText:n}=i;if(!n)t&&(e.detail.returnValue===`cancel`?t.focus():CO(t,e=>Dve(e,{url:z(c).trim(),text:z(s)?void 0:z(l)}))),M(c,``),M(l,``);else{if(e.detail.returnValue!==`cancel`){if(!i.editor)return;await new Promise(e=>{i.editor?.update(async()=>{let t=Q()??ag()?.clone();Z(t)||(t=ng()),z(s)||(M(l,z(l).trim(),!0),M(l,z(l)||z(c),!0),pg([wh(z(l))])),pv(t),e(void 0)})}),await sO(i.editor),i.editor.dispatchCommand(RC,z(d)&&z(u)?{url:z(c),target:`_blank`}:z(c))}else i.editor&&await sO(i.editor);M(c,``),M(l,``),M(u,!1)}},v=()=>i.editor?.registerCommand(Zp,e=>(sl(e,nl()?`Meta+K`:`Ctrl+K`)&&(e.preventDefault(),h()),!1),2);L(()=>{let{textArea:e}=i;if(e)return wO(e,`K`,()=>{h()})}),L(()=>{if(i.editor)return v()});var y=Hve(),b=P(y);{let e=e=>{Xc(e,{get name(){return CT[r].icon}})},t=A(()=>Y(`_sui.text_editor.${CT[r].labelKey}`)),n=A(()=>z(a)&&i.useRichText);Al(b,{iconic:!0,get"aria-label"(){return z(t)},get"aria-controls"(){return i.controlId},get pressed(){return z(n)},onclick:()=>{h()},startIcon:e,$$slots:{startIcon:!0}})}var x=I(b,2);{let e=A(()=>Y(`_sui.text_editor.insert_link`)),t=A(()=>!z(f)),r=A(()=>Y(`_sui.insert`));tu(x,{get title(){return z(e)},get okDisabled(){return z(t)},get okLabel(){return z(r)},restoreFocus:!1,onClose:e=>{_(e)},get open(){return z(o)},set open(e){M(o,e,!0)},children:(e,t)=>{var r=Vve(),i=P(r),a=N(i),o=F(a,!0),f=I(a,2);{let e=A(()=>!!z(c).trim()&&!QD(z(c))),t=A(()=>Y(`_sui.text_editor.url`));fu(f,{dir:`ltr`,get id(){return`${n}-url`},flex:!0,get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{g(e)},get value(){return z(c)},set value(e){M(c,e,!0)}})}D(i);var p=I(i,2),m=e=>{var t=zve(),r=N(t),i=F(r,!0),a=I(r,2);{let e=A(()=>Y(`_sui.text_editor.text`));fu(a,{dir:`auto`,get id(){return`${n}-text`},flex:!0,get"aria-label"(){return z(e)},onkeydown:e=>{g(e)},get value(){return z(l)},set value(e){M(l,e,!0)}})}D(t),R(e=>{q(r,`for`,`${n}-text`),W(i,e)},[()=>Y(`_sui.text_editor.text`)]),U(e,t)};G(p,e=>{z(s)||e(m)});var h=I(p,2),_=e=>{var t=Bve(),n=N(t);{let e=A(()=>Y(`_sui.text_editor.open_in_new_tab`));Ql(n,{get label(){return z(e)},get checked(){return z(u)},set checked(e){M(u,e,!0)}})}D(t),U(e,t)};G(h,e=>{z(d)&&e(_)}),R(e=>{q(a,`for`,`${n}-url`),W(o,e)},[()=>Y(`_sui.text_editor.url`)]),U(e,r)},$$slots:{default:!0}})}U(e,y),k()}function Wve(e,t){O(t,!0);let n=si(`editorStore`);{let r=e=>{Xc(e,{name:`arrow_drop_down`,class:`small-arrow`})},i=e=>{Eu(e,{children:(e,r)=>{var i=H();Bo(P(i),17,()=>t.components,e=>e.id,(e,t)=>{let r=A(()=>z(t));Du(e,{get label(){return z(r).label},onclick:()=>{DO(n,z(t))},startIcon:e=>{var t=H(),n=P(t),i=e=>{Xc(e,{get name(){return z(r).icon}})};G(n,e=>{z(r).icon&&e(i)}),U(e,t)},$$slots:{startIcon:!0}})}),U(e,i)},$$slots:{default:!0}})},a=A(()=>Y(`_sui.insert`));Xl(e,{get label(){return z(a)},endIcon:r,popup:i,$$slots:{endIcon:!0,popup:!0}})}k()}var Gve=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:1,OO=e=>{let[t,n=`0`]=String(e).toLowerCase().split(`e`),r=(t.split(`.`)[1]?.length??0)-Number(n);return Math.max(r,0)},Kve=({fractional:e,min:t})=>typeof t==`number`&&t>=0?e?`decimal`:`numeric`:`text`,kO=new Map,qve=e=>{let t=e||``,n=kO.get(t);if(n===void 0){try{n=new Intl.NumberFormat(e||void 0).formatToParts(1.5).find(({type:e})=>e===`decimal`).value}catch{n=`.`}kO.set(t,n)}return n},Jve=(e,t)=>{let n=qve(t);if(!e||n===`.`||e.includes(`.`))return e;let r=e.split(n);return r.length===2?r.join(`.`):e},AO=e=>{let t=e.trim()?Number(e):NaN;return Number.isNaN(t)?void 0:t},jO=e=>Number(e||0),MO=(e,t)=>typeof t==`number`&&jO(e)<=t,NO=(e,t)=>typeof t==`number`&&jO(e)>=t,Yve=(e,{step:t,direction:n,min:r,max:i})=>{if(Number.isNaN(Number(e))||(n>0?NO(e,i):MO(e,r)))return;let a=OO(t),o=Number((jO(e)+t*n).toFixed(a));return typeof i==`number`&&o>i?String(i):typeof r==`number`&&o<r?String(r):o.toFixed(a)},Xve=(e,{required:t=!1,min:n,max:r}={})=>{if(t&&(AO(e)===void 0||e===``))return!0;if(e===void 0||e===``)return!1;let i=Number(e);return Number.isNaN(i)||typeof n==`number`&&jO(e)<n||typeof r==`number`&&jO(e)>r},Zve=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`invalid`,`flex`,`min`,`max`,`step`,`fractional`,`inputmode`,`class`,`hidden`,`disabled`,`readonly`,`required`,`children`,`increaseIcon`,`decreaseIcon`,`onChange`,`onkeydown`,`oninput`]),Qve=B(`<div role="none" class="buttons svelte-g2cauy"><!> <!></div>`),$ve=B(`<span hidden=""> </span>`),eye=B(`<div role="none"><!> <!></div>`),tye={hash:`svelte-g2cauy`,code:`.number-input.svelte-g2cauy {display:inline-flex;align-items:center;position:relative;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.number-input.stepper.svelte-g2cauy {--sui-number-input-end-padding: 24px;}.number-input.flex.svelte-g2cauy:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.number-input.svelte-g2cauy:not(.disabled) button[aria-disabled='true'] {filter:grayscale(0) opacity(1);}.number-input.svelte-g2cauy:not(.disabled) button[aria-disabled='true'] * {filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}.number-input.svelte-g2cauy input {padding-right:var(--sui-number-input-end-padding, 8px);}.number-input.svelte-g2cauy .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.buttons.svelte-g2cauy {display:flex;flex-direction:column;position:absolute;inset-block:2px;right:2px;z-index:3;width:18px;}.buttons.svelte-g2cauy button {flex:none;margin:0 !important;border-width:0;border-radius:3px;padding:0;width:100%;height:50%;min-height:0;}.buttons.svelte-g2cauy button .icon {font-size:16px;}.number-input.svelte-g2cauy:dir(rtl) {--sui-textbox-text-align: right;}.number-input.svelte-g2cauy:dir(rtl) .buttons:where(.svelte-g2cauy) {right:auto;left:2px;}.number-input.svelte-g2cauy:dir(rtl) input {padding-right:8px;padding-left:var(--sui-number-input-end-padding, 8px);}`};function PO(e,t){let n=Eo();O(t,!0),K(e,tye);let r=J(t,`value`,15),i=J(t,`invalid`,15,!1),a=J(t,`flex`,3,!1),o=J(t,`min`,3,void 0),s=J(t,`max`,3,void 0),c=J(t,`step`,3,1),l=J(t,`fractional`,3,void 0),u=J(t,`inputmode`,3,void 0),d=J(t,`hidden`,3,!1),f=J(t,`disabled`,3,!1),p=J(t,`readonly`,3,!1),m=J(t,`required`,3,!1),h=ks(t,Zve),g=j(!1),_=j(``),v=A(()=>c()!==-1),y=A(()=>Gve(c())),b=A(()=>l()??(!z(v)||OO(z(y))>0)),x=A(()=>{let e=typeof o()==`number`,t=typeof s()==`number`;if(!(z(v)||!e&&!t))return e&&t?Y(`_sui.number_input.range`,{values:{min:o(),max:s()}}):e?Y(`_sui.number_input.min`,{values:{min:o()}}):Y(`_sui.number_input.max`,{values:{max:s()}})}),S=A(()=>[h[`aria-describedby`],z(x)?`${n}-range`:void 0].filter(Boolean).join(` `)||void 0),C=A(()=>Jve(z(_),t.lang??Jc.current)),w=A(()=>MO(z(C),o())),T=A(()=>NO(z(C),s()));L(()=>{let e=r();fo(()=>{AO(z(C))!==e&&M(_,String(e??``),!0)})}),L(()=>{r(AO(z(C)))}),L(()=>{z(g)&&i(Xve(z(C),{required:m(),min:o(),max:s()}))});let ee=e=>{let t=Yve(z(C),{step:z(y),direction:e,min:o(),max:s()});t!==void 0&&M(_,t,!0)},te=()=>{ee(-1)},ne=()=>{ee(1)};var re=eye();let ie;var ae=N(re),oe=e=>{var r=Qve(),i=N(r);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Go(P(n),()=>t.increaseIcon),U(e,n)},a=e=>{Xc(e,{name:`expand_less`})};G(r,e=>{t.increaseIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>f()||p()||Number.isNaN(Number(z(C)))||z(T)),a=A(()=>Y(`_sui.number_input.increase`));Al(i,{iconic:!0,get disabled(){return z(r)},get"aria-label"(){return z(a)},get"aria-controls"(){return n},onclick:()=>{ne()},startIcon:e,$$slots:{startIcon:!0}})}var a=I(i,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Go(P(n),()=>t.decreaseIcon),U(e,n)},a=e=>{Xc(e,{name:`expand_more`})};G(r,e=>{t.decreaseIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>f()||p()||Number.isNaN(Number(z(C)))||z(w)),i=A(()=>Y(`_sui.number_input.decrease`));Al(a,{iconic:!0,get disabled(){return z(r)},get"aria-label"(){return z(i)},get"aria-controls"(){return n},onclick:()=>{te()},startIcon:e,$$slots:{startIcon:!0}})}D(r),U(e,r)},se=e=>{var t=$ve(),r=F(t,!0);R(()=>{q(t,`id`,`${n}-range`),W(r,z(x))}),U(e,t)};G(ae,e=>{z(v)?e(oe):z(x)&&e(se,1)});var ce=I(ae,2);{let e=A(()=>z(v)?`spinbutton`:`textbox`),c=A(()=>z(v)&&Number.isFinite(r())?r():void 0),l=A(()=>z(v)?o():void 0),y=A(()=>z(v)?s():void 0),x=A(()=>u()??Kve({fractional:z(b),min:o()}));fu(ce,As({dir:`ltr`},()=>h,{get role(){return z(e)},get id(){return n},spellcheck:`false`,get flex(){return a()},get hidden(){return d()},get disabled(){return f()},get readonly(){return p()},get required(){return m()},get invalid(){return i()},get"aria-valuenow"(){return z(c)},get"aria-valuemin"(){return z(l)},get"aria-valuemax"(){return z(y)},get inputmode(){return z(x)},get"aria-describedby"(){return z(S)},onkeydown:e=>{let{key:n,ctrlKey:r,metaKey:i,altKey:a,shiftKey:o}=e,s=o||a||r||i,c=z(v)&&!f()&&!p()&&!s;n===`ArrowDown`&&c&&(e.preventDefault(),te()),n===`ArrowUp`&&c&&(e.preventDefault(),ne()),z(g)||M(g,!0),t.onkeydown?.(e)},oninput:e=>{z(g)||M(g,!0),t.oninput?.(e)},get onChange(){return t.onChange},get value(){return z(_)},set value(e){M(_,e,!0)}}))}D(re),R(()=>{ie=os(re,1,`sui number-input ${t.class??``}`,`svelte-g2cauy`,ie,{flex:a(),disabled:f(),readonly:p(),stepper:z(v)}),q(re,`hidden`,d())}),U(e,re),k()}var nye=B(`<div role="none" class="table-size svelte-avqlty"><label> </label> <!> <label> </label> <!></div>`),rye=B(`<!> <!>`,1),iye={hash:`svelte-avqlty`,code:`.table-size.svelte-avqlty {display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px 16px;}`};function aye(e,t){let n=Eo();O(t,!0),K(e,iye);let r=J(t,`disabled`,3,!1),i=si(`editorStore`),a=j(!1),o=j(ta(3)),s=j(ta(3)),c=A(()=>UD(z(o))),l=A(()=>UD(z(s))),u=A(()=>!!z(c)&&!!z(l)),d=()=>{z(c)||M(o,3,!0),z(l)||M(s,3,!0),M(a,!0)},f=e=>{sl(e,`Enter`)&&z(u)&&M(a,!1)},p=async({rows:e,columns:t})=>{let{editor:n}=i;n&&(n.update(()=>{d_e(e,t)}),await sO(n))},m=async({rows:e,columns:t})=>{let n=u_e(e,t);await CO(i.textArea,e=>{let t=yO(e,n,{block:!0}),r=t.start+t.text.indexOf(n)+2;return{...t,selectionStart:r,selectionEnd:r}})},h=async e=>{if(e.detail.returnValue!==`cancel`&&z(c)&&z(l)){let e={rows:z(c),columns:z(l)};i.useRichText?await p(e):await m(e)}else i.useRichText?i.editor&&await sO(i.editor):i.textArea?.focus()};var g=rye(),_=P(g);{let e=e=>{Xc(e,{get name(){return CT.table.icon}})},t=A(()=>Y(`_sui.text_editor.${CT.table.labelKey}`));Al(_,{iconic:!0,get disabled(){return r()},get"aria-label"(){return z(t)},get"aria-controls"(){return i.controlId},onclick:()=>{d()},startIcon:e,$$slots:{startIcon:!0}})}var v=I(_,2);{let e=A(()=>Y(`_sui.text_editor.insert_table`)),t=A(()=>!z(u)),r=A(()=>Y(`_sui.insert`));tu(v,{size:`x-small`,get title(){return z(e)},get okDisabled(){return z(t)},get okLabel(){return z(r)},restoreFocus:!1,onClose:e=>{h(e)},get open(){return z(a)},set open(e){M(a,e,!0)},children:(e,t)=>{var r=nye(),i=N(r),a=F(i,!0),u=I(i,2);{let e=A(()=>!z(c)),t=A(()=>Y(`_sui.text_editor.rows`));PO(u,{get id(){return`${n}-rows`},min:1,get max(){return 50},get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{f(e)},get value(){return z(o)},set value(e){M(o,e,!0)}})}var d=I(u,2),p=F(d,!0),m=I(d,2);{let e=A(()=>!z(l)),t=A(()=>Y(`_sui.text_editor.columns`));PO(m,{get id(){return`${n}-columns`},min:1,get max(){return 50},get invalid(){return z(e)},get"aria-label"(){return z(t)},onkeydown:e=>{f(e)},get value(){return z(s)},set value(e){M(s,e,!0)}})}D(r),R((e,t)=>{q(i,`for`,`${n}-rows`),W(a,e),q(d,`for`,`${n}-columns`),W(p,t)},[()=>Y(`_sui.text_editor.rows`),()=>Y(`_sui.text_editor.columns`)]),U(e,r)},$$slots:{default:!0}})}U(e,g),k()}function oye(e,t){O(t,!0);let n={paragraph:j_,blockquote:Fw,"code-block":cC},r={"bulleted-list":sw,"numbered-list":cw},i=si(`editorStore`),a=A(()=>i.selection.blockType===t.type),o=async()=>{if(!i.useRichText){CO(i.textArea,e=>vO(e,t.type));return}if(!i.editor)return;await sO(i.editor);let[,e]=t.type.match(/^heading-(\d)$/)??[],a=e?()=>Bw(`h${e}`):n[t.type];a&&i.editor.update(()=>{aue(Q(),a)}),t.type in r&&i.editor.dispatchCommand(r[t.type],void 0)};var s=H();Io(P(s),()=>z(a),e=>{{let n=e=>{Xc(e,{get name(){return CT[t.type].icon}})},r=A(()=>Y(`_sui.text_editor.${CT[t.type].labelKey}`));ku(e,{get label(){return z(r)},get checked(){return z(a)},onclick:()=>{z(a)||o()},startIcon:n,$$slots:{startIcon:!0}})}}),U(e,s),k()}var FO=B(`<!> <!>`,1),sye=B(`<!> <!> <!> <!> <!>`,1),IO=B(`<!> <!> <!> <!>`,1);function cye(e,t){O(t,!0);let n=J(t,`disabled`,3,!1),r=J(t,`readonly`,3,!1),i=si(`editorStore`),a=A(()=>EO([`paragraph`,...i.config.enabledButtons.filter(e=>wT.includes(e))])),o=A(()=>i.config.format===`html`),s=A(()=>i.useRichText||!z(o)),c=A(()=>i.config.enabledButtons.includes(`table`)),l=A(()=>z(o)&&i.useRichText&&i.config.enabledButtons.includes(`align`)),u=A(()=>i.config.enabledButtons.includes(`horizontal-rule`)),d=A(()=>i.useRichText?i.selection.tableCellKey??null:null),f=A(()=>!!z(d)&&!z(o)),p=A(()=>z(f)?i.config.components.filter(Lve):i.config.components),m=A(()=>z(p).filter(({trigger:e=`menuitem`})=>e===`button`)),h=A(()=>z(p).filter(({trigger:e=`menuitem`})=>e===`menuitem`)),g=A(()=>z(c)||!z(f)&&z(u)||z(p).length>0),_=A(()=>z(s)&&!z(f)),v=A(()=>EO(i.config.enabledButtons.filter(e=>fme.includes(e))));{let t=A(()=>n()||r()||i.componentHasFocus),p=A(()=>Y(`_sui.text_editor.text_editor`));fO(e,{get disabled(){return z(t)},get ariaLabel(){return z(p)},children:(e,t)=>{var n=IO(),r=P(n),p=e=>{{let t=e=>{{let t=A(()=>CT[i.selection.blockType]?.icon??`format_paragraph`);Xc(e,{get name(){return z(t)}})}},n=e=>{{let t=A(()=>Y(`_sui.text_editor.text_style_options`));Eu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();Bo(P(n),16,()=>z(a),e=>e,(e,t)=>{oye(e,{get type(){return t}})}),U(e,n)},$$slots:{default:!0}})}},r=A(()=>Y(`_sui.text_editor.show_text_style_options`));Xl(e,{get"aria-label"(){return z(r)},get"aria-controls"(){return i.controlId},startIcon:t,popup:n,$$slots:{startIcon:!0,popup:!0}})}};G(r,e=>{z(_)&&z(a).length>1&&e(p)});var y=I(r,2),b=e=>{var t=FO(),n=P(t);mu(n,{orientation:`vertical`}),uO(I(n,2),{}),U(e,t)},x=e=>{var t=IO(),n=P(t),r=e=>{var t=FO(),n=P(t),r=e=>{mu(e,{orientation:`vertical`})};G(n,e=>{z(_)&&z(a).length>1&&e(r)});var o=I(n,2);{let e=e=>{Xc(e,{name:`table_edit`})},t=e=>{hO(e,{get cellKey(){return z(d)}})},n=A(()=>Y(`_sui.text_editor.show_table_options`));Xl(o,{get"aria-label"(){return z(n)},get"aria-controls"(){return i.controlId},startIcon:e,popup:t,$$slots:{startIcon:!0,popup:!0}})}U(e,t)};G(n,e=>{z(c)&&z(d)&&e(r)});var o=I(n,2),s=e=>{var t=FO(),n=P(t);mu(n,{orientation:`vertical`}),Nve(I(n,2),{children:(e,t)=>{var n=H();Bo(P(n),16,()=>z(v),e=>e,(e,t)=>{var n=H(),r=P(n),i=e=>{Uve(e,{})},a=e=>{Fve(e,{get type(){return t}})};G(r,e=>{t===`link`?e(i):e(a,-1)}),U(e,n)}),U(e,n)},$$slots:{default:!0}}),U(e,t)};G(o,e=>{z(v).length&&e(s)});var p=I(o,2),y=e=>{var t=FO(),n=P(t);mu(n,{orientation:`vertical`}),Pve(I(n,2),{}),U(e,t)};G(p,e=>{z(l)&&e(y)});var b=I(p,2),x=e=>{var t=sye(),n=P(t);mu(n,{orientation:`vertical`});var r=I(n,2),i=e=>{{let t=A(()=>!!z(d));aye(e,{get disabled(){return z(t)}})}};G(r,e=>{z(c)&&e(i)});var a=I(r,2),o=e=>{Ive(e,{})};G(a,e=>{z(u)&&!z(f)&&e(o)});var s=I(a,2);Bo(s,17,()=>z(m),e=>e.id,(e,t)=>{Rve(e,{get component(){return z(t)}})});var l=I(s,2),p=e=>{Wve(e,{get components(){return z(h)}})};G(l,e=>{z(h).length&&e(p)}),U(e,t)};G(b,e=>{z(g)&&e(x)}),U(e,t)};G(y,e=>{i.useRichText&&i.selection.blockType===`code-block`?e(b):z(s)&&e(x,1)});var S=I(y,2);$l(S,{flex:!0});var C=I(S,2),w=e=>{{let t=e=>{{let t=A(()=>z(o)?`html`:`markdown`);Xc(e,{get name(){return z(t)}})}},n=A(()=>!i.useRichText),r=A(()=>Y(`_sui.text_editor.${z(o)?`edit_in_html`:`edit_in_markdown`}`));Al(e,{iconic:!0,get disabled(){return i.hasConverterError},get pressed(){return z(n)},get"aria-label"(){return z(r)},onclick:()=>{i.useRichText=!i.useRichText,i.useRichText&&i.convertToLexical()},startIcon:t,$$slots:{startIcon:!0}})}};G(C,e=>{i.config.modes.length>1&&e(w)}),U(e,n)},$$slots:{default:!0}})}k()}var lye=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`pending`,`format`,`flex`,`dir`,`modes`,`buttons`,`components`,`useMarkdownShortcuts`,`useEmojiAutocomplete`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`ariaLabelledby`,`ariaDescribedby`,`aria-label`,`aria-labelledby`,`aria-describedby`,`children`]),uye=B(`<div><!> <!> <!> <!> <!> <!></div> <!>`,1),dye={hash:`svelte-1pvwc2y`,code:`.text-editor.svelte-1pvwc2y {position:relative;margin:var(--sui-focus-ring-width);border-radius:var(--sui-textbox-border-radius);width:calc(100% - var(--sui-focus-ring-width) * 2);transition:all 200ms;}.text-editor.svelte-1pvwc2y:focus-within {outline:var(--sui-focus-ring-width) solid var(--sui-focus-ring-color);}.text-editor.flex.svelte-1pvwc2y:not([hidden]) {display:block;}.text-editor.svelte-1pvwc2y .sui.text-area {margin:0 !important;width:100% !important;min-width:auto;}.text-editor.svelte-1pvwc2y .sui.text-area textarea {border-start-start-radius:0 !important;border-start-end-radius:0 !important;border-end-start-radius:var(--sui-textbox-border-radius) !important;border-end-end-radius:var(--sui-textbox-border-radius) !important;}.text-editor.svelte-1pvwc2y {--sui-text-editor-toolbar-top: var(--sui-text-editor-inner-toolbar-top, 0px);--sui-text-editor-toolbar-z-index: var(--sui-text-editor-inner-toolbar-z-index, 100);}.text-editor.svelte-1pvwc2y > * {--sui-text-editor-inner-toolbar-top: calc(
var(--sui-text-editor-toolbar-top) + var(--sui-text-editor-toolbar-height)
);--sui-text-editor-inner-toolbar-z-index: calc(var(--sui-text-editor-toolbar-z-index) - 1);}`};function fye(e,t){O(t,!0),K(e,dye);let n=J(t,`value`,15,``),r=J(t,`pending`,15,!1),i=J(t,`format`,3,`markdown`),a=J(t,`flex`,3,!1),o=J(t,`dir`,3,void 0),s=J(t,`modes`,19,()=>[`rich-text`,`plain-text`]),c=J(t,`buttons`,19,()=>[...fme,...wT]),l=J(t,`components`,19,()=>[]),u=J(t,`useMarkdownShortcuts`,3,!0),d=J(t,`useEmojiAutocomplete`,3,!0),f=J(t,`hidden`,3,!1),p=J(t,`disabled`,3,!1),m=J(t,`readonly`,3,!1),h=J(t,`required`,3,!1),g=J(t,`invalid`,3,!1),_=J(t,`ariaLabel`,3,void 0),v=J(t,`ariaLabelledby`,3,void 0),y=J(t,`ariaDescribedby`,3,void 0),b=J(t,`aria-label`,3,void 0),x=J(t,`aria-labelledby`,3,void 0),S=J(t,`aria-describedby`,3,void 0),C=ks(t,lye),w=A(()=>({"aria-label":_()??b(),"aria-labelledby":v()??x(),"aria-describedby":y()??S()})),T=lO();T.config={...T.config,modes:s(),enabledButtons:c(),components:l(),useMarkdownShortcuts:u(),useEmojiAutocomplete:d(),format:i()},ci(`editorStore`,T);let ee=i()===`html`?`html`:`markdown`,te=2e4,ne=j(ta(PE())),re=j(0),ie=A(()=>!T.useRichText&&!f()),ae=A(()=>o()===`auto`&&T.useRichText?void 0:o()),oe=A(()=>!z(ie)||ee!==`markdown`||T.inputValue.length>te?``:[...new Set([...T.inputValue.matchAll(/^[ \t]*(?:```|~~~)[ \t]*(?<lang>[\w+#-]+)/gm)].map(({groups:e})=>e?.lang))].join(`,`)),se=e=>{if(z(re),!(!z(ie)||e.length>te))return oge(e,ee,{theme:z(ne)})};L(()=>FE(async()=>{let e=PE();z(ie)&&await iO(ee),e===PE()&&M(ne,e,!0)})),L(()=>{if(!z(ie))return;let e=z(oe)?z(oe).split(`,`):[];z(ne),fo(()=>{iO(ee).then(async()=>{M(re,z(re)+1),await Promise.all(e.map(e=>iO(e))),M(re,z(re)+1)})})}),L(()=>{let{textArea:e,useRichText:t}=T;if(!e||t)return;let n=()=>{T.selection={blockNodeKey:null,blockType:document.activeElement===e?Tve(bO(e)):`paragraph`,inlineTypes:[]}},r=[`selectionchange`,`select`,`input`,`keyup`,`mouseup`,`focus`];return fo(n),r.forEach(t=>e.addEventListener(t,n)),()=>{r.forEach(t=>e.removeEventListener(t,n))}}),L(()=>{r(T.pending)}),L(()=>()=>{r(!1)}),L(()=>{if(!T.initialized)return;let e=n();fo(()=>{T.inputValue=e})}),L(()=>{if(!T.initialized)return;let e=T.inputValue;fo(()=>{n()!==e&&n(e)})});var ce=uye(),le=P(ce);bs(le,()=>({...C,role:`none`,class:`sui text-editor`,hidden:f(),[ms]:{flex:a()},[hs]:{"--sui-text-editor-toolbar-height":`${T.toolbarHeight??``}px`}}),void 0,void 0,void 0,`svelte-1pvwc2y`);var ue=N(le);cye(ue,{get disabled(){return p()},get readonly(){return m()}});var de=I(ue,2);{let e=A(()=>!T.useRichText||f());cO(de,As(()=>z(w),{get dir(){return o()},get hidden(){return z(e)},get disabled(){return p()},get readonly(){return m()},get required(){return h()},get invalid(){return g()}}))}var fe=I(de,2);{let e=A(()=>T.useRichText||f());pO(fe,As(()=>z(w),{get id(){return`${T.editorId??``}-plain-text`},autoResize:!0,get useEmojiAutocomplete(){return d()},highlight:se,get flex(){return a()},get dir(){return z(ae)},get hidden(){return z(e)},get disabled(){return p()},get readonly(){return m()},get required(){return h()},get invalid(){return g()},get element(){return T.textArea},set element(e){T.textArea=e},get value(){return T.inputValue},set value(e){T.inputValue=e}}))}var pe=I(fe,2),me=e=>{uve(e,{})};G(pe,e=>{T.config.useEmojiAutocomplete&&!p()&&!m()&&e(me)});var he=I(pe,2),ge=e=>{hve(e,{})},_e=A(()=>T.config.enabledButtons.includes(`link`)&&!p()&&!m());G(he,e=>{z(_e)&&e(ge)});var ve=I(he,2),ye=e=>{bve(e,{})},be=A(()=>T.config.enabledButtons.includes(`table`)&&!p()&&!m());G(ve,e=>{z(be)&&e(ye)}),D(le);var xe=I(le,2),Se=e=>{Xu(e,{get show(){return T.showConverterError},set show(e){T.showConverterError=e},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`_sui.text_editor.converter_error`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(xe,e=>{T.showConverterError&&e(Se)}),U(e,ce),k()}var pye=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`class`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`onclick`,`oninput`]),mye=B(`<input/>`),hye={hash:`svelte-dnys5w`,code:`.color-input.svelte-dnys5w {display:inline-block;margin:var(--sui-focus-ring-width);border-width:var(--sui-color-input-border-width, 1px);border-color:var(--sui-color-input-border-color, var(--sui-control-border-color));border-radius:var(--sui-color-input-border-radius, var(--sui-button-medium-border-radius));padding:var(--sui-color-input-padding, 3px);width:var(--sui-color-input-width, calc(var(--sui-button-medium-height) * 1.5));height:var(--sui-color-input-height, var(--sui-button-medium-height));color:inherit;background-color:var(--sui-color-input-background-color, var(--sui-textbox-background-color));font-family:var(--sui-textbox-font-family);cursor:pointer;transition:all 200ms;}.color-input.svelte-dnys5w:is(:where(.svelte-dnys5w):hover, :where(.svelte-dnys5w):focus-visible) {background-color:var(--sui-color-input-background-color-focus, var(--sui-hover-background-color));}.color-input.svelte-dnys5w:active {background-color:var(--sui-color-input-background-color-active, var(--sui-active-background-color));}.color-input[aria-readonly=true].svelte-dnys5w {cursor:default;background-color:var(--sui-disabled-background-color);}.color-input[aria-invalid=true].svelte-dnys5w {border-color:var(--sui-error-border-color);}.color-input.svelte-dnys5w::-webkit-color-swatch-wrapper {padding:0;}.color-input.svelte-dnys5w::-webkit-color-swatch {border:1px solid var(--sui-secondary-border-color);border-radius:calc(var(--sui-button-medium-border-radius) / 2);}.color-input.svelte-dnys5w::-moz-color-swatch {border:1px solid var(--sui-secondary-border-color);border-radius:calc(var(--sui-button-medium-border-radius) / 2);}`};function gye(e,t){O(t,!0),K(e,hye);let n=J(t,`value`,15),r=J(t,`element`,15),i=J(t,`disabled`,3,!1),a=J(t,`readonly`,3,!1),o=J(t,`required`,3,!1),s=J(t,`invalid`,3,!1),c=J(t,`ariaLabel`,3,void 0),l=ks(t,pye),u=e=>{a()&&e.preventDefault(),t.onclick?.(e)},d=e=>{n(e.currentTarget.value),t.oninput?.(e)};var f=mye();bs(f,()=>({...l,value:n()??``,type:`color`,class:`sui color-input ${t.class??``}`,disabled:i()||void 0,"aria-label":c()??l[`aria-label`],"aria-disabled":i(),"aria-readonly":a(),"aria-required":o(),"aria-invalid":s(),onclick:u,oninput:d}),void 0,void 0,void 0,`svelte-dnys5w`,!0),Ds(f,e=>r(e),()=>r()),U(e,f),k()}var _ye=new Set([`$$slots`,`$$events`,`$$legacy`,`value`,`element`,`type`,`min`,`max`,`step`,`class`,`disabled`,`readonly`,`required`,`invalid`,`ariaLabel`,`oninput`]),vye=B(`<input/>`),yye={hash:`svelte-1gi6blb`,code:`.date-time-input.svelte-1gi6blb {display:inline-block;margin:var(--sui-focus-ring-width);border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);padding:var(--sui-textbox-singleline-padding);width:auto;min-width:0;height:var(--sui-textbox-height);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);line-height:var(--sui-textbox-singleline-line-height);font-weight:var(--sui-textbox-font-weight, var(--sui-font-weight-normal, normal));text-transform:var(--sui-date-time-input-text-transform, uppercase);letter-spacing:var(--sui-textbox-letter-spacing, normal);font-variant-numeric:tabular-nums;transition:all 200ms;}.date-time-input.svelte-1gi6blb:focus {color:var(--sui-textbox-foreground-color-focus, var(--sui-textbox-foreground-color));background-color:var(--sui-textbox-background-color-focus, var(--sui-textbox-background-color));}.date-time-input.svelte-1gi6blb:read-only {color:var(--sui-secondary-foreground-color);border-color:var(--sui-textbox-border-color) !important;}.date-time-input.svelte-1gi6blb:is(:where(.svelte-1gi6blb):disabled, :where(.svelte-1gi6blb):read-only) {background-color:var(--sui-disabled-background-color);}.date-time-input[aria-invalid=true].svelte-1gi6blb {border-color:var(--sui-error-border-color);}.date-time-input.svelte-1gi6blb::-webkit-calendar-picker-indicator {cursor:pointer;}.date-time-input.svelte-1gi6blb:is(:where(.svelte-1gi6blb):disabled, :where(.svelte-1gi6blb):read-only)::-webkit-calendar-picker-indicator {cursor:default;}`};function bye(e,t){O(t,!0),K(e,yye);let n=J(t,`value`,15),r=J(t,`element`,15),i=J(t,`type`,3,`date`),a=J(t,`min`,3,void 0),o=J(t,`max`,3,void 0),s=J(t,`step`,3,void 0),c=J(t,`disabled`,3,!1),l=J(t,`readonly`,3,!1),u=J(t,`required`,3,!1),d=J(t,`invalid`,3,!1),f=J(t,`ariaLabel`,3,void 0),p=ks(t,_ye),m=e=>{n(e.currentTarget.value),t.oninput?.(e)};var h=vye();bs(h,()=>({...p,value:n()??``,type:i(),min:a(),max:o(),step:s(),class:`sui date-time-input ${t.class??``}`,disabled:c()||void 0,readonly:l()||void 0,"aria-label":f()??p[`aria-label`],"aria-disabled":c(),"aria-readonly":l(),"aria-required":u(),"aria-invalid":d(),oninput:m}),void 0,void 0,void 0,`svelte-1gi6blb`,!0),Ds(h,e=>r(e),()=>r()),U(e,h),k()}var xye=new Set([`$$slots`,`$$events`,`$$legacy`,`mask`,`value`,`flex`,`monospace`,`class`,`hidden`,`disabled`,`readonly`,`required`,`invalid`,`children`,`visibilityIcon`]),Sye=B(`<div role="none"><!> <!></div>`),Cye={hash:`svelte-18xfqn2`,code:`.password-input.svelte-18xfqn2,
.secret-input.svelte-18xfqn2 {display:inline-flex;align-items:center;margin:var(--sui-focus-ring-width);min-width:var(--sui-textbox-singleline-min-width);}.password-input.flex.svelte-18xfqn2:not([hidden]),
.secret-input.flex.svelte-18xfqn2:not([hidden]) {display:inline-flex;width:-moz-available;width:-webkit-fill-available;width:stretch;min-width:0;}.password-input.svelte-18xfqn2 .text-input,
.secret-input.svelte-18xfqn2 .text-input {flex:auto;margin:0 !important;width:0;min-width:0 !important;}.password-input.svelte-18xfqn2 input,
.secret-input.svelte-18xfqn2 input {border-start-end-radius:0;border-end-end-radius:0;}.password-input.svelte-18xfqn2 button,
.secret-input.svelte-18xfqn2 button {margin-block:0;margin-inline-end:0;flex:none;margin-inline-start:-1px;border-width:1px;border-color:var(--sui-textbox-border-color);width:var(--sui-textbox-height);aspect-ratio:1/1;}.password-input.svelte-18xfqn2 button:last-child,
.secret-input.svelte-18xfqn2 button:last-child {border-start-start-radius:0;border-start-end-radius:4px;border-end-end-radius:4px;border-end-start-radius:0;}.password-input.svelte-18xfqn2 button .icon,
.secret-input.svelte-18xfqn2 button .icon {font-size:var(--sui-font-size-xx-large);}.secret-input.show.svelte-18xfqn2 input {-webkit-text-security:none;}.secret-input.svelte-18xfqn2 input {-webkit-text-security:disc;}.password-input.svelte-18xfqn2:dir(rtl),
.secret-input.svelte-18xfqn2:dir(rtl) {--sui-textbox-text-align: right;}`};function wye(e,t){let n=Eo();O(t,!0),K(e,Cye);let r=J(t,`value`,15),i=J(t,`flex`,3,!1),a=J(t,`monospace`,3,!0),o=J(t,`hidden`,3,!1),s=J(t,`disabled`,3,!1),c=J(t,`readonly`,3,!1),l=J(t,`required`,3,!1),u=J(t,`invalid`,3,!1),d=ks(t,xye),f=j(void 0),p=j(!1),m=A(()=>t.mask===`type`?{show:`_sui.password_input.show_password`,hide:`_sui.password_input.hide_password`}:{show:`_sui.secret_input.show_secret`,hide:`_sui.secret_input.hide_secret`});L(()=>{t.mask===`type`&&z(f)?.setAttribute(`type`,z(p)?`text`:`password`)});var h=Sye();let g;var _=N(h);fu(_,As({dir:`ltr`},()=>t.mask===`css`?{autocomplete:`off`,autocapitalize:`off`,autocorrect:`off`}:{},()=>d,{get id(){return n}},()=>t.mask===`type`?{type:`password`}:{},{spellcheck:`false`,get flex(){return i()},get monospace(){return a()},get hidden(){return o()},get disabled(){return s()},get readonly(){return c()},get required(){return l()},get invalid(){return u()},get element(){return z(f)},set element(e){M(f,e,!0)},get value(){return r()},set value(e){r(e)}}));var v=I(_,2);{let e=e=>{var n=H(),r=P(n),i=e=>{var n=H();Go(P(n),()=>t.visibilityIcon),U(e,n)},a=e=>{{let t=A(()=>z(p)?`visibility_off`:`visibility`);Xc(e,{get name(){return z(t)}})}};G(r,e=>{t.visibilityIcon?e(i):e(a,-1)}),U(e,n)},r=A(()=>s()||c()),i=A(()=>Y(z(p)?z(m).hide:z(m).show));Al(v,{iconic:!0,get disabled(){return z(r)},get pressed(){return z(p)},get"aria-label"(){return z(i)},get"aria-controls"(){return n},onclick:()=>{M(p,!z(p))},startIcon:e,$$slots:{startIcon:!0}})}D(h),R(()=>{g=os(h,1,`sui ${t.mask===`type`?`password-input`:`secret-input`} ${t.class??``}`,`svelte-18xfqn2`,g,{flex:i(),disabled:s(),readonly:c(),show:t.mask===`css`&&z(p)}),q(h,`hidden`,o())}),U(e,h),k()}var Tye=new Set([`$$slots`,`$$events`,`$$legacy`,`value`]);function LO(e,t){O(t,!0);let n=J(t,`value`,15),r=ks(t,Tye);wye(e,As(()=>r,{mask:`css`,get value(){return n()},set value(e){n(e)}})),k()}var Eye=new Set([`$$slots`,`$$events`,`$$legacy`,`selected`,`expanded`,`class`,`hidden`,`disabled`,`label`,`value`,`valueType`,`children`,`items`,`startIcon`,`endIcon`,`chevronIcon`,`onChange`,`onSelect`,`onExpand`]),Dye=B(`<span role="none" class="chevron svelte-fhtxf0" data-action="toggle"><!></span>`),Oye=B(`<span role="none" class="chevron placeholder svelte-fhtxf0"></span>`),kye=B(`<div role="group" class="group svelte-fhtxf0"><!></div>`),Aye=B(`<div><div role="none" class="row svelte-fhtxf0"><!> <!> <span role="none" class="label svelte-fhtxf0"><!></span> <!></div> <!></div>`),jye={hash:`svelte-fhtxf0`,code:`[role=treeitem].svelte-fhtxf0 {display:block;}[role=treeitem][hidden].svelte-fhtxf0 {display:none;}[role=treeitem].svelte-fhtxf0:focus-visible {outline-color:transparent;}[role=treeitem].svelte-fhtxf0:focus-visible > .row:where(.svelte-fhtxf0) {outline-color:var(--sui-focus-ring-color);outline-offset:calc(var(--sui-focus-ring-width) * -1);}[role=treeitem][aria-selected=true].svelte-fhtxf0 > .row:where(.svelte-fhtxf0) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}[role=treeitem].svelte-fhtxf0 > .row:where(.svelte-fhtxf0):hover {color:var(--sui-highlight-foreground-color);background-color:var(--sui-hover-background-color);}[role=treeitem].svelte-fhtxf0 > .row:where(.svelte-fhtxf0):active {background-color:var(--sui-active-background-color);}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-fhtxf0 > .row:where(.svelte-fhtxf0) {cursor:default;}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-fhtxf0 > .row:where(.svelte-fhtxf0):is(:where(.svelte-fhtxf0):hover, :where(.svelte-fhtxf0):active) {color:var(--sui-tree-foreground-color);background-color:transparent;}[role='tree'][aria-readonly='true'] [role=treeitem].svelte-fhtxf0 > .row:where(.svelte-fhtxf0) > .chevron:where(.svelte-fhtxf0):not(.placeholder) {cursor:pointer;}[role='tree'][aria-readonly='true'] [role=treeitem][aria-selected=true].svelte-fhtxf0 > .row:where(.svelte-fhtxf0):is(:where(.svelte-fhtxf0):hover, :where(.svelte-fhtxf0):active) {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);}[role=treeitem][aria-expanded=true].svelte-fhtxf0 > .row:where(.svelte-fhtxf0) > .chevron:where(.svelte-fhtxf0):dir(ltr) {transform:rotate(90deg);}[role=treeitem][aria-expanded=true].svelte-fhtxf0 > .row:where(.svelte-fhtxf0) > .chevron:where(.svelte-fhtxf0):dir(rtl) {transform:rotate(-90deg);}.row.svelte-fhtxf0 {display:flex;align-items:center;gap:4px;border-radius:var(--sui-tree-item-border-radius, var(--sui-option-border-radius, 4px));padding:var(--sui-tree-item-padding, var(--sui-option-padding, 0 8px));min-height:var(--sui-tree-item-height, var(--sui-option-height));cursor:pointer;transition:background-color 200ms;}.chevron.svelte-fhtxf0 {flex:none;display:flex;align-items:center;justify-content:center;margin-inline-start:calc((var(--sui-tree-item-level, 1) - 1) * var(--sui-tree-item-indent, 16px));width:var(--sui-tree-item-chevron-size, 24px);height:var(--sui-tree-item-chevron-size, 24px);transition:transform 200ms;}.label.svelte-fhtxf0 {flex:auto;overflow:hidden;padding:0 4px;white-space:nowrap;text-overflow:ellipsis;}.group.svelte-fhtxf0 {display:block;}.group[hidden].svelte-fhtxf0 {display:none;}`};function RO(e,t){let n=Eo();O(t,!0),K(e,jye);let r=J(t,`selected`,15,!1),i=J(t,`expanded`,15,!1),a=J(t,`hidden`,3,!1),o=J(t,`disabled`,3,!1),s=J(t,`label`,3,``),c=J(t,`value`,19,s),l=J(t,`valueType`,19,()=>dl(c())),u=ks(t,Eye),d=(si(`sui:tree-item-level`)??0)+1;ci(`sui:tree-item-level`,d);let f=e=>{r(e.detail.selected),t.onChange?.(e)},p=e=>{i(e.detail.expanded),t.onExpand?.(e)},m=e=>{t.onSelect?.(e)},h=e=>{let t=[[`Change`,f],[`Expand`,p],[`Select`,m]];return t.forEach(([t,n])=>{e.addEventListener(t,n)}),()=>{t.forEach(([t,n])=>{e.removeEventListener(t,n)})}};var g=Aye();bs(g,()=>({...u,id:n,role:`treeitem`,class:`sui treeitem ${t.class??``}`,tabindex:`-1`,hidden:a(),"aria-hidden":a(),"aria-disabled":o(),"aria-selected":r(),"aria-expanded":t.items?i():void 0,"aria-level":d,"aria-labelledby":`${n}-label`,"data-label":s(),"data-value":c(),"data-type":l()}),void 0,void 0,void 0,`svelte-fhtxf0`);var _=N(g);let v;var y=N(_),b=e=>{var n=Dye(),r=N(n),i=e=>{var n=H();Go(P(n),()=>t.chevronIcon),U(e,n)},a=e=>{{let t=A(()=>qc()?`chevron_left`:`chevron_right`);Xc(e,{get name(){return z(t)}})}};G(r,e=>{t.chevronIcon?e(i):e(a,-1)}),D(n),U(e,n)},x=e=>{U(e,Oye())};G(y,e=>{t.items?e(b):e(x,-1)});var S=I(y,2);Go(S,()=>t.startIcon??kr);var C=I(S,2),w=N(C),T=e=>{var t=V();R(()=>W(t,s())),U(e,t)},ee=e=>{var n=H();Go(P(n),()=>t.children??kr),U(e,n)};G(w,e=>{s()?e(T):e(ee,-1)}),D(C),Go(I(C,2),()=>t.endIcon??kr),D(_);var te=I(_,2),ne=e=>{var n=kye();Go(N(n),()=>t.items),D(n),R(()=>q(n,`hidden`,!i())),U(e,n)};G(te,e=>{t.items&&e(ne)}),D(g),es(g,()=>h),R(()=>{v=cs(_,``,v,{"--sui-tree-item-level":d}),q(C,`id`,`${n}-label`)}),U(e,g),k()}var zO=`[role="treeitem"]`,Mye=class{#e=new zl;constructor(e,{clickToSelect:t=!0,selectionFollowsFocus:n,expandOnSelect:r=!0}={}){e.dispatchEvent(new CustomEvent(`Initializing`)),this.parent=e,this.id=bl(`tree`),this.clickToSelect=t,this.expandOnSelect=r,this.selectionFollowsFocusOption=n,this.anchor=void 0,this.activated=!1,this.destroyed=!1,this._onClick=Vl(this,e=>this.onClick(e)),this._onKeyDown=Vl(this,e=>this.onKeyDown(e)),this._onFocusIn=Vl(this,e=>this.onFocusIn(e)),this.observer=new globalThis.MutationObserver(()=>{this.update()}),this.parent.tabIndex=-1,e.addEventListener(`click`,this._onClick),e.addEventListener(`keydown`,this._onKeyDown),e.addEventListener(`focusin`,this._onFocusIn),Hl(this,()=>this.destroyed)}activate(){if(this.activated)return;let{parent:e}=this;this.activated=!0,this.update(),this.observer.observe(e,{childList:!0,subtree:!0}),e.dispatchEvent(new CustomEvent(`Initialized`))}get multi(){return this.parent.getAttribute(`aria-multiselectable`)===`true`}get selectionFollowsFocus(){return this.selectionFollowsFocusOption??!this.multi}get isDisabled(){return this.parent.matches(`[aria-disabled="true"]`)}get isReadOnly(){return this.parent.matches(`[aria-readonly="true"]`)}get allItems(){return[...this.parent.querySelectorAll(zO)]}get visibleItems(){let e=[],t=n=>{[...n.children].forEach(n=>{if(n.getAttribute(`role`)!==`treeitem`){t(n);return}let r=n;if(r.matches(`[hidden], [aria-hidden="true"]`)||e.push(r),this.isParent(r)&&!this.isExpanded(r))return;let i=this.getGroup(r);i&&t(i)})};return t(this.parent),e}get activeItems(){return this.visibleItems.filter(e=>!e.matches(`[aria-disabled="true"]`))}get selectedItems(){return[...this.parent.querySelectorAll(`${zO}[aria-selected="true"]`)]}get currentItem(){return this.allItems.find(e=>e.tabIndex===0)}getGroup(e){return[...e.children].find(e=>e.getAttribute(`role`)===`group`)}getChildItems(e){let t=this.getGroup(e);return t?this.getItemsInGroup(t):[]}getItemsInGroup(e){let t=[],n=e=>{[...e.children].forEach(e=>{let r=e.getAttribute(`role`);r===`treeitem`?t.push(e):r!==`group`&&r!==`tree`&&n(e)})};return n(e),t}getParentItem(e){return e.parentElement?.closest(zO)??void 0}isParent(e){return e.hasAttribute(`aria-expanded`)}isExpanded(e){return e.getAttribute(`aria-expanded`)===`true`}getLabel(e){return e.dataset.label??e.querySelector(`.label`)?.textContent??``}update(){let{allItems:e,activeItems:t}=this;e.forEach((e,t)=>{e.id||=`${this.id}-item-${t+1}`,e.hasAttribute(`aria-selected`)||e.setAttribute(`aria-selected`,`false`)}),[this.parent,...this.parent.querySelectorAll(`[role="group"]`)].forEach(e=>{let t=this.getItemsInGroup(e);t.forEach((e,n)=>{e.setAttribute(`aria-posinset`,String(n+1)),e.setAttribute(`aria-setsize`,String(t.length))})});let n=t.find(e=>e===document.activeElement)??t.find(e=>e.tabIndex===0)??t.find(e=>e.getAttribute(`aria-selected`)===`true`)??t[0];this.setTabStop(n)}scrollIntoView(e){Nl(e)}setTabStop(e){this.parent.querySelectorAll(`${zO}[tabindex]:not([tabindex="-1"])`).forEach(t=>{t!==e&&(t.tabIndex=-1)}),e&&(e.tabIndex=0)}focusItem(e,{select:t=this.selectionFollowsFocus}={}){this.setTabStop(e),e.focus(),e.dispatchEvent(new CustomEvent(`Focus`)),this.scrollIntoView(e),t&&this.selectItem(e)}setSelected(e,t){e.getAttribute(`aria-selected`)===`true`!==t&&(e.setAttribute(`aria-selected`,String(t)),e.dispatchEvent(new CustomEvent(`Change`,{detail:{selected:t}})),t&&e.dispatchEvent(new CustomEvent(`Select`)))}selectItem(e,{additive:t=!1,range:n=!1}={}){if(this.isDisabled||this.isReadOnly)return;let{multi:r,anchor:i}=this,a=r&&n&&i&&i!==e?this.visibleItems:[],o=a.indexOf(i);if(o!==-1){let t=[o,a.indexOf(e)].sort((e,t)=>e-t);a.forEach((e,n)=>{this.setSelected(e,n>=t[0]&&n<=t[1]&&!e.matches(`[aria-disabled="true"]`))})}else r&&t?(this.setSelected(e,e.getAttribute(`aria-selected`)!==`true`),this.anchor=e):(this.selectedItems.forEach(t=>{t!==e&&this.setSelected(t,!1)}),this.setSelected(e,!0),this.anchor=e);this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:Fl(e)}))}selectAll(e){this.isDisabled||this.isReadOnly||!this.multi||(this.activeItems.forEach(e=>{this.setSelected(e,!0)}),this.parent.dispatchEvent(new CustomEvent(`Change`,{detail:Fl(e)})))}expandItem(e,t){if(this.isDisabled||!this.isParent(e)||this.isExpanded(e)===t)return;let n=this.getGroup(e);e.setAttribute(`aria-expanded`,String(t)),n&&(n.hidden=!t),e.dispatchEvent(new CustomEvent(`Expand`,{detail:{expanded:t}})),this.update()}expandSiblings(e){let t=this.getParentItem(e),n=t?this.getGroup(t):this.parent;n&&this.getItemsInGroup(n).forEach(e=>{this.expandItem(e,!0)})}typeAhead(e,t){let n=this.activeItems,r=Bl(n.map(e=>Ll(this.getLabel(e))),this.#e.push(e),n.indexOf(t));r!==-1&&n[r]!==t&&this.focusItem(n[r])}onFocusIn(e){let t=e.target.closest(zO);t&&this.setTabStop(t)}onClick(e){let t=e.target,n=t.closest(zO);if(!n||e.button!==0||this.isDisabled)return;if(n.matches(`[aria-disabled="true"]`)){e.preventDefault();return}let{ctrlKey:r,metaKey:i,shiftKey:a}=e;t.closest(`[data-action="toggle"]`)?(e.preventDefault(),this.focusItem(n,{select:!1}),this.expandItem(n,!this.isExpanded(n))):(this.focusItem(n,{select:!1}),this.clickToSelect&&this.selectItem(n,{additive:r||i,range:a}),this.expandOnSelect&&!r&&!i&&!a&&this.expandItem(n,!this.isExpanded(n)))}onKeyDown(e){let{key:t,ctrlKey:n,metaKey:r,shiftKey:i,altKey:a}=e,{activeItems:o,multi:s}=this;if(this.isDisabled||a||!o.length)return;let c=e.target.closest(zO)??this.currentItem??o[0],l=o.indexOf(c),{prevKey:u,nextKey:d}=Rl(`horizontal`,qc());if(t===`a`&&(n||r))s&&(e.preventDefault(),this.selectAll(c));else if(!(n||r)){if(t===`Enter`)e.preventDefault(),c.click();else if(t===` `)e.preventDefault(),s?this.selectItem(c,{additive:!i,range:i}):this.selectItem(c);else if(t===`ArrowDown`||t===`ArrowUp`){e.preventDefault();let n=o[t===`ArrowDown`?l+1:l-1];if(!n)return;s&&i?(this.focusItem(n,{select:!1}),this.selectItem(n,{additive:!0})):this.focusItem(n)}else if(t===d){if(e.preventDefault(),!this.isParent(c))return;if(!this.isExpanded(c)){this.expandItem(c,!0);return}let t=this.getChildItems(c).find(e=>o.includes(e));t&&this.focusItem(t)}else if(t===u){if(e.preventDefault(),this.isParent(c)&&this.isExpanded(c)){this.expandItem(c,!1);return}let t=this.getParentItem(c);t&&o.includes(t)&&this.focusItem(t)}else t===`Home`||t===`End`?(e.preventDefault(),this.focusItem(t===`Home`?o[0]:o[o.length-1])):t===`*`?(e.preventDefault(),this.expandSiblings(c)):t.length===1&&t.trim()&&this.typeAhead(t,c)}}destroy(){this.destroyed=!0,this.#e.reset(),this.observer.disconnect(),this.parent.removeEventListener(`click`,this._onClick),this.parent.removeEventListener(`keydown`,this._onKeyDown),this.parent.removeEventListener(`focusin`,this._onFocusIn)}},Nye=e=>t=>{let n=new Mye(t,e);return()=>{n.destroy()}},Pye=new Set([`$$slots`,`$$events`,`$$legacy`,`element`,`class`,`hidden`,`disabled`,`readonly`,`multiple`,`clickToSelect`,`selectionFollowsFocus`,`expandOnSelect`,`ariaLabel`,`children`,`onChange`]),Fye=B(`<div><div role="none" class="inner svelte-l14zys"><!></div></div>`),Iye={hash:`svelte-l14zys`,code:`[role=tree].svelte-l14zys {display:flex;flex-direction:column;margin:var(--sui-focus-ring-width);border-width:var(--sui-tree-border-width, 1px);border-style:var(--sui-tree-border-style, solid);border-color:var(--sui-tree-border-color, var(--sui-secondary-border-color));border-radius:var(--sui-tree-border-radius, 4px);padding:var(--sui-tree-padding, 4px);min-width:var(--sui-tree-min-width, calc(var(--sui-option-height) * 5));overflow:auto;color:var(--sui-tree-foreground-color, var(--sui-control-foreground-color));background-color:var(--sui-tree-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}.inner.svelte-l14zys {display:contents;}`};function BO(e,t){O(t,!0),K(e,Iye);let n=J(t,`element`,15),r=J(t,`hidden`,3,!1),i=J(t,`disabled`,3,!1),a=J(t,`readonly`,3,!1),o=J(t,`multiple`,3,!1),s=J(t,`clickToSelect`,3,!0),c=J(t,`selectionFollowsFocus`,3,void 0),l=J(t,`expandOnSelect`,3,!0),u=J(t,`ariaLabel`,3,void 0),d=ks(t,Pye);var f=Fye(),p=e=>{t.onChange?.(e)};bs(f,()=>({...d,role:`tree`,class:`sui tree ${t.class??``}`,hidden:r(),"aria-hidden":r(),"aria-disabled":i(),"aria-readonly":a()||void 0,"aria-multiselectable":o(),"aria-label":u(),onChange:p}),void 0,void 0,void 0,`svelte-l14zys`);var m=N(f);Go(N(m),()=>t.children??kr),D(m),D(f),Ds(f,e=>n(e),()=>n()),es(f,()=>Nye({clickToSelect:s(),selectionFollowsFocus:c(),expandOnSelect:l()})),R(()=>m.inert=i()),U(e,f),k()}var Lye=[`text`,`search`,`url`,`tel`,`email`,`password`,`number`],Rye=e=>document.documentElement.matches(`[data-env="dev"]`)?!0:e instanceof Element?e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&Lye.includes(e.type)||e.closest(`[role="textbox"]`)?.contentEditable===`true`:!1,zye={hash:`svelte-ytafm9`,code:`
/* https://fontsource.org/fonts/source-sans-3/cdn */
@font-face {font-family:'Source Sans 3';font-style:normal;font-display:swap;font-weight:200 900;src:url(https://cdn.jsdelivr.net/fontsource/fonts/source-sans-3:vf@5.3.1/latin-wght-normal.woff2)
format('woff2-variations');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;size-adjust:110%;
}
/* https://fontsource.org/fonts/noto-mono/cdn */
@font-face {font-family:'Noto Mono';font-style:normal;font-display:swap;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/noto-mono@5.3.0/latin-400-normal.woff2)
format('woff2');
}
/* https://fontsource.org/fonts/material-symbols-outlined/cdn */
@font-face {font-family:'Material Symbols Outlined';font-style:normal;font-display:block;font-weight:400;src:url(https://cdn.jsdelivr.net/fontsource/fonts/material-symbols-outlined:vf@5.3.9/latin-wght-normal.woff2)
format('woff2-variations');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}.material-symbols-outlined {
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */font-family:'Material Symbols Outlined';font-weight:normal;font-style:normal;font-size:24px;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;overflow-wrap:normal;direction:ltr;-moz-font-feature-settings:'liga';font-feature-settings:'liga';}`};function Bye(e){K(e,zye)}var Vye=new Set([`$$slots`,`$$events`,`$$legacy`,`orientation`,`children`]),Hye=B(`<meta name="viewport"/> <meta name="google" content="notranslate"/> <!>`,1),Uye=B(`<div class="font-loader svelte-1czfn2k" aria-hidden="true">Loading <strong>Sveltia</strong> <em>UI</em> <span role="none" class="material-symbols-outlined">favorite</span></div>`),Wye=B(`<!> <div><!></div>`,1),Gye={hash:`svelte-1czfn2k`,code:`:root,
:host {--sui-base-hue: 210;--sui-highlight-foreground-color: hsl(var(--sui-foreground-color-1-hsl));--sui-primary-foreground-color: hsl(var(--sui-foreground-color-2-hsl));--sui-secondary-foreground-color: hsl(var(--sui-foreground-color-3-hsl));--sui-tertiary-foreground-color: hsl(var(--sui-foreground-color-4-hsl));--sui-disabled-foreground-color: hsl(var(--sui-foreground-color-5-hsl));--sui-error-foreground-color: hsl(
var(--sui-error-color-hue) var(--sui-alert-foreground-color-saturation)
var(--sui-alert-foreground-color-lightness)
);--sui-warning-foreground-color: hsl(
var(--sui-warning-color-hue) var(--sui-alert-foreground-color-saturation)
var(--sui-alert-foreground-color-lightness)
);--sui-info-foreground-color: hsl(
var(--sui-info-color-hue) var(--sui-alert-foreground-color-saturation)
var(--sui-alert-foreground-color-lightness)
);--sui-success-foreground-color: hsl(
var(--sui-success-color-hue) var(--sui-alert-foreground-color-saturation)
var(--sui-alert-foreground-color-lightness)
);--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 35%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl) / 75%);--sui-active-background-color: hsl(var(--sui-background-color-5-hsl) / 100%);--sui-content-background-color: hsl(var(--sui-background-color-1-hsl));--sui-code-background-color: hsl(var(--sui-background-color-3-hsl));--sui-primary-background-color: hsl(var(--sui-background-color-2-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl) / 80%);--sui-secondary-background-color: hsl(var(--sui-background-color-3-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl) / 80%);--sui-tertiary-background-color: hsl(var(--sui-background-color-4-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl) / 80%);--sui-disabled-background-color: hsl(var(--sui-background-color-4-hsl));--sui-error-background-color: hsl(
var(--sui-error-color-hue) var(--sui-alert-background-color-saturation)
var(--sui-alert-background-color-lightness)
);--sui-warning-background-color: hsl(
var(--sui-warning-color-hue) var(--sui-alert-background-color-saturation)
var(--sui-alert-background-color-lightness)
);--sui-info-background-color: hsl(
var(--sui-info-color-hue) var(--sui-alert-background-color-saturation)
var(--sui-alert-background-color-lightness)
);--sui-success-background-color: hsl(
var(--sui-success-color-hue) var(--sui-alert-background-color-saturation)
var(--sui-alert-background-color-lightness)
);--sui-disabled-opacity: 0.35;--sui-modal-border-width: 0;--sui-focus-ring-width: 2px;--sui-focus-ring-color: var(--sui-primary-accent-color);--sui-focus-ring-offset: 1px;--sui-primary-border-color: hsl(var(--sui-border-color-2-hsl));--sui-secondary-border-color: hsl(var(--sui-border-color-3-hsl));--sui-error-border-color: hsl(
var(--sui-error-color-hue) var(--sui-alert-border-color-saturation)
var(--sui-error-border-color-lightness, var(--sui-alert-border-color-lightness))
);--sui-warning-border-color: hsl(
var(--sui-warning-color-hue) var(--sui-alert-border-color-saturation)
var(--sui-alert-border-color-lightness)
);--sui-info-border-color: hsl(
var(--sui-info-color-hue) var(--sui-alert-border-color-saturation)
var(--sui-alert-border-color-lightness)
);--sui-success-border-color: hsl(
var(--sui-success-color-hue) var(--sui-alert-border-color-saturation)
var(--sui-alert-border-color-lightness)
);--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 40%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 40%);--sui-font-family-default: "Source Sans 3", system-ui, sans-serif;--sui-font-size-xxx-large: 25px;--sui-font-size-xx-large: 21px;--sui-font-size-x-large: 19px;--sui-font-size-large: 17px;--sui-font-size-default: 15px;--sui-font-size-small: 13px;--sui-font-size-x-small: 11px;--sui-font-weight-normal: 400;--sui-font-weight-bold: 700;--sui-font-family-monospace: "Noto Sans Mono", ui-monospace, monospace;--sui-font-size-monospace: 0.9em;--sui-line-height-default: 1.2;--sui-line-height-compact: 1.4;--sui-line-height-comfortable: 1.6;--sui-word-spacing-normal: 1px;--sui-heading-margin: 0;--sui-heading-font-family: var(--sui-font-family-default);--sui-heading-font-weight: var(--sui-font-weight-bold);--sui-heading-line-height: var(--sui-line-height-default);--sui-paragraph-margin: 1.75em;--sui-menuitem-font-size: 14px;--sui-control-small-border-width: 1px;--sui-control-small-border-radius: calc(var(--sui-control-small-height) / 8);--sui-control-small-padding: 0 calc((var(--sui-control-small-height) / 5));--sui-control-small-height: 24px;--sui-control-medium-border-width: 1px;--sui-control-medium-border-radius: calc(var(--sui-control-medium-height) / 8);--sui-control-medium-padding: 0 calc((var(--sui-control-medium-height) / 4));--sui-control-medium-height: 32px;--sui-control-large-border-width: 1px;--sui-control-large-border-radius: calc(var(--sui-control-large-height) / 8);--sui-control-large-padding: 0 calc((var(--sui-control-large-height) / 3));--sui-control-large-height: 40px;--sui-control-border-color: hsl(var(--sui-border-color-2-hsl));--sui-control-foreground-color: var(--sui-primary-foreground-color);--sui-control-background-color: hsl(var(--sui-background-color-4-hsl));--sui-control-font-family: var(--sui-font-family-default);--sui-control-font-size: var(--sui-font-size-default);--sui-control-line-height: var(--sui-line-height-compact);--sui-button-small-border-radius: var(--sui-control-small-border-radius);--sui-button-small-padding: var(--sui-control-small-padding);--sui-button-small-height: var(--sui-control-small-height);--sui-button-medium-border-radius: var(--sui-control-medium-border-radius);--sui-button-medium-padding: var(--sui-control-medium-padding);--sui-button-medium-height: var(--sui-control-medium-height);--sui-button-large-border-radius: var(--sui-control-large-border-radius);--sui-button-large-padding: var(--sui-control-large-padding);--sui-button-large-height: var(--sui-control-large-height);--sui-button-border-color: var(--sui-control-border-color);--sui-button-background-color: var(--sui-control-background-color);--sui-checkbox-border-radius: var(--sui-control-medium-border-radius);--sui-checkbox-height: 20px;--sui-checkbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-checkbox-background-color: var(--sui-control-background-color);--sui-readonly-accent-color: var(--sui-tertiary-foreground-color);--sui-readonly-accent-color-inverted: var(--sui-primary-background-color);--sui-option-border-radius: var(--sui-control-medium-border-radius);--sui-option-padding: calc((var(--sui-control-medium-height) / 6))
calc((var(--sui-control-medium-height) / 5));--sui-option-height: var(--sui-control-medium-height);--sui-listbox-border-radius: var(--sui-control-medium-border-radius);--sui-listbox-border-color: var(--sui-control-border-color);--sui-listbox-foreground-color: var(--sui-control-foreground-color);--sui-listbox-background-color: hsl(var(--sui-background-color-1-hsl));--sui-tree-border-radius: var(--sui-control-medium-border-radius);--sui-tree-border-color: var(--sui-control-border-color);--sui-tree-foreground-color: var(--sui-control-foreground-color);--sui-tree-background-color: hsl(var(--sui-background-color-1-hsl));--sui-tree-item-border-radius: var(--sui-control-medium-border-radius);--sui-tree-item-padding: var(--sui-option-padding);--sui-tree-item-height: var(--sui-control-medium-height);--sui-tree-item-indent: 16px;--sui-textbox-border-radius: var(--sui-control-medium-border-radius);--sui-textbox-height: var(--sui-control-medium-height);--sui-textbox-border-color: var(--sui-control-border-color);--sui-textbox-foreground-color: var(--sui-control-foreground-color);--sui-textbox-background-color: hsl(var(--sui-background-color-1-hsl));--sui-textbox-font-family: var(--sui-font-family-default);--sui-textbox-font-size: var(--sui-font-size-default);--sui-textbox-singleline-padding: 0 8px;--sui-textbox-singleline-min-width: 240px;--sui-textbox-singleline-line-height: var(--sui-line-height-compact);--sui-textbox-multiline-padding: 16px;--sui-textbox-multiline-min-width: 480px;--sui-textbox-multiline-line-height: var(--sui-line-height-comfortable);--sui-tab-height: var(--sui-control-medium-height);--sui-tab-small-height: var(--sui-control-small-height);--sui-tab-medium-height: var(--sui-control-medium-height);--sui-tab-large-height: var(--sui-control-large-height);--sui-primary-toolbar-size: 56px;--sui-secondary-toolbar-size: 48px;--sui-bottom-navigation-height: var(--sui-primary-toolbar-size);--sui-primary-row-height: 56px;--sui-secondary-row-height: 40px;}
@media (pointer: coarse) {:root,
:host {--sui-menuitem-height: 40px;--sui-control-small-height: 32px;--sui-control-medium-height: 40px;--sui-control-large-height: 48px;--sui-checkbox-height: 24px;--sui-secondary-row-height: 48px;}
}
@media (prefers-reduced-transparency) {:root,
:host {--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));}
}:root[data-theme=light],
:host[data-theme=light] {color-scheme:light;--sui-foreground-color-1-hsl: var(--sui-base-hue) 5% 5%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 25%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 35%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 45%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 65%;--sui-background-color-1-hsl: var(--sui-base-hue) 5% 100%;--sui-background-color-2-hsl: var(--sui-base-hue) 5% 98%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 95%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 92%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 84%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 72%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 80%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 25%;--sui-alert-background-color-saturation: 65%;--sui-alert-background-color-lightness: 90%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 68%;--sui-error-border-color-lightness: 60%;}:root[data-theme=dark],
:host[data-theme=dark] {color-scheme:dark;--sui-foreground-color-1-hsl: var(--sui-base-hue) 10% 95%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 65%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 55%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 35%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 8%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 10%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 13%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 16%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 26%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 24%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 20%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 60%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 100% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 100% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 100% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 75%;--sui-alert-background-color-saturation: 40%;--sui-alert-background-color-lightness: 10%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 38%;}
@media (prefers-color-scheme: light) {:root:not([data-theme]),
:host:not([data-theme]) {color-scheme:light;--sui-foreground-color-1-hsl: var(--sui-base-hue) 5% 5%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 25%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 35%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 45%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 65%;--sui-background-color-1-hsl: var(--sui-base-hue) 5% 100%;--sui-background-color-2-hsl: var(--sui-base-hue) 5% 98%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 95%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 92%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 84%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 72%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 80%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 25%;--sui-alert-background-color-saturation: 65%;--sui-alert-background-color-lightness: 90%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 68%;--sui-error-border-color-lightness: 60%;}
}
@media (prefers-color-scheme: dark) {:root:not([data-theme]),
:host:not([data-theme]) {color-scheme:dark;--sui-foreground-color-1-hsl: var(--sui-base-hue) 10% 95%;--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 65%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 55%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 35%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 8%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 10%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 13%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 16%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 26%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 24%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 20%;--sui-shadow-color: var(--sui-base-hue) 10% 0%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 60%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 100% 45%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 100% 40%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 100% 35%);--sui-primary-accent-color-inverted: hsl(var(--sui-base-hue) 10% 100%);--sui-primary-accent-color-translucent: hsl(var(--sui-base-hue) 80% 50% / 60%);--sui-primary-accent-color-translucent-light: hsl(var(--sui-base-hue) 80% 50% / 40%);--sui-error-color-hue: 0;--sui-warning-color-hue: 40;--sui-info-color-hue: 210;--sui-success-color-hue: 100;--sui-alert-foreground-color-saturation: 85%;--sui-alert-foreground-color-lightness: 75%;--sui-alert-background-color-saturation: 40%;--sui-alert-background-color-lightness: 10%;--sui-alert-border-color-saturation: 48%;--sui-alert-border-color-lightness: 38%;}
}:root[data-contrast=more][data-theme=light],
:host[data-contrast=more][data-theme=light] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}:root[data-contrast=more][data-theme=dark],
:host[data-contrast=more][data-theme=dark] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
@media (prefers-color-scheme: light) {:root[data-contrast=more]:not([data-theme]),
:host[data-contrast=more]:not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
}
@media (prefers-color-scheme: dark) {:root[data-contrast=more]:not([data-theme]),
:host[data-contrast=more]:not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
}
@media (prefers-contrast: more) {:root:not([data-contrast])[data-theme=light],
:host:not([data-contrast])[data-theme=light] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}:root:not([data-contrast])[data-theme=dark],
:host:not([data-contrast])[data-theme=dark] {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
}
@media (prefers-contrast: more) and (prefers-color-scheme: light) {:root:not([data-contrast]):not([data-theme]),
:host:not([data-contrast]):not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 5% 10%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 5% 18%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 5% 28%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 5% 45%;--sui-background-color-3-hsl: var(--sui-base-hue) 5% 93%;--sui-background-color-4-hsl: var(--sui-base-hue) 5% 88%;--sui-background-color-5-hsl: var(--sui-base-hue) 5% 70%;--sui-border-color-1-hsl: var(--sui-base-hue) 5% 40%;--sui-border-color-2-hsl: var(--sui-base-hue) 5% 55%;--sui-border-color-3-hsl: var(--sui-base-hue) 5% 65%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-light: hsl(var(--sui-base-hue) 80% 37%);--sui-primary-accent-color: hsl(var(--sui-base-hue) 80% 32%);--sui-primary-accent-color-dark: hsl(var(--sui-base-hue) 80% 26%);--sui-alert-foreground-color-lightness: 18%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 40%;--sui-error-border-color-lightness: 40%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {:root:not([data-contrast]):not([data-theme]),
:host:not([data-contrast]):not([data-theme]) {--sui-foreground-color-2-hsl: var(--sui-base-hue) 10% 92%;--sui-foreground-color-3-hsl: var(--sui-base-hue) 10% 85%;--sui-foreground-color-4-hsl: var(--sui-base-hue) 10% 75%;--sui-foreground-color-5-hsl: var(--sui-base-hue) 10% 55%;--sui-background-color-1-hsl: var(--sui-base-hue) 10% 4%;--sui-background-color-2-hsl: var(--sui-base-hue) 10% 7%;--sui-background-color-3-hsl: var(--sui-base-hue) 10% 12%;--sui-background-color-4-hsl: var(--sui-base-hue) 10% 18%;--sui-background-color-5-hsl: var(--sui-base-hue) 10% 40%;--sui-border-color-1-hsl: var(--sui-base-hue) 10% 60%;--sui-border-color-2-hsl: var(--sui-base-hue) 10% 50%;--sui-border-color-3-hsl: var(--sui-base-hue) 10% 40%;--sui-primary-accent-color-text: hsl(var(--sui-base-hue) 100% 70%);--sui-focus-ring-color: var(--sui-primary-accent-color-text);--sui-alert-foreground-color-lightness: 85%;--sui-alert-border-color-saturation: 55%;--sui-alert-border-color-lightness: 55%;--sui-hover-background-color: hsl(var(--sui-background-color-5-hsl) / 60%);--sui-selected-background-color: hsl(var(--sui-background-color-5-hsl));--sui-active-background-color: hsl(var(--sui-background-color-5-hsl));--sui-primary-background-color-translucent: hsl(var(--sui-background-color-2-hsl));--sui-secondary-background-color-translucent: hsl(var(--sui-background-color-3-hsl));--sui-tertiary-background-color-translucent: hsl(var(--sui-background-color-4-hsl));--sui-popup-shadow-color: hsl(var(--sui-shadow-color) / 70%);--sui-popup-backdrop-color: hsl(var(--sui-shadow-color) / 60%);--sui-textbox-border-color: hsl(var(--sui-border-color-1-hsl));--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;--sui-disabled-opacity: 0.6;--sui-modal-border-width: 1px;}
}.material-symbols-outlined {font-variation-settings:"FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;}*,
::before,
::after {overflow-anchor:none;scroll-behavior:smooth;box-sizing:border-box;outline-offset:0px;outline-width:var(--sui-focus-ring-width) !important;outline-style:solid;outline-color:transparent;border-width:0;border-style:solid;vertical-align:top;font-size-adjust:inherit;}
@media (prefers-reduced-motion) {*,
::before,
::after {scroll-behavior:auto;transition-duration:1ms !important;}
}::selection {background-color:var(--sui-primary-accent-color-translucent-light);}* {-webkit-tap-highlight-color:transparent;}:focus {z-index:1;outline-width:0;}:focus-visible {outline-color:var(--sui-focus-ring-color);outline-offset:var(--sui-focus-ring-offset, 0);z-index:2;}h1 {margin:var(--sui-h1-margin, var(--sui-heading-margin));font-size:var(--sui-h1-font-size, 34px);font-family:var(--sui-h1-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h1-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h1-line-height, var(--sui-heading-line-height));}h2 {margin:var(--sui-h2-margin, var(--sui-heading-margin));font-size:var(--sui-h2-font-size, 30px);font-family:var(--sui-h2-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h2-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h2-line-height, var(--sui-heading-line-height));}h3 {margin:var(--sui-h3-margin, var(--sui-heading-margin));font-size:var(--sui-h3-font-size, 26px);font-family:var(--sui-h3-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h3-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h3-line-height, var(--sui-heading-line-height));}h4 {margin:var(--sui-h4-margin, var(--sui-heading-margin));font-size:var(--sui-h4-font-size, 22px);font-family:var(--sui-h4-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h4-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h4-line-height, var(--sui-heading-line-height));}h5 {margin:var(--sui-h5-margin, var(--sui-heading-margin));font-size:var(--sui-h5-font-size, 18px);font-family:var(--sui-h5-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h5-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h5-line-height, var(--sui-heading-line-height));}h6 {margin:var(--sui-h6-margin, var(--sui-heading-margin));font-size:var(--sui-h6-font-size, 14px);font-family:var(--sui-h6-font-family, var(--sui-heading-font-family));font-weight:var(--sui-h6-font-weight, var(--sui-heading-font-weight));line-height:var(--sui-h6-line-height, var(--sui-heading-line-height));}strong {font-weight:var(--sui-font-weight-bold, bold);}a {color:var(--sui-primary-accent-color-text);text-decoration:none;text-underline-offset:2px;}a:is(:hover, :focus, :active) {text-decoration:underline;}:is(:root, :host)[data-underline-links="true"] a {text-decoration:underline;}:is(p, ul, ol, dl) {margin:var(--sui-paragraph-margin) 0;line-height:var(--sui-line-height-comfortable);}:is(ul, ol) {padding-inline:2em;}:is(code, pre) {border-radius:4px;background-color:var(--sui-code-background-color);font-family:var(--sui-font-family-monospace);font-size:var(--sui-font-size-monospace);vertical-align:-0.05em;}pre {padding:8px;line-height:var(--sui-line-height-compact);-webkit-user-select:text;user-select:text;}code {padding:2px 4px;}table {border-collapse:collapse;}:is(th, td) {border:1px solid var(--sui-textbox-border-color);padding:8px;}blockquote {margin-inline:16px 0;border-inline-start:4px solid var(--sui-textbox-border-color);padding-inline-start:12px;}:is(.disabled, [aria-disabled=true], [inert]):not(body) {cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none;filter:grayscale(1) opacity(var(--sui-disabled-opacity, 0.35));}:is(.disabled, [aria-disabled=true], [inert]):not(body) * {filter:grayscale(0) opacity(1);}:is(.disabled, [aria-disabled=true], [inert]) * {cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none;}:is(.readonly, [aria-readonly=true]):not(body) {cursor:default;}:is(.readonly, [aria-readonly=true]):not(body) * {cursor:default;}.font-loader.svelte-1czfn2k {position:absolute;inset-inline-start:-99999px;font-family:var(--sui-font-family-default);}.app-shell.svelte-1czfn2k {position:fixed;inset:0;overflow:hidden;width:100%;height:100%;color:var(--sui-primary-foreground-color);background-color:var(--sui-primary-background-color);font-family:var(--sui-font-family-default);font-size:var(--sui-font-size-default);font-weight:var(--sui-font-weight-normal, normal);word-spacing:var(--sui-word-spacing-normal);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-user-select:none;user-select:none;touch-action:none;cursor:default;}.app-shell.horizontal.svelte-1czfn2k {display:flex;flex-direction:row;overflow:hidden;}.app-shell.vertical.svelte-1czfn2k {display:flex;flex-direction:column;overflow:hidden;}`};function Kye(e,t){O(t,!0),K(e,Gye);let n=J(t,`orientation`,3,`horizontal`),r=ks(t,Vye),i=j(!1);js(()=>{let e=globalThis.matchMedia(`(prefers-color-scheme: dark)`),{dataset:t}=document.documentElement,n=()=>{t.autoTheming!==`false`&&(t.theme=e.matches?`dark`:`light`)};n(),e.addEventListener(`change`,n);let r=globalThis.setTimeout(()=>{M(i,!0)},1e3);return()=>{e.removeEventListener(`change`,n),globalThis.clearTimeout(r)}});var a=Wye();$o(`1czfn2k`,e=>{var t=Hye(),n=P(t);Bye(I(n,4),{}),R(e=>q(n,`content`,e),[()=>`width=device-width, initial-scale=1, maximum-scale=1, interactive-widget=resizes-content`]),U(e,t)});var o=P(a),s=e=>{var t=Uye();cs(t,``,{},{opacity:`0`}),U(e,t)};G(o,e=>{z(i)||e(s)});var c=I(o,2),l=e=>e.preventDefault(),u=e=>e.preventDefault(),d=e=>{Rye(e.target)||e.preventDefault()};bs(c,()=>({...r,role:`none`,class:[`sui`,`app-shell`,n()],ondragover:l,ondrop:u,oncontextmenu:d}),void 0,void 0,void 0,`svelte-1czfn2k`),Go(N(c),()=>t.children??kr),D(c),U(e,a),k()}var qye=B(`<div role="none" class="sui empty-state svelte-1wdt5mv"><!></div>`),Jye={hash:`svelte-1wdt5mv`,code:`.empty-state.svelte-1wdt5mv {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:16px;width:100%;height:100%;text-align:center;}`};function VO(e,t){K(e,Jye);let n=J(t,`children`,3,void 0);var r=qye();Go(N(r),()=>n()??kr),D(r),U(e,r)}var Yye=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`hidden`,`disabled`,`ariaLabel`,`children`]),Xye=B(`<div><div role="none" class="inner svelte-l609t5"><!></div></div>`),Zye={hash:`svelte-l609t5`,code:`.inner.svelte-l609t5 {display:contents;}`};function HO(e,t){K(e,Zye);let n=J(t,`hidden`,3,!1),r=J(t,`disabled`,3,!1),i=J(t,`ariaLabel`,3,void 0),a=ks(t,Yye);var o=Xye();bs(o,()=>({...a,role:`group`,class:`sui group ${t.class??``}`,hidden:n(),"aria-hidden":n(),"aria-disabled":r(),"aria-label":i()}),void 0,void 0,void 0,`svelte-l609t5`);var s=N(o);Go(N(s),()=>t.children??kr),D(s),D(o),R(()=>s.inert=r()),U(e,o)}var Qye=B(`<div class="placeholder svelte-1ef93sf"></div>`),$ye={hash:`svelte-1ef93sf`,code:`.placeholder.svelte-1ef93sf {height:64px;}`};function UO(e,t){O(t,!0),K(e,$ye);let n=J(t,`eager`,3,!1),r=j(null),i=j(ta(n()));L(()=>(z(r)&&(async()=>{await Sl(z(r)),M(i,!0)})(),()=>{z(r)&&xl(z(r))}));var a=H(),o=P(a),s=e=>{var n=H();Go(P(n),()=>t.children),U(e,n)},c=e=>{var t=Qye();Ds(t,e=>M(r,e),()=>z(r)),U(e,t)};G(o,e=>{z(i)?e(s):e(c,-1)}),U(e,a),k()}var ebe={ok:`OK`,cancel:`Cancel`,close:`Close`,clear:`Clear`,insert:`Insert`,update:`Update`,remove:`Remove`,collapse:`Collapse`,expand:`Expand`,dismiss:`Dismiss`,alert:{error:`Error`,warning:`Warning`,info:`Information`,success:`Success`},role_descriptions:{disclosure:`disclosure`,option_group:`option group`,menu_item_group:`menu item group`,checkbox_group:`checkbox group`,table_head:`table head`,table_body:`table body`,table_foot:`table foot`,grid_head:`grid head`,grid_body:`grid body`,grid_foot:`grid foot`},emoji_suggestions:`Emoji Suggestions`,calendar:{year:`Year`,previous_decade:`Previous Decade`,next_decade:`Next Decade`,month:`Month`,previous_month:`Previous Month`,next_month:`Next Month`,today:`Today`},split_button:{x_options:`{$name} Options`,more_options:`More Options`},combobox:{select_an_option:`Select an option…`,filter_options:`Filter Options`,no_matching_options:`No matching options found`},number_input:{increase:`Increase`,decrease:`Decrease`,range:`From {$min} to {$max}`,min:`Minimum {$min}`,max:`Maximum {$max}`},password_input:{show_password:`Show Password`,hide_password:`Hide Password`},secret_input:{show_secret:`Show Secret`,hide_secret:`Hide Secret`},select_tags:{selected_options:`Selected Options`,remove_x:`Remove {$name}`},text_editor:{text_editor:`Text Editor`,code_editor:`Code Editor`,text_style_options:`Text Style Options`,show_text_style_options:`Show Text Style Options`,paragraph:`Paragraph`,heading_1:`Heading 1`,heading_2:`Heading 2`,heading_3:`Heading 3`,heading_4:`Heading 4`,heading_5:`Heading 5`,heading_6:`Heading 6`,bulleted_list:`Bulleted List`,numbered_list:`Numbered List`,blockquote:`Block Quote`,code_block:`Code Block`,bold:`Bold`,italic:`Italic`,strikethrough:`Strikethrough`,code:`Code`,link:`Link`,insert_link:`Insert Link`,edit_link:`Edit Link`,remove_link:`Remove Link`,text:`Text`,url:`URL`,open_in_new_tab:`Open in New Tab`,insert_table:`Insert Table`,rows:`Rows`,columns:`Columns`,table_options:`Table Options`,show_table_options:`Show Table Options`,insert_row_above:`Insert Row Above`,insert_row_below:`Insert Row Below`,insert_column_left:`Insert Column Left`,insert_column_right:`Insert Column Right`,delete_row:`Delete Row`,delete_column:`Delete Column`,delete_table:`Delete Table`,insert_horizontal_rule:`Insert Horizontal Rule`,alignment_options:`Alignment Options`,show_alignment_options:`Show Alignment Options`,align_left:`Left Align`,align_center:`Center Align`,align_right:`Right Align`,align_justify:`Justify Align`,edit_in_markdown:`Edit in Markdown`,edit_in_html:`Edit in HTML`,converter_error:`Unable to enable rich text mode. Please use the plain text editor instead.`,language:`Language`,plain_text:`Plain Text`}};function tbe(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1);var o=()=>n()??!1,s=e=>{n(e)};Uu(e,{get checked(){return o()},set checked(e){s(e)},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`}}),k()}var nbe=B(`<p> </p>`);function rbe(e,t){O(t,!0);let n=J(t,`currentValue`,3,!1);var r=H(),i=P(r),a=e=>{var t=nbe(),r=F(t,!0);R(e=>W(r,e),[()=>Y(`boolean.${n()}`)]),U(e,t)};G(i,e=>{typeof n()==`boolean`&&e(a)}),U(e,r),k()}var WO=e=>xE(e).replaceAll(`\\*`,`\\d+`),GO=(e,t)=>e===t||e.startsWith(`${t}.`),KO=new WeakMap,ibe=e=>{let t=KO.get(e);return t||(t=Object.keys(e).map((e,t)=>[e,t]).sort(([e],[t])=>e<t?-1:1),KO.set(e,t)),t},qO=(e,t,{live:n=!1}={})=>{if(n)return Object.keys(e).filter(e=>e.startsWith(t));let r=ibe(e),i=0,a=r.length;for(;i<a;){let e=Math.floor((i+a)/2);r[e][0]<t?i=e+1:a=e}let o=[];for(let e=i;e<r.length&&r[e][0].startsWith(t);e+=1)o.push(r[e]);return o.sort(([,e],[,t])=>e-t).map(([e])=>e)},JO=/^(?<parent>.+)\.\d+$/,YO=new WeakMap,XO=(e,t,{live:n=!1}={})=>{if(n)return Object.keys(e).filter(e=>e.match(JO)?.groups?.parent===t);let r=YO.get(e);return r||(r=new Map,Object.keys(e).forEach(e=>{let{parent:t}=e.match(JO)?.groups??{};if(t===void 0)return;let n=r.get(t);n?n.push(e):r.set(t,[e])}),YO.set(e,r)),r.get(t)??[]},ZO=e=>e.startsWith(`__sc_`),abe=[`forEach`,`isDisjointFrom`,`isSubsetOf`,`isSupersetOf`],obe=[`difference`,`intersection`,`symmetricDifference`,`union`],QO=!1,$O=class e extends Set{#e=new Map;#t=j(0);#n=j(0);#r=$a||-1;constructor(e){if(super(),e){for(var t of e)super.add(t);this.#n.v=super.size}QO||this.#a()}#i(e){return $a===this.#r?j(e):Yi(e)}#a(){QO=!0;var t=e.prototype,n=Set.prototype;for(let e of abe)t[e]=function(...t){return z(this.#t),n[e].apply(this,t)};for(let r of obe)t[r]=function(...t){z(this.#t);var i=n[r].apply(this,t);return new e(i)}}has(e){var t=super.has(e),n=this.#e,r=n.get(e);if(r===void 0){if(!t)return z(this.#t),!1;r=this.#i(!0),n.set(e,r)}return z(r),t}add(e){return super.has(e)||(super.add(e),M(this.#n,super.size),ea(this.#t)),this}delete(e){var t=super.delete(e),n=this.#e,r=n.get(e);return r!==void 0&&(n.delete(e),M(r,!1)),t&&(M(this.#n,super.size),ea(this.#t)),t}clear(){if(super.size!==0){super.clear();var e=this.#e;for(var t of e.values())M(t,!1);e.clear(),M(this.#n,0),ea(this.#t)}}keys(){return this.values()}values(){return z(this.#t),super.values()}entries(){return z(this.#t),super.entries()}[Symbol.iterator](){return this.keys()}get size(){return z(this.#n)}},ek=class extends Map{#e=new Map;#t=j(0);#n=j(0);#r=$a||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return $a===this.#r?j(e):Yi(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else return z(this.#t),!1}return z(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else{z(this.#t);return}}return z(n),super.get(e)}getOrInsert(e,t){return super.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return super.has(e)||this.set(e,t(e)),this.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),M(this.#n,super.size),ea(o);else if(i!==t){ea(r);var s=o.reactions===null?null:new Set(o.reactions);s!==null&&r.reactions?.every(e=>s.has(e))||ea(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),M(n,-1)),r&&(M(this.#n,super.size),ea(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;M(this.#n,0);for(var t of e.values())M(t,-1);ea(this.#t),e.clear()}}#a(){z(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)z(n)}keys(){return z(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return z(this.#n),super.size}},tk=new Map,nk=new ek,rk=new Map,ik=new Map,ak=new Set,ok=new Map,sk=new Map,ck=new Set,{dependencies:sbe,version:lk}={name:`@sveltia/cms`,version:`0.251.0`,description:`Sveltia CMS is a modern, lightweight, Git-based headless content management system.`,keywords:[`svelte`,`cms`,`content-management-system`],homepage:`https://sveltiacms.app/en/`,repository:{type:`git`,url:`git+https://github.com/sveltia/sveltia-cms.git`},funding:{type:`github`,url:`https://github.com/sponsors/kyoshino`},license:`MIT`,author:{name:`Kohei Yoshino`,url:`https://github.com/kyoshino`},type:`module`,scripts:{bench:`playwright test -c bench/playwright.config.js`,"bench:compare":`node bench/compare.js`,"bench:profile":`node bench/summarize-profile.js`,build:`vite build`,"build:watch":`vite build --watch`,check:`pnpm run --no-bail '/^check:.*/'`,"check:audit":`pnpm audit --ignore-registry-errors`,"check:cspell":`cspell --no-progress`,"check:eslint":`eslint .`,"check:imports":`node scripts/find-unused-imports.js`,"check:l10n":`node scripts/check-locales.js`,"check:oxlint":`oxlint .`,"check:prettier":`prettier --check .`,"check:stylelint":`stylelint '**/*.{css,scss,svelte}'`,"check:svelte":`svelte-check`,dev:`vite`,format:`prettier --write .`,prepublishOnly:`vite build`,preview:`vite preview`,test:`NODE_OPTIONS=--no-experimental-webstorage vitest run`,"test:components":`NODE_OPTIONS=--no-experimental-webstorage vitest run --project browser`,"test:components:coverage":`NODE_OPTIONS=--no-experimental-webstorage vitest run --coverage --project browser --coverage.include='src/lib/components/**/*.svelte' --coverage.thresholds.branches=98.4`,"test:e2e":`playwright test -c e2e/playwright.config.js`,"test:e2e:ui":`playwright test -c e2e/playwright.config.js --ui`,"test:unit":`NODE_OPTIONS=--no-experimental-webstorage vitest run --project unit`,"test:unit:coverage":`NODE_OPTIONS=--no-experimental-webstorage vitest run --coverage --project unit`,"test:watch":`NODE_OPTIONS=--no-experimental-webstorage vitest`},dependencies:{"@cfworker/json-schema":`^4.1.1`,"@discourse/heic":`^1.0.0`,"@jsquash/webp":`^1.5.0`,"@lexical/markdown":`^0.52.0`,"@sindresorhus/transliterate":`^2.3.1`,"@sveltia/i18n":`^1.5.0`,"@sveltia/ui":`^0.87.4`,"@sveltia/utils":`^0.12.4`,buffer:`^6.0.3`,"create-react-class":`^15.7.0`,dayjs:`^1.11.23`,deepmerge:`^4.3.1`,exifr:`^7.1.3`,"fast-deep-equal":`^3.1.3`,flat:`^6.0.1`,htm:`^3.1.1`,immutable:`^5.1.9`,"isomorphic-dompurify":`^4.6.0`,"isomorphic-git":`^1.44.3`,leaflet:`^1.9.4`,lexical:`^0.52.0`,marked:`^18.1.1`,"marked-bidi":`^1.0.15`,mime:`^4.1.1`,"parse-entities":`^4.0.2`,"pdfjs-dist":`^6.4.299`,qrcode:`^1.5.4`,react:`^19.3.1`,"react-dom":`^19.3.1`,"sanitize-filename":`^1.6.4`,"smol-toml":`^1.9.1`,svgo:`^4.1.0`,"terra-draw":`^1.38.0`,"terra-draw-leaflet-adapter":`1.0.3`,turndown:`^7.2.4`,yaml:`^2.9.1`},devDependencies:{"@playwright/test":`^1.64.1`,"@stylistic/eslint-plugin":`^5.10.0`,"@sveltejs/vite-plugin-svelte":`^7.3.1`,"@types/leaflet":`^1.9.22`,"@types/node":`^26.6.5`,"@types/qrcode":`^1.5.6`,"@types/react":`^19.3.0`,"@types/react-dom":`^19.3.0`,"@vitest/browser-playwright":`^5.0.5`,"@vitest/coverage-v8":`^5.0.5`,cspell:`^10.4.0`,eslint:`^9.39.5`,"eslint-config-airbnb-extended":`^3.3.0`,"eslint-config-prettier":`^10.1.8`,"eslint-plugin-jsdoc":`^65.4.1`,"eslint-plugin-package-json":`^1.10.1`,"eslint-plugin-svelte":`^3.23.1`,"eslint-plugin-unused-imports":`^4.4.1`,globals:`^17.13.0`,"happy-dom":`^21.0.4`,messageformat:`^4.1.0`,oxlint:`^1.89.0`,playwright:`^1.64.1`,"postcss-html":`^2.0.0`,prettier:`^3.9.10`,"prettier-plugin-svelte":`^4.1.1`,sonda:`^0.14.0`,stylelint:`^17.16.0`,"stylelint-config-recommended":`^18.0.0`,svelte:`^5.57.2`,"svelte-check":`^4.7.7`,"ts-json-schema-generator":`^2.9.0`,typescript:`^6.0.3`,vite:`^8.3.5`,vitest:`^5.0.5`,"vitest-browser-svelte":`^3.1.0`},publishConfig:{directory:`package`}},{DEV:cbe,VITE_SITE_URL:lbe}={DEV:!1},uk=cbe?lbe||`http://localhost:5174`:void 0,ube=[`text/yaml`,`application/x-yaml`,`application/yaml`,`application/toml`,`application/json`],dk=(e,t=[])=>(t.forEach(t=>{Object.hasOwn(e,t)&&Object.defineProperty(e,t,{value:e[t],writable:!1,enumerable:!0,configurable:!0})}),ta(e)),fk=e=>ni(e),pk=e=>{let t=j(e);return{get current(){return z(t)},set current(e){M(t,e)}}},mk=e=>ta({current:e}),hk=e=>{let t=A(e);return{get current(){return z(t)}}},gk=e=>{let t;return hk(()=>{let n=e();return(0,yr.default)(n,t)||(t=n),t})},_k=e=>Ca(()=>{L(e)}),vk=(e,t)=>{L(()=>(e(),fo(t)))},yk=(e,t,n)=>{L(()=>{let r=e();if(!r)return;let i=!1;return r.then(e=>{i||t(e)},n&&(e=>{i||n(e)})),()=>{i=!0}})},bk=(e,t,n,r,i=e=>e,a=e=>e)=>{let o,s=()=>{let t=i(e());n()!==t&&r(t),o=t},c=()=>{let r=a(n());e()!==r&&t(r)};return vk(e,s),vk(n,()=>{n()!==o&&c()}),{updateInput:s,updateValue:c}},xk=pk(),Sk=xk,Ck={},wk=pk(),Tk=pk([]),Ek=hk(()=>!!Sk.current||!!Tk.current.length),Dk={errors:new Set,warnings:new Set,mediaFields:new Set,relationFields:new Set,formatLocales:new Set},Ok=e=>Array.isArray(e.fields)&&!Array.isArray(e.files),kk=e=>Array.isArray(e.files),Ak=e=>kk(e)&&e.name===`_singletons`,jk=e=>e?._type===`entry`&&!!e._file.arrayFile,dbe=(e,{visible:t=void 0,type:n=void 0}={})=>`divider`in e||t&&e.hide?!1:n===`entry`?Ok(e):n===`file`?kk(e):n===`singleton`?Ak(e):Ok(e)||kk(e),Mk=e=>!(`divider`in e)&&typeof e.file==`string`&&Array.isArray(e.fields),Nk=e=>e.filter(e=>Mk(e)),Pk=[`boolean`,`code`,`color`,`compute`,`datetime`,`file`,`hidden`,`image`,`keyvalue`,`list`,`map`,`markdown`,`number`,`object`,`relation`,`richtext`,`select`,`string`,`text`,`uuid`],Fk=[`boolean`,`color`,`compute`,`datetime`,`map`,`markdown`,`number`,`richtext`,`string`,`text`,`uuid`],Ik=Fk.filter(e=>![`boolean`,`number`].includes(e)),Lk=[`file`,`image`],Rk=[`richtext`,`markdown`],zk=[`text`,`string`,...Rk],Bk=[...Lk,`relation`,`select`],fbe=[...Bk,`datetime`,`keyvalue`,`list`,`number`],Vk=(e=``)=>RegExp(`\\bblob:${xE(globalThis.location.origin)}\\/${are.source}\\b`,e),pbe=/(?:(.+?)\/)?(([^/]+?)(?:\.((?:[Tt][Aa][Rr]\.)?[a-zA-Z0-9]+))?)$/,mbe=[`application/atom+xml`,`application/javascript`,`application/json`,`application/ld+json`,`application/rss+xml`,`application/xhtml+xml`,`application/xml`,`application/yaml`,`image/svg+xml`],Hk=e=>e.startsWith(`text/`)||mbe.includes(e),Uk=e=>{let[,t,n,r,i]=e.match(pbe)??[];return{dirname:t,basename:n,filename:r,extension:i}},Wk=(e,t)=>{if(!t.length)return!0;let n=e.name.toLowerCase();return t.some(t=>{let r=t.toLowerCase();if(r.startsWith(`.`))return n.endsWith(r);let[i,a]=r.split(`/`);return a===`*`?e.type.split(`/`)[0]===i:e.type===r})},hbe=async({items:e},{accept:t}={})=>{let n=t?t.split(`,`).map(e=>e.trim()).filter(Boolean):[],r=e=>new Promise(t=>{e.file(t,()=>t(null))}),i=e=>new Promise(t=>{e.readEntries(t,()=>t([]))}),a=async e=>{if(e.name.startsWith(`.`))return[];if(e.isFile){let t=await r(e);return t&&Wk(t,n)?[t]:[]}let t=e.createReader(),o=[];for(;;){let e=await i(t);if(!e.length)break;o.push(...e)}return(await Promise.all(o.map(a))).flat()},o=[...e].map(e=>e.webkitGetAsEntry()).filter(e=>e!==null);return(await Promise.all(o.map(a))).flat().sort((e,t)=>e.name.localeCompare(t.name))},gbe=async e=>(await e.text()).replace(/\r\n?/g,`
`),_be=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,Gk=async e=>{let t=_be(e);return new Uint8Array(await t.arrayBuffer()).toBase64()},vbe=async e=>{let t=Uint8Array.fromBase64(e);return new TextDecoder().decode(t)},ybe=(e,t)=>{let n=document.createElement(`a`),r=URL.createObjectURL(e),i=e.type.split(`/`)[1]?.split(/[+;]/)[0];n.download=t||e.name||[Date.now(),i].filter(Boolean).join(`.`),n.href=r,n.click(),globalThis.setTimeout(()=>{URL.revokeObjectURL(r)},0)},Kk=/{{(.+?)}}/,qk=new RegExp(Kk.source,`g`),Jk=/\\\{\\\{.+?\\\}\\\}/g,Yk=[`year`,`month`,`day`,`hour`,`minute`,`second`],Xk=/{{(?:year|month|day|hour|minute|second)}}/,Zk=/^fields\./,bbe=/\|\s*default\s*\(/,Qk={uuid:{length:void 0,pattern:`[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}`},uuid_short:{length:`short`,pattern:`[0-9a-f]{12}`},uuid_shorter:{length:`shorter`,pattern:`[0-9a-f]{8}`}},$k={slug_length:!1,slug_editor_tag:!1,yaml_quote:!1,uuid_read_only:!1,save_all_locales:!1,automatic_deployments:!1,multiple_folders_i18n_root:!1,omit_default_locale_from_filename:!1,logo_url:!1},xbe={slug_length:"The `slug_length` collection option is deprecated and will be removed in Sveltia CMS 1.0. Use the global `slug.maxlength` option instead. ",slug_editor_tag:"The `{{fields._slug}}` and `{{fields._slug | localize}}` slug template tags are deprecated and will be removed in Sveltia CMS 1.0. Use the `slug` collection option’s object form instead: `{{fields._slug}}` is equivalent to `slug: { editable: true }`, and `{{fields._slug | localize}}` is equivalent to `slug: { editable: true, i18n: true }`. https://sveltiacms.app/en/docs/collections/entries/slugs#making-slugs-editable",yaml_quote:"The `yaml_quote` collection option is deprecated and will be removed in Sveltia CMS 1.0. Use the global `output.yaml.quote` option instead. `yaml_quote: true` is equivalent to `quote: double`. https://sveltiacms.app/en/docs/data-output#controlling-data-output",uuid_read_only:"The `read_only` option for the UUID field type is deprecated and will be removed in Sveltia CMS 1.0. Use the `readonly` option instead.",save_all_locales:"The `save_all_locales` i18n option is deprecated and will be removed in Sveltia CMS 1.0. Use the `initial_locales` option instead. `save_all_locales: false` is equivalent to `initial_locales: all`. https://sveltiacms.app/en/docs/i18n/options#disabling-non-default-locale-content",automatic_deployments:"The `automatic_deployments` backend option is deprecated and will be removed in Sveltia CMS 1.0. Use the `skip_ci` option instead. `automatic_deployments: false` is equivalent to `skip_ci: true`, and `automatic_deployments: true` is equivalent to `skip_ci: false`. https://sveltiacms.app/en/docs/deployments#disabling-automatic-deployments",multiple_folders_i18n_root:"The `multiple_folders_i18n_root` i18n structure is deprecated and will be removed in Sveltia CMS 1.0. Use the `multiple_root_folders` structure instead. https://sveltiacms.app/en/docs/i18n/structures#multiple-root-folders",omit_default_locale_from_filename:"The `omit_default_locale_from_filename` i18n option is deprecated and will be removed in Sveltia CMS 1.0. Use the `omit_default_locale_from_file_path` option instead. https://sveltiacms.app/en/docs/i18n/structures",logo_url:"The `logo_url` option is deprecated and will be removed in a future version of Sveltia CMS. Use the `logo.src` option instead. https://sveltiacms.app/en/docs/customization#custom-logo"},eA=(e,t)=>{$k[e]||(console.warn(t??xbe[e]),$k[e]=!0)},Sbe=`_index`,tA=new WeakMap,nA=e=>{if(!Ok(e))return;let{index_file:t}=e;if(t)return(t===!0?void 0:t.name)??Sbe},rA=e=>{let t=tA.get(e);if(t&&t.locale===Jc.current)return t.indexFile;let n=nA(e),r;if(n!==void 0){let{index_file:t}=e,i=t===!0?{}:t;r={name:n,label:i.label||Y(`index_file`),icon:i.icon??`home`,extension:i.extension,format:i.format,fields:i.fields,editor:i.editor}}return tA.set(e,{locale:Jc.current,indexFile:r}),r},iA=(e,t)=>{let n=nA(e);if(n===void 0)return!1;let r=e._file?.fullPathRegEx;return!!r&&t.match(r)?.groups?.subPath===n},aA=(e,t)=>{let n=nA(e);if(n===void 0)return!1;let r=Object.values(t.locales??{})[0]?.path;return r===void 0?t.slug===n:iA(e,r)},oA=[`markdown`,`md`,`mdown`,`mdwn`,`mdx`,`mkd`,`mkdn`,`html.md`],Cbe={raw:`txt`,yaml:`yml`,yml:`yml`,toml:`toml`,json:`json`},sA={yaml:`yaml`,yml:`yaml`,toml:`toml`,json:`json`,astro:`raw`},cA={"json-frontmatter":[`{`,`}`],"toml-frontmatter":[`+++`,`+++`],"yaml-frontmatter":[`---`,`---`]},lA=[`yaml-frontmatter`,`toml-frontmatter`,`json-frontmatter`],uA=[`yml`,`yaml`,`toml`,`json`,`frontmatter`,...lA,`raw`],dA=[`toml`,`toml-frontmatter`],fA={yml:`yaml`,yaml:`yaml`,toml:`toml`,json:`json`,frontmatter:`yaml`,"yaml-frontmatter":`yaml`,"toml-frontmatter":`toml`,"json-frontmatter":`json`},pA=e=>Object.hasOwn(fA,e)?fA[e]:void 0,mA=e=>typeof e==`string`&&!!e.trim(),hA=e=>typeof e==`string`&&/^https?:\/\//i.test(e.trim())&&wE(e.trim()),gA=e=>e.replace(/&(?![a-zA-Z0-9#]+;)/g,`&amp;`).replaceAll(`"`,`&quot;`),wbe={"&":`&amp;`,"<":`&lt;`,">":`&gt;`},_A=e=>e.replace(/[&<>]/g,e=>wbe[e]),vA={ALLOWED_TAGS:[`a`],ALLOWED_ATTR:[`href`,`target`,`rel`]},yA=(e,t)=>_t(e.replace(`<a>`,`<a href="${gA(t)}" target="_blank" rel="noopener noreferrer">`),vA),bA=(e,{allowedTags:t=[`strong`,`em`,`del`,`code`,`a`],allowedAttr:n=[`href`]}={})=>_t(pr(e),{ALLOWED_TAGS:t,ALLOWED_ATTR:n}),xA=e=>bA(e.replaceAll(`\\n`,`<br>`),{allowedTags:[`strong`,`em`,`del`,`code`,`a`,`br`]}),SA=[`index`,`_index`],Tbe=[...oA,...Object.keys(sA)],Ebe=e=>{if(typeof e!=`string`||!e.trim())return;let t=CE(e.trim()),{filename:n,extension:r}=Uk(t);return r!==void 0&&Tbe.includes(r)?n:t},CA=pk(``),wA=e=>{let t=e;if(!Ok(t))return;let{nested:n}=t;if(!n||typeof n!=`object`)return;let{depth:r,summary:i,subfolders:a}=n;return{depth:typeof r==`number`&&r>=1?Math.floor(r):1/0,summary:mA(i)?i:void 0,subfolders:a!==!1}},TA=e=>!!wA(e),EA=e=>{if(!TA(e))return;let t=e.meta?.path;if(t&&typeof t==`object`)return{indexFileName:Ebe(t.index_file)}},DA=e=>TA(e)?EA(e)?.indexFileName:void 0,OA=e=>wA(e)?.subfolders===!1?void 0:EA(e)?.indexFileName,kA=(e,t)=>{let n=OA(e);return n&&t.endsWith(`/${n}`)?t.slice(0,-n.length-1):t},AA=({collection:e,isNew:t,originalPath:n,currentPath:r})=>r===void 0?!1:t&&OA(e)?!0:!!CE(r)||!!CE(n??``),jA=e=>{let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)},MA=(e,t)=>!e||t.startsWith(`${e}/`),Dbe=({collection:e,entries:t,dirPath:n})=>{if(!TA(e))return!1;let r=CE(n);return!r||t.some(({subPath:e})=>MA(r,e))},NA=({collection:e,entries:t,dirPath:n})=>{let r=wA(e);if(!r)return t;let{subfolders:i}=r,a=CE(n);return t.filter(({subPath:e})=>{if(!MA(a,e))return!1;let t=(a?e.slice(a.length+1):e).split(`/`).length;return i?a?t===2:t<=2:t===1})},PA=(e,t,n)=>{let r=e;return r.has(t)||r.set(t,n()),r.get(t)},FA=(e,t,n,r)=>{if(e.has(t)){let n=e.get(t);return e.delete(t),e.set(t,n),n}let i=n();return e.set(t,i),e.size>r&&e.delete(e.keys().next().value),i},IA=(e,t,n)=>PA(e,t,()=>n().finally(()=>{e.delete(t)})),LA=(e,t,n)=>PA(e,t,()=>n().catch(n=>{throw e.delete(t),n})),RA=(e,t)=>{let n;return()=>{let r=e();return n&&n.source===r||(n={source:r,value:t(r)}),n.value}},Obe=/(?:^|\/){{locale}}(?:\/|$)/,zA=e=>e.includes(`{{locale}}`),kbe=e=>e.split(`{{locale}}`).length===2&&Obe.test(e),BA=e=>{let t=e.indexOf(`{{locale}}`);if(t===-1)return;let n=e.slice(0,t),r=e.slice(t+10);if(n===``||n.endsWith(`/`))return r.startsWith(`/`)?`${n}${r.slice(1)}`:r===``?n.endsWith(`//`)?void 0:n.length>1?n.slice(0,-1):n:/^\.(?:[^./][^/]*\.|{{)/.test(r)?`${n}${r.slice(1)}`:void 0;if(/[^/]\.$/.test(n)&&/^(?:[./]|$)/.test(r))return`${n.slice(0,-1)}${r}`},VA=e=>BA(e)!==void 0,HA=({path:e,locale:t,omitLocale:n=!1})=>(n&&(e=BA(e)??e),e.replaceAll(`{{locale}}`,t)),UA=(e,t)=>`${e}/`.split(`{{locale}}/`).map(xE).join(t),Abe=new Map,jbe=(e,t)=>e.replace(PA(Abe,t,()=>RegExp(`^${UA(t,`(?:[^/]+\\/)?`)}`)),``),Mbe={type:`language`,languageDisplay:`standard`,style:`short`,fallback:`none`},WA=e=>{let t;if(e!==`_default`)try{[t]=Intl.getCanonicalLocales(e)}catch{}return t},GA=e=>e===`_default`?`auto`:qc(e)?`rtl`:`ltr`,Nbe=new Map,KA=(e,{displayLocale:t=WA(Jc.current??`en`),formatterOptions:n=Mbe}={})=>{let r=WA(e);if(!r)return;let i=t?PA(Nbe,t,()=>new Intl.DisplayNames(t,n)):new Intl.DisplayNames(void 0,n);try{let e=i.of(r);if(!e)return;let[n,...a]=e;return[n.toLocaleUpperCase(t),...a].join(``)}catch(e){console.error(e);return}},Pbe=new Map,qA=(e,t={})=>{let n={style:`narrow`,type:`conjunction`,...t};return PA(Pbe,`${e}|${n.style}|${n.type}`,()=>{let t=new Intl.ListFormat(WA(e),n);return{format:e=>t.format([...e].filter(e=>e!=null).map(e=>`${e}`))}})},JA=({_i18n:e,locale:t,path:n})=>{let{defaultLocale:r,omitDefaultLocaleFromFilePath:i}=e;return HA({path:n,locale:t,omitLocale:i&&t===r})},YA=({extension:e,format:t})=>(t?ik.get(t)?.extension:void 0)||e||(t?Cbe[t]??`md`:`md`),XA=({extension:e,format:t})=>t||(oA.includes(e)?`frontmatter`:sA[e]??`yaml-frontmatter`),Fbe=({subPath:e,indexFileName:t,nestedDepth:n,entrySuffix:r=``,indexSuffix:i=``})=>{let a=t?xE(t):``,o=!!a&&!!i,s=a&&!o?`|${a}`:``,c;if(!e)c=n===void 0?`[^/]+?`:`[^/]+?(?:\\/[^/]+?)${Number.isFinite(n)?`{0,${Math.max(0,n-1)}}`:`*`}`;else{let t=`${xE(e).replace(Jk,`[^/]+?`)}${s}`;if(n===void 0)c=t;else{let r=Number.isFinite(n)?Math.max(0,n-e.split(`/`).length):void 0;c=`${r===void 0?`(?:[^/]+\\/)*`:`(?:[^/]+\\/){0,${r}}`}(?:${t})`}}return o?`(?<subPath>${`(?!${a}${r})`}(?:${c})${r}|${a}${i})`:`(?<subPath>${c})`},Ibe=({extension:e,format:t,basePath:n,subPath:r,indexFileName:i,indexFileExtension:a,nestedDepth:o,_i18n:s})=>{let{allLocales:c,defaultLocale:l,omitDefaultLocaleFromFilePath:u,structureMap:{i18nMultiFile:d,i18nMultiFolder:f,i18nMultiRootFolder:p}}=s,m=c.map(xE).join(`|`),h=c.filter(e=>e!==l).map(xE).join(`|`),g=`(?<locale>${m})`,_=u?`(?:(?<locale>${h})\\/)?`:`${g}\\/`,v=u?`(?:\\.(?<locale>${h}))?`:`\\.${g}`,y=!!n&&zA(n),b=y?UA(n,_):n?`${xE(n)}\\/`:``,x=YA({format:t,extension:e}),S=i&&a!==void 0&&a!==x?a:void 0,C=e=>{let t=u?`(?:\\.(?:${h}))?`:`\\.(?:${m})`;return`(?=${d?t:``}\\.${xE(e)}$)`},w=[`^`,p&&!y?_:``,b,f&&!y?_:``,Fbe({subPath:r,indexFileName:i,nestedDepth:o,entrySuffix:S?C(x):``,indexSuffix:S?C(S):``}),d?v:``,`\\.`,S?`(?:${xE(x)}|${xE(S)})`:xE(x),`$`].join(``);return new RegExp(w)},ZA=({format:e,delimiter:t})=>mA(t)?[t,t]:Array.isArray(t)&&t.length===2?t:cA[e]??void 0,Lbe=({indexFile:e,extension:t,format:n})=>{if(!e)return;let{extension:r,format:i}=e;if(r===void 0&&i===void 0)return;let a=YA({extension:r,format:i}),o=XA({extension:a,format:i}),s=YA({extension:t,format:n}),c=XA({extension:s,format:n});if(a!==s||o!==c)return{extension:a,format:o}},QA=({rawCollection:e,file:t,_i18n:n})=>{let{folder:r,file:i,path:a,extension:o,format:s,frontmatter_delimiter:c,body_field:l,yaml_quote:u}=e,d=Ok(e),f=d&&typeof i==`string`,p=t?.file?CE(t.file):f?CE(i):void 0,m=p?Uk(p).extension:o,h=t?.format??s,g=YA({format:h,extension:m}),_=XA({format:h,extension:g}),v=t?.frontmatter_delimiter??c,y=d&&!f,b=y?CE(r):void 0,x=y?rA(e):void 0,S=x?.name,C=y?wA(e)?.depth:void 0,w=Lbe({indexFile:x,extension:o,format:s});u!==void 0&&eA(`yaml_quote`);let T={extension:g,format:_,basePath:b,subPath:y?a:void 0,fullPathRegEx:b===void 0?void 0:Ibe({extension:g,format:_,basePath:b,subPath:a,indexFileName:S,indexFileExtension:w?.extension,nestedDepth:C,_i18n:n}),fullPath:p?JA({_i18n:n,locale:n.defaultLocale,path:p}):void 0,fmDelimiters:ZA({format:_,delimiter:v}),bodyField:t?.body_field??l,yamlQuote:!!u};return f&&(T.arrayFile=!0),w&&(T.indexFile={...T,...w,fmDelimiters:ZA({format:w.format,delimiter:v})}),T},$A=({collection:e,collectionFile:t,isIndexFile:n=!1})=>{let{_file:r}=t??e;return(n?r.indexFile:void 0)??r},ej={SINGLE_FILE:`single_file`,SINGLE_FILE_DEFAULT_ROOT:`single_file_default_root`,MULTIPLE_FILES:`multiple_files`,MULTIPLE_FOLDERS:`multiple_folders`,MULTIPLE_FOLDERS_I18N_ROOT:`multiple_folders_i18n_root`,MULTIPLE_ROOT_FOLDERS:`multiple_root_folders`},Rbe=[ej.MULTIPLE_FOLDERS_I18N_ROOT,ej.MULTIPLE_ROOT_FOLDERS],tj={key:`translationKey`,value:`{{slug}}`},nj=({cmsConfig:e,collection:t,file:n})=>{let r=e?.i18n;if(!E(r))return;let i=structuredClone(r),{name:a,i18n:o}=t;if(o||a===`_singletons`){if(E(o)&&Object.assign(i,o),n){if(!n.i18n)return;E(n.i18n)&&Object.assign(i,n.i18n)}return i}},zbe=e=>e?.omit_default_locale_from_file_path??e?.omit_default_locale_from_filename??!1,Bbe={i18nEnabled:!1,saveAllLocales:!0,allLocales:[`_default`],initialLocales:[`_default`],defaultLocale:`_default`,structure:ej.SINGLE_FILE,structureMap:{i18nSingleFile:!1,i18nSingleFileDefaultRoot:!1,i18nMultiFile:!1,i18nMultiFolder:!1,i18nMultiRootFolder:!1},canonicalSlug:{...tj},omitDefaultLocaleFromFilePath:!1,omitDefaultLocaleFromPreviewPath:!1},rj=e=>(e?.collectionFile??e?.collection)?._i18n??Bbe,Vbe=(e,t,n,r)=>!t&&typeof r!=`string`?typeof n==`string`&&zA(n)?ej.MULTIPLE_FOLDERS:e:t?.file.includes(`{{locale}}`)?ej.MULTIPLE_FILES:e===ej.SINGLE_FILE_DEFAULT_ROOT?ej.SINGLE_FILE_DEFAULT_ROOT:ej.SINGLE_FILE,Hbe=(e,t)=>({i18nSingleFile:e&&t===ej.SINGLE_FILE,i18nSingleFileDefaultRoot:e&&t===ej.SINGLE_FILE_DEFAULT_ROOT,i18nMultiFile:e&&t===ej.MULTIPLE_FILES,i18nMultiFolder:e&&t===ej.MULTIPLE_FOLDERS,i18nMultiRootFolder:e&&(t===ej.MULTIPLE_FOLDERS_I18N_ROOT||t===ej.MULTIPLE_ROOT_FOLDERS)}),ij=({i18nSingleFile:e,i18nSingleFileDefaultRoot:t})=>!!e||!!t,aj=({i18nMultiFile:e,i18nMultiFolder:t,i18nMultiRootFolder:n})=>!!e||!!t||!!n,Ube=(e,t,n)=>e?n&&t.includes(n)?n:t[0]:`_default`,Wbe=(e,t,n)=>e===`all`?t:e==="default"?[n]:t.filter(t=>t===n||!Array.isArray(e)||e.includes(t)),Gbe=(e,t,n)=>e?n?VA(n.file):aj(t):!1,oj=(e,t)=>{let n=nj({cmsConfig:Sk.current,collection:e,file:t}),{structure:r=ej.SINGLE_FILE,locales:i=[],default_locale:a,initial_locales:o,save_all_locales:s=!0,canonical_slug:c={key:void 0,value:void 0},omit_default_locale_from_filename:l,omit_default_locale_from_file_path:u=l??!1,omit_default_locale_from_preview_path:d=!1}=n??{};n?.save_all_locales!==void 0&&eA(`save_all_locales`),l!==void 0&&eA(`omit_default_locale_from_filename`);let{key:f=tj.key,value:p=tj.value}=c,m=i.length>0,h=m?i:[`_default`],g=Ube(m,h,a),{folder:_,file:v}=e,y=Vbe(r,t,_,v),b=Hbe(m,y),x=!m||s===!0&&o===void 0,S=Wbe(o,h,g),C=Gbe(u,b,t);return y===`multiple_folders_i18n_root`&&eA(`multiple_folders_i18n_root`),{i18nEnabled:m,saveAllLocales:x,allLocales:h,defaultLocale:g,initialLocales:S,structure:y,structureMap:b,canonicalSlug:{key:f,value:p},omitDefaultLocaleFromFilePath:C,omitDefaultLocaleFromPreviewPath:d}},sj=pk(),cj=new Map,lj=({collections:e=Sk.current?.collections??[],visible:t,type:n}={})=>e.filter(e=>dbe(e,{visible:t,type:n})),Kbe=()=>lj({visible:!0})[0],qbe=e=>{if(!Ok(e))return[];let{fields:t,thumbnail:n=!0}=e;return n===!1?[]:typeof n==`string`?[n]:Array.isArray(n)?n:t?.length?t.filter(({widget:e=`string`})=>Lk.includes(e)).map(({multiple:e,name:t})=>e?`${t}.*`:t):[]},Jbe=(e,t)=>({...e,_i18n:t,_type:`entry`,_file:QA({rawCollection:e,_i18n:t}),_thumbnailFieldNames:qbe(e)}),uj=(e,t,n)=>({...e,_i18n:t,_type:Ak(e)?`singleton`:`file`,_fileMap:Object.fromEntries(n.filter(Mk).map(t=>{let n=oj(e,t),r=QA({rawCollection:e,file:t,_i18n:n});return[t.name,{...t,_file:r,_i18n:n}]}))}),dj=()=>{let e=Sk.current?.singletons;if(!Array.isArray(e))return;let t=Nk(e).map(e=>({...e,file:CE(e.file)}));if(!t.length)return;let n={name:`_singletons`,files:t};return uj(n,oj(n),t)},fj=e=>{let t=cj.get(e);if(t)return t;if(e===`_singletons`){let t=dj();return cj.set(e,t),t}let n=lj().find(t=>t.name===e);if(!n){cj.set(e,void 0);return}let r=Ok(n)?n:void 0,i=kk(n)?n:void 0;if(!r&&!i){cj.set(e,void 0);return}r?(typeof r.folder==`string`&&(r.folder=CE(r.folder)),typeof r.file==`string`&&(r.file=CE(r.file))):i?.files.forEach(e=>{e.file&&=CE(e.file)});let a=oj(n),o=r?Jbe(r,a):uj(i,a,i.files);return cj.set(e,o),o},pj=(e,{useSingular:t=!1}={})=>{let{_type:n,name:r,label:i,label_singular:a}=e;return n===`singleton`?Y(`files`):t&&a?a:i||r},mj=e=>e?e===`_singletons`?9999999:Sk.current?.collections?.findIndex(({name:t})=>t===e)??-1:-1,hj=pk(!1),gj=pk(),_j=pk([]),vj=pk([]),Ybe=RA(()=>vj.current,e=>{let t=new Map;return e.forEach((e,n)=>{Object.values(e.locales).forEach(({path:r})=>{t.has(r)||t.set(r,{entry:e,index:n})})}),t}),yj=e=>{let t=Ybe(),n;return[...e].forEach(e=>{let r=t.get(e);r&&(!n||r.index<n.index)&&(n=r)}),n?.entry},bj=pk([]),xj=(e,t)=>{let n=typeof e==`string`?fj(e):e;if(n&&`_fileMap`in n&&Object.hasOwn(n._fileMap,t))return n._fileMap[t]},Sj=(e,t)=>{let n=fj(e);if(!n)return;let r=t?xj(n,t):void 0;if(!t||r)return{collection:n,collectionFile:r}},Cj=e=>e.label||e.name,wj=(e,t)=>`_fileMap`in e?Object.values(e._fileMap).filter(({_file:e,_i18n:n})=>e.fullPath===t.locales[n.defaultLocale]?.path):[],Tj=(e,t)=>{let n=_j.current.find(({collectionName:n,fileName:r})=>n===e&&r===t);if(!n?.filePathMap)return;let r=new Set(Object.values(n.filePathMap));return vj.current.find(e=>Object.values(e.locales).some(({path:e})=>r.has(e)))},Ej=(e,t)=>{if(e&&t){let{collections:n,singletons:r}=Sk.current;if(e===`_singletons`)return Array.isArray(r)?Nk(r).findIndex(e=>e.name===t):-1;let i=lj({collections:n}).find(({name:t})=>t===e);if(i&&`files`in i)return i.files.findIndex(({name:e})=>e===t)}return-1};function Dj(e){return e&&e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}function Oj(e){return e}function Xbe(e,t){t||={};let n=t.delimiter||`.`,r=t.maxDepth,i=t.transformKey||Oj,a={};function o(e,s,c){c||=1,Object.keys(e).forEach(function(l){let u=e[l],d=t.safe&&Array.isArray(u),f=Object.prototype.toString.call(u),p=Dj(u),m=f===`[object Object]`||f===`[object Array]`,h=s?s+n+i(l):i(l);if(!d&&!p&&m&&Object.keys(u).length&&(!t.maxDepth||c<r))return o(u,h,c+1);a[h]=u})}return o(e),a}function kj(e,t){t||={};let n=t.delimiter||`.`,r=t.overwrite||!1,i=t.transformKey||Oj,a={};if(Dj(e)||Object.prototype.toString.call(e)!==`[object Object]`)return e;function o(e){let n=Number(e);return isNaN(n)||e.indexOf(`.`)!==-1||t.object?e:n}function s(e,t,r){return Object.keys(r).reduce(function(t,i){return t[e+n+i]=r[i],t},t)}function c(e){let t=Object.prototype.toString.call(e),n=t===`[object Array]`,r=t===`[object Object]`;if(!e)return!0;if(n)return!e.length;if(r)return!Object.keys(e).length}return e=Object.keys(e).reduce(function(n,r){let i=Object.prototype.toString.call(e[r]);return i!==`[object Object]`&&i!==`[object Array]`||c(e[r])?(n[r]=e[r],n):s(r,n,Xbe(e[r],t))},{}),Object.keys(e).forEach(function(s){let c=s.split(n).map(i),l=o(c.shift()),u=o(c[0]),d=a;for(;u!==void 0;){if(l===`__proto__`)return;let e=Object.prototype.toString.call(d[l]),n=e===`[object Object]`||e===`[object Array]`;if(!r&&!n&&d[l]!==void 0)return;(r&&!n||!r&&d[l]==null)&&(d[l]=typeof u==`number`&&!t.object?[]:{}),d=d[l],c.length>0&&(l=o(c.shift()),u=o(c[0]))}d[l]=kj(e[s],t)}),a}var Zbe=``,Qbe=``,$be=/[.\uE000\uE001]/g,exe=/\uE001([\uE000\uE001])|\uE000/g,Aj=/[\uE000\uE001]/,jj=`\0`,Mj=/^(?:0|[1-9]\d*)$/,Nj=e=>!Number.isNaN(Number(e))&&!Mj.test(e),txe=e=>Nj(e)?`${jj}${e}`:e,Pj=e=>E(e)&&[Object.prototype,null].includes(Object.getPrototypeOf(e)),Fj=e=>Array.isArray(e)?(e.forEach((t,n)=>{e[n]=Fj(t)}),e):Pj(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e.startsWith(jj)?e.slice(1):e,Fj(t)])):e,Ij=e=>e.includes(`.`)||Aj.test(e)?e.replace($be,e=>e===`.`?Zbe:`${Qbe}${e}`):e,Lj=e=>Aj.test(e)?e.replace(exe,(e,t)=>t??`.`):e,Rj=e=>[`[object Object]`,`[object Array]`].includes(Object.prototype.toString.call(e))&&!!Object.keys(e).length,nxe=e=>Object.prototype.toString.call(e)===`[object Object]`&&Object.keys(e).some(e=>Mj.test(e)),rxe=(e,t)=>{let n=`${t}.`;return Object.keys(e).some(e=>e.startsWith(n)&&Mj.test(e.slice(n.length).split(`.`)[0]))},zj=(e,t)=>{let n={},r=(e,t)=>{t!==void 0&&nxe(e)&&(n[t]={}),Object.entries(e).forEach(([e,i])=>{let a=Ij(e),o=t===void 0?a:`${t}.${a}`;Rj(i)?r(i,o):n[o]=i})};return Rj(e)?r(e,t):t!==void 0&&(n[t]=e),n},ixe=e=>txe(Lj(e)),Bj=e=>{let t=Object.entries(e);return t.some(([,e])=>Rj(e))?Bj(Object.fromEntries(t.flatMap(([e,t])=>Rj(t)?Object.entries(zj(t,e)):[[e,t]]))):t.some(([e])=>Aj.test(e)||e.split(`.`).some(Nj))?Fj(kj(e,{transformKey:ixe})):kj(e)},Vj=e=>e?Bj(Object.fromEntries(Object.entries(e).sort(([e],[t])=>TE(e,t)))):kj(e),Hj=e=>e==null||e===``||Array.isArray(e)&&!e.length||Pj(e)&&!Object.keys(e).length,Uj=e=>Array.isArray(e)&&!e.length||E(e)&&!Object.keys(e).length,Wj=(e,t)=>({[e]:Array.isArray(t)?[]:{},...zj(t,e)}),Gj=(e,t,{live:n=!1}={})=>{let r=qO(e,`${t}.`,{live:n});if(!r.length)return;let i=r.map(n=>[`_${n.slice(t.length)}`,e[n]]),a=e[t];return Uj(a)&&i.push([`_`,a]),Vj(Object.fromEntries(i))._},axe=e=>typeof e==`object`&&e?Array.isArray(e)?`\0[]`:`\0{}`:e,Kj=(e,t,n)=>{let r=qO(t,`${n}.`),i=[...r,n].map(e=>axe(t[e])),a=e.keys,o=e.values;return e.keyPath===n&&a.length===r.length&&r.every((e,t)=>e===a[t])&&i.every((e,t)=>e===o[t])||Object.assign(e,{keyPath:n,keys:r,values:i,subtree:Gj(t,n)}),e.subtree},qj=(e,t)=>{Object.keys(e).forEach(n=>{GO(n,t)&&delete e[n]})},oxe=(e,t,n)=>{qj(e,t),Object.assign(e,Wj(t,n))},Jj=({multiline:e,dotAll:t,source:n})=>e||t||n.includes(`[\\s\\S]`)||n.includes(`[\\S\\s]`),sxe=e=>{let t=[],n=0,r=``,i=0,a=!1;return[...e,`,`].forEach((o,s)=>{r?o===r&&(r=``):n===0&&o===`,`?(t.push(e.slice(i,s).trim()),i=s+1,a=!1):n===0&&/[\s>+~]/.test(o)?a=!0:(a&&=(i=s,!1),o===`"`||o===`'`?r=o:o===`(`||o===`[`?n+=1:(o===`)`||o===`]`)&&--n)}),t},Yj=e=>{let t=sxe(e).map(e=>/^[a-z][a-z\d-]*(?![\w-])/i.exec(e)?.[0].toLowerCase()??``);return t.every(Boolean)?[...new Set(t)]:void 0},cxe=e=>{try{return document.createDocumentFragment().querySelector(e),!0}catch{return!1}},Xj=({htmlSelector:e,fromBlockHTML:t,toBlockHTML:n})=>typeof e==`string`&&typeof t==`function`&&typeof n==`function`,Zj=e=>Bj(Object.fromEntries(Object.entries(zj(e)).filter(([e])=>!ZO(e.split(`.`).pop())))),lxe=e=>{let t=e?.parentElement?.closest(`[data-component-path]`);return t?JSON.parse(t.dataset.componentPath):[]},uxe=(e,t)=>{let n=e?.closest(`[role="textbox"]`);if(!n)return;let r=()=>{t(n.getAttribute(`aria-readonly`)===`true`)},i=new MutationObserver(r);return r(),i.observe(n,{attributes:!0,attributeFilter:[`aria-readonly`]}),i},Qj=e=>e.replace(/\\([!-/:-@[-`{-~])/g,`$1`),$j=e=>e.replace(/\\(?=[!-/:-@[-`{-~]|$)/g,`\\\\`).replace(/"/g,`\\"`),eM=/!\[(?<alt>(?:[^\]\\!]|\\(?!!\[).|!(?!\[))*)\]\((?<src>(?:[^"()\\!]|\\(?!!\[).|!(?!\[)|\((?:[^)!]|!(?!\[))*\)|"(?:[^"!]|!(?!\[))*")*?)(?:(?<![^\\]\s)\s+"(?<title>(?:[^"\\!]|\\(?!!\[).|!(?!\[))*)")?\)/;new RegExp(eM,`g`);var tM=RegExp(`${eM.source}|\\[!\\[(?<alt2>(?:[^\\]\\\\!]|\\\\(?!!\\[).|!(?!\\[))*)\\]\\((?<src2>(?:[^"()\\\\!]|\\\\(?!!\\[).|!(?!\\[)|\\((?:[^)!]|!(?!\\[))*\\)|"(?:[^"!]|!(?!\\[))*")*?)(?:(?<![^\\\\]\\s)\\s+"(?<title2>(?:[^"\\\\!]|\\\\(?!!\\[).|!(?!\\[))*)")?\\)\\](?:\\((?<link>[^()]*(?:\\([^)]*\\)[^)]*|\\([^)]*)?)\\))`),nM=e=>({src:e.getAttribute(`src`)??``,alt:e.getAttribute(`alt`)??``,title:e.getAttribute(`title`)??``}),rM=({src:e=``,alt:t=``,title:n=``})=>{if(!e)return``;let r=document.createElement(`img`);return r.setAttribute(`src`,e),r.setAttribute(`alt`,t),n&&r.setAttribute(`title`,n),r},iM={id:`image`,label:`Image`,fields:[{name:`src`,label:`Source`,widget:`image`},{name:`alt`,label:`Alt Text`,required:!1},{name:`title`,label:`Title`,required:!1}],pattern:eM,fromBlock:e=>{let{src:t,alt:n,title:r}=e.groups??{};return{src:t,alt:n,title:r&&Qj(r)}},toBlock:e=>{let{src:t=``,alt:n=``,title:r=``}=e;return t?`![${n}](${t}${r?` "${$j(r)}"`:``})`:``},toPreview:e=>{let{src:t=``,alt:n=``,title:r=``}=e;return`<img src="${gA(t)}" alt="${gA(n)}" title="${gA(r)}">`},htmlSelector:`img`,fromBlockHTML:nM,toBlockHTML:rM},dxe={id:`linked-image`,label:`Image`,fields:[...iM.fields,{name:`link`,label:`Link`,required:!1}],pattern:tM,fromBlock:e=>{let{src:t,alt:n,title:r,src2:i,alt2:a,title2:o,link:s}=e.groups??{};return{src:(t||i||``).trim(),alt:(n||a||``).trim(),title:Qj(r||o||``).trim(),link:(s||``).trim()}},toBlock:e=>{let{src:t=``,alt:n=``,title:r=``,link:i=``}=e,a=t?`![${n}](${t}${r?` "${$j(r)}"`:``})`:``;return a&&i?`[${a}](${i})`:a},toPreview:e=>{let{src:t=``,alt:n=``,title:r=``,link:i=``}=e,a=`<img src="${gA(t)}" alt="${gA(n)}" title="${gA(r)}">`;return i?`<a href="${gA(i)}">${a}</a>`:a},htmlSelector:`a:has(> img:only-child), img`,fromBlockHTML:e=>{if(e.localName===`img`)return{...nM(e),link:``};if(!e.textContent?.trim())return{...nM(e.querySelector(`img`)),link:e.getAttribute(`href`)??``}},toBlockHTML:e=>{let{link:t=``}=e,n=rM(e);if(!n||!t)return n;let r=document.createElement(`a`);return r.setAttribute(`href`,t),r.append(n),r}},fxe=()=>{let e={icon:`image`,label:Y(`editor_components.image`),fields:[{name:`src`,label:Y(`editor_components.src`),widget:`image`},{name:`alt`,label:Y(`editor_components.alt`),required:!1},{name:`title`,label:Y(`editor_components.title`),required:!1}],trigger:`button`,createMarkdown:()=>`![]()`};return[{...iM,...e},{...dxe,...e,fields:[...e.fields,{name:`link`,label:Y(`editor_components.link`),required:!1}]}]},aM=e=>{if(!e)return;if(tk.has(e))return e;let t=e.replace(/^x-/,``);return t!==e&&tk.has(t)?t:void 0},oM=e=>{let t=aM(e);if(t){let e=tk.get(t);return{...e,id:`x-${t}`,label:e.label??t}}return fxe().find(({id:t})=>t===e)},sM=e=>{if(!e)return;let t=Object.values(e);if(t.some(e=>e.config?.multiple===!0))return!0;if(t.some(e=>e.config?.multiple===!1))return!1},cM=e=>{if(!e?.config)return;let{multiple:t}=e.config;if(typeof t==`boolean`)return t},lM=e=>{let t=Sk.current;return e.multiple??sM(e.media_libraries)??cM(e.media_library)??sM(t?.media_libraries)??cM(t?.media_library)??!1},pxe=/^\d+$/,uM=e=>pxe.test(e),dM=e=>Number.isInteger(e)?e:Number(e.toPrecision(15)),fM=(e,t)=>{let[n,r=`0`]=String(e).split(`e`);return Number(`${n}e${Number(r)+t}`)},pM=(e,t)=>{if(typeof e!=`number`)return NaN;if(!Number.isFinite(e))return e;let n=Math.abs(dM(e)),r=fM(Math.round(fM(n,t)),-t);return Math.sign(e)*r+0},mxe=/^(.*?)<([^>]+)>(.*)$/,mM=/\.\d+$/,hM=new Map,gM=(e,t)=>{if(e.length!==1)return!1;let[n]=e;return n.widget===t&&`root`in n&&n.root===!0},_M=e=>{let t=e.widget??`string`;return Lk.includes(t)?lM(e):Bk.includes(t)?!!e.multiple:!1},vM=e=>{let t=e.match(mxe);if(!t)return{cleanKey:e};let[,n,r,i]=t;return i?{cleanKey:e}:{cleanKey:n||``,typeName:r}},hxe=({field:e,key:t,keyPathArray:n,segmentIndex:r,pendingExplicitType:i,valueMap:a})=>{let{cleanKey:o,typeName:s}=vM(t),{widget:c=`text`}=e,l=s??i,u=uM(o),d=o===`*`;if((u||d)&&Bk.includes(c))return{field:_M(e)?e:void 0,explicitType:l};let{field:f}=e,{fields:p}=e,{types:m,typeKey:h=`type`}=e;if(f){let e=u||d?n[r+1]:void 0;return{field:!e||f.name===e||f.widget===`object`&&`fields`in f&&f.fields?.some(t=>t.name===e)?f:void 0,explicitType:l}}if(p&&(u||d))return{field:e,explicitType:l};if(p&&!u&&o!==``)return{field:p.find(({name:e})=>e===o),explicitType:l};if(m&&(u||d)){let e=l??a[[n.slice(0,r).join(`.`),o,h].join(`.`)];return{field:m.find(({name:t})=>t===e),explicitType:d?void 0:l}}if(m&&t!==h&&o!==h&&o!==``){let e=l??a[[n.slice(0,r).join(`.`),h].join(`.`)];return{field:m.find(({name:t})=>t===e)?.fields?.find(({name:e})=>e===o),explicitType:void 0}}return{field:void 0,explicitType:l}},yM=({collectionName:e,fileName:t,isIndexFile:n},r={})=>({collectionName:e,fileName:t,isIndexFile:n,...r}),bM=e=>{let{collectionName:t,fileName:n=void 0,componentName:r=void 0,valueMap:i={},keyPath:a,isIndexFile:o=!1}=e,s=[t,n??``,r??``,a,o?`1`:`0`].join(`|`);if(hM.has(s))return hM.get(s);let c=fj(t),l=c&&n?xj(c,n):void 0;if(!c||n&&c?._type!==`entry`&&!l){hM.set(s,void 0);return}let{fields:u=[]}=l??c,d=o?rA(c):void 0,f=r?oM(r)?.fields??[]:d?.fields??u,p=a.split(`.`),m,h,g=!1;if(p.forEach((e,t)=>{if(t===0){let{cleanKey:t,typeName:n}=vM(e);m=f.find(({name:e})=>e===t),!m&&d?.fields&&(m=u.find(({name:e})=>e===t)),n&&(h=n)}else if(m){let n=hxe({field:m,key:e,keyPathArray:p,segmentIndex:t,pendingExplicitType:h,valueMap:i});m=n.field,h=n.explicitType}m&&`types`in m&&(g=!0)}),h&&m&&`types`in m){let{types:e}=m;m=e.find(({name:e})=>e===h)}return g||hM.set(s,m),m},gxe=({keyPath:e,valueMap:t={},...n})=>{let r=e.split(`.`);return r.map((e,i)=>{let a=r.slice(0,i).join(`.`),o=i?`${a}.${e}`:e;if(uM(e)){let e=bM({...n,valueMap:t,keyPath:a}),{widget:r=`text`}=e??{};if(Bk.includes(r))return;let{field:i}=e??{},{types:s,typeKey:c=`type`}=e??{};if(i)return`*.${i.name}`;let l=s?t[`${o}.${c}`]:void 0;return l?`*<${l}>`:`*`}let s=bM({...n,valueMap:t,keyPath:o}),{types:c,typeKey:l=`type`}=s??{},u=s?.widget===`object`&&c?t[`${o}.${l}`]:void 0;return u?`${e}<${u}>`:e}).filter(e=>e!==void 0).join(`.`)},xM=e=>{let t=e.widget??`string`;return Pk.includes(t)?`builtin`:rk.has(t)?`custom`:`unknown`},SM=({fieldConfig:{required:e=!0},locale:t})=>Array.isArray(e)?e.includes(t):!!e,CM=({valueMap:e,keyPath:t,isList:n,isCustomFieldType:r=!1})=>{let i=e[t];if(!n&&!r)return E(i)?Gj(e,t)??i:i;let a=XO(e,t);return a.length?a.map(t=>e[t]).filter(e=>e!==void 0):r?i===void 0||E(i)?Gj(e,t)??i:i:[]},wM=/\.[^.]*$/,TM=e=>{let{keyPath:t}=e;if(!t.includes(`.`))return;let n=bM({...e,keyPath:t.replace(wM,``)});return n?.widget===`keyvalue`?n:void 0},EM=(e,t,{live:n=!0}={})=>{let r=`${t}.`;return qO(e,r,{live:n}).map(t=>[Lj(t.slice(r.length)),e[t]])},DM=(e,t,n)=>{qO(e,`${t}.`,{live:!0}).forEach(t=>{delete e[t]}),n.length&&e[t]===null&&delete e[t],n.forEach(([n,r])=>{e[`${t}.${Ij(n)}`]=r})},_xe=({content:e,referenceContent:t,keyPath:n})=>{let r=EM(e,n),i=r.map(([e])=>e),a=EM(t,n).map(([e])=>e).filter(e=>i.includes(e)),o=[...a,...i.filter(e=>!a.includes(e))];o.some((e,t)=>e!==i[t])&&DM(e,n,o.map(e=>r[i.indexOf(e)]))},OM=(e,t)=>{let n=new Map;return Object.keys(e).forEach(r=>{if(!r.includes(`.`)||!t(e,r))return;let i=r.replace(wM,``),a=n.get(i);a?a.push(r):n.set(i,[r])}),n},vxe=({draft:e,isRealKey:t,locales:n})=>{let{collectionName:r,fileName:i,isIndexFile:a,originalValues:o,currentValues:s}=e;return(n??Object.keys(s)).some(e=>{let n=s[e],c=OM(o[e],t);return[...OM(n,t)].some(([e,t])=>{let o=c.get(e);return t.some((e,t)=>e!==o[t])&&!!TM({collectionName:r,fileName:i,isIndexFile:a,keyPath:t[0],valueMap:n})})})},kM=RegExp(`\\.__sc_\\w+$`),AM=[`collection`,`collectionFile`,`fields`,`originalEntry`],jM=0,yxe=()=>!jM,MM=e=>{jM+=1;let t=()=>{--jM},n;try{n=e()}catch(e){throw t(),e}return n instanceof Promise?n.finally(t):(t(),n)},NM=e=>{Object.keys(e?.files??{}).forEach(e=>{URL.revokeObjectURL(e)})},PM=e=>Object.fromEntries(Object.entries(e).filter(([e])=>!kM.test(e))),FM=(e,t)=>!kM.test(t)&&e[t]!==void 0,IM=(e,t,{relative:n=!1,dropEmptyPlaceholders:r=!1}={})=>{let i=`${t}.`;return Object.fromEntries([...Object.hasOwn(e,t)?[t]:[],...qO(e,i)].filter(t=>{if(!FM(e,t))return!1;let n=e[t];return!(r&&(E(n)||Array.isArray(n))&&!Object.keys(n).length)}).map(t=>[n?t.slice(i.length):t,e[t]]))},LM=(e,t)=>{let n=0;return Object.keys(t).some(r=>FM(t,r)?(n+=1,!Object.hasOwn(e,r)||!(0,yr.default)(e[r],t[r])):!1)||Object.keys(e).filter(t=>FM(e,t)).length!==n},RM=({originalLocales:e,currentLocales:t},n)=>Object.keys(n).filter(n=>e[n]!==!1||t[n]!==!1),bxe=(e,t)=>{let{originalValues:n,currentValues:r}=e;return t.length!==RM(e,n).length||t.some(e=>{let t=n[e];return!t||LM(t,r[e])})},zM=e=>{if(!e)return!1;let{originalLocales:t,currentLocales:n,originalSlugs:r,currentSlugs:i,originalPath:a,currentPath:o}=e,s=RM(e,e.currentValues);return!(0,yr.default)(t,n)||!(0,yr.default)(r,i)||CE(a??``)!==CE(o??``)||bxe(e,s)||vxe({draft:e,isRealKey:FM,locales:s})},BM=Symbol(`valueMapVersion`),VM=e=>e?.[BM],HM=Symbol(`subtreeVersions`),xxe=class{#e=j(0);get count(){return z(this.#e)}set count(e){M(this.#e,e,!0)}},Sxe=(e,t)=>{let n=e?.[HM];if(!n)return;let r=n.get(t);return r?r.count:VM(e)},UM=(e={},{onSet:t,onDelete:n}={})=>{let r=ta(e),i=j(0),a=new Set(Object.keys(e)),o=new Map,s=e=>{let t=e.split(`.`);return t.map((e,n)=>t.slice(0,n+1).join(`.`))},c=e=>{s(e).forEach(e=>{o.has(e)||o.set(e,new xxe)})},l=e=>{M(i,z(i)+1),s(e).forEach(e=>{o.get(e).count+=1})};return a.forEach(e=>{c(e)}),new Proxy(r,{get:(e,t)=>t===BM?z(i):t===HM?o:e[t],ownKeys:e=>{let t=new Set(Reflect.ownKeys(e));return[...[...a].filter(e=>t.has(e)),...[...t].filter(e=>!a.has(e))]},set:(e,n,r)=>{let i=e[n];return i!==r&&(e[n]=r,a.add(n),c(n),l(n)),t?.(e,n,r,i),!0},deleteProperty:(e,t)=>{let r=e[t];return t in e&&(delete e[t],a.delete(t),l(t)),n?.(e,t,r),!0}})},WM=new WeakMap,GM=(e,t,n=`currentValues`)=>{let r=e?.[n]?.[t];if(!r)return{};let i=VM(r);if(i===void 0)return ni(r);let a=WM.get(r);if(a?.version===i)return a.snapshot;let o=fo(()=>ni(r));return WM.set(r,{version:i,snapshot:o}),o},KM=e=>Object.fromEntries(Object.keys(e.currentValues??{}).map(t=>[t,GM(e,t)])),qM=(e,t,n,r=`currentValues`)=>Sxe(e?.[r]?.[t],n)===void 0?GM(e,t,r):fo(()=>GM(e,t,r)),JM=`entry-draft`,YM=`data-entry-draft-root`,XM=new WeakMap,Cxe=e=>e&&{...e,currentValues:KM(e)},ZM=class{#e=j();get current(){return z(this.#e)}set current(e){M(this.#e,e)}#t=A(()=>zM(Cxe(this.current)));get modified(){return z(this.#t)}set modified(e){M(this.#t,e)}},QM=e=>ci(JM,e),$M=()=>si(JM),eN=e=>new Map([[JM,e]]),tN=(e,t)=>{e.setAttribute(YM,``),XM.set(e,t)},wxe=e=>{let t=e?.closest(`[${YM}]`);return t?XM.get(t):void 0},nN=e=>{queueMicrotask(e)},rN=new Set,iN=pk(!1),aN=e=>{let t=()=>{rN.delete(e),iN.current=!!rN.size};rN.add(e),iN.current=!0,e.then(t,t)},oN=async()=>{for(;rN.size;)await Promise.allSettled(rN)},sN=async e=>{await oN(),e()};function Txe(e,t){O(t,!0);let n=$M(),{valueStoreKey:r=`currentValues`}=si(`field-editor`)??{},i=J(t,`currentValue`,15),a=J(t,`required`,3,!0),o=J(t,`readonly`,3,!1),s=J(t,`invalid`,3,!1),c=j(``),l=j(``),u=j(!1),d=A(()=>Mr(t.fieldConfig.default_language,`plain`)),f=A(()=>Mr(t.fieldConfig.allow_language_selection,!0)),p=A(()=>Mr(t.fieldConfig.output_code_only,!1)),m=A(()=>Mr(t.fieldConfig.keys,()=>({code:`code`,lang:`lang`}),!0)),h=A(()=>qM(n.current,t.locale,t.keyPath,r)),g=A(()=>`${t.keyPath}.${z(m).code}`),_=A(()=>`${t.keyPath}.${z(m).lang}`),v=()=>{if(z(p))typeof i()==`string`?z(c)!==i()&&M(c,i(),!0):M(c,``),M(l,z(d),!0);else{let e=z(h)[z(g)],t=z(h)[z(_)]||z(d);typeof e==`string`?z(c)!==e&&M(c,e,!0):M(c,``),typeof t==`string`?z(l)!==t&&M(l,t,!0):M(l,``)}},y=()=>{if(z(p)){i()!==z(c)&&i(z(c));return}let e=n.current;if(!e)return;let a={};if((!E(z(h)[t.keyPath])||Object.keys(z(h)[t.keyPath]).length)&&(a[t.keyPath]={}),z(h)[z(g)]!==z(c)&&(a[z(g)]=z(c)),z(h)[z(_)]!==z(l)&&(a[z(_)]=z(l)),!Object.keys(a).length)return;let o=e[r][t.locale];nN(()=>{Object.assign(o,a)})};vk(()=>z(h),()=>{v()}),vk(()=>[z(c),z(l)],()=>{y()}),L(()=>{if(!z(u))return;let{promise:e,resolve:t}=Promise.withResolvers();return aN(e),async()=>{await co(),t()}});var b=H();Fo(P(b),pl,null,e=>{var n=H();Io(P(n),()=>JSON.stringify(t.fieldConfig),e=>{rve(e,{get showLanguageSwitcher(){return z(f)},flex:!0,get readonly(){return o()},get required(){return a()},get invalid(){return s()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get code(){return z(c)},set code(e){M(c,e,!0)},get lang(){return z(l)},set lang(e){M(l,e,!0)},get pending(){return z(u)},set pending(e){M(u,e,!0)}})}),U(e,n)}),U(e,b),k()}var Exe=B(`<pre> </pre>`);function Dxe(e,t){O(t,!0);let n=$M(),r=A(()=>Mr(t.fieldConfig.default_language,``)),i=A(()=>Mr(t.fieldConfig.output_code_only,!1)),a=A(()=>Mr(t.fieldConfig.keys,()=>({code:`code`,lang:`lang`}),!0)),o=A(()=>qM(n.current,t.locale,t.keyPath)),s=A(()=>`${t.keyPath}.${z(a).code}`),c=A(()=>`${t.keyPath}.${z(a).lang}`),l=A(()=>z(i)?t.currentValue:z(o)[z(s)]),u=A(()=>z(i)?z(r):z(o)[z(c)]);var d=H(),f=P(d),p=e=>{var t=Exe(),n=F(t,!0);R(()=>{os(t,1,ns(z(u)?`language-${z(u)}`:void 0)),W(n,z(l))}),U(e,t)};G(f,e=>{z(l)&&e(p)}),U(e,d),k()}var cN=/^#(?<r>[0-9a-f]{2})(?<g>[0-9a-f]{2})(?<b>[0-9a-f]{2})(?<a>[0-9a-f]{2})?$/i,lN=e=>Number.parseInt(e,16),Oxe=(e,{enableAlpha:t=!1}={})=>{let{r:n,g:r,b:i,a}=e?.match(cN)?.groups??{};if(!n)return``;let o=t&&a?` / ${Math.round(lN(a)/255*100)}%`:``;return`rgb(${lN(n)} ${lN(r)} ${lN(i)}${o})`},kxe=/^#[0-9a-f]{6}$/i,Axe=e=>{if(typeof e!=`string`)return;let{r:t,g:n,b:r,a:i=`ff`}=e.match(cN)?.groups??{};if(t)return{rgb:`#${t}${n}${r}`,alpha:lN(i)}},uN=({rgb:e,alpha:t,enableAlpha:n=!1})=>kxe.test(e)?n?`${e}${t.toString(16).padStart(2,`0`)}`:e:``,jxe=({currentValue:e,rgb:t,alpha:n,enableAlpha:r=!1})=>{let i=Axe(e);if(i)return i;if((e==null||e===``)&&uN({rgb:t,alpha:n,enableAlpha:r})!==``)return{rgb:``,alpha:255}},Mxe=B(` <!>`,1),Nxe=B(`<span role="none" class="value svelte-udhsyb"><!> <!></span>`),Pxe=B(`<div role="none" class="svelte-udhsyb"><!> <!> <!></div>`),Fxe={hash:`svelte-udhsyb`,code:`div.svelte-udhsyb {display:flex;align-items:center;gap:8px;.value:where(.svelte-udhsyb) {display:flex;align-items:center;gap:8px;.sui.text-input {width:88px;min-width:0;}.sui.slider {padding:8px;--sui-slider-base-width: 80px;}}}`};function Ixe(e,t){let n=Eo();O(t,!0),K(e,Fxe);let r=J(t,`currentValue`,15),i=J(t,`required`,3,!0),a=J(t,`readonly`,3,!1),o=J(t,`invalid`,3,!1),s=j(``),c=j(255),l=A(()=>Mr(t.fieldConfig.allowInput,!1)),u=A(()=>Mr(t.fieldConfig.enableAlpha,!1)),d={rgb:``,alpha:255},f=()=>{let e=jxe({currentValue:r(),rgb:z(s),alpha:z(c),enableAlpha:z(u)});e&&(z(s)!==e.rgb&&M(s,e.rgb,!0),z(u)&&z(c)!==e.alpha&&M(c,e.alpha,!0)),d={rgb:z(s),alpha:z(c)}},p=()=>{if(z(s)===d.rgb&&z(c)===d.alpha)return;let e=uN({rgb:z(s),alpha:z(c),enableAlpha:z(u)});r()!==e&&r(e)};vk(()=>r(),()=>{f()}),vk(()=>[z(s),z(c)],()=>{p()});var m=Pxe(),h=N(m);gye(h,{get id(){return`${n}-picker`},get readonly(){return a()},get required(){return i()},get invalid(){return o()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return z(s)},set value(e){M(s,e,!0)}});var g=I(h,2),_=e=>{var r=Nxe(),d=N(r),f=e=>{fu(e,{dir:`ltr`,get id(){return`${n}-input`},get invalid(){return o()},get readonly(){return a()},get required(){return i()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return z(s)},set value(e){M(s,e,!0)}})};G(d,e=>{z(l)&&e(f)});var p=I(d,2),m=e=>{var t=Mxe(),n=P(t),r=I(n);{let e=A(()=>!z(s)),t=A(()=>Y(`opacity`));qoe(r,{min:0,max:255,get disabled(){return z(e)},get readonly(){return a()},get sliderLabel(){return z(t)},get value(){return z(c)},set value(e){M(c,e,!0)}})}R(e=>W(n,`${e??``} `),[()=>Y(`opacity`)]),U(e,t)};G(p,e=>{z(u)&&e(m)}),D(r),U(e,r)};G(g,e=>{(z(l)||z(u))&&e(_)});var v=I(g,2),y=e=>{{let t=A(()=>Y(`clear`)),r=A(()=>!z(s)),i=A(()=>`${n}-picker ${z(l)?`${n}-input`:``}`);Al(e,{variant:`tertiary`,get label(){return z(t)},get disabled(){return z(r)},get"aria-controls"(){return z(i)},onclick:()=>{M(s,``),M(c,255)}})}};G(v,e=>{!a()&&!i()&&e(y)}),D(m),U(e,m),k()}var Lxe=B(`<p><span role="none" class="preview svelte-1m6xsa0"><span role="none" class="color svelte-1m6xsa0"></span> <span role="none" class="value"> </span> <span role="none" class="value"> </span></span></p>`),Rxe={hash:`svelte-1m6xsa0`,code:`.preview.svelte-1m6xsa0 {display:inline-flex;align-items:center;gap:8px;.color:where(.svelte-1m6xsa0) {display:block;width:24px;height:24px;border-radius:24px;}}`};function zxe(e,t){O(t,!0),K(e,Rxe);let n=A(()=>Mr(t.fieldConfig.enableAlpha,!1)),r=A(()=>Oxe(t.currentValue,{enableAlpha:z(n)}));var i=H(),a=P(i),o=e=>{var n=Lxe(),i=N(n),a=N(i);let o;var s=I(a,2),c=F(s,!0),l=F(I(s,2),!0);D(i),D(n),R(()=>{o=cs(a,``,o,{"background-color":t.currentValue}),W(c,t.currentValue),W(l,z(r))}),U(e,n)},s=A(()=>typeof t.currentValue==`string`&&t.currentValue.trim());G(a,e=>{z(s)&&e(o)}),U(e,i),k()}function Bxe(e,t){O(t,!0);let n=J(t,`required`,3,!0),r=J(t,`readonly`,3,!1),i=J(t,`invalid`,3,!1);{let a=A(()=>String(t.currentValue));fu(e,{dir:`auto`,get value(){return z(a)},flex:!0,get readonly(){return r()},get required(){return n()},get invalid(){return i()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`}})}k()}var dN=(e,t)=>e.replaceAll(qk,(e,n)=>String(t(n)??``)),fN=(e,t)=>e.map(e=>{let{defaultValue:n,truthyValue:r,falsyValue:i}=e.args,a={...e.args},o=!1;if(n!==void 0){let e=dN(n,t);e!==n&&(a.defaultValue=e,o=!0)}if(r!==void 0){let e=dN(r,t);e!==r&&(a.truthyValue=e,o=!0)}if(i!==void 0){let e=dN(i,t);e!==i&&(a.falsyValue=e,o=!0)}let{customArgs:s}=e,c;return s?.some(e=>typeof e==`string`&&Kk.test(e))&&(c=s.map(e=>typeof e==`string`?dN(e,t):e)),!o&&!c?e:{...e,args:a,...c?{customArgs:c}:{}}}),pN=(e,t,n)=>{let r=t+n;for(;/\s/.test(e[r]??``);)r+=n;return e[r]??``},mN=(e,t)=>{let n=``,r=0;for(;r<e.length;){let i=e.indexOf(`{{`,r);if(i===-1){n+=e.slice(r);break}n+=e.slice(r,i);let a=i+2,o=!1;for(;a<e.length;){let s=e[a],c=e[a+1];if(s===`'`&&(!o&&[`(`,`,`].includes(pN(e,a,-1))?o=!0:o&&[`,`,`)`].includes(pN(e,a,1))&&(o=!1)),!o&&s===`}`&&c===`}`){let o=a,s=e[i-1]===`'`,c=e[o+2]===`'`,l=e[i-2],u=e[o+3],d=e.slice(i+2,o),f=s&&c&&[`(`,`,`,`[`,`|`].includes(l??``)&&[`)`,`,`,`]`].includes(u??``);n+=d?f?e.slice(i,o+2):t(e.slice(i,o+2),d):e.slice(i,o+2),r=o+2;break}a+=1}if(a>=e.length){n+=e.slice(i);break}}return n},hN=e=>{let t=[];return{tags:t,literals:mN(e,(e,n)=>(t.push(n),`\0`)).split(`\0`)}},gN=e=>Kk.test(e),_N=e=>e.replace(Zk,``),vN=(e,t=[])=>{let n=e.split(`/`).pop(),r=n.lastIndexOf(`.`),i=r===-1?``:n.slice(r+1),a=r===-1?n:n.slice(0,r),o=t.find(e=>a.endsWith(`.${e}`));return o&&(a=a.slice(0,-(o.length+1))),{filename:a,extension:i}},yN=({_i18n:e})=>e?.structureMap?.i18nMultiFile?e.allLocales:[],Vxe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs=r()})(n,(function(){"use strict";var e=1e3,t=6e4,n=36e5,r=`millisecond`,i=`second`,a=`minute`,o=`hour`,s=`day`,c=`week`,l=`month`,u=`quarter`,d=`year`,f=`date`,p=`Invalid Date`,m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:`en`,weekdays:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),ordinal:function(e){var t=[`th`,`st`,`nd`,`rd`],n=e%100;return`[`+e+(t[(n-20)%10]||t[n]||t[0])+`]`}},_=function(e,t,n){var r=String(e);return!r||r.length>=t?e:``+Array(t+1-r.length).join(n)+e},v={s:_,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?`+`:`-`)+_(r,2,`0`)+`:`+_(i,2,`0`)},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,l),a=n-i<0,o=t.clone().add(r+(a?-1:1),l);return+(-(r+(n-i)/(a?i-o:o-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:l,y:d,w:c,d:s,D:f,h:o,m:a,s:i,ms:r,Q:u}[e]||String(e||``).toLowerCase().replace(/s$/,``)},u:function(e){return e===void 0}},y=`en`,b={};b[y]=g;var x=`$isDayjsObject`,S=function(e){return e instanceof ee||!(!e||!e[x])},C=function e(t,n,r){var i;if(!t)return y;if(typeof t==`string`){var a=t.toLowerCase();b[a]&&(i=a),n&&(b[a]=n,i=a);var o=t.split(`-`);if(!i&&o.length>1)return e(o[0])}else{var s=t.name;b[s]=t,i=s}return!r&&i&&(y=i),i||!r&&y},w=function(e,t){if(S(e))return e.clone();var n=typeof t==`object`?t:{};return n.date=e,n.args=arguments,new ee(n)},T=v;T.l=C,T.i=S,T.w=function(e,t){return w(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var ee=function(){function g(e){this.$L=C(e.locale,null,!0),this.parse(e),this.$x=this.$x||e.x||{},this[x]=!0}var _=g.prototype;return _.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t==`string`&&!/Z$/i.test(t)){var r=t.match(m);if(r){var i=r[2]-1||0,a=(r[7]||`0`).substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,a)}}return new Date(t)}(e),this.init()},_.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},_.$utils=function(){return T},_.isValid=function(){return this.$d.toString()!==p},_.isSame=function(e,t){var n=w(e);return this.startOf(t)<=n&&n<=this.endOf(t)},_.isAfter=function(e,t){return w(e)<this.startOf(t)},_.isBefore=function(e,t){return this.endOf(t)<w(e)},_.$g=function(e,t,n){return T.u(e)?this[t]:this.set(n,e)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(e,t){var n=this,r=!!T.u(t)||t,u=T.p(e),p=function(e,t){var i=T.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return r?i:i.endOf(s)},m=function(e,t){return T.w(n.toDate()[e].apply(n.toDate(`s`),(r?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},h=this.$W,g=this.$M,_=this.$D,v=`set`+(this.$u?`UTC`:``);switch(u){case d:return r?p(1,0):p(31,11);case l:return r?p(1,g):p(0,g+1);case c:var y=this.$locale().weekStart||0,b=(h<y?h+7:h)-y;return p(r?_-b:_+(6-b),g);case s:case f:return m(v+`Hours`,0);case o:return m(v+`Minutes`,1);case a:return m(v+`Seconds`,2);case i:return m(v+`Milliseconds`,3);default:return this.clone()}},_.endOf=function(e){return this.startOf(e,!1)},_.$set=function(e,t){var n,c=T.p(e),u=`set`+(this.$u?`UTC`:``),p=(n={},n[s]=u+`Date`,n[f]=u+`Date`,n[l]=u+`Month`,n[d]=u+`FullYear`,n[o]=u+`Hours`,n[a]=u+`Minutes`,n[i]=u+`Seconds`,n[r]=u+`Milliseconds`,n)[c],m=c===s?this.$D+(t-this.$W):t;if(c===l||c===d){var h=this.clone().set(f,1);h.$d[p](m),h.init(),this.$d=h.set(f,Math.min(this.$D,h.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},_.set=function(e,t){return this.clone().$set(e,t)},_.get=function(e){return this[T.p(e)]()},_.add=function(r,u){var f,p=this;r=Number(r);var m=T.p(u),h=function(e){var t=w(p);return T.w(t.date(t.date()+Math.round(e*r)),p)};if(m===l)return this.set(l,this.$M+r);if(m===d)return this.set(d,this.$y+r);if(m===s)return h(1);if(m===c)return h(7);var g=(f={},f[a]=t,f[o]=n,f[i]=e,f)[m]||1,_=this.$d.getTime()+r*g;return T.w(_,this)},_.subtract=function(e,t){return this.add(-1*e,t)},_.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||p;var r=e||`YYYY-MM-DDTHH:mm:ssZ`,i=T.z(this),a=this.$H,o=this.$m,s=this.$M,c=n.weekdays,l=n.months,u=n.meridiem,d=function(e,n,i,a){return e&&(e[n]||e(t,r))||i[n].slice(0,a)},f=function(e){return T.s(a%12||12,e,`0`)},m=u||function(e,t,n){var r=e<12?`AM`:`PM`;return n?r.toLowerCase():r};return r.replace(h,(function(e,r){return r||function(e){switch(e){case`YY`:return String(t.$y).slice(-2);case`YYYY`:return T.s(t.$y,4,`0`);case`M`:return s+1;case`MM`:return T.s(s+1,2,`0`);case`MMM`:return d(n.monthsShort,s,l,3);case`MMMM`:return d(l,s);case`D`:return t.$D;case`DD`:return T.s(t.$D,2,`0`);case`d`:return String(t.$W);case`dd`:return d(n.weekdaysMin,t.$W,c,2);case`ddd`:return d(n.weekdaysShort,t.$W,c,3);case`dddd`:return c[t.$W];case`H`:return String(a);case`HH`:return T.s(a,2,`0`);case`h`:return f(1);case`hh`:return f(2);case`a`:return m(a,o,!0);case`A`:return m(a,o,!1);case`m`:return String(o);case`mm`:return T.s(o,2,`0`);case`s`:return String(t.$s);case`ss`:return T.s(t.$s,2,`0`);case`SSS`:return T.s(t.$ms,3,`0`);case`Z`:return i}return null}(e)||i.replace(`:`,``)}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(r,f,p){var m,h=this,g=T.p(f),_=w(r),v=(_.utcOffset()-this.utcOffset())*t,y=this-_,b=function(){return T.m(h,_)};switch(g){case d:m=b()/12;break;case l:m=b();break;case u:m=b()/3;break;case c:m=(y-v)/6048e5;break;case s:m=(y-v)/864e5;break;case o:m=y/n;break;case a:m=y/t;break;case i:m=y/e;break;default:m=y}return p?m:T.a(m)},_.daysInMonth=function(){return this.endOf(l).$D},_.$locale=function(){return b[this.$L]},_.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=C(e,t,!0);return r&&(n.$L=r),n},_.clone=function(){return T.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},g}(),te=ee.prototype;return w.prototype=te,[[`$ms`,r],[`$s`,i],[`$m`,a],[`$H`,o],[`$W`,s],[`$M`,l],[`$y`,d],[`$D`,f]].forEach((function(e){te[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),w.extend=function(e,t){return e.$i||=(e(t,ee,w),!0),w},w.locale=C,w.isDayjs=S,w.unix=function(e){return w(1e3*e)},w.en=b[y],w.Ls=b,w.p={},w}))})),Hxe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_customParseFormat=r()})(n,(function(){"use strict";var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,r=/\d\d/,i=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,o={},s=function(e){return(e=+e)+(e>68?1900:2e3)},c=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||={}).offset=function(e){if(!e||e===`Z`)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return n===0?0:t[0]===`+`?-n:n}(e)}],u=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?`pm`:`PM`);return n},f={A:[a,function(e){this.afternoon=d(e,!1)}],a:[a,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*e}],SS:[r,function(e){this.milliseconds=10*e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[i,c(`seconds`)],ss:[i,c(`seconds`)],m:[i,c(`minutes`)],mm:[i,c(`minutes`)],H:[i,c(`hours`)],h:[i,c(`hours`)],HH:[i,c(`hours`)],hh:[i,c(`hours`)],D:[i,c(`day`)],DD:[r,c(`day`)],Do:[a,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,``)===e&&(this.day=r)}],w:[i,c(`week`)],ww:[r,c(`week`)],M:[i,c(`month`)],MM:[r,c(`month`)],MMM:[a,function(e){var t=u(`months`),n=(u(`monthsShort`)||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw Error();this.month=n%12||n}],MMMM:[a,function(e){var t=u(`months`).indexOf(e)+1;if(t<1)throw Error();this.month=t%12||t}],Y:[/[+-]?\d+/,c(`year`)],YY:[r,function(e){this.year=s(e)}],YYYY:[/\d{4}/,c(`year`)],Z:l,ZZ:l};function p(n){for(var r=n,i=o&&o.formats,a=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var a=r&&r.toUpperCase();return n||i[r]||e[r]||i[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),s=a.length,c=0;c<s;c+=1){var l=a[c],u=f[l],d=u&&u[0],p=u&&u[1];a[c]=p?{regex:d,parser:p}:l.replace(/^\[|\]$/g,``)}return function(e){for(var t={},n=0,r=0;n<s;n+=1){var i=a[n];if(typeof i==`string`)r+=i.length;else{var o=i.regex,c=i.parser,l=e.slice(r),u=o.exec(l)[0];c.call(t,u),e=e.replace(u,``)}}return function(e){var t=e.afternoon;if(t!==void 0){var n=e.hours;t?n<12&&(e.hours+=12):n===12&&(e.hours=0),delete e.afternoon}}(t),t}}return function(e,t,n){n.p.customParseFormat=!0,e&&e.parseTwoDigitYear&&(s=e.parseTwoDigitYear);var r=t.prototype,i=r.parse;r.parse=function(e){var t=e.date,r=e.utc,a=e.args;this.$u=r;var s=a[1];if(typeof s==`string`){var c=!0===a[2],l=!0===a[3],u=c||l,d=a[2];l&&(d=a[2]),o=this.$locale(),!c&&d&&(o=n.Ls[d]),this.$d=function(e,t,n,r){try{if([`x`,`X`].indexOf(t)>-1)return new Date((t===`X`?1e3:1)*e);var i=p(t)(e),a=i.year,o=i.month,s=i.day,c=i.hours,l=i.minutes,u=i.seconds,d=i.milliseconds,f=i.zone,m=i.week,h=new Date,g=s||(a||o?1:h.getDate()),_=a||h.getFullYear(),v=0;a&&!o||(v=o>0?o-1:h.getMonth());var y,b=c||0,x=l||0,S=u||0,C=d||0;return f?new Date(Date.UTC(_,v,g,b,x,S,C+60*f.offset*1e3)):n?new Date(Date.UTC(_,v,g,b,x,S,C)):(y=new Date(_,v,g,b,x,S,C),m&&(y=r(y).week(m).toDate()),y)}catch{return new Date(``)}}(t,s,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(s)&&(this.$d=new Date(``)),o={}}else if(s instanceof Array)for(var f=s.length,m=1;m<=f;m+=1){a[1]=s[m-1];var h=n.apply(this,a);if(h.isValid()){this.$d=h.$d,this.$L=h.$L,this.init();break}m===f&&(this.$d=new Date(``))}else i.call(this,e)}}}))})),Uxe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_localizedFormat=r()})(n,(function(){"use strict";var e={LTS:`h:mm:ss A`,LT:`h:mm A`,L:`MM/DD/YYYY`,LL:`MMMM D, YYYY`,LLL:`MMMM D, YYYY h:mm A`,LLLL:`dddd, MMMM D, YYYY h:mm A`};return function(t,n,r){var i=n.prototype,a=i.format;r.en.formats=e,i.format=function(t){t===void 0&&(t=`YYYY-MM-DDTHH:mm:ssZ`);var n=this.$locale().formats,r=function(t,n){return t.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,r,i){var a=i&&i.toUpperCase();return r||n[i]||e[i]||n[a].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))}(t,n===void 0?{}:n);return a.call(this,r)}}}))})),Wxe=s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_utc=r()})(n,(function(){"use strict";var e=`minute`,t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,i,a){var o=i.prototype;a.utc=function(e){return new i({date:e,utc:!0,args:arguments})},o.utc=function(t){var n=a(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},o.local=function(){return a(this.toDate(),{locale:this.$L,utc:!1})};var s=o.parse;o.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),s.call(this,e)};var c=o.init;o.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else c.call(this)};var l=o.utcOffset;o.utcOffset=function(r,i){var a=this.$utils().u;if(a(r))return this.$u?0:a(this.$offset)?l.call(this):this.$offset;if(typeof r==`string`&&(r=function(e){e===void 0&&(e=``);var r=e.match(t);if(!r)return null;var i=(``+r[0]).match(n)||[`-`,0,0],a=i[0],o=60*i[1]+ +i[2];return o===0?0:a===`+`?o:-o}(r),r===null))return this;var o=Math.abs(r)<=16?60*r:r;if(o===0)return this.utc(i);var s=this.clone();if(i)return s.$offset=o,s.$u=!1,s;var c=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(s=this.local().add(o+c,e)).$offset=o,s.$x.$localOffset=c,s};var u=o.format;o.format=function(e){var t=e||(this.$u?`YYYY-MM-DDTHH:mm:ss[Z]`:``);return u.call(this,t)},o.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var d=o.toDate;o.toDate=function(e){return e===`s`&&this.$offset?a(this.format(`YYYY-MM-DD HH:mm:ss:SSS`)).toDate():d.call(this)};var f=o.diff;o.diff=function(e,t,n){if(e&&this.$u===e.$u)return f.call(this,e,t,n);var r=this.local(),i=a(e).local();return f.call(r,i,t,n)}}}))})),bN=u(Vxe(),1),xN=u(Hxe(),1),SN=u(Uxe(),1),CN=u(Wxe(),1),wN=new Map([[`ß`,`ss`],[`ẞ`,`Ss`],[`ä`,`ae`],[`Ä`,`Ae`],[`ö`,`oe`],[`Ö`,`Oe`],[`ü`,`ue`],[`Ü`,`Ue`],[`À`,`A`],[`Á`,`A`],[`Â`,`A`],[`Ã`,`A`],[`Ä`,`Ae`],[`Å`,`A`],[`Æ`,`AE`],[`Ç`,`C`],[`È`,`E`],[`É`,`E`],[`Ê`,`E`],[`Ë`,`E`],[`Ə`,`A`],[`Ì`,`I`],[`Í`,`I`],[`Î`,`I`],[`Ï`,`I`],[`Ð`,`D`],[`Ñ`,`N`],[`Ò`,`O`],[`Ó`,`O`],[`Ô`,`O`],[`Õ`,`O`],[`Ö`,`Oe`],[`Ō`,`O`],[`Ő`,`O`],[`Ø`,`O`],[`Œ`,`OE`],[`Ù`,`U`],[`Ú`,`U`],[`Û`,`U`],[`Ü`,`Ue`],[`Ű`,`U`],[`Ý`,`Y`],[`Þ`,`TH`],[`ß`,`ss`],[`à`,`a`],[`á`,`a`],[`â`,`a`],[`ã`,`a`],[`ä`,`ae`],[`å`,`a`],[`æ`,`ae`],[`ç`,`c`],[`è`,`e`],[`é`,`e`],[`ê`,`e`],[`ë`,`e`],[`ə`,`a`],[`ì`,`i`],[`í`,`i`],[`î`,`i`],[`ï`,`i`],[`ð`,`d`],[`ñ`,`n`],[`ò`,`o`],[`ó`,`o`],[`ô`,`o`],[`õ`,`o`],[`ö`,`oe`],[`ō`,`o`],[`ő`,`o`],[`ø`,`o`],[`œ`,`oe`],[`ù`,`u`],[`ú`,`u`],[`û`,`u`],[`ü`,`ue`],[`ű`,`u`],[`ý`,`y`],[`þ`,`th`],[`ÿ`,`y`],[`à`,`a`],[`À`,`A`],[`á`,`a`],[`Á`,`A`],[`â`,`a`],[`Â`,`A`],[`ã`,`a`],[`Ã`,`A`],[`è`,`e`],[`È`,`E`],[`é`,`e`],[`É`,`E`],[`ê`,`e`],[`Ê`,`E`],[`ì`,`i`],[`Ì`,`I`],[`í`,`i`],[`Í`,`I`],[`ò`,`o`],[`Ò`,`O`],[`ó`,`o`],[`Ó`,`O`],[`ô`,`o`],[`Ô`,`O`],[`õ`,`o`],[`Õ`,`O`],[`ù`,`u`],[`Ù`,`U`],[`ú`,`u`],[`Ú`,`U`],[`ý`,`y`],[`Ý`,`Y`],[`ă`,`a`],[`Ă`,`A`],[`Đ`,`D`],[`đ`,`d`],[`ĩ`,`i`],[`Ĩ`,`I`],[`ũ`,`u`],[`Ũ`,`U`],[`ơ`,`o`],[`Ơ`,`O`],[`ư`,`u`],[`Ư`,`U`],[`ạ`,`a`],[`Ạ`,`A`],[`ả`,`a`],[`Ả`,`A`],[`ấ`,`a`],[`Ấ`,`A`],[`ầ`,`a`],[`Ầ`,`A`],[`ẩ`,`a`],[`Ẩ`,`A`],[`ẫ`,`a`],[`Ẫ`,`A`],[`ậ`,`a`],[`Ậ`,`A`],[`ắ`,`a`],[`Ắ`,`A`],[`ằ`,`a`],[`Ằ`,`A`],[`ẳ`,`a`],[`Ẳ`,`A`],[`ẵ`,`a`],[`Ẵ`,`A`],[`ặ`,`a`],[`Ặ`,`A`],[`ẹ`,`e`],[`Ẹ`,`E`],[`ẻ`,`e`],[`Ẻ`,`E`],[`ẽ`,`e`],[`Ẽ`,`E`],[`ế`,`e`],[`Ế`,`E`],[`ề`,`e`],[`Ề`,`E`],[`ể`,`e`],[`Ể`,`E`],[`ễ`,`e`],[`Ễ`,`E`],[`ệ`,`e`],[`Ệ`,`E`],[`ỉ`,`i`],[`Ỉ`,`I`],[`ị`,`i`],[`Ị`,`I`],[`ọ`,`o`],[`Ọ`,`O`],[`ỏ`,`o`],[`Ỏ`,`O`],[`ố`,`o`],[`Ố`,`O`],[`ồ`,`o`],[`Ồ`,`O`],[`ổ`,`o`],[`Ổ`,`O`],[`ỗ`,`o`],[`Ỗ`,`O`],[`ộ`,`o`],[`Ộ`,`O`],[`ớ`,`o`],[`Ớ`,`O`],[`ờ`,`o`],[`Ờ`,`O`],[`ở`,`o`],[`Ở`,`O`],[`ỡ`,`o`],[`Ỡ`,`O`],[`ợ`,`o`],[`Ợ`,`O`],[`ụ`,`u`],[`Ụ`,`U`],[`ủ`,`u`],[`Ủ`,`U`],[`ứ`,`u`],[`Ứ`,`U`],[`ừ`,`u`],[`Ừ`,`U`],[`ử`,`u`],[`Ử`,`U`],[`ữ`,`u`],[`Ữ`,`U`],[`ự`,`u`],[`Ự`,`U`],[`ỳ`,`y`],[`Ỳ`,`Y`],[`ỵ`,`y`],[`Ỵ`,`Y`],[`ỷ`,`y`],[`Ỷ`,`Y`],[`ỹ`,`y`],[`Ỹ`,`Y`],[`ء`,`e`],[`آ`,`a`],[`أ`,`a`],[`ؤ`,`w`],[`إ`,`a`],[`ئ`,`y`],[`ا`,`a`],[`ب`,`b`],[`ة`,`t`],[`ت`,`t`],[`ث`,`th`],[`ج`,`j`],[`ح`,`h`],[`خ`,`kh`],[`د`,`d`],[`ذ`,`dh`],[`ر`,`r`],[`ز`,`z`],[`س`,`s`],[`ش`,`sh`],[`ص`,`s`],[`ض`,`d`],[`ط`,`t`],[`ظ`,`z`],[`ع`,`e`],[`غ`,`gh`],[`ـ`,`_`],[`ف`,`f`],[`ق`,`q`],[`ك`,`k`],[`ل`,`l`],[`م`,`m`],[`ن`,`n`],[`ه`,`h`],[`و`,`w`],[`ى`,`a`],[`ي`,`y`],[`َ‎`,`a`],[`ُ`,`u`],[`ِ‎`,`i`],[`٠`,`0`],[`١`,`1`],[`٢`,`2`],[`٣`,`3`],[`٤`,`4`],[`٥`,`5`],[`٦`,`6`],[`٧`,`7`],[`٨`,`8`],[`٩`,`9`],[`چ`,`ch`],[`ک`,`k`],[`گ`,`g`],[`پ`,`p`],[`ژ`,`zh`],[`ی`,`y`],[`۰`,`0`],[`۱`,`1`],[`۲`,`2`],[`۳`,`3`],[`۴`,`4`],[`۵`,`5`],[`۶`,`6`],[`۷`,`7`],[`۸`,`8`],[`۹`,`9`],[`ټ`,`p`],[`ځ`,`z`],[`څ`,`c`],[`ډ`,`d`],[`ﺫ`,`d`],[`ﺭ`,`r`],[`ړ`,`r`],[`ﺯ`,`z`],[`ږ`,`g`],[`ښ`,`x`],[`ګ`,`g`],[`ڼ`,`n`],[`ۀ`,`e`],[`ې`,`e`],[`ۍ`,`ai`],[`ٹ`,`t`],[`ڈ`,`d`],[`ڑ`,`r`],[`ں`,`n`],[`ہ`,`h`],[`ھ`,`h`],[`ے`,`e`],[`А`,`A`],[`а`,`a`],[`Б`,`B`],[`б`,`b`],[`В`,`V`],[`в`,`v`],[`Г`,`G`],[`г`,`g`],[`Д`,`D`],[`д`,`d`],[`ъе`,`ye`],[`Ъе`,`Ye`],[`ъЕ`,`yE`],[`ЪЕ`,`YE`],[`Е`,`E`],[`е`,`e`],[`Ё`,`Yo`],[`ё`,`yo`],[`Ж`,`Zh`],[`ж`,`zh`],[`З`,`Z`],[`з`,`z`],[`И`,`I`],[`и`,`i`],[`ый`,`iy`],[`Ый`,`Iy`],[`ЫЙ`,`IY`],[`ыЙ`,`iY`],[`Й`,`Y`],[`й`,`y`],[`К`,`K`],[`к`,`k`],[`Л`,`L`],[`л`,`l`],[`М`,`M`],[`м`,`m`],[`Н`,`N`],[`н`,`n`],[`О`,`O`],[`о`,`o`],[`П`,`P`],[`п`,`p`],[`Р`,`R`],[`р`,`r`],[`С`,`S`],[`с`,`s`],[`Т`,`T`],[`т`,`t`],[`У`,`U`],[`у`,`u`],[`Ф`,`F`],[`ф`,`f`],[`Х`,`Kh`],[`х`,`kh`],[`Ц`,`Ts`],[`ц`,`ts`],[`Ч`,`Ch`],[`ч`,`ch`],[`Ш`,`Sh`],[`ш`,`sh`],[`Щ`,`Sch`],[`щ`,`sch`],[`Ъ`,``],[`ъ`,``],[`Ы`,`Y`],[`ы`,`y`],[`Ь`,``],[`ь`,``],[`Э`,`E`],[`э`,`e`],[`Ю`,`Yu`],[`ю`,`yu`],[`Я`,`Ya`],[`я`,`ya`],[`ă`,`a`],[`Ă`,`A`],[`ș`,`s`],[`Ș`,`S`],[`ț`,`t`],[`Ț`,`T`],[`ţ`,`t`],[`Ţ`,`T`],[`ş`,`s`],[`Ş`,`S`],[`ç`,`c`],[`Ç`,`C`],[`ğ`,`g`],[`Ğ`,`G`],[`ı`,`i`],[`İ`,`I`],[`ա`,`a`],[`Ա`,`A`],[`բ`,`b`],[`Բ`,`B`],[`գ`,`g`],[`Գ`,`G`],[`դ`,`d`],[`Դ`,`D`],[`ե`,`ye`],[`Ե`,`Ye`],[`զ`,`z`],[`Զ`,`Z`],[`է`,`e`],[`Է`,`E`],[`ը`,`y`],[`Ը`,`Y`],[`թ`,`t`],[`Թ`,`T`],[`ժ`,`zh`],[`Ժ`,`Zh`],[`ի`,`i`],[`Ի`,`I`],[`լ`,`l`],[`Լ`,`L`],[`խ`,`kh`],[`Խ`,`Kh`],[`ծ`,`ts`],[`Ծ`,`Ts`],[`կ`,`k`],[`Կ`,`K`],[`հ`,`h`],[`Հ`,`H`],[`ձ`,`dz`],[`Ձ`,`Dz`],[`ղ`,`gh`],[`Ղ`,`Gh`],[`ճ`,`tch`],[`Ճ`,`Tch`],[`մ`,`m`],[`Մ`,`M`],[`յ`,`y`],[`Յ`,`Y`],[`ն`,`n`],[`Ն`,`N`],[`շ`,`sh`],[`Շ`,`Sh`],[`ու`,`u`],[`ՈՒ`,`U`],[`Ու`,`U`],[`ո`,`vo`],[`Ո`,`Vo`],[`չ`,`ch`],[`Չ`,`Ch`],[`պ`,`p`],[`Պ`,`P`],[`ջ`,`j`],[`Ջ`,`J`],[`ռ`,`r`],[`Ռ`,`R`],[`ս`,`s`],[`Ս`,`S`],[`վ`,`v`],[`Վ`,`V`],[`տ`,`t`],[`Տ`,`T`],[`ր`,`r`],[`Ր`,`R`],[`ց`,`c`],[`Ց`,`C`],[`փ`,`p`],[`Փ`,`P`],[`ք`,`q`],[`Ք`,`Q`],[`օ`,`o`],[`Օ`,`O`],[`ֆ`,`f`],[`Ֆ`,`F`],[`և`,`yev`],[`ა`,`a`],[`ბ`,`b`],[`გ`,`g`],[`დ`,`d`],[`ე`,`e`],[`ვ`,`v`],[`ზ`,`z`],[`თ`,`t`],[`ი`,`i`],[`კ`,`k`],[`ლ`,`l`],[`მ`,`m`],[`ნ`,`n`],[`ო`,`o`],[`პ`,`p`],[`ჟ`,`zh`],[`რ`,`r`],[`ს`,`s`],[`ტ`,`t`],[`უ`,`u`],[`ფ`,`ph`],[`ქ`,`q`],[`ღ`,`gh`],[`ყ`,`k`],[`შ`,`sh`],[`ჩ`,`ch`],[`ც`,`ts`],[`ძ`,`dz`],[`წ`,`ts`],[`ჭ`,`tch`],[`ხ`,`kh`],[`ჯ`,`j`],[`ჰ`,`h`],[`č`,`c`],[`ď`,`d`],[`ě`,`e`],[`ň`,`n`],[`ř`,`r`],[`š`,`s`],[`ť`,`t`],[`ů`,`u`],[`ž`,`z`],[`Č`,`C`],[`Ď`,`D`],[`Ě`,`E`],[`Ň`,`N`],[`Ř`,`R`],[`Š`,`S`],[`Ť`,`T`],[`Ů`,`U`],[`Ž`,`Z`],[`ހ`,`h`],[`ށ`,`sh`],[`ނ`,`n`],[`ރ`,`r`],[`ބ`,`b`],[`ޅ`,`lh`],[`ކ`,`k`],[`އ`,`a`],[`ވ`,`v`],[`މ`,`m`],[`ފ`,`f`],[`ދ`,`dh`],[`ތ`,`th`],[`ލ`,`l`],[`ގ`,`g`],[`ޏ`,`gn`],[`ސ`,`s`],[`ޑ`,`d`],[`ޒ`,`z`],[`ޓ`,`t`],[`ޔ`,`y`],[`ޕ`,`p`],[`ޖ`,`j`],[`ޗ`,`ch`],[`ޘ`,`tt`],[`ޙ`,`hh`],[`ޚ`,`kh`],[`ޛ`,`th`],[`ޜ`,`z`],[`ޝ`,`sh`],[`ޞ`,`s`],[`ޟ`,`d`],[`ޠ`,`t`],[`ޡ`,`z`],[`ޢ`,`a`],[`ޣ`,`gh`],[`ޤ`,`q`],[`ޥ`,`w`],[`ަ`,`a`],[`ާ`,`aa`],[`ި`,`i`],[`ީ`,`ee`],[`ު`,`u`],[`ޫ`,`oo`],[`ެ`,`e`],[`ޭ`,`ey`],[`ޮ`,`o`],[`ޯ`,`oa`],[`ް`,``],[`α`,`a`],[`β`,`v`],[`γ`,`g`],[`δ`,`d`],[`ε`,`e`],[`ζ`,`z`],[`η`,`i`],[`θ`,`th`],[`ι`,`i`],[`κ`,`k`],[`λ`,`l`],[`μ`,`m`],[`ν`,`n`],[`ξ`,`ks`],[`ο`,`o`],[`π`,`p`],[`ρ`,`r`],[`σ`,`s`],[`τ`,`t`],[`υ`,`y`],[`φ`,`f`],[`χ`,`x`],[`ψ`,`ps`],[`ω`,`o`],[`ά`,`a`],[`έ`,`e`],[`ί`,`i`],[`ό`,`o`],[`ύ`,`y`],[`ή`,`i`],[`ώ`,`o`],[`ς`,`s`],[`ϊ`,`i`],[`ΰ`,`y`],[`ϋ`,`y`],[`ΐ`,`i`],[`Α`,`A`],[`Β`,`B`],[`Γ`,`G`],[`Δ`,`D`],[`Ε`,`E`],[`Ζ`,`Z`],[`Η`,`I`],[`Θ`,`TH`],[`Ι`,`I`],[`Κ`,`K`],[`Λ`,`L`],[`Μ`,`M`],[`Ν`,`N`],[`Ξ`,`KS`],[`Ο`,`O`],[`Π`,`P`],[`Ρ`,`R`],[`Σ`,`S`],[`Τ`,`T`],[`Υ`,`Y`],[`Φ`,`F`],[`Χ`,`X`],[`Ψ`,`PS`],[`Ω`,`O`],[`Ά`,`A`],[`Έ`,`E`],[`Ί`,`I`],[`Ό`,`O`],[`Ύ`,`Y`],[`Ή`,`I`],[`Ώ`,`O`],[`Ϊ`,`I`],[`Ϋ`,`Y`],[`ā`,`a`],[`ē`,`e`],[`ģ`,`g`],[`ī`,`i`],[`ķ`,`k`],[`ļ`,`l`],[`ņ`,`n`],[`ū`,`u`],[`Ā`,`A`],[`Ē`,`E`],[`Ģ`,`G`],[`Ī`,`I`],[`Ķ`,`K`],[`Ļ`,`L`],[`Ņ`,`N`],[`Ū`,`U`],[`č`,`c`],[`š`,`s`],[`ž`,`z`],[`Č`,`C`],[`Š`,`S`],[`Ž`,`Z`],[`ą`,`a`],[`č`,`c`],[`ę`,`e`],[`ė`,`e`],[`į`,`i`],[`š`,`s`],[`ų`,`u`],[`ū`,`u`],[`ž`,`z`],[`Ą`,`A`],[`Č`,`C`],[`Ę`,`E`],[`Ė`,`E`],[`Į`,`I`],[`Š`,`S`],[`Ų`,`U`],[`Ū`,`U`],[`Ќ`,`Kj`],[`ќ`,`kj`],[`Љ`,`Lj`],[`љ`,`lj`],[`Њ`,`Nj`],[`њ`,`nj`],[`Тс`,`Ts`],[`тс`,`ts`],[`ą`,`a`],[`ć`,`c`],[`ę`,`e`],[`ł`,`l`],[`ń`,`n`],[`ś`,`s`],[`ź`,`z`],[`ż`,`z`],[`Ą`,`A`],[`Ć`,`C`],[`Ę`,`E`],[`Ł`,`L`],[`Ń`,`N`],[`Ś`,`S`],[`Ź`,`Z`],[`Ż`,`Z`],[`Є`,`Ye`],[`І`,`I`],[`Ї`,`Yi`],[`Ґ`,`G`],[`є`,`ye`],[`і`,`i`],[`ї`,`yi`],[`ґ`,`g`],[`IJ`,`IJ`],[`ij`,`ij`],[`¢`,`c`],[`¥`,`Y`],[`߿`,`b`],[`৳`,`t`],[`૱`,`Bo`],[`฿`,`B`],[`₠`,`CE`],[`₡`,`C`],[`₢`,`Cr`],[`₣`,`F`],[`₥`,`m`],[`₦`,`N`],[`₧`,`Pt`],[`₨`,`Rs`],[`₩`,`W`],[`₫`,`s`],[`€`,`E`],[`₭`,`K`],[`₮`,`T`],[`₯`,`Dp`],[`₰`,`S`],[`₱`,`P`],[`₲`,`G`],[`₳`,`A`],[`₴`,`S`],[`₵`,`C`],[`₶`,`tt`],[`₷`,`S`],[`₸`,`T`],[`₹`,`R`],[`₺`,`L`],[`₽`,`P`],[`₿`,`B`],[`﹩`,`$`],[`¢`,`c`],[`¥`,`Y`],[`₩`,`W`],[`𝐀`,`A`],[`𝐁`,`B`],[`𝐂`,`C`],[`𝐃`,`D`],[`𝐄`,`E`],[`𝐅`,`F`],[`𝐆`,`G`],[`𝐇`,`H`],[`𝐈`,`I`],[`𝐉`,`J`],[`𝐊`,`K`],[`𝐋`,`L`],[`𝐌`,`M`],[`𝐍`,`N`],[`𝐎`,`O`],[`𝐏`,`P`],[`𝐐`,`Q`],[`𝐑`,`R`],[`𝐒`,`S`],[`𝐓`,`T`],[`𝐔`,`U`],[`𝐕`,`V`],[`𝐖`,`W`],[`𝐗`,`X`],[`𝐘`,`Y`],[`𝐙`,`Z`],[`𝐚`,`a`],[`𝐛`,`b`],[`𝐜`,`c`],[`𝐝`,`d`],[`𝐞`,`e`],[`𝐟`,`f`],[`𝐠`,`g`],[`𝐡`,`h`],[`𝐢`,`i`],[`𝐣`,`j`],[`𝐤`,`k`],[`𝐥`,`l`],[`𝐦`,`m`],[`𝐧`,`n`],[`𝐨`,`o`],[`𝐩`,`p`],[`𝐪`,`q`],[`𝐫`,`r`],[`𝐬`,`s`],[`𝐭`,`t`],[`𝐮`,`u`],[`𝐯`,`v`],[`𝐰`,`w`],[`𝐱`,`x`],[`𝐲`,`y`],[`𝐳`,`z`],[`𝐴`,`A`],[`𝐵`,`B`],[`𝐶`,`C`],[`𝐷`,`D`],[`𝐸`,`E`],[`𝐹`,`F`],[`𝐺`,`G`],[`𝐻`,`H`],[`𝐼`,`I`],[`𝐽`,`J`],[`𝐾`,`K`],[`𝐿`,`L`],[`𝑀`,`M`],[`𝑁`,`N`],[`𝑂`,`O`],[`𝑃`,`P`],[`𝑄`,`Q`],[`𝑅`,`R`],[`𝑆`,`S`],[`𝑇`,`T`],[`𝑈`,`U`],[`𝑉`,`V`],[`𝑊`,`W`],[`𝑋`,`X`],[`𝑌`,`Y`],[`𝑍`,`Z`],[`𝑎`,`a`],[`𝑏`,`b`],[`𝑐`,`c`],[`𝑑`,`d`],[`𝑒`,`e`],[`𝑓`,`f`],[`𝑔`,`g`],[`𝑖`,`i`],[`𝑗`,`j`],[`𝑘`,`k`],[`𝑙`,`l`],[`𝑚`,`m`],[`𝑛`,`n`],[`𝑜`,`o`],[`𝑝`,`p`],[`𝑞`,`q`],[`𝑟`,`r`],[`𝑠`,`s`],[`𝑡`,`t`],[`𝑢`,`u`],[`𝑣`,`v`],[`𝑤`,`w`],[`𝑥`,`x`],[`𝑦`,`y`],[`𝑧`,`z`],[`𝑨`,`A`],[`𝑩`,`B`],[`𝑪`,`C`],[`𝑫`,`D`],[`𝑬`,`E`],[`𝑭`,`F`],[`𝑮`,`G`],[`𝑯`,`H`],[`𝑰`,`I`],[`𝑱`,`J`],[`𝑲`,`K`],[`𝑳`,`L`],[`𝑴`,`M`],[`𝑵`,`N`],[`𝑶`,`O`],[`𝑷`,`P`],[`𝑸`,`Q`],[`𝑹`,`R`],[`𝑺`,`S`],[`𝑻`,`T`],[`𝑼`,`U`],[`𝑽`,`V`],[`𝑾`,`W`],[`𝑿`,`X`],[`𝒀`,`Y`],[`𝒁`,`Z`],[`𝒂`,`a`],[`𝒃`,`b`],[`𝒄`,`c`],[`𝒅`,`d`],[`𝒆`,`e`],[`𝒇`,`f`],[`𝒈`,`g`],[`𝒉`,`h`],[`𝒊`,`i`],[`𝒋`,`j`],[`𝒌`,`k`],[`𝒍`,`l`],[`𝒎`,`m`],[`𝒏`,`n`],[`𝒐`,`o`],[`𝒑`,`p`],[`𝒒`,`q`],[`𝒓`,`r`],[`𝒔`,`s`],[`𝒕`,`t`],[`𝒖`,`u`],[`𝒗`,`v`],[`𝒘`,`w`],[`𝒙`,`x`],[`𝒚`,`y`],[`𝒛`,`z`],[`𝒜`,`A`],[`𝒞`,`C`],[`𝒟`,`D`],[`𝒢`,`g`],[`𝒥`,`J`],[`𝒦`,`K`],[`𝒩`,`N`],[`𝒪`,`O`],[`𝒫`,`P`],[`𝒬`,`Q`],[`𝒮`,`S`],[`𝒯`,`T`],[`𝒰`,`U`],[`𝒱`,`V`],[`𝒲`,`W`],[`𝒳`,`X`],[`𝒴`,`Y`],[`𝒵`,`Z`],[`𝒶`,`a`],[`𝒷`,`b`],[`𝒸`,`c`],[`𝒹`,`d`],[`𝒻`,`f`],[`𝒽`,`h`],[`𝒾`,`i`],[`𝒿`,`j`],[`𝓀`,`k`],[`𝓁`,`l`],[`𝓂`,`m`],[`𝓃`,`n`],[`𝓅`,`p`],[`𝓆`,`q`],[`𝓇`,`r`],[`𝓈`,`s`],[`𝓉`,`t`],[`𝓊`,`u`],[`𝓋`,`v`],[`𝓌`,`w`],[`𝓍`,`x`],[`𝓎`,`y`],[`𝓏`,`z`],[`𝓐`,`A`],[`𝓑`,`B`],[`𝓒`,`C`],[`𝓓`,`D`],[`𝓔`,`E`],[`𝓕`,`F`],[`𝓖`,`G`],[`𝓗`,`H`],[`𝓘`,`I`],[`𝓙`,`J`],[`𝓚`,`K`],[`𝓛`,`L`],[`𝓜`,`M`],[`𝓝`,`N`],[`𝓞`,`O`],[`𝓟`,`P`],[`𝓠`,`Q`],[`𝓡`,`R`],[`𝓢`,`S`],[`𝓣`,`T`],[`𝓤`,`U`],[`𝓥`,`V`],[`𝓦`,`W`],[`𝓧`,`X`],[`𝓨`,`Y`],[`𝓩`,`Z`],[`𝓪`,`a`],[`𝓫`,`b`],[`𝓬`,`c`],[`𝓭`,`d`],[`𝓮`,`e`],[`𝓯`,`f`],[`𝓰`,`g`],[`𝓱`,`h`],[`𝓲`,`i`],[`𝓳`,`j`],[`𝓴`,`k`],[`𝓵`,`l`],[`𝓶`,`m`],[`𝓷`,`n`],[`𝓸`,`o`],[`𝓹`,`p`],[`𝓺`,`q`],[`𝓻`,`r`],[`𝓼`,`s`],[`𝓽`,`t`],[`𝓾`,`u`],[`𝓿`,`v`],[`𝔀`,`w`],[`𝔁`,`x`],[`𝔂`,`y`],[`𝔃`,`z`],[`𝔄`,`A`],[`𝔅`,`B`],[`𝔇`,`D`],[`𝔈`,`E`],[`𝔉`,`F`],[`𝔊`,`G`],[`𝔍`,`J`],[`𝔎`,`K`],[`𝔏`,`L`],[`𝔐`,`M`],[`𝔑`,`N`],[`𝔒`,`O`],[`𝔓`,`P`],[`𝔔`,`Q`],[`𝔖`,`S`],[`𝔗`,`T`],[`𝔘`,`U`],[`𝔙`,`V`],[`𝔚`,`W`],[`𝔛`,`X`],[`𝔜`,`Y`],[`𝔞`,`a`],[`𝔟`,`b`],[`𝔠`,`c`],[`𝔡`,`d`],[`𝔢`,`e`],[`𝔣`,`f`],[`𝔤`,`g`],[`𝔥`,`h`],[`𝔦`,`i`],[`𝔧`,`j`],[`𝔨`,`k`],[`𝔩`,`l`],[`𝔪`,`m`],[`𝔫`,`n`],[`𝔬`,`o`],[`𝔭`,`p`],[`𝔮`,`q`],[`𝔯`,`r`],[`𝔰`,`s`],[`𝔱`,`t`],[`𝔲`,`u`],[`𝔳`,`v`],[`𝔴`,`w`],[`𝔵`,`x`],[`𝔶`,`y`],[`𝔷`,`z`],[`𝔸`,`A`],[`𝔹`,`B`],[`𝔻`,`D`],[`𝔼`,`E`],[`𝔽`,`F`],[`𝔾`,`G`],[`𝕀`,`I`],[`𝕁`,`J`],[`𝕂`,`K`],[`𝕃`,`L`],[`𝕄`,`M`],[`𝕆`,`O`],[`𝕊`,`S`],[`𝕋`,`T`],[`𝕌`,`U`],[`𝕍`,`V`],[`𝕎`,`W`],[`𝕏`,`X`],[`𝕐`,`Y`],[`𝕒`,`a`],[`𝕓`,`b`],[`𝕔`,`c`],[`𝕕`,`d`],[`𝕖`,`e`],[`𝕗`,`f`],[`𝕘`,`g`],[`𝕙`,`h`],[`𝕚`,`i`],[`𝕛`,`j`],[`𝕜`,`k`],[`𝕝`,`l`],[`𝕞`,`m`],[`𝕟`,`n`],[`𝕠`,`o`],[`𝕡`,`p`],[`𝕢`,`q`],[`𝕣`,`r`],[`𝕤`,`s`],[`𝕥`,`t`],[`𝕦`,`u`],[`𝕧`,`v`],[`𝕨`,`w`],[`𝕩`,`x`],[`𝕪`,`y`],[`𝕫`,`z`],[`𝕬`,`A`],[`𝕭`,`B`],[`𝕮`,`C`],[`𝕯`,`D`],[`𝕰`,`E`],[`𝕱`,`F`],[`𝕲`,`G`],[`𝕳`,`H`],[`𝕴`,`I`],[`𝕵`,`J`],[`𝕶`,`K`],[`𝕷`,`L`],[`𝕸`,`M`],[`𝕹`,`N`],[`𝕺`,`O`],[`𝕻`,`P`],[`𝕼`,`Q`],[`𝕽`,`R`],[`𝕾`,`S`],[`𝕿`,`T`],[`𝖀`,`U`],[`𝖁`,`V`],[`𝖂`,`W`],[`𝖃`,`X`],[`𝖄`,`Y`],[`𝖅`,`Z`],[`𝖆`,`a`],[`𝖇`,`b`],[`𝖈`,`c`],[`𝖉`,`d`],[`𝖊`,`e`],[`𝖋`,`f`],[`𝖌`,`g`],[`𝖍`,`h`],[`𝖎`,`i`],[`𝖏`,`j`],[`𝖐`,`k`],[`𝖑`,`l`],[`𝖒`,`m`],[`𝖓`,`n`],[`𝖔`,`o`],[`𝖕`,`p`],[`𝖖`,`q`],[`𝖗`,`r`],[`𝖘`,`s`],[`𝖙`,`t`],[`𝖚`,`u`],[`𝖛`,`v`],[`𝖜`,`w`],[`𝖝`,`x`],[`𝖞`,`y`],[`𝖟`,`z`],[`𝖠`,`A`],[`𝖡`,`B`],[`𝖢`,`C`],[`𝖣`,`D`],[`𝖤`,`E`],[`𝖥`,`F`],[`𝖦`,`G`],[`𝖧`,`H`],[`𝖨`,`I`],[`𝖩`,`J`],[`𝖪`,`K`],[`𝖫`,`L`],[`𝖬`,`M`],[`𝖭`,`N`],[`𝖮`,`O`],[`𝖯`,`P`],[`𝖰`,`Q`],[`𝖱`,`R`],[`𝖲`,`S`],[`𝖳`,`T`],[`𝖴`,`U`],[`𝖵`,`V`],[`𝖶`,`W`],[`𝖷`,`X`],[`𝖸`,`Y`],[`𝖹`,`Z`],[`𝖺`,`a`],[`𝖻`,`b`],[`𝖼`,`c`],[`𝖽`,`d`],[`𝖾`,`e`],[`𝖿`,`f`],[`𝗀`,`g`],[`𝗁`,`h`],[`𝗂`,`i`],[`𝗃`,`j`],[`𝗄`,`k`],[`𝗅`,`l`],[`𝗆`,`m`],[`𝗇`,`n`],[`𝗈`,`o`],[`𝗉`,`p`],[`𝗊`,`q`],[`𝗋`,`r`],[`𝗌`,`s`],[`𝗍`,`t`],[`𝗎`,`u`],[`𝗏`,`v`],[`𝗐`,`w`],[`𝗑`,`x`],[`𝗒`,`y`],[`𝗓`,`z`],[`𝗔`,`A`],[`𝗕`,`B`],[`𝗖`,`C`],[`𝗗`,`D`],[`𝗘`,`E`],[`𝗙`,`F`],[`𝗚`,`G`],[`𝗛`,`H`],[`𝗜`,`I`],[`𝗝`,`J`],[`𝗞`,`K`],[`𝗟`,`L`],[`𝗠`,`M`],[`𝗡`,`N`],[`𝗢`,`O`],[`𝗣`,`P`],[`𝗤`,`Q`],[`𝗥`,`R`],[`𝗦`,`S`],[`𝗧`,`T`],[`𝗨`,`U`],[`𝗩`,`V`],[`𝗪`,`W`],[`𝗫`,`X`],[`𝗬`,`Y`],[`𝗭`,`Z`],[`𝗮`,`a`],[`𝗯`,`b`],[`𝗰`,`c`],[`𝗱`,`d`],[`𝗲`,`e`],[`𝗳`,`f`],[`𝗴`,`g`],[`𝗵`,`h`],[`𝗶`,`i`],[`𝗷`,`j`],[`𝗸`,`k`],[`𝗹`,`l`],[`𝗺`,`m`],[`𝗻`,`n`],[`𝗼`,`o`],[`𝗽`,`p`],[`𝗾`,`q`],[`𝗿`,`r`],[`𝘀`,`s`],[`𝘁`,`t`],[`𝘂`,`u`],[`𝘃`,`v`],[`𝘄`,`w`],[`𝘅`,`x`],[`𝘆`,`y`],[`𝘇`,`z`],[`𝘈`,`A`],[`𝘉`,`B`],[`𝘊`,`C`],[`𝘋`,`D`],[`𝘌`,`E`],[`𝘍`,`F`],[`𝘎`,`G`],[`𝘏`,`H`],[`𝘐`,`I`],[`𝘑`,`J`],[`𝘒`,`K`],[`𝘓`,`L`],[`𝘔`,`M`],[`𝘕`,`N`],[`𝘖`,`O`],[`𝘗`,`P`],[`𝘘`,`Q`],[`𝘙`,`R`],[`𝘚`,`S`],[`𝘛`,`T`],[`𝘜`,`U`],[`𝘝`,`V`],[`𝘞`,`W`],[`𝘟`,`X`],[`𝘠`,`Y`],[`𝘡`,`Z`],[`𝘢`,`a`],[`𝘣`,`b`],[`𝘤`,`c`],[`𝘥`,`d`],[`𝘦`,`e`],[`𝘧`,`f`],[`𝘨`,`g`],[`𝘩`,`h`],[`𝘪`,`i`],[`𝘫`,`j`],[`𝘬`,`k`],[`𝘭`,`l`],[`𝘮`,`m`],[`𝘯`,`n`],[`𝘰`,`o`],[`𝘱`,`p`],[`𝘲`,`q`],[`𝘳`,`r`],[`𝘴`,`s`],[`𝘵`,`t`],[`𝘶`,`u`],[`𝘷`,`v`],[`𝘸`,`w`],[`𝘹`,`x`],[`𝘺`,`y`],[`𝘻`,`z`],[`𝘼`,`A`],[`𝘽`,`B`],[`𝘾`,`C`],[`𝘿`,`D`],[`𝙀`,`E`],[`𝙁`,`F`],[`𝙂`,`G`],[`𝙃`,`H`],[`𝙄`,`I`],[`𝙅`,`J`],[`𝙆`,`K`],[`𝙇`,`L`],[`𝙈`,`M`],[`𝙉`,`N`],[`𝙊`,`O`],[`𝙋`,`P`],[`𝙌`,`Q`],[`𝙍`,`R`],[`𝙎`,`S`],[`𝙏`,`T`],[`𝙐`,`U`],[`𝙑`,`V`],[`𝙒`,`W`],[`𝙓`,`X`],[`𝙔`,`Y`],[`𝙕`,`Z`],[`𝙖`,`a`],[`𝙗`,`b`],[`𝙘`,`c`],[`𝙙`,`d`],[`𝙚`,`e`],[`𝙛`,`f`],[`𝙜`,`g`],[`𝙝`,`h`],[`𝙞`,`i`],[`𝙟`,`j`],[`𝙠`,`k`],[`𝙡`,`l`],[`𝙢`,`m`],[`𝙣`,`n`],[`𝙤`,`o`],[`𝙥`,`p`],[`𝙦`,`q`],[`𝙧`,`r`],[`𝙨`,`s`],[`𝙩`,`t`],[`𝙪`,`u`],[`𝙫`,`v`],[`𝙬`,`w`],[`𝙭`,`x`],[`𝙮`,`y`],[`𝙯`,`z`],[`𝙰`,`A`],[`𝙱`,`B`],[`𝙲`,`C`],[`𝙳`,`D`],[`𝙴`,`E`],[`𝙵`,`F`],[`𝙶`,`G`],[`𝙷`,`H`],[`𝙸`,`I`],[`𝙹`,`J`],[`𝙺`,`K`],[`𝙻`,`L`],[`𝙼`,`M`],[`𝙽`,`N`],[`𝙾`,`O`],[`𝙿`,`P`],[`𝚀`,`Q`],[`𝚁`,`R`],[`𝚂`,`S`],[`𝚃`,`T`],[`𝚄`,`U`],[`𝚅`,`V`],[`𝚆`,`W`],[`𝚇`,`X`],[`𝚈`,`Y`],[`𝚉`,`Z`],[`𝚊`,`a`],[`𝚋`,`b`],[`𝚌`,`c`],[`𝚍`,`d`],[`𝚎`,`e`],[`𝚏`,`f`],[`𝚐`,`g`],[`𝚑`,`h`],[`𝚒`,`i`],[`𝚓`,`j`],[`𝚔`,`k`],[`𝚕`,`l`],[`𝚖`,`m`],[`𝚗`,`n`],[`𝚘`,`o`],[`𝚙`,`p`],[`𝚚`,`q`],[`𝚛`,`r`],[`𝚜`,`s`],[`𝚝`,`t`],[`𝚞`,`u`],[`𝚟`,`v`],[`𝚠`,`w`],[`𝚡`,`x`],[`𝚢`,`y`],[`𝚣`,`z`],[`𝚤`,`l`],[`𝚥`,`j`],[`𝛢`,`A`],[`𝛣`,`B`],[`𝛤`,`G`],[`𝛥`,`D`],[`𝛦`,`E`],[`𝛧`,`Z`],[`𝛨`,`I`],[`𝛩`,`TH`],[`𝛪`,`I`],[`𝛫`,`K`],[`𝛬`,`L`],[`𝛭`,`M`],[`𝛮`,`N`],[`𝛯`,`KS`],[`𝛰`,`O`],[`𝛱`,`P`],[`𝛲`,`R`],[`𝛳`,`TH`],[`𝛴`,`S`],[`𝛵`,`T`],[`𝛶`,`Y`],[`𝛷`,`F`],[`𝛸`,`x`],[`𝛹`,`PS`],[`𝛺`,`O`],[`𝛻`,`D`],[`𝛼`,`a`],[`𝛽`,`b`],[`𝛾`,`g`],[`𝛿`,`d`],[`𝜀`,`e`],[`𝜁`,`z`],[`𝜂`,`i`],[`𝜃`,`th`],[`𝜄`,`i`],[`𝜅`,`k`],[`𝜆`,`l`],[`𝜇`,`m`],[`𝜈`,`n`],[`𝜉`,`ks`],[`𝜊`,`o`],[`𝜋`,`p`],[`𝜌`,`r`],[`𝜍`,`s`],[`𝜎`,`s`],[`𝜏`,`t`],[`𝜐`,`y`],[`𝜑`,`f`],[`𝜒`,`x`],[`𝜓`,`ps`],[`𝜔`,`o`],[`𝜕`,`d`],[`𝜖`,`E`],[`𝜗`,`TH`],[`𝜘`,`K`],[`𝜙`,`f`],[`𝜚`,`r`],[`𝜛`,`p`],[`𝜜`,`A`],[`𝜝`,`V`],[`𝜞`,`G`],[`𝜟`,`D`],[`𝜠`,`E`],[`𝜡`,`Z`],[`𝜢`,`I`],[`𝜣`,`TH`],[`𝜤`,`I`],[`𝜥`,`K`],[`𝜦`,`L`],[`𝜧`,`M`],[`𝜨`,`N`],[`𝜩`,`KS`],[`𝜪`,`O`],[`𝜫`,`P`],[`𝜬`,`S`],[`𝜭`,`TH`],[`𝜮`,`S`],[`𝜯`,`T`],[`𝜰`,`Y`],[`𝜱`,`F`],[`𝜲`,`X`],[`𝜳`,`PS`],[`𝜴`,`O`],[`𝜵`,`D`],[`𝜶`,`a`],[`𝜷`,`v`],[`𝜸`,`g`],[`𝜹`,`d`],[`𝜺`,`e`],[`𝜻`,`z`],[`𝜼`,`i`],[`𝜽`,`th`],[`𝜾`,`i`],[`𝜿`,`k`],[`𝝀`,`l`],[`𝝁`,`m`],[`𝝂`,`n`],[`𝝃`,`ks`],[`𝝄`,`o`],[`𝝅`,`p`],[`𝝆`,`r`],[`𝝇`,`s`],[`𝝈`,`s`],[`𝝉`,`t`],[`𝝊`,`y`],[`𝝋`,`f`],[`𝝌`,`x`],[`𝝍`,`ps`],[`𝝎`,`o`],[`𝝏`,`a`],[`𝝐`,`e`],[`𝝑`,`i`],[`𝝒`,`k`],[`𝝓`,`f`],[`𝝔`,`r`],[`𝝕`,`p`],[`𝝖`,`A`],[`𝝗`,`B`],[`𝝘`,`G`],[`𝝙`,`D`],[`𝝚`,`E`],[`𝝛`,`Z`],[`𝝜`,`I`],[`𝝝`,`TH`],[`𝝞`,`I`],[`𝝟`,`K`],[`𝝠`,`L`],[`𝝡`,`M`],[`𝝢`,`N`],[`𝝣`,`KS`],[`𝝤`,`O`],[`𝝥`,`P`],[`𝝦`,`R`],[`𝝧`,`TH`],[`𝝨`,`S`],[`𝝩`,`T`],[`𝝪`,`Y`],[`𝝫`,`F`],[`𝝬`,`X`],[`𝝭`,`PS`],[`𝝮`,`O`],[`𝝯`,`D`],[`𝝰`,`a`],[`𝝱`,`v`],[`𝝲`,`g`],[`𝝳`,`d`],[`𝝴`,`e`],[`𝝵`,`z`],[`𝝶`,`i`],[`𝝷`,`th`],[`𝝸`,`i`],[`𝝹`,`k`],[`𝝺`,`l`],[`𝝻`,`m`],[`𝝼`,`n`],[`𝝽`,`ks`],[`𝝾`,`o`],[`𝝿`,`p`],[`𝞀`,`r`],[`𝞁`,`s`],[`𝞂`,`s`],[`𝞃`,`t`],[`𝞄`,`y`],[`𝞅`,`f`],[`𝞆`,`x`],[`𝞇`,`ps`],[`𝞈`,`o`],[`𝞉`,`a`],[`𝞊`,`e`],[`𝞋`,`i`],[`𝞌`,`k`],[`𝞍`,`f`],[`𝞎`,`r`],[`𝞏`,`p`],[`𝞐`,`A`],[`𝞑`,`V`],[`𝞒`,`G`],[`𝞓`,`D`],[`𝞔`,`E`],[`𝞕`,`Z`],[`𝞖`,`I`],[`𝞗`,`TH`],[`𝞘`,`I`],[`𝞙`,`K`],[`𝞚`,`L`],[`𝞛`,`M`],[`𝞜`,`N`],[`𝞝`,`KS`],[`𝞞`,`O`],[`𝞟`,`P`],[`𝞠`,`S`],[`𝞡`,`TH`],[`𝞢`,`S`],[`𝞣`,`T`],[`𝞤`,`Y`],[`𝞥`,`F`],[`𝞦`,`X`],[`𝞧`,`PS`],[`𝞨`,`O`],[`𝞩`,`D`],[`𝞪`,`av`],[`𝞫`,`g`],[`𝞬`,`d`],[`𝞭`,`e`],[`𝞮`,`z`],[`𝞯`,`i`],[`𝞰`,`i`],[`𝞱`,`th`],[`𝞲`,`i`],[`𝞳`,`k`],[`𝞴`,`l`],[`𝞵`,`m`],[`𝞶`,`n`],[`𝞷`,`ks`],[`𝞸`,`o`],[`𝞹`,`p`],[`𝞺`,`r`],[`𝞻`,`s`],[`𝞼`,`s`],[`𝞽`,`t`],[`𝞾`,`y`],[`𝞿`,`f`],[`𝟀`,`x`],[`𝟁`,`ps`],[`𝟂`,`o`],[`𝟃`,`a`],[`𝟄`,`e`],[`𝟅`,`i`],[`𝟆`,`k`],[`𝟇`,`f`],[`𝟈`,`r`],[`𝟉`,`p`],[`𝟊`,`F`],[`𝟋`,`f`],[`⒜`,`(a)`],[`⒝`,`(b)`],[`⒞`,`(c)`],[`⒟`,`(d)`],[`⒠`,`(e)`],[`⒡`,`(f)`],[`⒢`,`(g)`],[`⒣`,`(h)`],[`⒤`,`(i)`],[`⒥`,`(j)`],[`⒦`,`(k)`],[`⒧`,`(l)`],[`⒨`,`(m)`],[`⒩`,`(n)`],[`⒪`,`(o)`],[`⒫`,`(p)`],[`⒬`,`(q)`],[`⒭`,`(r)`],[`⒮`,`(s)`],[`⒯`,`(t)`],[`⒰`,`(u)`],[`⒱`,`(v)`],[`⒲`,`(w)`],[`⒳`,`(x)`],[`⒴`,`(y)`],[`⒵`,`(z)`],[`Ⓐ`,`(A)`],[`Ⓑ`,`(B)`],[`Ⓒ`,`(C)`],[`Ⓓ`,`(D)`],[`Ⓔ`,`(E)`],[`Ⓕ`,`(F)`],[`Ⓖ`,`(G)`],[`Ⓗ`,`(H)`],[`Ⓘ`,`(I)`],[`Ⓙ`,`(J)`],[`Ⓚ`,`(K)`],[`Ⓛ`,`(L)`],[`Ⓝ`,`(N)`],[`Ⓞ`,`(O)`],[`Ⓟ`,`(P)`],[`Ⓠ`,`(Q)`],[`Ⓡ`,`(R)`],[`Ⓢ`,`(S)`],[`Ⓣ`,`(T)`],[`Ⓤ`,`(U)`],[`Ⓥ`,`(V)`],[`Ⓦ`,`(W)`],[`Ⓧ`,`(X)`],[`Ⓨ`,`(Y)`],[`Ⓩ`,`(Z)`],[`ⓐ`,`(a)`],[`ⓑ`,`(b)`],[`ⓒ`,`(c)`],[`ⓓ`,`(d)`],[`ⓔ`,`(e)`],[`ⓕ`,`(f)`],[`ⓖ`,`(g)`],[`ⓗ`,`(h)`],[`ⓘ`,`(i)`],[`ⓙ`,`(j)`],[`ⓚ`,`(k)`],[`ⓛ`,`(l)`],[`ⓜ`,`(m)`],[`ⓝ`,`(n)`],[`ⓞ`,`(o)`],[`ⓟ`,`(p)`],[`ⓠ`,`(q)`],[`ⓡ`,`(r)`],[`ⓢ`,`(s)`],[`ⓣ`,`(t)`],[`ⓤ`,`(u)`],[`ⓥ`,`(v)`],[`ⓦ`,`(w)`],[`ⓧ`,`(x)`],[`ⓨ`,`(y)`],[`ⓩ`,`(z)`],[`Ċ`,`C`],[`ċ`,`c`],[`Ġ`,`G`],[`ġ`,`g`],[`Ħ`,`H`],[`ħ`,`h`],[`Ż`,`Z`],[`ż`,`z`],[`𝟎`,`0`],[`𝟏`,`1`],[`𝟐`,`2`],[`𝟑`,`3`],[`𝟒`,`4`],[`𝟓`,`5`],[`𝟔`,`6`],[`𝟕`,`7`],[`𝟖`,`8`],[`𝟗`,`9`],[`𝟘`,`0`],[`𝟙`,`1`],[`𝟚`,`2`],[`𝟛`,`3`],[`𝟜`,`4`],[`𝟝`,`5`],[`𝟞`,`6`],[`𝟟`,`7`],[`𝟠`,`8`],[`𝟡`,`9`],[`𝟢`,`0`],[`𝟣`,`1`],[`𝟤`,`2`],[`𝟥`,`3`],[`𝟦`,`4`],[`𝟧`,`5`],[`𝟨`,`6`],[`𝟩`,`7`],[`𝟪`,`8`],[`𝟫`,`9`],[`𝟬`,`0`],[`𝟭`,`1`],[`𝟮`,`2`],[`𝟯`,`3`],[`𝟰`,`4`],[`𝟱`,`5`],[`𝟲`,`6`],[`𝟳`,`7`],[`𝟴`,`8`],[`𝟵`,`9`],[`𝟶`,`0`],[`𝟷`,`1`],[`𝟸`,`2`],[`𝟹`,`3`],[`𝟺`,`4`],[`𝟻`,`5`],[`𝟼`,`6`],[`𝟽`,`7`],[`𝟾`,`8`],[`𝟿`,`9`],[`①`,`1`],[`②`,`2`],[`③`,`3`],[`④`,`4`],[`⑤`,`5`],[`⑥`,`6`],[`⑦`,`7`],[`⑧`,`8`],[`⑨`,`9`],[`⑩`,`10`],[`⑪`,`11`],[`⑫`,`12`],[`⑬`,`13`],[`⑭`,`14`],[`⑮`,`15`],[`⑯`,`16`],[`⑰`,`17`],[`⑱`,`18`],[`⑲`,`19`],[`⑳`,`20`],[`⑴`,`1`],[`⑵`,`2`],[`⑶`,`3`],[`⑷`,`4`],[`⑸`,`5`],[`⑹`,`6`],[`⑺`,`7`],[`⑻`,`8`],[`⑼`,`9`],[`⑽`,`10`],[`⑾`,`11`],[`⑿`,`12`],[`⒀`,`13`],[`⒁`,`14`],[`⒂`,`15`],[`⒃`,`16`],[`⒄`,`17`],[`⒅`,`18`],[`⒆`,`19`],[`⒇`,`20`],[`⒈`,`1.`],[`⒉`,`2.`],[`⒊`,`3.`],[`⒋`,`4.`],[`⒌`,`5.`],[`⒍`,`6.`],[`⒎`,`7.`],[`⒏`,`8.`],[`⒐`,`9.`],[`⒑`,`10.`],[`⒒`,`11.`],[`⒓`,`12.`],[`⒔`,`13.`],[`⒕`,`14.`],[`⒖`,`15.`],[`⒗`,`16.`],[`⒘`,`17.`],[`⒙`,`18.`],[`⒚`,`19.`],[`⒛`,`20.`],[`⓪`,`0`],[`⓫`,`11`],[`⓬`,`12`],[`⓭`,`13`],[`⓮`,`14`],[`⓯`,`15`],[`⓰`,`16`],[`⓱`,`17`],[`⓲`,`18`],[`⓳`,`19`],[`⓴`,`20`],[`⓵`,`1`],[`⓶`,`2`],[`⓷`,`3`],[`⓸`,`4`],[`⓹`,`5`],[`⓺`,`6`],[`⓻`,`7`],[`⓼`,`8`],[`⓽`,`9`],[`⓾`,`10`],[`⓿`,`0`],[`🙰`,`&`],[`🙱`,`&`],[`🙲`,`&`],[`🙳`,`&`],[`🙴`,`&`],[`🙵`,`&`],[`🙶`,`"`],[`🙷`,`"`],[`🙸`,`"`],[`‽`,`?!`],[`🙹`,`?!`],[`🙺`,`?!`],[`🙻`,`?!`],[`🙼`,`/`],[`🙽`,`\\`],[`🜇`,`AR`],[`🜈`,`V`],[`🜉`,`V`],[`🜆`,`VR`],[`🜅`,`VF`],[`🜩`,`2`],[`🜪`,`5`],[`🝡`,`f`],[`🝢`,`W`],[`🝣`,`U`],[`🝧`,`V`],[`🝨`,`T`],[`🝪`,`V`],[`🝫`,`MB`],[`🝬`,`VB`],[`🝲`,`3B`],[`🝳`,`3B`],[`💯`,`100`],[`🔙`,`BACK`],[`🔚`,`END`],[`🔛`,`ON!`],[`🔜`,`SOON`],[`🔝`,`TOP`],[`🔞`,`18`],[`🔤`,`abc`],[`🔠`,`ABCD`],[`🔡`,`abcd`],[`🔢`,`1234`],[`🔣`,`T&@%`],[`#️⃣`,`#`],[`*️⃣`,`*`],[`0️⃣`,`0`],[`1️⃣`,`1`],[`2️⃣`,`2`],[`3️⃣`,`3`],[`4️⃣`,`4`],[`5️⃣`,`5`],[`6️⃣`,`6`],[`7️⃣`,`7`],[`8️⃣`,`8`],[`9️⃣`,`9`],[`🔟`,`10`],[`🅰️`,`A`],[`🅱️`,`B`],[`🆎`,`AB`],[`🆑`,`CL`],[`🅾️`,`O`],[`🅿`,`P`],[`🆘`,`SOS`],[`🅲`,`C`],[`🅳`,`D`],[`🅴`,`E`],[`🅵`,`F`],[`🅶`,`G`],[`🅷`,`H`],[`🅸`,`I`],[`🅹`,`J`],[`🅺`,`K`],[`🅻`,`L`],[`🅼`,`M`],[`🅽`,`N`],[`🆀`,`Q`],[`🆁`,`R`],[`🆂`,`S`],[`🆃`,`T`],[`🆄`,`U`],[`🆅`,`V`],[`🆆`,`W`],[`🆇`,`X`],[`🆈`,`Y`],[`🆉`,`Z`],[`−`,`-`],[`⁓`,`-`]]),TN=[[`æ`,`ae`],[`Æ`,`Ae`],[`ø`,`oe`],[`Ø`,`Oe`],[`å`,`aa`],[`Å`,`Aa`]],EN={sv:[[`ä`,`a`],[`Ä`,`A`],[`ö`,`o`],[`Ö`,`O`],[`å`,`a`],[`Å`,`A`]],da:TN,nb:TN,de:[[`ä`,`ae`],[`Ä`,`Ae`],[`ö`,`oe`],[`Ö`,`Oe`],[`ü`,`ue`],[`Ü`,`Ue`],[`ß`,`ss`],[`ẞ`,`Ss`]],tr:[[`â`,`a`],[`Â`,`A`],[`ö`,`o`],[`Ö`,`O`],[`ü`,`u`],[`Ü`,`U`]],hu:[[`ű`,`u`],[`Ű`,`U`],[`ö`,`o`],[`Ö`,`O`],[`ü`,`u`],[`Ü`,`U`],[`á`,`a`],[`Á`,`A`],[`é`,`e`],[`É`,`E`],[`í`,`i`],[`Í`,`I`],[`ó`,`o`],[`Ó`,`O`],[`ú`,`u`],[`Ú`,`U`]],sr:[[`ђ`,`dj`],[`Ђ`,`Dj`],[`џ`,`dz`],[`Џ`,`Dz`],[`љ`,`lj`],[`Љ`,`Lj`],[`њ`,`nj`],[`Њ`,`Nj`],[`ћ`,`c`],[`Ћ`,`C`],[`ч`,`ch`],[`Ч`,`Ch`],[`ш`,`sh`],[`Ш`,`Sh`],[`ж`,`zh`],[`Ж`,`Zh`]]};for(let e of Object.keys(EN))EN[e]=new Map(EN[e]);var Gxe=e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),DN=e=>{let t=[...e.keys()].sort((e,t)=>t.length-e.length);return new RegExp(t.map(e=>Gxe(e)).join(`|`),`gu`)},Kxe=DN(wN),ON=new Map;for(let[e,t]of Object.entries(EN)){let n=new Map(wN);for(let[e,r]of t)n.set(e,r);ON.set(e,{replacements:n,pattern:DN(n)})}var qxe=e=>{if(!e)return;let t=e.toLowerCase().replace(/^no(-|$)/,`nb$1`);if(Object.hasOwn(EN,t))return t;let n=t.split(`-`)[0];if(Object.hasOwn(EN,n))return n};function Jxe(e,t){if(typeof e!=`string`)throw TypeError(`Expected a string, got \`${typeof e}\``);t={customReplacements:[],...t};let n=qxe(t.locale),r=[...t.customReplacements],i=wN,a=Kxe;if(n&&({replacements:i,pattern:a}=ON.get(n)),e=e.normalize(),r.length>0){r.sort((e,t)=>t[0].length-e[0].length);for(let[t,n]of r)e=e.replaceAll(t,n)}return e=e.replace(a,e=>i.get(e)??e),e=e.normalize(`NFD`).replaceAll(/\p{Diacritic}/gu,``).normalize(),e=e.replaceAll(/\p{Dash_Punctuation}/gu,`-`),e}var kN=/[\p{Z}\p{C}!"#$%&'()*+,/:;<=>?@[\\\]^`{|}]/u,AN=/[^\w-~]/,Yxe=[`da`,`de`,`hu`,`nb`,`sr`,`sv`,`tr`],Xxe={unicode:new RegExp(kN,`gu`),ascii:new RegExp(AN,`g`)},Zxe=new Map,jN=(e,{fallback:t=!0,locale:n=void 0,maxLength:r=void 0}={})=>{let{slug:{encoding:i=`unicode`,clean_accents:a=!1,sanitize_replacement:o=`-`,maxlength:s=void 0,trim:c=!0,lowercase:l=!0}={}}=Sk.current??{},u=r??s,d=e;a&&(d=Jxe(d.normalize(`NFD`),{locale:n&&Yxe.includes(n)?n:void 0})),d=d.replaceAll(Xxe[i===`ascii`?`ascii`:`unicode`],` `),d=d.trim().replaceAll(/\s+/g,o);let f;if(o){let e=xE(o),t=PA(Zxe,e,()=>({consecutivePattern:RegExp(`(?:${e})+`,`g`),trimPattern:RegExp(`^(?:${e})+|(?:${e})+$`,`g`)}));d=d.replace(t.consecutivePattern,o),c&&({trimPattern:f}=t,d=d.replace(f,``))}return!d&&t&&(d=ml(`short`)),typeof u==`number`&&d.length>u&&(d=SE(d,u,{ellipsis:``}),f&&(d=d.replace(f,``))),l&&(d=d.toLocaleLowerCase()),d},MN=e=>jN(e.trim(),{fallback:!1}),NN=({takenNames:e,name:t})=>{let n=t.trim();if(!n)return`empty`;let r=MN(n);return!r||n.includes(`/`)||r.startsWith(`.`)?`invalid`:e.includes(r)?`duplicate`:void 0},Qxe=new Set([`local`,`utc`]),PN=new WeakMap,FN=e=>typeof e==`string`&&!Qxe.has(e),IN=e=>{let t=PN.get(e);if(t)return t;let{type:n=`datetime-local`,min:r=void 0,max:i=void 0,step:a=void 0,format:o,date_format:s=void 0,time_format:c=void 0,picker_utc:l=!1,input_timezone:u=`local`,output_utc:d=!1}=e,f=typeof u==`string`&&u!==`any`?u:`local`,p=typeof s==`string`?s:``,m=typeof c==`string`?c:``,h=n===`date`||c===!1,g=n===`time`||s===!1,_=h?`9999-12-31`:g?void 0:`9999-12-31T23:59`,v=e.input_timezone===void 0?l?`utc`:`local`:f,y={type:h?`date`:g?`time`:`datetime-local`,min:typeof r==`string`&&r?r:void 0,max:typeof i==`string`&&i?i:_,step:typeof a==`number`&&Number.isInteger(a)&&a>0||a===`any`?a:void 0,format:o||[p,m].join(` `).trim()||void 0,dateOnly:h,timeOnly:g,inputTimeZone:v,outputUTC:e.output_utc===void 0?l:d,utc:v===`utc`,singleCustomTimeZone:FN(v)?v:void 0};return PN.set(e,y),y},$xe=[{key:`af`,name:`Afrikaans`},{key:`am`,name:`Amharic`},{key:`ar-iq`,name:` Arabic (Iraq)`},{key:`ar-dz`,name:`Arabic (Algeria)`},{key:`ar-kw`,name:`Arabic (Kuwait)`},{key:`ar-ly`,name:`Arabic (Lybia)`},{key:`ar-ma`,name:`Arabic (Morocco)`},{key:`ar-sa`,name:`Arabic (Saudi Arabia)`},{key:`ar-tn`,name:` Arabic (Tunisia)`},{key:`ar`,name:`Arabic`},{key:`az`,name:`Azerbaijani`},{key:`be`,name:`Belarusian`},{key:`bg`,name:`Bulgarian`},{key:`bi`,name:`Bislama`},{key:`bm`,name:`Bambara`},{key:`bn-bd`,name:`Bengali (Bangladesh)`},{key:`bn`,name:`Bengali`},{key:`bo`,name:`Tibetan`},{key:`br`,name:`Breton`},{key:`bs`,name:`Bosnian`},{key:`ca`,name:`Catalan`},{key:`cs`,name:`Czech`},{key:`cv`,name:`Chuvash`},{key:`cy`,name:`Welsh`},{key:`da`,name:`Danish`},{key:`de-at`,name:`German (Austria)`},{key:`de-ch`,name:`German (Switzerland)`},{key:`de`,name:`German`},{key:`dv`,name:`Maldivian`},{key:`en-au`,name:`English (Australia)`},{key:`el`,name:`Greek`},{key:`en-gb`,name:`English (United Kingdom)`},{key:`en-ie`,name:`English (Ireland)`},{key:`en-il`,name:`English (Israel)`},{key:`en-in`,name:`English (India)`},{key:`en-nz`,name:`English (New Zealand)`},{key:`en-sg`,name:`English (Singapore)`},{key:`en-tt`,name:`English (Trinidad & Tobago)`},{key:`en-ca`,name:`English (Canada)`},{key:`en`,name:`English`},{key:`eo`,name:`Esperanto`},{key:`es-mx`,name:`Spanish (Mexico)`},{key:`es-pr`,name:`Spanish (Puerto Rico)`},{key:`es-us`,name:`Spanish (United States)`},{key:`es-do`,name:`Spanish (Dominican Republic)`},{key:`et`,name:`Estonian`},{key:`eu`,name:`Basque`},{key:`fa`,name:`Persian`},{key:`fi`,name:`Finnish`},{key:`fr-ca`,name:`French (Canada)`},{key:`fr-ch`,name:`French (Switzerland)`},{key:`fr`,name:`French`},{key:`fo`,name:`Faroese`},{key:`fy`,name:`Frisian`},{key:`ga`,name:`Irish or Irish Gaelic`},{key:`gd`,name:`Scottish Gaelic`},{key:`gl`,name:`Galician`},{key:`gom-latn`,name:`Konkani Latin script`},{key:`gu`,name:`Gujarati`},{key:`he`,name:`Hebrew`},{key:`hi`,name:`Hindi`},{key:`hr`,name:`Croatian`},{key:`ht`,name:`Haitian Creole (Haiti)`},{key:`hu`,name:`Hungarian`},{key:`hy-am`,name:`Armenian`},{key:`id`,name:`Indonesian`},{key:`is`,name:`Icelandic`},{key:`it-ch`,name:`Italian (Switzerland)`},{key:`it`,name:`Italian`},{key:`jv`,name:`Javanese`},{key:`ka`,name:`Georgian`},{key:`kk`,name:`Kazakh`},{key:`km`,name:`Cambodian`},{key:`ko`,name:`Korean`},{key:`ku`,name:`Kurdish`},{key:`ky`,name:`Kyrgyz`},{key:`kn`,name:`Kannada`},{key:`lb`,name:`Luxembourgish`},{key:`ja`,name:`Japanese`},{key:`lt`,name:`Lithuanian`},{key:`lv`,name:`Latvian`},{key:`me`,name:`Montenegrin`},{key:`mi`,name:`Maori`},{key:`mk`,name:`Macedonian`},{key:`ml`,name:`Malayalam`},{key:`mn`,name:`Mongolian`},{key:`mr`,name:`Marathi`},{key:`ms-my`,name:`Malay`},{key:`ms`,name:`Malay`},{key:`mt`,name:`Maltese (Malta)`},{key:`lo`,name:`Lao`},{key:`my`,name:`Burmese`},{key:`nb`,name:`Norwegian Bokmål`},{key:`ne`,name:`Nepalese`},{key:`nl`,name:`Dutch`},{key:`nl-be`,name:`Dutch (Belgium)`},{key:`nn`,name:`Nynorsk`},{key:`pa-in`,name:`Punjabi (India)`},{key:`pl`,name:`Polish`},{key:`pt-br`,name:`Portuguese (Brazil)`},{key:`pt`,name:`Portuguese`},{key:`rn`,name:`Kirundi`},{key:`ro`,name:`Romanian`},{key:`es`,name:`Spanish`},{key:`ru`,name:`Russian`},{key:`rw`,name:`Kinyarwanda (Rwanda)`},{key:`sd`,name:`Sindhi`},{key:`se`,name:`Northern Sami`},{key:`si`,name:`Sinhalese`},{key:`sk`,name:`Slovak`},{key:`sl`,name:`Slovenian`},{key:`oc-lnc`,name:`Occitan, lengadocian dialecte`},{key:`sq`,name:`Albanian`},{key:`sr-cyrl`,name:`Serbian Cyrillic`},{key:`sr`,name:`Serbian`},{key:`ss`,name:`siSwati`},{key:`sv-fi`,name:`Finland Swedish`},{key:`sv`,name:`Swedish`},{key:`sw`,name:`Swahili`},{key:`ta`,name:`Tamil`},{key:`te`,name:`Telugu`},{key:`tet`,name:`Tetun Dili (East Timor)`},{key:`tg`,name:`Tajik`},{key:`th`,name:`Thai`},{key:`tl-ph`,name:`Tagalog (Philippines)`},{key:`tlh`,name:`Klingon`},{key:`tr`,name:`Turkish`},{key:`tzl`,name:`Talossan`},{key:`tzm`,name:`Central Atlas Tamazight`},{key:`ug-cn`,name:`Uyghur (China)`},{key:`uk`,name:`Ukrainian`},{key:`tk`,name:`Turkmen`},{key:`ur`,name:`Urdu`},{key:`uz-latn`,name:`Uzbek Latin`},{key:`uz`,name:`Uzbek`},{key:`vi`,name:`Vietnamese`},{key:`x-pseudo`,name:`Pseudo`},{key:`tzm-latn`,name:`Central Atlas Tamazight Latin`},{key:`yo`,name:`Yoruba Nigeria`},{key:`zh-cn`,name:`Chinese (China)`},{key:`zh-hk`,name:`Chinese (Hong Kong)`},{key:`zh-tw`,name:`Chinese (Taiwan)`},{key:`zh`,name:`Chinese`}],eSe=function(e,t,n){let r=Promise.resolve();function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},tSe=(typeof document>`u`?void 0:document.currentScript?.src)||{}.url,LN=e=>{let t=`https://unpkg.com/${e}`,n=sbe[e]?.replace(/^\D/,``);return n?`${t}@${n}`:t},RN=async(e,t)=>eSe(()=>import(`${LN(e)}/${t}`),void 0),nSe=async()=>`${LN(`leaflet`)}/dist/images/marker-icon-2x.png`,rSe=[`unpkg.com`,`cdn.jsdelivr.net`],iSe=e=>{let t=new URL(e),n=t.pathname.match(/^(.*\/@sveltia\/cms)(?:@([^/]*))?(\/.*)$/);if(!n)return e;let[,r,i,a]=n;return i===lk||i===void 0&&!rSe.includes(t.host)?e:(t.pathname=`${r}@${lk}${a}`,t.href)},aSe=(e,t=tSe)=>{let n=`chunks/${e}.js`,r=`https://unpkg.com/@sveltia/cms@${lk}/dist/${n}`;if(!t)return[r];let i=new URL(n,iSe(t)).href;return i===r?[r]:[i,r]},zN={},BN=async e=>{if(e in zN)return zN[e]();let t;for(let n of aSe(e))try{return await import(n)}catch(e){t=e}throw Error(`Failed to load the ${e} chunk.`,{cause:t})},oSe=async e=>(await RN(`dayjs`,`esm/locale/${e}.js`)).default,sSe=new Set($xe.map(({key:e})=>e)),VN=new Set([`en`]),HN=new Map,cSe=new Map,lSe=e=>{let t;try{t=new Intl.Locale(e)}catch{return}let{language:n,script:r,region:i}=t,a=[e.toLowerCase()];return r&&i&&a.push(`${n}-${r}-${i}`),r&&a.push(`${n}-${r}`),i&&a.push(`${n}-${i}`),r&&!i&&a.push(`${n}-${t.maximize().region}`),a.push(n),a.map(e=>e.toLowerCase()).find(e=>sSe.has(e))},UN=e=>PA(cSe,e,()=>lSe(e)),uSe=e=>{if(VN.has(e))return Promise.resolve();let t=HN.get(e);return t||(t=(async()=>{try{bN.default.locale(await oSe(e),void 0,!0),VN.add(e)}catch(t){console.error(`Failed to load the Day.js locale “${e}”`,t)}finally{HN.delete(e)}})(),HN.set(e,t)),t},dSe=async e=>{let t=new Set([...e].map(UN).filter(e=>e!==void 0));await Promise.all([...t].map(uSe))},WN=(e,t)=>{let{localize_format:n}=e,r=typeof n==`string`?n:n===!0&&t&&t!==`_default`?t:void 0;if(!r)return;let i=UN(r);return i&&i!==`en`&&VN.has(i)?i:void 0},GN=u(s(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_timezone=r()})(n,(function(){"use strict";var e={year:0,month:1,day:2,hour:3,minute:4,second:5},t={};return function(n,r,i){var a,o=function(e,n,r){r===void 0&&(r={});var i=new Date(e);return function(e,n){n===void 0&&(n={});var r=n.timeZoneName||`short`,i=e+`|`+r,a=t[i];return a||(a=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:r}),t[i]=a),a}(n,r).formatToParts(i)},s=function(t,n){for(var r=o(t,n),a=[],s=0;s<r.length;s+=1){var c=r[s],l=c.type,u=c.value,d=e[l];d>=0&&(a[d]=parseInt(u,10))}var f=a[3],p=f===24?0:f,m=a[0]+`-`+a[1]+`-`+a[2]+` `+p+`:`+a[4]+`:`+a[5]+`:000`,h=+t;return(i.utc(m).valueOf()-(h-=h%1e3))/6e4},c=r.prototype;c.tz=function(e,t){if(e===void 0&&(e=a),!this.isValid())return this;var n,r=this.utcOffset(),o=this.toDate(),c=o.toLocaleString(`en-US`,{timeZone:e}),l=s(+o,e);if(!Number(l))n=this.utcOffset(0,t);else if(n=i(c,{locale:this.$L}).$set(`millisecond`,this.$ms).utcOffset(l,!0),t){var u=n.utcOffset();n=n.add(r-u,`minute`)}return n.$x.$timezone=e,n},c.offsetName=function(e){var t=this.$x.$timezone||i.tz.guess(),n=o(this.valueOf(),t,{timeZoneName:e}).find((function(e){return e.type.toLowerCase()===`timezonename`}));return n&&n.value};var l=c.startOf;c.startOf=function(e,t){if(!this.$x||!this.$x.$timezone)return l.call(this,e,t);var n=i(this.format(`YYYY-MM-DD HH:mm:ss:SSS`),{locale:this.$L});return l.call(n,e,t).tz(this.$x.$timezone,!0)},i.tz=function(e,t,n){var r=n&&t,o=n||t||a,c=s(+i(),o);if(typeof e!=`string`)return i(e).tz(o);var l=i.utc(e,r).valueOf();if(Number.isNaN(l)){var u=i(NaN);return u.$x.$timezone=o,u}var d=function(e,t,n){var r=e-60*t*1e3,i=s(r,n);if(t===i)return[r,t];var a=s(r-=60*(i-t)*1e3,n);return i===a?[r,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}(l,c,o),f=d[0],p=d[1],m=i(f).utcOffset(p);return m.$x.$timezone=o,m},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(e){a=e}}}))}))(),1);bN.default.extend(xN.default),bN.default.extend(SN.default),bN.default.extend(CN.default),bN.default.extend(GN.default);var KN=e=>e instanceof Date&&!Number.isNaN(e.getTime()),qN=e=>e?bN.default.utc:bN.default,JN=/\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)$/i,fSe=/Z/,pSe=/[AaHhkmSsXx]|LT|LLL|lll/,YN=e=>e.replaceAll(/\[.*?]/g,``),XN=e=>fSe.test(YN(e)),ZN=(e,t)=>JN.test(e)&&pSe.test(YN(t))&&!XN(t),QN=(e,t,n,r)=>e(t,n,r,ZN(t,n)),$N=({value:e,format:t,parseAsUTC:n,localeKey:r})=>{let i=qN(n),a=QN(i,e,t,r);return a.isValid()?a:i(e)},eP=(e,t,n)=>(n?e.locale(n):e).format(t),tP=(e,t)=>t===`UTC`?e.toDate():bN.default.tz(e.format(`YYYY-MM-DDTHH:mm:ss.SSS`),t).toDate(),nP=(e,t)=>{if(!t||JN.test(e))return new Date(e);let n=bN.default.utc(e);return n.isValid()?tP(n,t):void 0},rP=e=>{let{format:t,dateOnly:n,utc:r,outputUTC:i,singleCustomTimeZone:a}=IN(e);return r||t&&i?`UTC`:n?void 0:a},iP=(e,t,n)=>{let{format:r,timeOnly:i}=IN(t);if(!e)return;let a=rP(t),o;if(r){let i=WN(t,n);if(a===`UTC`||!a){let t=$N({value:e,format:r,parseAsUTC:a===`UTC`,localeKey:i});o=t.isValid()?t.toDate():void 0}else{let t=QN(qN(!0),e,r,i);o=t.isValid()?XN(r)?t.toDate():tP(t,a):nP(e,a)}}else o=nP(i?`${new Date().toJSON().split(`T`)[0]}T${e}`:e,a);if(KN(o))return o;console.error(`Invalid Date`,e)};bN.default.extend(xN.default),bN.default.extend(SN.default),bN.default.extend(CN.default);var mSe=/^\d{4}-[01]\d-[0-3]\d$/,hSe=/T\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?Z$/,aP=Object.freeze([`date`,`default`,`localize`,`lower`,`slugify`,`ternary`,`truncate`,`upper`]),oP=/^[A-Za-z_]\w*$/,gSe=RegExp(`^(?<method>${oP.source.slice(1,-1)})(?:\\((?<args>.*)\\))?$`,`s`),_Se=/\s*(?:'(?<string>.*?)'|(?<number>-?\d+(?:\.\d+)?))\s*(?<separator>,|$)/sy,vSe=Object.entries({date:/^date\('(?<format>.+?)'(?:,\s*'(?<timeZone>.+?)')?\)$/,default:/^default\('(?<defaultValue>.+?)'\)$/,ternary:/^ternary\('(?<truthyValue>.*?)',\s*'(?<falsyValue>.*?)'\)$/,truncate:/^truncate\((?<max>\d+)(?:,\s*'(?<ellipsis>.+?)')?\)$/}),ySe=e=>{let t=[];if(!e.trim())return t;let n=new RegExp(_Se),r;do{let i=n.exec(e)?.groups;if(!i)return;t.push(i.string??Number(i.number)),{separator:r}=i}while(r);return t},bSe=e=>{for(let[t,n]of vSe){let r=Object.entries(e.match(n)?.groups??{});if(r.length)return{method:t,args:Object.fromEntries(r.filter(([,e])=>e!==void 0))}}let{method:t,args:n}=e.match(gSe)?.groups??{};if(t&&!aP.includes(t)){if(n===void 0)return{method:t,args:{}};let e=ySe(n);if(e)return{method:t,args:{},customArgs:e}}return{method:e,args:{}}},xSe=e=>{let t=[],n=``,r=!1;return[...e].forEach((i,a)=>{i===`'`&&(!r&&/[(,]\s*$/.test(e.slice(0,a))?r=!0:r&&/^\s*[,)]/.test(e.slice(a+1))&&(r=!1)),i===`|`&&!r?(t.push(n.trim()),n=``):n+=i}),t.push(n.trim()),t},SSe=new Map,sP=e=>FA(SSe,e,()=>{let[t,...n]=xSe(e.trim());return Object.freeze({value:t,transformations:Object.freeze(n.map(e=>{let{method:t,args:n,customArgs:r}=bSe(e);return Object.freeze({method:t,args:Object.freeze(n),...r?{customArgs:Object.freeze(r)}:{}})}))})},500),CSe=e=>String(e).toUpperCase(),wSe=e=>String(e).toLowerCase(),TSe=(e,{format:t,timeZone:n},r,i)=>{let a=String(e),{format:o,dateOnly:s,utc:c}=IN(r),l=o?WN(r,i):void 0,u=n===`utc`||c||s&&!!a.match(mSe)||s&&!!a.match(hSe),d=o&&!(e instanceof Date)?$N({value:a,format:o,parseAsUTC:u,localeKey:l}):qN(u)(a);return d.isValid()?eP(d,t,l):``},ESe=(e,{defaultValue:t})=>e?String(e):t,DSe=(e,{truthyValue:t,falsyValue:n})=>e?t:n,OSe=(e,{max:t,ellipsis:n=`…`})=>SE(String(e),Number(t),{ellipsis:n}),kSe=new WeakMap,ASe=({method:e,transform:t,value:n,customArgs:r,locale:i})=>{try{let e=t(n,{args:[...r??[]],locale:i===`_default`?void 0:i});if(typeof e?.then==`function`)throw e.then(void 0,()=>void 0),TypeError(`The function must return a string, not a Promise`);return String(e??``)}catch(r){let i=PA(kSe,t,()=>new Set);return i.has(e)||(i.add(e),console.error(`The custom “${e}” string transformation failed. Further errors are not logged:`,r)),String(n??``)}},jSe=({fieldConfig:e,value:t,transformation:n,locale:r})=>{let{method:i,args:a,customArgs:o}=n;switch(i){case`upper`:return CSe(t);case`lower`:return wSe(t);case`slugify`:return jN(String(t),{fallback:!1,locale:r});case`date`:return TSe(t,a,e??{},r);case`default`:return ESe(t,a);case`ternary`:return DSe(t,a);case`truncate`:return OSe(t,a);default:{let e=sk.get(i);return e?ASe({method:i,transform:e,value:t,customArgs:o,locale:r}):String(t)}}},cP=({fieldConfig:e,value:t,transformations:n,locale:r})=>(n.forEach(n=>{t=jSe({fieldConfig:e,value:t,transformation:n,locale:r})}),t),lP=e=>{let t=new Map;return Object.keys(e).forEach(e=>{let n=e.split(`.`),r=``;n.forEach((e,n)=>{if(n>0){let n=t.get(r);n?n.add(e):t.set(r,new Set([e]))}r=n===0?e:`${r}.${e}`})}),{childSegmentMap:t}},uP=(e,t)=>e.childSegmentMap.has(t),dP=(e,t)=>[...e.childSegmentMap.get(t)??[]].filter(uM).map(Number).sort((e,t)=>e-t),fP=e=>{let t=new Map;return Object.keys(e).forEach(e=>{let n=0;for(;;){let r=e.indexOf(`.`,n);if(r===-1)return;let i=e.indexOf(`.`,r+1),a=i===-1?e.length:i,o=e.slice(r+1,a);if(uM(o)){let n=e.slice(0,r),i=t.get(n);i?i.add(Number(o)):t.set(n,new Set([Number(o)]))}n=r+1}}),t},pP=(e,t)=>[...e.get(t)??[]].sort((e,t)=>e-t),MSe=/^\d{4}-[01]\d-[0-3]\d$/,NSe=/T00:00(?::00)?(?:\.000)?Z$/,mP={year:`numeric`,month:`short`,day:`numeric`},hP={hour:`numeric`,minute:`numeric`,hour12:!0},PSe={...mP,...hP},FSe=new Map,gP=(e,t)=>Number.isNaN(e.getTime())?`Invalid Date`:PA(FSe,t??``,()=>new Intl.DateTimeFormat(t??void 0,PSe)).format(e);bN.default.extend(xN.default),bN.default.extend(SN.default),bN.default.extend(CN.default),bN.default.extend(GN.default);var ISe=new Map,_P=({locale:e,parts:t,timeZone:n})=>PA(ISe,[e,t,n].join(`|`),()=>t===`time`?new Intl.DateTimeFormat(e,{...hP,timeZone:n}):t===`date`?new Intl.DateTimeFormat(e,{...mP,timeZone:n}):new Intl.DateTimeFormat(e,{...mP,...hP,timeZone:n,timeZoneName:void 0})),vP=({locale:e,fieldConfig:t,currentValue:n})=>{let{format:r,dateOnly:i,timeOnly:a,utc:o,singleCustomTimeZone:s}=IN(t),c=o?`UTC`:s;if(typeof n!=`string`||!n.trim())return``;if(r){let i=WN(t,e);if(ZN(n,r)){let a=iP(n,t,e),o=rP(t);return a?eP(o?(0,bN.default)(a).tz(o):(0,bN.default)(a),r,i):``}let a=$N({value:n,format:r,parseAsUTC:o,localeKey:i});return a.isValid()?a.format(r):(console.error(`Invalid Date`,n),``)}let l=iP(n,t,e),u=WA(e);return KN(l)?a?_P({locale:u,parts:`time`,timeZone:c}).format(l):i?_P({locale:u,parts:`date`,timeZone:o||MSe.test(n)||NSe.test(n)?`UTC`:c}).format(l):_P({locale:u,parts:`datetime`,timeZone:c}).format(l):``},LSe=new Map,yP=e=>PA(LSe,e,()=>Intl.NumberFormat(e,{maximumFractionDigits:20})),bP=({widget:e,value_type:t})=>t??(e===`compute`?`string`:`int`),xP=e=>[`float`,`float/string`].includes(bP(e)),SP=e=>![`int`,`float`].includes(bP(e)),CP=e=>e.widget===`number`||e.widget===`compute`&&bP(e)!==`string`,wP=e=>(e.widget===`number`||e.widget===`compute`)&&!SP(e),TP=e=>typeof e==`number`?e:typeof e==`string`&&e.trim()?Number(e):NaN,EP=(e,t)=>{if(xP(t))return Number.isFinite(e)?e+0:NaN;let n=Math.trunc(e);return Number.isSafeInteger(n)?n+0:NaN},DP=(e,t)=>e==null||typeof e==`string`&&!e.trim()?!1:Number.isNaN(EP(Number(e),t)),OP=({inputValue:e,fieldConfig:t})=>{if(typeof e==`string`)return e;if(e===void 0||Number.isNaN(e))return SP(t)?``:null;let n=EP(e,t);return Number.isNaN(n)?String(e):SP(t)?String(n):n},RSe=({currentValue:e,fieldConfig:t,inputValue:n=void 0})=>{if(DP(e,t)&&e===OP({inputValue:n,fieldConfig:t}))return n;if(typeof e==`number`)return e;if(typeof e!=`string`||!e.trim())return;let r=EP(Number(e),t);return Number.isNaN(r)?void 0:r},zSe=RA(()=>_j.current,e=>{let t=new Map,n=[];return e.forEach(e=>{e.filePathMap?[...new Set(Object.values(e.filePathMap))].forEach(n=>{PA(t,n,()=>[]).push(e)}):n.push([e,fj(e.collectionName)?._file?.fullPathRegEx])}),{fileMap:t,regexFolders:n}}),kP=e=>{let{fileMap:t,regexFolders:n}=zSe();return t.get(e)||n.filter(([,t])=>t?.test(e)).map(([e])=>e).sort((e,t)=>(t.folderPath??``).localeCompare(e.folderPath??``))},BSe=RA(()=>_j.current,()=>new WeakMap),VSe=e=>PA(BSe(),e,()=>kP(Object.values(e.locales)[0].path)),AP=e=>VSe(e).map(({collectionName:e})=>fj(e)).filter(e=>!!e),HSe=s(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e,t,i){if(typeof t!=`string`)throw Error(`Input must be string`);for(var a=t.length,o=0,s,c,l=0;l<a;l+=1){if(s=t.charCodeAt(l),c=t[l],n(s)&&r(t.charCodeAt(l+1))&&(l+=1,c+=t[l]),o+=e(c),o===i)return t.slice(0,l+1);if(o>i)return t.slice(0,l-c.length+1)}return t}})),USe=s(((e,t)=>{function n(e){return e>=55296&&e<=56319}function r(e){return e>=56320&&e<=57343}t.exports=function(e){if(typeof e!=`string`)throw Error(`Input must be string`);for(var t=e.length,i=0,a=null,o=null,s=0;s<t;s++)a=e.charCodeAt(s),r(a)?o!=null&&n(o)?i+=1:i+=3:a<=127?i+=1:a>=128&&a<=2047?i+=2:a>=2048&&a<=65535&&(i+=3),o=a;return i}})),WSe=s(((e,t)=>{var n=HSe(),r=USe();t.exports=n.bind(null,r)})),GSe=u(s(((e,t)=>{var n=WSe(),r=/[\/\?<>\\:\*\|"]/g,i=/[\x00-\x1f\x80-\x9f]/g,a=/^\.+$/,o=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i;function s(e,t){for(var n=e.length;n>0&&(e[n-1]===`.`||e[n-1]===` `);)n--;return n<e.length?e.slice(0,n)+t:e}function c(e,t){if(typeof e!=`string`)throw Error(`Input must be string`);var c=e.replace(r,t).replace(i,t).replace(a,t).replace(o,t);return c=s(c,t),n(c,255)}t.exports=function(e,t){var n=t&&t.replacement||``,r=c(e,n);return n===``?r:c(r,``)}}))(),1),jP=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[\da-f]{2})+/gi,e=>{try{return t(e)}catch{return e}})}},MP=e=>jP(e,decodeURI),NP=e=>jP(e,decodeURIComponent),PP=e=>{try{return new URL(e).href}catch{return encodeURI(MP(e).toWellFormed())}},FP=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),IP=(e,t=encodeURIComponent)=>e.split(`/`).map(e=>t(e)).join(`/`),LP=e=>e.replace(/\/+$/,``),RP=(e,t)=>RegExp(`^${e.split(`/`).map(t).join(`\\/`)}(?=\\/|$)`),zP=e=>{let t=e.startsWith(`@`);return t&&(e=e.slice(1)),e=IP(e,FP),t?`@${e}`:e},BP=(e,t)=>{let n=e.toLowerCase();if(!t.some(e=>e.toLowerCase()===n))return e;let{filename:r,extension:i}=Uk(e),a=i?`\\.${i}`:``,o=RegExp(`^${xE(r)}-(?<num>\\d+)${a}$`,`i`),s=0;return t.forEach(e=>{let t=e.match(o);t&&(s=Math.max(s,Number(t.groups.num)))}),`${r}-${s+1}${i?`.${i}`:``}`},VP=e=>(0,GSe.default)(e.normalize().replace(/[\s\u00A0\u202F]+/g,` `)),KSe=[[`jpg`,`jpeg`,`jpe`,`jfif`],[`tif`,`tiff`],[`htm`,`html`],[`yml`,`yaml`],[`md`,`markdown`],[`mpg`,`mpeg`],[`mid`,`midi`],[`aif`,`aiff`]],HP=(e,t)=>{let n=e?.toLowerCase()??``,r=t?.toLowerCase()??``;return n===r||KSe.some(e=>e.includes(n)&&e.includes(r))},UP=e=>e.filter(Boolean).join(`/`),WP=e=>Uk(e).dirname??``,GP=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,qSe=e=>e.split(`/`).filter(e=>e!==`.`&&e!==`..`).join(`/`),KP=e=>{let t=e.split(`/`),n=!1;return t.forEach((e,r)=>{if(e===`.`||e===`..`){if(n&&(t[r]=null,e===`..`)){let e=t.findLastIndex((e,t)=>!!e&&t<r);e>-1&&(t[e]=null)}}else n=!0}),UP(t)},qP=e=>typeof e==`string`?new Blob([e],{type:`text/plain`}):e,JP=e=>typeof e==`string`?new TextEncoder().encode(e).length:e.size,YP=async e=>{let t=await e.arrayBuffer();return _l(new Blob([`blob ${t.byteLength}\0`,t]))},JSe=new WeakMap,XP=e=>typeof e==`string`?YP(qP(e)):LA(JSe,e,()=>YP(e)),ZP=(e,{locale:t,defaultLocale:n}={})=>(t?e.locales[t]:void 0)??(n?e.locales[n]:void 0)??Object.values(e.locales)[0],QP=(e,t)=>e[t]?t:Object.keys(e)[0],$P=(e,{includePrevious:t=!1}={})=>[...new Set([...Object.values(e.locales).map(({path:e})=>e),...t&&e.workflow?.previousPaths||[]])],eF=(e,t)=>WP(ZP(e,{locale:t}).path),tF=(e,{basePath:t,fullPathRegEx:n}={})=>{let r=n?e.match(n)?.groups?.subPath:void 0;if(r!==void 0)return WP(r);let i=CE(t??``);return WP(zA(i)?jbe(e,i):GP(e,i))},nF=(e,t)=>{let n=e.find(({name:e})=>e===t);return n?n.fields??[]:void 0},rF=({value:e,fields:t,types:n,typeKey:r=`type`})=>t??(n?nF(n,e?.[r]):void 0)??[],iF=e=>{let{field:t,fields:n=[],types:r=[]}=e;return[...t?[t]:[],...n,...r.flatMap(e=>e.fields??[])]},aF=(e,t,n)=>{let r=n?.get(e);if(r!==void 0)return r;let i=t(e)||iF(e).some(e=>aF(e,t,n));return n?.set(e,i),i},YSe=/^(?:0|[1-9]\d*)$/,XSe=/^(.+)\.\d+\.([^.]+)$/,oF=e=>{if(e.widget!==`list`||!(`fields`in e||`types`in e))return;let{map_key_field:t}=e;return typeof t==`string`&&t?t:void 0},ZSe=e=>YSe.test(e)&&Number(e)<2**32-1,QSe=(e,t)=>!E(e)||!Object.values(e).every(e=>e===null||E(e))?e:Object.entries(e).map(([e,n])=>({...n,[t]:e})),$Se=(e,t)=>Array.isArray(e)?Object.fromEntries(e.map(e=>{let{[t]:n=``,...r}=E(e)?e:{};return[String(n),r]})):e,eCe=new WeakMap,tCe=e=>aF(e,e=>!!oF(e),eCe),sF=(e,t,n)=>{let{widget:r=`string`}=t,{fields:i,types:a,typeKey:o}=t,s=e=>rF({value:e,fields:i,types:a,typeKey:o});if(!tCe(t))return e;if(r===`object`)return cF(e,s(e),n);if(r!==`list`)return e;let c=oF(t),{field:l}=t,u=c&&n?QSe(e,c):e;if(Array.isArray(u)){let e=u.map(e=>l?sF(e,l,n):cF(e,s(e),n));e.some((e,t)=>e!==u[t])&&(u=e)}return c&&!n?$Se(u,c):u},cF=(e,t,n)=>{if(!E(e))return e;let r=e;return t.forEach(t=>{let{name:i}=t;if(!Object.hasOwn(e,i))return;let a=sF(e[i],t,n);a!==e[i]&&(r===e&&(r={...e}),r[i]=a)}),r},lF=e=>{if(e.componentName)return;let[,t,n]=e.keyPath.match(XSe)??[];if(!t)return;let r=bM({...e,keyPath:t});if(r&&oF(r)===n)return{listKeyPath:t,keyField:n}},uF=({valueMap:e,listKeyPath:t,keyField:n})=>{let r=`${t}.`,i=`.${n}`;return Object.keys(e).filter(e=>e.startsWith(r)&&e.endsWith(i)&&uM(e.slice(r.length,-i.length)))},nCe=({valueMap:e,keyPath:t,listKeyPath:n,keyField:r,value:i})=>uF({valueMap:e,listKeyPath:n,keyField:r}).some(n=>n!==t&&e[n]!==void 0&&e[n]!==null&&String(e[n])===String(i)),dF=Symbol.for(`yaml.alias`),fF=Symbol.for(`yaml.document`),pF=Symbol.for(`yaml.map`),mF=Symbol.for(`yaml.pair`),hF=Symbol.for(`yaml.scalar`),gF=Symbol.for(`yaml.seq`),_F=Symbol.for(`yaml.node.type`),vF=e=>!!e&&typeof e==`object`&&e[_F]===dF,yF=e=>!!e&&typeof e==`object`&&e[_F]===fF,bF=e=>!!e&&typeof e==`object`&&e[_F]===pF,xF=e=>!!e&&typeof e==`object`&&e[_F]===mF,SF=e=>!!e&&typeof e==`object`&&e[_F]===hF,CF=e=>!!e&&typeof e==`object`&&e[_F]===gF;function wF(e){if(e&&typeof e==`object`)switch(e[_F]){case pF:case gF:return!0}return!1}function TF(e){if(e&&typeof e==`object`)switch(e[_F]){case dF:case pF:case hF:case gF:return!0}return!1}var EF=e=>(SF(e)||wF(e))&&!!e.anchor,DF=Symbol(`break visit`),rCe=Symbol(`skip children`),OF=Symbol(`remove node`);function kF(e,t){let n=iCe(t);yF(e)?AF(null,e.contents,n,Object.freeze([e]))===OF&&(e.contents=null):AF(null,e,n,Object.freeze([]))}kF.BREAK=DF,kF.SKIP=rCe,kF.REMOVE=OF;function AF(e,t,n,r){let i=aCe(e,t,n,r);if(TF(i)||xF(i))return oCe(e,r,i),AF(e,i,n,r);if(typeof i!=`symbol`){if(wF(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=AF(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===DF)return DF;else i===OF&&(t.items.splice(e,1),--e)}}else if(xF(t)){r=Object.freeze(r.concat(t));let e=AF(`key`,t.key,n,r);if(e===DF)return DF;e===OF&&(t.key=null);let i=AF(`value`,t.value,n,r);if(i===DF)return DF;i===OF&&(t.value=null)}}return i}function iCe(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function aCe(e,t,n,r){if(typeof n==`function`)return n(e,t,r);if(bF(t))return n.Map?.(e,t,r);if(CF(t))return n.Seq?.(e,t,r);if(xF(t))return n.Pair?.(e,t,r);if(SF(t))return n.Scalar?.(e,t,r);if(vF(t))return n.Alias?.(e,t,r)}function oCe(e,t,n){let r=t[t.length-1];if(wF(r))r.items[e]=n;else if(xF(r))e===`key`?r.key=n:r.value=n;else if(yF(r))r.contents=n;else{let e=vF(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var sCe={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},cCe=e=>e.replace(/[!,[\]{}]/g,e=>sCe[e]),jF=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+cCe(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&TF(e.contents)){let t={};kF(e.contents,(e,n)=>{TF(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)i===`!!`&&a===`tag:yaml.org,2002:`||e&&!r.some(e=>e.startsWith(a))||t.push(`%TAG ${i} ${a}`);return t.join(`
`)}};jF.defaultYaml={explicit:!1,version:`1.2`},jF.defaultTags={"!!":`tag:yaml.org,2002:`};function MF(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function NF(e){let t=new Set;return kF(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function PF(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function lCe(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=NF(e);let a=PF(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(SF(t.node)||wF(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function FF(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=FF(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=FF(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=FF(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=FF(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function IF(e,t,n){if(Array.isArray(e))return e.map((e,t)=>IF(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!EF(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var LF=class{constructor(e){Object.defineProperty(this,_F,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!yF(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=IF(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?FF(i,{"":o},``,o):o}},RF=class extends LF{constructor(e){super(dF),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],kF(e,{Node:(e,t)=>{(vF(t)||EF(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(IF(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=zF(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(MF(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function zF(e,t,n){if(vF(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(wF(t)){let r=0;for(let i of t.items){let t=zF(e,i,n);t>r&&(r=t)}return r}if(xF(t)){let r=zF(e,t.key,n),i=zF(e,t.value,n);return Math.max(r,i)}return 1}var BF=e=>!e||typeof e!=`function`&&typeof e!=`object`,VF=class extends LF{constructor(e){super(hF),this.value=e}toJSON(e,t){return t?.keep?this.value:IF(this.value,e,t)}toString(){return String(this.value)}};VF.BLOCK_FOLDED=`BLOCK_FOLDED`,VF.BLOCK_LITERAL=`BLOCK_LITERAL`,VF.PLAIN=`PLAIN`,VF.QUOTE_DOUBLE=`QUOTE_DOUBLE`,VF.QUOTE_SINGLE=`QUOTE_SINGLE`;var uCe=`tag:yaml.org,2002:`;function dCe(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function HF(e,t,n){if(yF(e)&&(e=e.contents),TF(e))return e;if(xF(e)){let t=n.schema[pF].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new RF(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=uCe+t.slice(2));let l=dCe(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new VF(e);return c&&(c.node=t),t}l=e instanceof Map?o[pF]:Symbol.iterator in Object(e)?o[gF]:o[pF]}a&&(a(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,e,n):typeof l?.nodeClass?.from==`function`?l.nodeClass.from(n.schema,e,n):new VF(e);return t?u.tag=t:l.default||(u.tag=l.tag),c&&(c.node=u),u}function UF(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return HF(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var WF=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,GF=class extends LF{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>TF(t)||xF(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(WF(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(wF(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,UF(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(wF(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&SF(i)?i.value:i:wF(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!xF(t))return!1;let n=t.value;return n==null||e&&SF(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return wF(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(wF(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,UF(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},fCe=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function KF(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var qF=(e,t,n)=>e.endsWith(`
`)?KF(n,t):n.includes(`
`)?`
`+KF(n,t):(e.endsWith(` `)?``:` `)+n;function JF(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=YF(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=YF(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function YF(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var XF=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ZF=e=>/^(%|---|\.\.\.)/m.test(e);function pCe(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function QF(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(ZF(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:JF(o,a,`quoted`,XF(t,!1))}function $F(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return QF(e,t);let n=t.indent||(ZF(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:JF(r,n,`flow`,XF(t,!1))}function eI(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=QF;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?$F:i&&!t?QF:n?$F:QF}return r(e,t)}var tI;try{tI=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{tI=/\n+(?!\n|$)/g}function nI({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return eI(n,r);let l=r.indent||(r.forceBlockIndent||ZF(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===VF.BLOCK_FOLDED?!1:t===VF.BLOCK_LITERAL||!pCe(n,c,l.length);if(!n)return u?`|
`:`>
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
`&&(p=p.slice(0,-1)),p.replace(tI,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=XF(r,!0);o!==`folded`&&t!==VF.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=JF(`${v}${e}${p}`,l,`block`,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function mCe(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return eI(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?eI(a,t):nI(e,t,n,r);if(!s&&!u&&i!==VF.PLAIN&&a.includes(`
`))return nI(e,t,n,r);if(ZF(a)){if(c===``)return t.forceBlockIndent=!0,nI(e,t,n,r);if(s&&c===l)return eI(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return eI(a,t)}return s?d:JF(d,c,`flow`,XF(t,!1))}function rI(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==VF.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=VF.QUOTE_DOUBLE);let c=e=>{switch(e){case VF.BLOCK_FOLDED:case VF.BLOCK_LITERAL:return i||a?eI(o.value,t):nI(o,t,n,r);case VF.QUOTE_DOUBLE:return QF(o.value,t);case VF.QUOTE_SINGLE:return $F(o.value,t);case VF.PLAIN:return mCe(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function iI(e,t){let n=Object.assign({blockQuote:!0,commentString:fCe,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function hCe(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(SF(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function gCe(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(SF(e)||wF(e))&&e.anchor;a&&MF(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function aI(e,t,n,r){if(xF(e))return e.toString(t,n,r);if(vF(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=TF(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=hCe(t.doc.schema.tags,a);let o=gCe(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):SF(a)?rI(a,t,n,r):a.toString(t,n,r);return o?SF(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function _Ce({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=TF(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(wF(e)||!TF(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||wF(e)||(SF(e)?e.type===VF.BLOCK_FOLDED||e.type===VF.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=aI(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=qF(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=qF(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=qF(g,n.indent,l(f))));let _,v,y;TF(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&SF(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&CF(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=aI(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${KF(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&wF(t)){let e=x[0],r=x.indexOf(`
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=qF(g,n.indent,l(y)):h&&i&&i(),g}function oI(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var sI=`<<`,cI={identify:e=>e===sI||typeof e==`symbol`&&e.description===sI,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new VF(Symbol(sI)),{addToJSMap:lI}),stringify:()=>sI},vCe=(e,t)=>(cI.identify(t)||SF(t)&&(!t.type||t.type===VF.PLAIN)&&cI.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===cI.tag&&e.default);function lI(e,t,n){let r=dI(e,n);if(CF(r))for(let n of r.items)uI(e,t,n);else if(Array.isArray(r))for(let n of r)uI(e,t,n);else uI(e,t,r)}function uI(e,t,n){let r=dI(e,n);if(!bF(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function dI(e,t){return e&&vF(t)?t.resolve(e.doc,e):t}function fI(e,t,{key:n,value:r}){if(TF(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(vCe(e,n))lI(e,t,r);else{let i=IF(n,``,e);if(t instanceof Map)t.set(i,IF(r,i,e));else if(t instanceof Set)t.add(i);else{let a=yCe(n,i,e),o=IF(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function yCe(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(TF(e)&&n?.doc){let t=iI(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),oI(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function pI(e,t,n){return new mI(HF(e,void 0,n),HF(t,void 0,n))}var mI=class e{constructor(e,t=null){Object.defineProperty(this,_F,{value:mF}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return TF(n)&&(n=n.clone(t)),TF(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return fI(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?_Ce(this,e,t,n):JSON.stringify(this)}};function hI(e,t,n){return(t.inFlow??e.flow?xCe:bCe)(e,t,n)}function bCe({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(TF(i))!d&&i.spaceBefore&&f.push(``),gI(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(xF(i)){let e=TF(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),gI(n,f,e.commentBefore,d))}d=!1;let s=aI(i,u,()=>o=null,()=>d=!0);o&&(s+=qF(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`}}return e?(p+=`
`+KF(l(e),c),s&&s()):d&&o&&o(),p}function xCe({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(TF(i))i.spaceBefore&&d.push(``),gI(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(xF(i)){let e=TF(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),gI(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=TF(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=aI(i,c,()=>a=null);l||=d.length>u||o.includes(`
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=qF(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function gI({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=KF(t(r),e);n.push(i.trimStart())}}function _I(e,t){let n=SF(t)?t.value:t;for(let r of e)if(xF(r)&&(r.key===t||r.key===n||SF(r.key)&&r.key.value===n))return r}var vI=class extends GF{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(pF,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(pI(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=xF(e)?e:!e||typeof e!=`object`||!(`key`in e)?new mI(e,e?.value):new mI(e.key,e.value);let r=_I(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);SF(r.value)&&BF(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=_I(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=_I(this.items,e)?.value;return(!t&&SF(n)?n.value:n)??void 0}has(e){return!!_I(this.items,e)}set(e,t){this.add(new mI(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)fI(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!xF(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),hI(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},yI={collection:`map`,default:!0,nodeClass:vI,tag:`tag:yaml.org,2002:map`,resolve(e,t){return bF(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>vI.from(e,t,n)},bI=class extends GF{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(gF,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=xI(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=xI(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&SF(r)?r.value:r}has(e){let t=xI(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=xI(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];SF(r)&&BF(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(IF(e,String(r++),t));return n}toString(e,t,n){return e?hI(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(HF(a,void 0,n))}}return i}};function xI(e){let t=SF(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var SI={collection:`seq`,default:!0,nodeClass:bI,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return CF(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>bI.from(e,t,n)},CI={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),rI(e,t,n,r)}},wI={identify:e=>e==null,createNode:()=>new VF(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new VF(null),stringify:({source:e},t)=>typeof e==`string`&&wI.test.test(e)?e:t.options.nullStr},TI={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new VF(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&TI.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function EI({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var DI={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:EI},OI={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():EI(e)}},kI={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new VF(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:EI},AI=e=>typeof e==`bigint`||Number.isInteger(e),jI=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function MI(e,t,n){let{value:r}=e;return AI(r)&&r>=0?n+r.toString(t):EI(e)}var NI={identify:e=>AI(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>jI(e,2,8,n),stringify:e=>MI(e,8,`0o`)},PI={identify:AI,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>jI(e,0,10,n),stringify:EI},FI={identify:e=>AI(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>jI(e,2,16,n),stringify:e=>MI(e,16,`0x`)},SCe=[yI,SI,CI,wI,TI,NI,PI,FI,DI,OI,kI];function II(e){return typeof e==`bigint`||Number.isInteger(e)}var LI=({value:e})=>JSON.stringify(e),CCe=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:LI},{identify:e=>e==null,createNode:()=>new VF(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:LI},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:LI},{identify:II,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>II(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:LI}],wCe=[yI,SI].concat(CCe,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),RI={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=VF.BLOCK_LITERAL,t!==VF.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===VF.BLOCK_LITERAL?`
`:` `)}return rI({comment:e,type:t,value:s},r,i,a)}};function zI(e,t){if(CF(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!xF(r)){if(bF(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new mI(new VF(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=xF(r)?r:new mI(r)}}else t(`Expected a sequence for this tag`);return e}function BI(e,t,n){let{replacer:r}=n,i=new bI(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(pI(o,s,n))}return i}var VI={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:zI,createNode:BI},HI=class e extends bI{constructor(){super(),this.add=vI.prototype.add.bind(this),this.delete=vI.prototype.delete.bind(this),this.get=vI.prototype.get.bind(this),this.has=vI.prototype.has.bind(this),this.set=vI.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(xF(e)?(r=IF(e.key,``,t),i=IF(e.value,r,t)):r=IF(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=BI(e,t,n),i=new this;return i.items=r.items,i}};HI.tag=`tag:yaml.org,2002:omap`;var UI={collection:`seq`,identify:e=>e instanceof Map,nodeClass:HI,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=zI(e,t),r=[];for(let{key:e}of n.items)SF(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new HI,n)},createNode:(e,t,n)=>HI.from(e,t,n)};function WI({value:e,source:t},n){return t&&(e?GI:KI).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var GI={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new VF(!0),stringify:WI},KI={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new VF(!1),stringify:WI},TCe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:EI},ECe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():EI(e)}},DCe={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new VF(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:EI},qI=e=>typeof e==`bigint`||Number.isInteger(e);function JI(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function YI(e,t,n){let{value:r}=e;if(qI(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return EI(e)}var OCe={identify:qI,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>JI(e,2,2,n),stringify:e=>YI(e,2,`0b`)},kCe={identify:qI,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>JI(e,1,8,n),stringify:e=>YI(e,8,`0`)},ACe={identify:qI,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>JI(e,0,10,n),stringify:EI},jCe={identify:qI,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>JI(e,2,16,n),stringify:e=>YI(e,16,`0x`)},XI=class e extends vI{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=xF(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new mI(e.key,null):new mI(e,null),_I(this.items,t.key)||this.items.push(t)}get(e,t){let n=_I(this.items,e);return!t&&xF(n)?SF(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=_I(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new mI(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(pI(e,null,n));return i}};XI.tag=`tag:yaml.org,2002:set`;var ZI={collection:`map`,identify:e=>e instanceof Set,nodeClass:XI,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>XI.from(e,t,n),resolve(e,t){if(bF(e)){if(e.hasAllNullValues(!0))return Object.assign(new XI,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function QI(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function $I(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return EI(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var eL={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>QI(e,n),stringify:$I},tL={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>QI(e,!1),stringify:$I},nL={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(nL.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=QI(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``},rL=[yI,SI,CI,wI,GI,KI,OCe,kCe,ACe,jCe,TCe,ECe,DCe,RI,cI,UI,VI,ZI,eL,tL,nL],iL=new Map([[`core`,SCe],[`failsafe`,[yI,SI,CI]],[`json`,wCe],[`yaml11`,rL],[`yaml-1.1`,rL]]),aL={binary:RI,bool:TI,float:kI,floatExp:OI,floatNaN:DI,floatTime:tL,int:PI,intHex:FI,intOct:NI,intTime:eL,map:yI,merge:cI,null:wI,omap:UI,pairs:VI,seq:SI,set:ZI,timestamp:nL},MCe={"tag:yaml.org,2002:binary":RI,"tag:yaml.org,2002:merge":cI,"tag:yaml.org,2002:omap":UI,"tag:yaml.org,2002:pairs":VI,"tag:yaml.org,2002:set":ZI,"tag:yaml.org,2002:timestamp":nL};function oL(e,t,n){let r=iL.get(t);if(r&&!e)return n&&!r.includes(cI)?r.concat(cI):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(iL.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(cI)),i.reduce((e,t)=>{let n=typeof t==`string`?aL[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(aL).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var NCe=(e,t)=>e.key<t.key?-1:+(e.key>t.key),PCe=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?oL(e,`compat`):e?oL(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?MCe:{},this.tags=oL(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,pF,{value:yI}),Object.defineProperty(this,hF,{value:CI}),Object.defineProperty(this,gF,{value:SI}),this.sortMapEntries=typeof a==`function`?a:a===!0?NCe:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function FCe(e,t){let n=[],r=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push(`---`);let i=iI(e,t),{commentString:a}=i.options;if(e.commentBefore){n.length!==1&&n.unshift(``);let t=a(e.commentBefore);n.unshift(KF(t,``))}let o=!1,s=null;if(e.contents){if(TF(e.contents)){if(e.contents.spaceBefore&&r&&n.push(``),e.contents.commentBefore){let t=a(e.contents.commentBefore);n.push(KF(t,``))}i.forceBlockIndent=!!e.comment,s=e.contents.comment}let t=s?void 0:()=>o=!0,c=aI(e.contents,i,()=>s=null,t);s&&(c+=qF(c,``,a(s))),(c[0]===`|`||c[0]===`>`)&&n[n.length-1]===`---`?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(aI(e.contents,i));if(e.directives?.docEnd){if(e.comment){let t=a(e.comment);t.includes(`
`)?(n.push(`...`),n.push(KF(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(KF(a(t),``)))}return n.join(`
`)+`
`}var sL=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,_F,{value:fF});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new jF({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[_F]:{value:fF}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=TF(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){cL(this.contents)&&this.contents.add(e)}addIn(e,t){cL(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=NF(this);e.anchor=!t||n.has(t)?PF(t||`a`,n):t}return new RF(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=lCe(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=HF(e,l,p);return o&&wF(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new mI(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return cL(this.contents)?this.contents.delete(e):!1}deleteIn(e){return WF(e)?this.contents!=null&&(this.contents=null,!0):cL(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return wF(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return WF(e)?!t&&SF(this.contents)?this.contents.value:this.contents:wF(this.contents)?this.contents.getIn(e,t):void 0}has(e){return wF(this.contents)?this.contents.has(e):!1}hasIn(e){return WF(e)?this.contents!==void 0:wF(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=UF(this.schema,[e],t):cL(this.contents)&&this.contents.set(e,t)}setIn(e,t){WF(e)?this.contents=t:this.contents==null?this.contents=UF(this.schema,Array.from(e),t):cL(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new jF({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new jF({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new PCe(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=IF(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?FF(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return FCe(this,e)}};function cL(e){if(wF(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var lL=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},uL=class extends lL{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},ICe=class extends lL{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},dL=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function fL(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:b&&n===`seq-item-ind`||(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function pL(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(pL(t.key)||pL(t.value))return!0}return!1;default:return!0}}function mL(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&pL(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function hL(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||SF(e)&&SF(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var gL=`All mapping items must start at the same column`;function LCe({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??vI)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=fL(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,gL)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||pL(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,gL);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&mL(r.indent,u,i),n.atKey=!1,hL(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=fL(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&mL(r.indent,f,i),s=c.range[2];let l=new mI(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new mI(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function RCe({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??bI)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=fL(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&mL(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function _L(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var vL=`Block collections are not allowed within flow collections`,yL=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function zCe({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?vI:bI))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=fL(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&pL(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];xF(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],yL(m)&&i(r.range,`BLOCK_IN_FLOW`,vL)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);yL(f)&&i(g.range,`BLOCK_IN_FLOW`,vL),n.atKey=!1;let _=fL(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?yL(m)&&i(v.range,`BLOCK_IN_FLOW`,vL):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new mI(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;hL(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new vI(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=_L(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function bL(e,t,n,r,i,a){let o=n.type===`block-map`?LCe(e,t,n,r,a):n.type===`block-seq`?RCe(e,t,n,r,a):zCe(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function BCe(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===vI.tagName&&s===`map`||o===bI.tagName&&s===`seq`)return bL(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),bL(e,t,n,i,o)}let l=bL(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=TF(u)?u:new VF(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function VCe(e,t,n){let r=t.offset,i=HCe(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?VF.BLOCK_FOLDED:VF.BLOCK_LITERAL,o=t.source?UCe(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===VF.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
`),d+=f+t.slice(c)+r,f=`
`,p=!0):r===``?f===`
`?d+=`
`:f=`
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
`+o[e][0].slice(c);d[d.length-1]!==`
`&&(d+=`
`);break;default:d+=`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function HCe({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function UCe(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function WCe(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=VF.PLAIN,c=GCe(a,l);break;case`single-quoted-scalar`:s=VF.QUOTE_SINGLE,c=KCe(a,l);break;case`double-quoted-scalar`:s=VF.QUOTE_DOUBLE,c=qCe(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=_L(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function GCe(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),xL(e)}function KCe(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),xL(e.slice(1,-1)).replace(/''/g,`'`)}function xL(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
`?a+=o:o=`
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function qCe(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
`){if(i===`
`){let{fold:t,offset:i}=JCe(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=YCe[i];if(a)n+=a;else if(i===`
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=XCe(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`&&(a!==`\r`||e[r+2]!==`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function JCe(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
`);)r===`
`&&(n+=`
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var YCe={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function XCe(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function SL(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?VCe(e,t,r):WCe(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[hF]:c?ZCe(e.schema,i,c,n,r):t.type===`scalar`?QCe(e,i,t,r):e.schema[hF];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=SF(a)?a:new VF(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new VF(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function ZCe(e,t,n,r,i){if(n===`!`)return e[hF];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[hF])}function QCe({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[hF];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[hF];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function $Ce(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var ewe={composeNode:CL,composeEmptyNode:wL};function CL(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=twe(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=SL(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=BCe(ewe,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=wL(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!SF(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function wL(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=SL(e,{type:`scalar`,offset:$Ce(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function twe({options:e},{offset:t,source:n,end:r},i){let a=new RF(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=_L(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function nwe(e,t,{offset:n,start:r,value:i,end:a},o){let s=new sL(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=fL(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?CL(c,i,l,o):wL(c,l.end,r,null,l,o);let u=s.contents.range[2],d=_L(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function TL(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function EL(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`:`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var rwe=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=TL(e);r?this.warnings.push(new ICe(i,t,n)):this.errors.push(new uL(i,t,n))},this.directives=new jF({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=EL(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(wF(i)&&!i.flow&&i.items.length>0){let e=i.items[0];xF(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:EL(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=TL(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=nwe(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new uL(TL(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new uL(TL(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=_L(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new uL(TL(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new sL(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},DL=Symbol(`break visit`),iwe=Symbol(`skip children`),OL=Symbol(`remove item`);function kL(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),AL(Object.freeze([]),e,t)}kL.BREAK=DL,kL.SKIP=iwe,kL.REMOVE=OL,kL.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},kL.parentCollection=(e,t)=>{let n=kL.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function AL(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=AL(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===DL)return DL;else r===OL&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function awe(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`:case`\r
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function jL(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var ML=new Set(`0123456789ABCDEFabcdef`),owe=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),NL=new Set(`,[]{}`),swe=new Set(` ,[]{}
\r `),PL=e=>!e||swe.has(e),cwe=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`||t===`\r`&&this.buffer[e+1]===`
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
`||!t&&!this.atEnd)return e+n+1}return t===`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&jL(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&jL(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!jL(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&jL(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(PL),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&jL(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(PL),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||jL(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>jL(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(jL(r)||e&&NL.has(r))break;t=n}else if(jL(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&NL.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&NL.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(PL),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(jL(n)||t&&NL.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!jL(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(owe.has(t))t=this.buffer[++e];else if(t===`%`&&ML.has(this.buffer[e+1])&&ML.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},lwe=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function FL(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function IL(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function LL(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function RL(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function zL(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function BL(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function VL(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!FL(t.start,`explicit-key-ind`)&&!FL(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,LL(t.value)?t.value.end?BL(t.value.end,t.sep):t.value.end=t.sep:BL(t.start,t.sep),delete t.sep)}var uwe=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new cwe,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=awe(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&VL(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&IL(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:IL(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=zL(RL(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){BL(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(FL(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=zL(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(FL(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(LL(t.key)&&!FL(t.sep,`newline`)){let e=zL(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):FL(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!FL(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){BL(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||FL(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=zL(RL(t));VL(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=zL(RL(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=zL(RL(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function dwe(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new lwe||null,prettyErrors:t}}function HL(e,t={}){let{lineCounter:n,prettyErrors:r}=dwe(t),i=new uwe(n?.addNewLine),a=new rwe(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new uL(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(dL(e,n)),o.warnings.forEach(dL(e,n))),o}function fwe(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=HL(e,n);if(!i)return null;if(i.warnings.forEach(e=>oI(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function UL(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return yF(e)&&!r?e.toString(n):new sL(e,r,n).toString(n)}var WL=new Map,pwe=/(?:^|[^\d])\.0|\d\.0*(?!\d)|\d[eE][-+]?\d/,mwe=/^[-+]?(?:\d+|0o[0-7]+|0x[\da-fA-F]+)$/,hwe=/^[-+]?(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][-+]?\d+)?$/,gwe=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][-+]?\d+)?$/,GL=/^-?\d+$/,KL=e=>pwe.test(e),qL=e=>typeof e==`number`&&Number.isInteger(e),JL=e=>{let t=Object.is(e,-0)?`-0`:String(e);return/[.e]/.test(t)?t:`${t}.0`},YL=(e,t,n)=>{let r=e.get(t);e.set(t,r===void 0||r===n?n:null)},XL=(e,t)=>{let n=String(t).replace(/[\\.]/g,`\\$&`);return e?`${e}.${n}`:n},_we=e=>{let t={},n=(e,r)=>{if(SF(e)){let{value:n,source:i,tag:a}=e;r&&qL(n)&&(!a||a===`tag:yaml.org,2002:float`)&&typeof i==`string`&&!mwe.test(i)&&(t[r]={value:n,source:i})}else bF(e)?e.items.forEach(({key:e,value:t})=>{SF(e)&&n(t,XL(r,String(e.value)))}):CF(e)&&e.items.forEach((e,t)=>{n(e,XL(r,t))})};return n(e.contents,``),t},ZL=class{constructor(e,t){this.value=e,this.source=t}toJSON(){return this.value}},vwe=(e,t,n)=>{let r=n?.source;return qL(t)&&typeof r==`string`&&!GL.test(r)?new ZL(t,r):t},ywe=e=>{let t={},n=(e,r)=>e instanceof ZL?(r&&(t[r]={value:e.value,source:e.source}),e.value):((Array.isArray(e)||E(e))&&Object.entries(e).forEach(([t,i])=>{e[t]=n(i,XL(r,t))}),e);return{value:n(e,``),sourceMap:t}},QL=(e,t)=>{Object.keys(t).length&&WL.set(e,t)},$L=(e,t,n)=>{let r=t?e.get(t):void 0;return r?e.set(n,r):e.delete(n),r},bwe=({previousPath:e,path:t})=>$L(WL,e,t),xwe=(e,t)=>{let n=new Map;return Object.entries(e).forEach(([e,t])=>{let[r,...i]=e.split(`.`);n.has(r)||n.set(r,[]),n.get(r).push([i.join(`.`),t])}),Object.fromEntries(t.flatMap((e,t)=>e===void 0?[]:(n.get(String(e))??[]).map(([e,n])=>[e?`${t}.${e}`:String(t),n])))},Swe=(e,{value:t,source:n})=>typeof e==`number`&&e===t?new ZL(e,n):void 0,eR=(e,t,n=Swe,r=``)=>{let i=r&&Object.hasOwn(t,r)?t[r]:void 0,a=i?n(e,i):void 0;return a===void 0?Array.isArray(e)?e.map((e,i)=>eR(e,t,n,XL(r,i))):Pj(e)?Object.fromEntries(Object.entries(e).map(([e,i])=>[e,eR(i,t,n,XL(r,e))])):e:a},tR=(e,t,n)=>n.test(e)&&/[.eE]/.test(e)&&Number(e.replaceAll(`_`,``))===t,Cwe=({value:e,source:t})=>tR(t,e,gwe)?t:void 0,wwe={identify:e=>e instanceof ZL,default:!0,tag:`tag:yaml.org,2002:float`,resolve:e=>Number(e),stringify:({value:e})=>{let{value:t,source:n}=e;return tR(n,t,hwe)?n:JL(t)}},nR=new Map,Twe=({_file:e,previousPath:t,path:n})=>{if(e.format!==`frontmatter`)return e;let r=$L(nR,t,n);return r?{...e,format:r,configuredFormat:e.format,fmDelimiters:e.fmDelimiters??cA[r]}:e},rR=new Map,Ewe=/\d{16}/,iR=e=>Ewe.test(e),aR=(e,t)=>{YL(rR,e,t)},oR=e=>{let t=Number(e);return Number.isSafeInteger(t)||aR(t,String(e)),t},sR=e=>typeof e==`bigint`?oR(e):Number.isInteger(e)&&!Number.isSafeInteger(e)?(aR(e,String(BigInt(e))),e):((Array.isArray(e)||E(e))&&Object.entries(e).forEach(([t,n])=>{e[t]=sR(n)}),e),cR=(e,t,n)=>{let r=n?.source;return typeof t==`number`&&!Number.isSafeInteger(t)&&typeof r==`string`&&GL.test(r)?oR(BigInt(r)):t},lR=e=>typeof e==`number`&&!Number.isSafeInteger(e)?rR.get(e)??void 0:void 0,Dwe=()=>rR.size>0,uR=e=>{let t=lR(e);return t===void 0?Array.isArray(e)?e.map(uR):Pj(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,uR(t)])):e:BigInt(t)};
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function Owe(e,t){let n=e.slice(0,t).split(/\r?\n/);return[n.length,n.pop().length+1]}function kwe(e,t,n){let r=e.split(/\r?\n/),i=``,a=(Math.log10(t+1)|0)+1;for(let e=t-1;e<=t+1;e++){let o=r[e-1];o&&(i+=e.toString().padEnd(a,` `),i+=`: `,i+=o,i+=`
`,e===t&&(i+=` `.repeat(a+n+2),i+=`^
`))}return i}var dR=class e extends Error{line;column;codeblock;constructor(e,t){let[n,r]=Owe(t.toml,t.ptr),i=kwe(t.toml,n,r);super(`Invalid TOML document: ${e}\n\n${i}`,t),this.line=n,this.column=r,this.codeblock=i}static x(t,n,r){throw new e(t,{toml:n.s,ptr:r??n.p})}};
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function fR(e){let t=e.p,n=e.s.charCodeAt(e.p++),r=n,i=n===39,a=n===e.s.charCodeAt(e.p)&&n===e.s.charCodeAt(e.p+1);a&&((n=e.s.charCodeAt(e.p+=2))===10?e.p++:n===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let o=``,s=e.p,c=0;for(;e.p<e.s.length;e.p++)if(n=e.s.charCodeAt(e.p),a&&(n===10||n===13&&e.s.charCodeAt(e.p+1)===10))c&&=3;else if(n<32&&n!==9||n===127)dR.x(`control characters are not allowed in strings`,e);else if((!c||c===3)&&n===r&&(!a||e.s.charCodeAt(e.p+1)===r&&e.s.charCodeAt(e.p+2)===r)){if(a&&(e.s.charCodeAt(e.p+3)===r&&e.p++,e.s.charCodeAt(e.p+3)===r&&e.p++),!c){let t=e.s.slice(s,e.p);o=o?o+t:t}return e.p+=a?3:1,o}else if(!c)!i&&n===92&&(o+=e.s.slice(s,s=e.p),c=1);else if(c===1){if(n===120||n===117||n===85){let t=e.p++-1,r=0,i=n===120?2:n===117?4:8;for(let t=0;t<i;t++,e.p++){let t=e.s.charCodeAt(e.p),n=t>=48&&t<=57?t-48:t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:-1;n<0&&dR.x(`invalid non-hex character in unicode escape`,e),r=r<<4|n}(r<0||r>1114111||r>=55296&&r<=57343)&&dR.x(`invalid unicode escape`,e,t),o+=String.fromCodePoint(r),s=e.p--,c=0}else a&&(n===32||n===9)?c=2:(n===98?o+=`\b`:n===116?o+=` `:n===110?o+=`
`:n===102?o+=`\f`:n===114?o+=`\r`:n===101?o+=`\x1B`:n===34?o+=`"`:n===92?o+=`\\`:dR.x(`unrecognised escape sequence`,e),s=e.p+1,c=0)}else n!==32&&n!==9&&(c===2&&dR.x(`invalid escape: only line-ending whitespace may be escaped`,e,s),c=+(!i&&n===92),s=e.p);dR.x(`unfinished string`,e,t)}
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var Awe=/^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i,pR=class e extends Date{#e=!1;#t=!1;#n=null;constructor(e,t,n){let r=!0,i=!0,a=`Z`,o;if(typeof e==`string`){if(t)prep:{if(t<3){if(+e.slice(11,13)>23){e=``;break prep}t===2?(a=null,e+=`Z`):(o=e.charCodeAt(e.length-1))!==90&&o!==122&&(a=e.slice(e.length-6)),n&&(e=e.slice(0,10)+`T`+e.slice(11))}else t===4&&(e=+e.slice(0,2)>23?``:`0000-01-01T${e}Z`);r=t!==4,i=t!==3}else{let t=e.match(Awe);t?(t[1]||(r=!1,e=`0000-01-01T${e}`),i=!!t[2],i&&e[10]===` `&&(e=e.replace(` `,`T`)),t[2]&&+t[2]>23?e=``:(a=t[3]||null,!a&&i&&(e+=`Z`))):e=``}}super(e),isNaN(this.getTime())||(this.#e=r,this.#t=i,this.#n=a)}isDateTime(){return this.#e&&this.#t}isLocal(){return!this.#e||!this.#t||!this.#n}isDate(){return this.#e&&!this.#t}isTime(){return this.#t&&!this.#e}isValid(){return this.#e||this.#t}toISOString(){let e=super.toISOString();if(this.isDate())return e.slice(0,10);if(this.isTime())return e.slice(11,23);if(this.#n===null)return e.slice(0,-1);if(this.#n===`Z`||this.#n===`z`)return e;let t=this.#n.slice(1,3)*60+ +this.#n.slice(4,6);return t=this.#n[0]===`-`?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#n}static wrapAsOffsetDateTime(t,n=`Z`){let r=new e(t);return r.#n=n,r}static wrapAsLocalDateTime(t){let n=new e(t);return n.#n=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#t=!1,n.#n=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#e=!1,n.#n=null,n}};
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function mR(e,t=10){return t===16?e>47&&e<58||e>64&&e<71||e>96&&e<103:e>47&&e<48+t}function hR(e,t){return e===32||e===9||e===10||e===13||t&&(e===t||e===44)||e===35}function gR(e,t){let n=e.p,r=e.s.charCodeAt(e.p);if(r===91||r===123){e.d--||dR.x(`document contains excessively nested structures. aborting.`,e);let t=r===91?Fwe(e):Pwe(e);return e.d++,t}return r===34||r===39?fR(e):r===116?((e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)&&dR.x(`invalid value`,e,n),e.p++,!0):r===102?((e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)&&dR.x(`invalid value`,e,n),e.p++,!1):r===43||r===45?_R(e,e.p,e.s.charCodeAt(++e.p),44-r,t):e.s.charCodeAt(e.p+4)===45&&e.s.charCodeAt(e.p+7)===45?jwe(e,r,t):e.s.charCodeAt(e.p+2)===58?Mwe(e,r,t):_R(e,e.p,r,0,t)}function _R(e,t,n,r,i){let a=n,o=0,s=!1;if(a===105)return(e.s.charCodeAt(++e.p)!==110||e.s.charCodeAt(++e.p)!==102)&&dR.x(`invalid value`,e,t),e.p++,(r||1)/0;if(a===110)return(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==110)&&dR.x(`invalid value`,e,t),e.p++,NaN;if(a===48){if(++e.p>=e.s.length||hR(a=e.s.charCodeAt(e.p),i))return e.bi===!0?0n:0;if(!r){if(a===120)return vR(e,t,16,i);if(a===98)return vR(e,t,2,i);if(a===111)return vR(e,t,8,i)}a===46?o=2:a===101||a===69?o=4:dR.x(`illegal leading zero`,e,t)}else mR(a)||dR.x(`invalid value`,e,t);for(;++e.p<e.s.length&&(a=e.s.charCodeAt(e.p),!hR(a,i));)o||=1,a===95?(o&1||dR.x(`illegal underscore`,e),o+=11,s=!0):o===1&&a===46?o=2:(o===1||o===3)&&(a===101||a===69)?o=4:o===4&&(a===43||a===45)?o=6:mR(a)?o>9?o-=11:o&1||o++:dR.x(`illegal character in numeric literal`,e);if(!o){let t=(n-48)*(r||1);return e.bi===!0?BigInt(t):t}o&1||dR.x(`unfinished numeric value`,e,t);let c=e.s.slice(t,e.p);return s&&(c=c.replaceAll(`_`,``)),o>1?parseFloat(c):yR(e,c,10,t)}function vR(e,t,n,r){let i,a=1;for(;++e.p<e.s.length&&(i=e.s.charCodeAt(e.p),!hR(i,r));)i===95?(a&1&&dR.x(`illegal underscore`,e),a=3):mR(i,n)?a&1&&a--:dR.x(`illegal character in numeric literal`,e);a&1&&dR.x(`unfinished numeric value`,e);let o=e.s.slice(t+2,e.p);return a&&(o=o.replaceAll(`_`,``)),yR(e,o,n,t)}function yR(e,t,n,r){if(e.bi!==!0)int:{let i=parseInt(t,n);if(!Number.isSafeInteger(i)){if(e.bi)break int;dR.x(`integer value cannot be represented losslessly`,e,r)}return i}return BigInt(n===10?t:(n===2?`0b`:n===8?`0o`:`0x`)+t)}function jwe(e,t,n){let r=e.p++,i;if(!mR(t)||!mR(e.s.charCodeAt(e.p++))||!mR(e.s.charCodeAt(e.p++))||!mR(e.s.charCodeAt(e.p++)))return _R(e,e.p=r,t,0,n);if(e.p+=5,mR(e.s.charCodeAt(e.p++))||dR.x(`invalid date-time: date part is malformed`,e,r),e.p>=e.s.length||((t=e.s.charCodeAt(e.p))!==32||(i=!0,!mR(e.s.charCodeAt(e.p+1))))&&t!==84&&t!==116)return bR(e,e.s.slice(r,e.p),3,!1,r);if(e.s.charCodeAt(e.p+=3)!==58&&dR.x(`invalid date-time: time part is malformed`,e,r),e.s.charCodeAt(e.p+=3)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;mR(e.s.charCodeAt(++e.p)););if(t=e.s.charCodeAt(e.p)){if(t===90||t===122)return bR(e,e.s.slice(r,++e.p),1,i,r,`[+00:00]`);if(t===43||t===45)return bR(e,e.s.slice(r,e.p+=6),1,i,r,!e.ld&&`[`+e.s.slice(e.p-6,e.p)+`]`)}return bR(e,e.s.slice(r,e.p),2,i,r)}function Mwe(e,t,n){let r=e.p;if(!mR(t)||!mR(e.s.charCodeAt(++e.p)))return _R(e,--e.p,t,0,n);if(e.s.charCodeAt(e.p+=4)===58&&(e.p+=3),e.s.charCodeAt(e.p)===46)for(;mR(e.s.charCodeAt(++e.p)););return bR(e,e.s.slice(r,e.p),4,!1,r)}function bR(e,t,n,r,i,a){if(e.ld){let a=new pR(t,n,r);return a.isValid()||dR.x(`invalid date`,e,i),a}try{switch(a&&(t+=a),n){case 1:return Temporal.ZonedDateTime.from(t);case 2:return Temporal.PlainDateTime.from(t);case 3:return Temporal.PlainDate.from(t);case 4:return Temporal.PlainTime.from(t)}}catch(t){dR.x(t instanceof Error?t.message:``+t,e,i)}}
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function Nwe(e){for(;e.p<e.s.length;e.p++){let t=e.s.charCodeAt(e.p);if(t===10)break;if(t===13&&e.s.charCodeAt(e.p+1)===10){e.p++;break}(t<32&&t!==9||t===127)&&dR.x(`control characters are not allowed in comments`,e)}}function xR(e,t,n){let r;for(;e.p<e.s.length;){for(;e.p<e.s.length&&((r=e.s.charCodeAt(e.p))===32||r===9||!t&&(r===10||r===13&&e.s.charCodeAt(e.p+1)===10));)e.p++;if(n||r!==35)break;Nwe(e)}}
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function SR(e,t=61){let n,r=0,i=[],a,o=e.s.charCodeAt(n=e.p);do if(o===t)return r||dR.x(`unexpected end of key`,e),r===1&&i.push(e.s.slice(a,e.p)),e.p++,i;else o===46?(r||dR.x(`illegal empty bare key`,e),r===1&&i.push(e.s.slice(a,e.p)),r=0):!r&&(o===34||o===39)?(o===e.s.charCodeAt(e.p+1)&&o===e.s.charCodeAt(e.p+2)&&dR.x(`illegal quoted key: multiline strings are not allowed`,e),i.push(fR(e)),r=2,e.p--):o===32||o===9?r===1&&(i.push(e.s.slice(a,e.p)),r=2):r===2||o<48&&o!==45||o>57&&o<65||o>90&&o<97&&o!==95||o>122?dR.x(`illegal character in key`,e):r||(r=1,a=e.p);while(o=e.s.charCodeAt(++e.p));dR.x(`incomplete key-value: cannot find end of key`,e,n)}function Pwe(e){let t=e.p++,n=Object.create(null),r=new Set,i;for(;e.p<e.s.length;){if(xR(e),(i=e.s.charCodeAt(e.p))===125)return e.p++,n;let t,a=n,o=!1,s=e.p,c=SR(e);for(let n=0;n<c.length;n++){n&&(a=o?a[t]:a[t]=Object.create(null)),t=c[n],(o=Object.hasOwn(a,t))&&(typeof a[t]!=`object`||r.has(a[t]))&&dR.x(`trying to redefine an already defined value`,e,s);let i=t===`__proto__`;if(e.uk&&(i||t===`constructor`)){a=e.uk!==1&&dR.x(`document contains an unsafe property`,e,s);break}!o&&i&&Object.defineProperty(a,t,{enumerable:!0,configurable:!0,writable:!0})}o&&dR.x(`trying to redefine an already defined value`,e,s),xR(e,!0,!0);let l=gR(e,125);if(a&&typeof(a[t]=l)==`object`&&r.add(l),xR(e),(i=e.s.charCodeAt(e.p++))===125)return n;i!==44&&dR.x(`expected comma or end of structure`,e,e.p-1)}dR.x(`unfinished table`,e,t)}function Fwe(e){let t=e.p++,n=[],r;for(;e.p<e.s.length;){if(xR(e),(r=e.s.charCodeAt(e.p))===93)return e.p++,n;if(n.push(gR(e,93)),xR(e),(r=e.s.charCodeAt(e.p++))===93)return n;r!==44&&dR.x(`expected comma or end of structure`,e,e.p-1)}dR.x(`unfinished array`,e,t)}
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function CR(e,t,n,r,i){let a=n,o=r,s,c=!1,l;for(let n=0;n<t.length;n++){if(n){if(a=c?a[s]:a[s]=Object.create(null),o=(l=o[s]).c,i===0&&(l.t===1||l.t===2))return null;if(l.t===2){let e=a.length-1;a=a[e],o=o[e].c}}if(s=t[n],(c=Object.hasOwn(a,s))&&o[s]?.t===0&&o[s]?.d)return null;if(!c){let r=s===`__proto__`;if(e.uk&&(r||s===`constructor`))return!1;r&&(Object.defineProperty(a,s,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(o,s,{enumerable:!0,configurable:!0,writable:!0})),o[s]={t:n<t.length-1&&i===2?3:i,d:!1,i:0,c:Object.create(null)}}}if(l=o[s],l.t!==i&&(i!==1||l.t!==3)||(i===2&&(l.d||(l.d=!0,a[s]=[]),a[s].push(a=Object.create(null)),l.c[l.i++]=l={t:1,d:!1,i:0,c:Object.create(null)}),l.d))return null;if(l.d=!0,i===1)a=c?a[s]:a[s]=Object.create(null);else if(i===0&&c)return null;return[s,a,l.c]}function wR(e,t,n){(t===null||e.uk===2)&&dR.x(t===null?`trying to redefine an already defined table or value`:`document contains an unsafe property`,e,n)}function Iwe(e,t={}){let n={s:e,p:0,d:t.maxDepth??1e3,bi:t.integersAsBigInt??!1,ld:t.useLegacyDate??!0,uk:t.unsafeKeyBehaviour===`throw`?2:+(t.unsafeKeyBehaviour===`drop`)},r=Object.create(null),i=Object.create(null),a,o=!1,s=r,c=i;for(e.charCodeAt(0)===65279&&n.p++,xR(n);n.p<e.length;){if(e.charCodeAt(n.p)===91){let t=e.charCodeAt(++n.p)===91;a=n.p+=+t,o=!1;let l=SR(n,93);t&&(e.charCodeAt(n.p)!==93&&dR.x(`expected end of table array declaration`,n),n.p++);let u=CR(n,l,r,i,t?2:1);u?(c=u[2],s=u[1]):(wR(n,u,a),o=!0)}else{a=n.p;let e=CR(n,SR(n),s,c,0);!e&&!o&&wR(n,e,a),xR(n,!0,!0);let t=gR(n,void 0);e&&!o&&(e[1][e[0]]=t)}xR(n,!0),n.p<e.length&&(a=e.charCodeAt(n.p))!==10&&(a!==13||e.charCodeAt(n.p+1)!==10)&&dR.x(`each key-value declaration must be followed by an end-of-line`,n),xR(n)}return r}
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var Lwe=/^[a-z0-9-_]+$/i,TR=!!``.isWellFormed;function ER(e){let t=typeof e;if(t===`object`){if(Array.isArray(e))return`array`;if(typeof e.getUTCDate==`function`&&e instanceof Date)return`date`;if(globalThis.Temporal){if(e.until){if(e instanceof Temporal.ZonedDateTime)return`temporal/tz+uc`;if(e instanceof Temporal.PlainDateTime||e instanceof Temporal.PlainDate)return`temporal/uc`;if(e instanceof Temporal.PlainTime||e instanceof Temporal.Instant)return`temporal`;if(e instanceof Temporal.PlainYearMonth)return`temporal/x`}else if(e.toPlainDate&&e instanceof Temporal.PlainMonthDay||e.negated&&e instanceof Temporal.Duration)return`temporal/x`}}return t}function Rwe(e){for(let t=0;t<e.length;t++)if(ER(e[t])!==`object`)return!1;return e.length!=0}function DR(e){return JSON.stringify(e).replaceAll(``,`\\u007f`)}function zwe(e){return DR(TR?e.toWellFormed():e)}function OR(e){if(Lwe.test(e))return e;if(TR&&!e.isWellFormed())throw RangeError(`key contains illegal lone surrogates`);return DR(e)}function kR(e,t,n,r,i){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);switch(t){case`number`:if(isNaN(e))return`nan`;if(e===1/0)return`inf`;if(e===-1/0)return`-inf`;if(Number.isInteger(e)&&(r||!Number.isSafeInteger(e)))return e.toFixed(1);case`bigint`:case`boolean`:case`temporal`:return e.toString();case`string`:return zwe(e);case`date`:if(isNaN(e.getTime()))throw TypeError(`cannot serialize invalid date`);return e.toISOString();case`object`:return Bwe(e,n,r,i);case`array`:return Vwe(e,n,r,i);case`temporal/tz+uc`:if(i){let t=e.timeZoneId,n=t.charCodeAt(0);if(n!==43&&n!==45&&(n!==85&&n!==71&&n!==90&&n!==69||t!==`UTC`&&t!==`UCT`&&t!==`Universal`&&t!==`Zulu`&&!t.startsWith(`GMT`)&&t!==`Greenwich`&&!t.startsWith(`Etc/`)))throw TypeError(`Temporal objects with an IANA timezone are not allowed in Temporal strict mode`)}case`temporal/uc`:if(i&&e.calendarId!==`iso8601`)throw TypeError(`Temporal objects with a non-default calendar are not allowed in Temporal strict mode`);return e.toString({calendarName:`never`,timeZoneName:`never`});case`temporal/x`:throw TypeError(`Unsupported `+e[Symbol.toStringTag])}}function Bwe(e,t,n,r){let i=Object.keys(e);if(i.length===0)return`{}`;let a=`{ `;for(let o=0;o<i.length;o++){let s=i[o];o&&(a+=`, `),a+=OR(s)+` = `+kR(e[s],ER(e[s]),t-1,n,r)}return a+` }`}function Vwe(e,t,n,r){if(e.length===0)return`[]`;let i=`[ `;for(let a=0;a<e.length;a++){if(a&&(i+=`, `),e[a]===null||e[a]===void 0)throw TypeError(`arrays cannot contain null or undefined values`);i+=kR(e[a],ER(e[a]),t-1,n,r)}return i+` ]`}function Hwe(e,t,n,r,i){if(n===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let a=``;for(let o=0;o<e.length;o++)a+=`${a&&`
`}[[${t}]]\n`,a+=AR(0,e[o],t,n,r,i);return a}function AR(e,t,n,r,i,a){if(r===0)throw Error(`Could not stringify the object: maximum object depth exceeded`);let o=``,s=``,c=Object.keys(t);for(let e=0;e<c.length;e++){let l=c[e];if(t[l]!==null&&t[l]!==void 0){let e=ER(t[l]);if(e===`symbol`||e===`function`)throw TypeError(`cannot serialize values of type '${e}'`);let c=OR(l);if(e===`array`&&Rwe(t[l]))s+=(s&&`
`)+Hwe(t[l],n?`${n}.${c}`:c,r-1,i,a);else if(e===`object`){let e=n?`${n}.${c}`:c;s+=(s&&`
`)+AR(e,t[l],e,r-1,i,a)}else o+=c,o+=` = `,o+=kR(t[l],e,r,i,a),o+=`
`}}return e&&(o||!s)&&(o=o?`[${e}]\n${o}`:`[${e}]`),o&&s?`${o}\n${s}`:o||s}function Uwe(e,{maxDepth:t=1e3,numbersAsFloat:n=!1,strictTemporal:r=!1}={}){if(ER(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let i=AR(0,e,``,t,n,r);return i[i.length-1]===`
`?i:i+`
`}
/*!
* Copyright (c) Squirrel Chat et al., All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var Wwe=/(?<![\w.:+-])(?:\d{4}-\d{2}-\d{2}(?:[Tt ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:[Zz]|[+-]\d{2}:\d{2})?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)(?![\w.:+-])/g,Gwe=/(?<![\w.:+-])[-+]?(?:0x[\da-fA-F_]+|0o[0-7_]+|0b[01_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][-+]?\d[\d_]*)?)(?![\w.:+-])/g,Kwe=/"""[\s\S]*?"""(?!")|'''[\s\S]*?'''(?!')|"(?:[^"\\\n]|\\.)*"|'[^'\n]*'|#[^\n]*/g,qwe=/^[-+]?\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][-+]?\d[\d_]*)?$/,Jwe=class extends pR{#e;constructor(e,t){super(e),this.#e=t}toISOString(){return this.#e}},Ywe=(e,t)=>{let n=tR(t,e,qwe)?t:JL(e);return Object.assign(new Date(0),{toISOString:()=>n})},Xwe=e=>{let t=new Map,n=new Set;return e.replace(Kwe,` `).match(Gwe)?.forEach(e=>{let r=!/^[-+]?0[xob]/.test(e)&&/[.eE]/.test(e),i=Number(e.replaceAll(`_`,``));r?Number.isInteger(i)&&YL(t,i,e):n.add(i)}),n.forEach(e=>{t.delete(e)}),t},Zwe=e=>{let t=new Map;return e.match(Wwe)?.forEach(e=>{let n=new pR(e);n.isValid()&&YL(t,n.toISOString(),e)}),t},Qwe=(e,t)=>{let n={},r,i,a=(t,o)=>{if(t instanceof pR){let i=t.toISOString();r??=Zwe(e),n[o]={value:i,source:r.get(i)??i}}else Number.isInteger(t)?(i??=KL(e)?Xwe(e):new Map,i.has(t)&&(n[o]={value:t,source:i.get(t)??JL(t)})):(Array.isArray(t)||E(t))&&Object.entries(t).forEach(([e,t])=>{a(t,XL(o,e))})};return a(t,``),n},$we=({path:e,str:t,parsed:n})=>{QL(e,Qwe(t,n))},eTe=(e,t)=>e===t||e instanceof pR&&e.toISOString()===t,tTe=(e,{value:t,source:n})=>typeof t==`number`?e===t?Ywe(t,n):void 0:eTe(e,t)?new Jwe(t,n):void 0,nTe=(e,t)=>eR(e,t,tTe),rTe=(e,t,n)=>vwe(e,cR(e,t,n),n),jR=(e,t)=>{if(t===void 0||!KL(e))return iR(e)?JSON.parse(e,cR):JSON.parse(e);let{value:n,sourceMap:r}=ywe(JSON.parse(e,rTe));return QL(t,r),n},MR=(e,t)=>{let n=sR(Iwe(e,{integersAsBigInt:`asNeeded`}));return t!==void 0&&$we({path:t,str:e,parsed:n}),vr(n)},iTe=(e,t,n)=>{let r=HL(e,t);if(r.warnings.forEach(e=>console.warn(e)),r.errors.length)throw r.errors[0];return QL(n,_we(r)),r.toJS(t)},NR=(e,t,n)=>{let r=iR(e),i=r?{...t,intAsBigInt:!0}:t,a=n!==void 0&&KL(e)?iTe(e,i,n):fwe(e,i);return r?sR(a):a},aTe=e=>lA.find(t=>e.startsWith(cA[t][0]))??`yaml-frontmatter`,oTe=/^\{\n(?<head>\{[\s\S]*?\})\n\}(?:\n\n(?<body>[\s\S]*))?$/,sTe=(e,t)=>{let n=e.trim();return jR(n.startsWith(`{`)?n:`{${n}}`,t)},PR={yaml:(e,t)=>NR(e,void 0,t),toml:MR,json:jR},cTe={...PR,json:sTe},lTe=new Map,uTe=({collection:e,collectionFile:t,isIndexFile:n,format:r,text:i,path:a})=>{let{format:o,fmDelimiters:s,bodyField:{key:c=`body`,inline:l=!1}={}}=$A({collection:e,collectionFile:t,isIndexFile:n}),[u,d]=(o===`frontmatter`?ZA({format:r,delimiter:s}):s)??cA[`yaml-frontmatter`],f=xE(u),p=xE(d),m=PA(lTe,`${f}|${p}`,()=>RegExp(`^${f}[ \t]*\n(?:(?<head>[\\s\\S]*?)\n)?${p}[ \t]*(?:\n(?<body>[\\s\\S]*))?$`,`s`)),h=(r===`json-frontmatter`&&u===`{`&&d===`}`?i.match(oTe)?.groups:void 0)??i.match(m)?.groups;if(!h)return{[c]:i};let{head:g=``,body:_}=h,v=lA.includes(r)?pA(r):void 0,y=v?cTe[v](g,a):{};return(!y||typeof y!=`object`||Array.isArray(y))&&(y={}),{...y,...!Object.hasOwn(y,c)&&(!l||_?.trim())?{[c]:_?.replace(/^\n/,``)}:{}}},FR=({path:e,folder:{collectionName:t,fileName:n}})=>{let r=fj(t),i=r&&n?xj(r,n):void 0;if(!r)throw Error(`Collection not found`);if(n&&!i)throw Error(`Collection file not found`);let a=!i&&iA(r,e),{format:o}=$A({collection:r,collectionFile:i,isIndexFile:a});return{collection:r,collectionFile:i,isIndexFile:a,format:o}},dTe=e=>{try{return!!ik.get(FR(e).format)?.parser}catch{return!1}},fTe=async({text:e=``,path:t,folder:n})=>{let r=FR({path:t,folder:n}),{collection:i,collectionFile:a,isIndexFile:o}=r,{format:s}=r;WL.delete(t),e=e.trim().replace(/\r\n?/g,`
`);let c=ik.get(s)?.parser;if(c)return c(e);if(s===`raw`)return{body:e};try{if(s===`frontmatter`){let n=aTe(e);nR.set(t,n),s=n}if(lA.includes(s))return uTe({collection:i,collectionFile:a,isIndexFile:o,format:s,text:e,path:t});let n=pA(s);if(n)return PR[n](e,t)}catch(e){throw Error(`${t} could not be parsed due to ${e.name}: ${e.message}`)}throw ik.has(s)?Error(`${t} could not be parsed, as no \`fromFile\` method was registered for the custom “${s}” format with \`CMS.registerCustomFormat()\``):Error(`${t} could not be parsed due to an unknown format: ${s}`)},pTe=async()=>{let{scheduler:e}=globalThis;typeof e?.yield==`function`?await e.yield():await pl()},mTe=async(e,t,{budget:n=50}={})=>{let r=performance.now();for(let i=0;i<e.length;i+=1)performance.now()-r>=n&&(await pTe(),r=performance.now()),await t(e[i])},IR=()=>{let e=0;return{next:()=>{e+=1;let t=e;return()=>t===e}}},LR=e=>{let t=0,n=[];return async r=>{t>=e?await new Promise(e=>{n.push(()=>e(void 0))}):t+=1;try{return await r()}finally{let e=n.shift();e?e():--t}}},RR=e=>/\/_index(?:\.[\w-]+)?\.md$/.test(e),hTe=/{{([^]*?)}}/,gTe=new Map,zR=({subPath:e,subPathTemplate:t})=>{if(t?.includes(`{{slug}}`)){let n=PA(gTe,t,()=>{let e=t.split(hTe).map((e,t)=>t%2==0?xE(e):e===`slug`?`([^/]+)`:`[^/]+?`).join(``);return RegExp(`^${e}$`)}),[,r]=e.match(n)??[];if(r)return r}return e},BR=(e,t=new Set)=>{if(typeof e!=`object`||!e)return!1;if(t.has(e))return!0;t.add(e);let n=Object.values(e).some(e=>BR(e,t));return t.delete(e),n},_Te=()=>`${lk}\n${wk.current}`,vTe=({parsedFileMap:e,path:t,key:n,content:r})=>{try{e.set(t,{key:n,content:structuredClone(r),format:nR.get(t),valueSources:WL.get(t)})}catch{}},yTe=async(e,t,n)=>{let{path:r,parsed:i}=e,a=_Te(),o=dTe(e);if(i?.key===a&&!o)return i.format?nR.set(r,i.format):nR.delete(r),i.valueSources?WL.set(r,i.valueSources):WL.delete(r),i.content;try{if(e.text===void 0)throw Error(`${r} could not be read.`);let t=await fTe(e);if(BR(t))throw Error(`${r} could not be parsed, as it contains a circular reference.`);return n&&!o&&!iR(e.text)&&vTe({parsedFileMap:n,path:r,key:a,content:t}),t}catch(e){console.error(e),t.push(e);return}},VR=({rawContent:e,fields:t,i18nSingleFile:n,validate:r})=>{let i=t[0].name;if(n)return!E(e)||!Object.values(e).every(r)?void 0:Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{[i]:t}]));if(r(e))return{[i]:e}},HR=(e,t,n)=>{if(!E(e))return;let r=t.filter(e=>e!==n),i=Object.fromEntries(Object.entries(e).filter(([e])=>!r.includes(e))),a={[n]:i};return r.forEach(t=>{E(e[t])&&(a[t]=e[t])}),a},bTe=(e,t,n)=>{let r={rawContent:e,fields:t,i18nSingleFile:n};return gM(t,`list`)?VR({...r,validate:oF(t[0])?e=>E(e)||Array.isArray(e):Array.isArray}):gM(t,`keyvalue`)?VR({...r,validate:e=>E(e)&&Object.values(e).every(e=>typeof e==`string`)}):E(e)?e:void 0},UR=(e,t,n)=>{let r=bTe(e,t,n);if(r)return n?Object.fromEntries(Object.entries(r).map(([e,n])=>[e,cF(n,t,!0)])):cF(r,t,!0)},xTe=(e,t,n,r,i)=>r?.split(`/`).pop()===`_index`&&/\/_index(?:\.[\w-]+)?\.[\w]+$/.test(e)&&i!==`md`?!0:RR(e)?!(t||rA(n)?.name===`_index`||r?.split(`/`).pop()===`_index`&&i===`md`||DA(n)===`_index`):!1,STe=({file:e,fileName:t,fullPathRegEx:n,defaultLocale:r,isMultiFileStructure:i})=>{let{path:a,folder:{filePathMap:o}}=e;if(t){if(i){let[e,t]=Object.entries(o??{}).find(([,e])=>e===a)??[];return{subPath:t,locale:e}}return{subPath:a,locale:void 0}}if(!n)return{subPath:void 0,locale:void 0};let s=a.match(n);if(!s?.groups)return{subPath:void 0,locale:void 0};let{subPath:c,locale:l=r}=s.groups;return{subPath:c,locale:l}},WR=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a})=>{let o=r||zR({subPath:i,subPathTemplate:a});e.slug=o,e.locales._default={slug:o,path:n,content:zj(t)}},GR=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,allLocales:o})=>{let s=r||zR({subPath:i,subPathTemplate:a});e.slug=s,e.locales=Object.fromEntries(o.filter(e=>E(t[e])).map(e=>[e,{slug:s,path:n,content:zj(t[e])}]))},CTe=({entry:e,rawContent:t,path:n,fileName:r,subPath:i,subPathTemplate:a,locale:o,defaultLocale:s,collectionName:c,canonicalSlugKey:l,entryMap:u})=>{let d=l&&typeof t[l]==`string`?t[l]:void 0,f=r||zR({subPath:i,subPathTemplate:a}),p={slug:f,path:n,content:zj(t)},m=`${c}/${r||(d??i)}`,h=u.get(m);return h?(h.locales[o]=p,o!==s&&h.slug||(h.slug=f,h.subPath=i),!0):(e.id=m,e.locales[o]=p,e.slug=f,u.set(m,e),!1)},KR=new Map,qR=({collection:e,item:t,index:n,path:r,meta:i={}})=>{let{fields:a,_i18n:{i18nEnabled:o,allLocales:s,defaultLocale:c,structureMap:{i18nSingleFileDefaultRoot:l}}}=e,u=l?HR(t,s,c):t,d=u?UR(u,a,o):void 0;if(!d)return;let f=String(n),p={id:``,slug:``,subPath:f,locales:{},arrayIndex:n,...i};return o?GR({entry:p,rawContent:d,path:r,subPath:f,allLocales:s}):WR({entry:p,rawContent:d,path:r,subPath:f}),Object.keys(p.locales).length?p:void 0},wTe=({collection:e,file:t,rawContent:n,entries:r,errors:i})=>{let{path:a,meta:o={}}=t;Array.isArray(n)?(KR.set(a,n),n.forEach((t,n)=>{let i=qR({collection:e,item:t,index:n,path:a,meta:o});i&&r.push(i)})):(KR.set(a,null),i.push(Error(`${a} could not be parsed, as it doesn’t contain an array.`)))},TTe=async({file:e,entries:t,entryMap:n,errors:r,parsedFileMap:i})=>{let a=await yTe(e,r,i),{path:o,meta:s={},folder:{collectionName:c,fileName:l}}=e,{collection:u,collectionFile:d}=Sj(c,l)??{},f=!d&&u?._type===`entry`&&u._file.arrayFile;if(!a){f&&KR.set(o,null);return}if(!u)return;if(f){wTe({collection:u,file:e,rawContent:a,entries:t,errors:r});return}let{fields:p=[],_file:{fullPathRegEx:m,subPath:h,extension:g},_i18n:{i18nEnabled:_,allLocales:v,defaultLocale:y,structureMap:b,canonicalSlug:{key:x}}}=d??u,S=!d&&iA(u,o)&&rA(u)?.fields||p,C=b.i18nSingleFileDefaultRoot?HR(a,v,y):a;if(!C)return;let w=ij(b),T=UR(C,S,w);if(!T||xTe(o,l,u,h,g))return;let ee=aj(b),{subPath:te,locale:ne}=STe({file:e,fileName:l,fullPathRegEx:m,defaultLocale:y,isMultiFileStructure:ee});if(!te||ee&&!ne)return;let re={id:``,slug:``,subPath:te,locales:{},...s},ie={entry:re,rawContent:T,path:o,fileName:l,subPath:te,subPathTemplate:h};if(!_)WR(ie);else if(w)GR({...ie,allLocales:v});else if(CTe({...ie,locale:ne,defaultLocale:y,collectionName:c,canonicalSlugKey:x,entryMap:n}))return;t.push(re)},JR=async(e,{parsedFileMap:t}={})=>{let n=[],r=new Map,i=[];return await mTe(e,async e=>{try{await TTe({file:e,entries:n,entryMap:r,errors:i,parsedFileMap:t})}catch(e){console.error(e),i.push(e)}}),{entries:n.filter(e=>(e.id=ml(),!!e.slug&&!!Object.keys(e.locales).length)),errors:i}},ETe=/^\/(?<pattern>.+)\/(?<flags>[dgimsuvy]*)$/,YR=/[gy]/g,XR=e=>{if(e instanceof RegExp){let t=e.flags.replace(YR,``);return t===e.flags?e:new RegExp(e.source,t)}if(typeof e==`string`){let{pattern:t,flags:n}=e.match(ETe)?.groups??{pattern:e};if(t)try{return new RegExp(t,n?.replace(YR,``))}catch{}}},ZR=pk([]),DTe=hk(()=>new Set(ZR.current.map(e=>e.id))),OTe=new WeakMap,kTe=e=>PA(OTe,e,()=>{let{filter:t}=e._type===`entry`?e:{},n=t?.field;if(n!==void 0)return{field:n,pattern:XR(t?.pattern),values:t?.value===void 0?[]:Array.isArray(t.value)?t.value:[t.value]}}),QR=(e,t)=>{let n=kTe(e);if(!n||aA(e,t))return!0;let{field:r,pattern:i,values:a}=n,o=LB({entry:t,locale:e._i18n.defaultLocale,collectionName:e.name,key:r}),s=Array.isArray(o)?o:[o??null];return i?s.some(e=>e!=null&&i.test(String(e))):s.some(e=>a.includes(e))},$R=e=>AP(e).filter(t=>!t.hide&&QR(t,e)),ez={entrySource:void 0,folderSource:void 0,buckets:void 0,map:new Map,folderMap:new Map},tz=()=>{if(!ez.buckets){let e=new Map;vj.current.forEach(t=>{new Set(AP(t).map(({name:e})=>e)).forEach(n=>{PA(e,n,()=>[]).push(t)})}),ez.buckets=e}return ez.buckets},ATe=e=>{let t=fj(e);return t?(tz().get(e)??[]).filter(e=>QR(t,e)):[]},nz=()=>{let e=vj.current,t=_j.current;(e!==ez.entrySource||t!==ez.folderSource)&&(ez.entrySource=e,ez.folderSource=t,ez.buckets=void 0,ez.map=new Map,ez.folderMap=new Map)},rz=e=>{nz();let t=ez.map.get(e);if(t)return t;let n=ATe(e);return ez.map.set(e,n),n},jTe=(e,t)=>{let{_file:{fullPathRegEx:n=void 0,subPath:r=void 0}={}}=e._type===`entry`?e:{};if(!n)return[];let{defaultLocale:i}=e._i18n,a=new Set(t);return vj.current.flatMap(e=>{if(a.has(e))return[];let t={},o={};Object.values(e.locales).forEach(e=>{let{subPath:a,locale:s=i}=e.path.match(n)?.groups??{};a&&(t[s]={...e,slug:zR({subPath:a,subPathTemplate:r})},o[s]=a)});let s=QP(t,i);if(!s)return[];let{slug:c}=t[s],l=o[s];return[{...e,slug:c,subPath:l,locales:t}]})},iz=e=>(nz(),PA(ez.folderMap,e,()=>{let t=fj(e),n=tz().get(e)??[];return t?[...n,...jTe(t,n)]:n})),az=(e,t)=>{let n=fj(e);return!n||nA(n)===void 0?t.length:t.filter(e=>!aA(n,e)).length},MTe=e=>rA(e)?!rz(e.name).some(t=>aA(e,t)):!1,NTe=`order`,oz=e=>e?._type===`entry`&&(!!e.reorder||jk(e)),sz=e=>{let t=e?.reorder;if(t&&typeof e.file!=`string`)return E(t)&&typeof t.key==`string`&&t.key?t.key:NTe},cz=e=>{let t=e?.reorder;if(E(t)&&typeof t.group==`string`&&t.group)return t.group},lz=e=>{if(jk(e))return e=>e.arrayIndex??0;let t=sz(e);if(!t)return()=>void 0;let{defaultLocale:n}=e._i18n;return e=>{let r=e.locales[n]?.content?.[t],i=typeof r==`number`||typeof r==`string`&&r.trim()?Number(r):NaN;return Number.isFinite(i)?i:void 0}},uz=(e,t)=>{let n=lz(t),r=e.map(e=>({entry:e,v:n(e)}));return r.sort((e,t)=>e.v!==void 0&&t.v!==void 0?e.v-t.v:e.v===void 0?t.v===void 0?0:1:-1),r.map(({entry:e})=>e)},dz=e=>e?.identifier_field??`title`,PTe=new WeakMap,FTe=e=>PA(PTe,e,()=>{let t=new Map;return e.forEach(({value:e,label:n})=>{t.has(e)||t.set(e,n)}),t}),ITe=new WeakMap,fz=0,pz=e=>PA(ITe,e,()=>{let e=fz;return fz+=1,e}),mz=e=>gN(e)?e:e===`slug`?`{{fields.slug}}`:`{{${e}}}`,LTe=e=>{if(!e||e.widget!==`list`)return!1;let t=`fields`in e,n=`types`in e;return t||n},hz={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,timeZoneName:`longOffset`},gz=new Map,RTe=e=>{let t=e??``,n=gz.get(t);return n||(n=new Intl.DateTimeFormat(`en-US`,{...hz,hourCycle:`h23`,timeZone:e}),gz.set(t,n)),n},_z=({date:e=new Date,timeZone:t=void 0}={})=>Object.fromEntries(RTe(t).formatToParts(e).filter(({type:e})=>e in hz).map(({type:e,value:t})=>[e,t])),zTe=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),vz={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function yz(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function BTe(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function VTe(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function bz(e){return VTe(e)||yz(e)}var xz=document.createElement(`i`);function Sz(e){let t=`&`+e+`;`;xz.innerHTML=t;let n=xz.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}var HTe=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function Cz(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?bz:u===`decimal`?yz:BTe;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&zTe.includes(y)&&(_=y,v=Sz(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`&&Sz(y);e&&(_=y,v=e)}let S=1+l-o,C=``;if(x||n.nonTerminated!==!1){if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):bz(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(UTe(e))h(7,S),C=`�`;else if(e in vz)h(6,S),C=vz[e];else{let t=``;WTe(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,HTe[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function UTe(e){return e>=55296&&e<=57343||e>1114111}function WTe(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var wz=e=>e?.name||e?.login||e?.email,GTe=/^#+[^\S\n\r\u2028\u2029]+(.*)$/gm,KTe=e=>{if(!e.endsWith(`}`))return e;for(let t=e.indexOf(`{#`,1);t>0&&!(t+2>=e.length-1);t=e.indexOf(`{#`,t+1))if(/\s/.test(e[t-1]))return e.slice(0,t).trimEnd();return e},qTe=e=>e.matchAll(GTe).map(([,e])=>KTe(e.trim())).find(e=>!!e)??``,Tz=(e,{allowMarkdown:t=!1}={})=>(e=pr(e),t&&(e=Cz(e)),e=_t(e,{ALLOWED_TAGS:t?[`strong`,`em`,`code`]:[],ALLOWED_ATTR:[]}),t||(e=Cz(e)),e.trim()),Ez=(e,{identifierField:t=`title`,useBody:n=!0}={})=>{let r=[t,`title`,`name`,`label`].find(t=>typeof e[t]==`string`&&!!e[t].trim());return r?e[r].trim():n&&typeof e.body==`string`?qTe(e.body):``},JTe=(e,t)=>{let{slug:n,entryPath:r,basePath:i,fullPathRegEx:a,locales:o,localeSuffixes:s,commitDate:c,commitAuthor:l}=t;if(e===`slug`)return n;if(e===`locales`)return o.sort((e,t)=>e.localeCompare(t)).join(`, `);if(e===`dirname`)return tF(r,{basePath:i,fullPathRegEx:a});if(e===`filename`||e===`extension`)return vN(r,s)[e];if(e===`commit_date`)return c??``;if(e===`commit_author`)return wz(l)},Dz=!1,Oz=(e,t)=>{let{content:n,collectionName:r,replaceSubContext:i,locale:a,fallbackSummary:o}=t,{value:s,transformations:c}=sP(e),l=_N(s),u={collectionName:r,valueMap:n,keyPath:l},d=JTe(s,i),f=fN(c,e=>Oz(e,t));if(d===void 0&&(f.some(({method:e})=>e===`date`||e===`ternary`)?d=Object.hasOwn(n,l)?n[l]:void 0:(bM(u)?.widget===`relation`&&(Dz=!0),d=IB({...u,locale:a})),l===`title`&&!d&&(d=o)),d===void 0)return``;if(d instanceof Date&&!f.length){let{year:e,month:t,day:n}=_z({date:d});return`${e}-${t}-${n}`}return f.length&&(d=cP({fieldConfig:bM({...u}),value:d,transformations:f,locale:a})),String(d)},YTe=new WeakMap,kz,Az=0,XTe=()=>{let e=vj.current;return e!==kz&&(kz=e,Az+=1),Az},ZTe=(e,t,{locale:n,useTemplate:r=!1,allowMarkdown:i=!1,template:a,useIndexFileLabel:o=!0}={})=>{if(o&&aA(e,t))return rA(e)?.label;let{_type:s,name:c,_i18n:{defaultLocale:l}}=e,{_file:{basePath:u,fullPathRegEx:d}={},summary:f}=s===`entry`?e:{},p=dz(s===`entry`?e:void 0),m=a??f,{locales:h,slug:g,commitDate:_,commitAuthor:v}=t,y=n??l,b=Object.hasOwn(h,y)?y:Object.keys(h)[0]??y,{content:x={},path:S=``}=h[b]??{},C=Ez(x,{identifierField:p})||g.replaceAll(`-`,` `);if(!r||!m)return Tz(C,{allowMarkdown:i});let w={content:x,collectionName:c,replaceSubContext:{slug:g,entryPath:S,basePath:u,fullPathRegEx:d,locales:Object.keys(h),localeSuffixes:yN(e),commitDate:_,commitAuthor:v},locale:b,fallbackSummary:C};return Tz(mN(m,(e,t)=>Oz(t,w)),{allowMarkdown:i})},jz=(e,t,n={})=>{let{locale:r,useTemplate:i=!1,allowMarkdown:a=!1,template:o,useIndexFileLabel:s=!0}=n,c=PA(PA(YTe,t,()=>new WeakMap),e,()=>new Map),l=[r??``,i?`1`:`0`,a?`1`:`0`,o??``,s?`1`:`0`,Jc.current].join(`
`),u=XTe(),d=c.get(l);if(d&&(d.generation===void 0||d.generation===u))return d.summary;let f=Dz;Dz=!1;let p=ZTe(e,t,n),m=Dz;return Dz=f||m,c.set(l,{summary:p,generation:m?u:void 0}),p},Mz=(e,t)=>{let n=e?.[t];return n==null?``:String(n)},Nz=(e,t,n,{stored:r=!1}={})=>{let{slug:i,locale:a,getDisplayValue:o}=t,{content:s,locales:c,defaultLocale:l}=n;if(e===`slug`)return i;if(e===`locale`)return a;let u=_N(e);return r?Mz(s,u)||Mz(c[l]?.content,u):o(u)||o(u,l)||``},QTe=(e,t)=>{let{content:n,locales:r,defaultLocale:i,identifierField:a}=t;return Ez(n,{identifierField:a})||Ez(r[i]?.content||{},{identifierField:a})||e.slug},Pz=(e,t,n,r)=>{let{label:i,value:a,searchValue:o}=e,s=!1;return t.forEach(e=>{let t=`{{${e}}}`,c=Nz(e,n,r);if(a.includes(t)){let i=Nz(e,n,r,{stored:!0});i||(s=!0),a=a.replaceAll(t,()=>i)}i=i.replaceAll(t,()=>c),o=o?.replaceAll(t,()=>c)??``}),{label:i.trim()||QTe(n,r),value:s?``:a,searchValue:o.trim()}},Fz=e=>{let t=[];return mN(e,(e,n)=>(t.push(n),``)),t},$Te=(e,t)=>{let n=e.value_field,r=e.display_fields??[n??`{{${t}}}`],i=e.search_fields??r,a=mz(n??`{{slug}}`),o=r.map(mz).join(` `),s=i.map(mz).join(` `),c=EO([...Fz(o),...Fz(a),...Fz(s)]);return{_valueField:a,_displayField:o,_searchField:s,allFieldNames:c,hasListFields:c.some(e=>e.includes(`*`))}},eEe=/\.(\d+)$/,tEe=(e,t)=>{let n=new Map;return e.filter(e=>e.includes(`*`)).forEach(e=>{let r=e.replace(/\.\*.*$/,``),i=bM({...t,keyPath:r});n.set(e,{baseFieldName:r,fieldConfig:i,isComplexListField:LTe(i)})}),Map.groupBy(n.entries(),([,{baseFieldName:e}])=>e)},Iz=({templates:e,replacements:t,staticFieldNames:n,context:r,fallbackContext:i})=>{let{_displayField:a,_valueField:o,_searchField:s}=e,c=e=>t.reduce((e,[t,n])=>e.replaceAll(`{{${t}}}`,()=>n),e),{label:l,value:u,searchValue:d}=Pz({label:c(a),value:c(o),searchValue:c(s)},n,r,i);return{label:l,value:t.some(([e,t])=>o.includes(`{{${e}}}`)&&String(t??``)===``)?``:u,searchValue:d||l}},nEe=new Map,Lz=(e,t,n=t)=>Object.entries(e).filter(([e])=>t.test(e)).map(([e,t])=>{let r=e.match(n);return{index:parseInt(r[1],10),value:t}}).sort((e,t)=>e.index-t.index),rEe=({baseFieldName:e,groupEntries:t,content:n,templates:r,allFieldNames:i,context:a,fallbackContext:o})=>{let s=Lz(n,PA(nEe,e,()=>RegExp(`^${xE(e)}\\.\\d+$`)),eEe),c=i.filter(e=>!e.includes(`*`));return s.map(({value:e})=>Iz({templates:r,replacements:t.map(([t])=>[t,e]),staticFieldNames:c,context:a,fallbackContext:o}))},Rz=/^(.+)\.\*\.(.+)$/,iEe=new Map,aEe=e=>{let t=null;return e.some(([e])=>(t=e.match(Rz),!!t)),t},oEe=({groupEntries:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a})=>{let[,o,s]=aEe(e)??[];if(!o)return[];let c=Lz(t,PA(iEe,`${o}:${s}`,()=>{let e=xE(o),t=xE(s);return RegExp(`^${e}\\.([0-9]+)\\.${t}$`)})),l=r.filter(e=>!e.includes(`*`));return c.map(({index:r})=>Iz({templates:n,replacements:e.flatMap(([e])=>{let[,n,i]=e.match(Rz)??[];return n?[[e,t[`${n}.${r}.${i}`]??``]]:[]}),staticFieldNames:l,context:i,fallbackContext:a}))},sEe=({baseFieldGroups:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a})=>{let o=[],s=!1;return e.forEach((e,c)=>{if(e.length===0)return;let[,l]=e[0],u={groupEntries:e,content:t,templates:n,allFieldNames:r,context:i,fallbackContext:a},d=l.isComplexListField?oEe({...u}):rEe({...u,baseFieldName:c});o.push(...d),s=!0}),{results:o,hasProcessedListFields:s}},cEe=({templates:e,allFieldNames:t,context:n,fallbackContext:r})=>{let{_displayField:i,_valueField:a,_searchField:o}=e,{label:s,value:c,searchValue:l}=Pz({label:i,value:a,searchValue:o},t,n,r);return{label:s,value:c,searchValue:l||s}},zz=e=>e.filter(({value:e})=>!!e),lEe=({refEntry:e,content:t,collection:n,templates:r,fileName:i,locale:a,identifierField:o,pendingEntries:s=void 0})=>{let{locales:c}=e,{name:l,_i18n:{defaultLocale:u}}=n,{allFieldNames:d,hasListFields:f}=r,p=kA(n,e.slug),m={collectionName:l,fileName:i,isIndexFile:aA(n,e),keyPath:``},h={slug:p,locale:a,getDisplayValue:(e,n)=>IB({...m,keyPath:e,valueMap:n?c[n]?.content??{}:t,locale:n??a,pendingEntries:s})},g={content:t,locales:c,defaultLocale:u,identifierField:o};if(!f)return zz([cEe({templates:r,allFieldNames:d,context:h,fallbackContext:g})]);let{results:_,hasProcessedListFields:v}=sEe({baseFieldGroups:tEe(d,m),content:t,templates:r,allFieldNames:d,context:h,fallbackContext:g});if(v)return zz(_);let{_displayField:y,_valueField:b,_searchField:x}=r,{label:S,value:C,searchValue:w}=Pz({label:y,value:b,searchValue:x},d.filter(e=>!e.includes(`*`)),h,g);return zz([{label:S,value:C,searchValue:w||S}])},uEe=/^{{fields\.(.+?)}}$/,dEe=new Map,Bz=(e,t)=>{let n=e[t];if(n!==void 0&&!Array.isArray(n))return n;let r=PA(dEe,t,()=>RegExp(`^${xE(t)}\\.\\d+$`)),i=Object.keys(e).filter(e=>r.test(e)).map(t=>e[t]);return i.length?i:n},fEe=(e,t,n=void 0)=>e.map(({field:e,values:r,exclude:i})=>({field:e,exclude:i,values:r.flatMap(e=>{if(typeof e!=`string`)return[e];if(e===`{{slug}}`)return n?[n]:[];let r=e.match(uEe);if(!r)return[e];let i=t?Bz(t,r[1]):void 0;return Array.isArray(i)?i:i===void 0?[]:[i]})})),pEe=({refEntries:e,collection:t,locale:n,fileName:r=void 0,entryFilters:i=[],defaultLocale:a=void 0})=>e.filter(e=>!r||r===e.slug).map(e=>{let{content:t}=e.locales[n]??(a?e.locales[a]:void 0)??e.locales._default??{};return{refEntry:e,hasContent:!!t&&Object.keys(t).length>0,content:t??{}}}).filter(({hasContent:e,content:n,refEntry:r})=>e&&i.every(({field:e,values:i,exclude:a=!1})=>{if(i.length===0)return!0;let o=e===`slug`,s=_N(e),c=o?kA(t,r.slug):Bz(n,s),l=Array.isArray(c)?c.some(e=>i.includes(e)):i.includes(c);return a?!l:l})),Vz=(e,t)=>{let{databaseName:n}=e??{};return n?new DE(n,t):void 0},Hz=[`eq`,`ne`,`lt`,`lte`,`gt`,`gte`,`in`,`not_in`,`empty`],Uz=e=>{let{field:t,pattern:n}=e,r={field:t};return n!==void 0&&(r.pattern=n),Hz.forEach(t=>{e[t]!==void 0&&(r[t]=e[t])}),r},Wz=e=>!!e&&Hz.some(t=>e[t]!==void 0),Gz=e=>{let{field:t,pattern:n}=e,r=[t],i=Object.fromEntries(Hz.filter(t=>e[t]!==void 0).map(t=>[t,e[t]]));return n===void 0?Object.keys(i).length&&r.push(null):r.push(String(n)),Object.keys(i).length&&r.push(i),JSON.stringify(r)},Kz=e=>e===`*other`?Y(`other`):e,qz=(e,t,n)=>{let r=XR(t);return[...Map.groupBy(e,e=>{let t=n(e);return t==null?`*other`:r?String(t).match(r)?.[0]??`*other`:String(t)})].sort(([e],[t])=>TE(Kz(e),Kz(t)))},Jz=(e,t,n)=>{let{field:r,pattern:i}=t??{};return r?Object.fromEntries(qz(e,i,e=>n(e,r))):e.length?{"*":e}:{}},Yz=(e,t,n)=>n?n.test(String(e??``)):e===t,Xz=(e,t,n)=>n?TE(e,t):e-t,Zz=(e,t,n,r)=>{let i=e.map(e=>({item:e,key:t(e)})),a=i.filter(({key:e})=>e!==void 0),o=i.filter(({key:e})=>e===void 0);return a.sort(({key:e},{key:t})=>Xz(e,t,n)),r===`descending`&&a.reverse(),[...a,...o].forEach(({item:t},n)=>{e[n]=t}),e},mEe=e=>e.filter(e=>e!==`*`),Qz=e=>e?Gz(e):void 0,$z=(e,t)=>{let n=Qz(e.group);return n!==void 0&&!!e.collapsedGroups?.[n]?.includes(t)},eB=(e,t)=>{let n=Qz(e.group);if(n===void 0)return e;let{[n]:r,...i}=e.collapsedGroups??{},a=t.length?{...i,[n]:t}:i,{collapsedGroups:o,...s}=e;return Object.keys(a).length?{...s,collapsedGroups:a}:s},tB=(e,t,n)=>{let r=Qz(e.group),i=(r===void 0?[]:e.collapsedGroups?.[r]??[]).filter(e=>e!==t);return n&&i.push(t),eB(e,i)},nB=(e,t,n)=>eB(e,n?[...t]:[]),rB=async(e,t,n,{defaults:r={}}={})=>{let i=Vz(e,`ui-settings`),a;try{a=await i?.get(t)}catch{}let o={...r,...E(a)?a:{}};n.current=o;let s=o;return _k(()=>{let{current:e}=n;(0,yr.default)(e,s)||(s=e,(async()=>{try{await i?.set(t,e)}catch{}})())})},iB=(e,t)=>{if(Array.isArray(e))return{options:e};if(E(e)){let n=e[t],r=e.default;if(Array.isArray(n)){let e=r?n.find(({name:e})=>e===r):void 0;return{options:n,default:e?Uz(e):void 0}}}return{options:[]}},aB=e=>Array.isArray(e)&&e.every(e=>typeof e==`string`),oB=e=>{if(aB(e))return{keys:e};if(E(e)){let{fields:t,default:n}=e;return aB(t)?E(n)?{keys:t,defaultKey:n.field,defaultOrder:[`descending`,`Descending`].includes(n.direction??``)?`descending`:`ascending`}:{keys:t}:{keys:[]}}return{keys:[]}},sB=[`slug`,`commit_author`,`commit_date`],hEe=[`dirname`,`filename`,`extension`,`locales`],gEe=/\{\{.+?\}\}/,_Ee=/^\{\{\s*(?:fields\.)?([^\s|{}]+)\s*\}\}$/,cB=e=>gEe.test(e),lB=e=>{let{table_columns:t,summary_fields:n}=e;if(Array.isArray(t))return t.map(e=>E(e)?{key:e.field,label:e.label}:{key:e});if(Array.isArray(n))return n.map(e=>({key:e===`summary`?`_summary`:e}))},vEe=new Map,uB=e=>PA(vEe,e,()=>{try{let{language:t,script:n}=new Intl.Locale(e).maximize();return`${t}-${n}`}catch{return e.toLowerCase()}}),yEe=(e,t)=>{if(Object.hasOwn(e,t))return t;let n=uB(t),r=Object.keys(e).filter(e=>uB(e)===n);return r.find(e=>!e.includes(`-`))??r[0]},dB=(e,t)=>{let n=e[`${t}_localized`];return E(n)?n:void 0},fB=({config:e,option:t,locale:n})=>{if(!e)return;let r=dB(e,t);if(r){if(n&&n!==`_default`&&Object.hasOwn(r,n))return r[n];let e=Jc.current?yEe(r,Jc.current):void 0;if(e!==void 0)return r[e]}return e[t]},pB=({config:e,locale:t})=>fB({config:e,option:`label`,locale:t})||e.name||``,mB=({fieldConfig:e,locale:t,defaultLocale:n})=>{let r=dB(e,`default`);if(!r)return e;let{default_localized:i,...a}=e,o=e.i18n===`duplicate`?n:t;return Object.hasOwn(r,o)?{...a,default:r[o]}:a},hB=[`title`,`name`,`date`,`author`,`description`],bEe=[`ascending`,`descending`],xEe=[`date`,`commit_date`],gB={slug:String,commit_author:String,commit_date:Date,_summary:String,_manual:String},_B=Object.keys(gB),SEe=e=>e?{keys:[e,...hB.filter(t=>t!==e)],defaultKey:e}:{keys:[...hB]},vB=({collection:e,isCommitAuthorAvailable:t,isCommitDateAvailable:n})=>{let{name:r,identifier_field:i,sortable_fields:a,summary:o,_i18n:{i18nEnabled:s,canonicalSlug:c}}=e,l=a?oB(a):SEe(i),u=[...l.keys],{defaultKey:d,defaultOrder:f}=l;o&&u.unshift(`_summary`);let p=s?[..._B,c.key]:_B;u=EO(u).filter(e=>!!e&&(p.includes(e)||!!bM({collectionName:r,keyPath:e})));let m=u.includes(`commit_author`),h=u.includes(`commit_date`),g=jk(e);t&&!g?!u.includes(`author`)&&!m&&u.push(`commit_author`):m&&(u=u.filter(e=>e!==`commit_author`)),n&&!g?!u.includes(`date`)&&!h&&u.push(`commit_date`):h&&(u=u.filter(e=>e!==`commit_date`));let _=sz(e);return(_||jk(e))&&(u=u.filter(e=>e!==_),u.includes(`_manual`)||u.unshift(`_manual`),d=`_manual`,f=`ascending`),d=d&&u.includes(d)?d:u[0],f??=d?`ascending`:void 0,{keys:u,default:{key:d,order:f}}},yB=({key:e,fieldConfig:t})=>e in gB?gB[e]:t?.widget===`boolean`?Boolean:t&&wP(t)?Number:String,bB=({collection:e,key:t})=>{if([..._B,`name`].includes(t))return Y(`sort_keys.${t}`);if(t.includes(`.`))return t.split(`.`).map((t,n,r)=>{if(uM(t))return;let i=r.slice(0,n+1).join(`.`);return fB({config:bM({collectionName:e.name,keyPath:i}),option:`label`})||t}).filter(Boolean).join(` – `);let n=e.fields?.find(({name:e})=>e===t);return fB({config:n,option:`label`})||t},xB=hk(()=>{let e=sj.current;if(e?._type!==`entry`)return[];let{current:t}=vj,{keys:n}=vB({collection:e,isCommitAuthorAvailable:t.some(e=>!!e.commitAuthor),isCommitDateAvailable:t.some(e=>!!e.commitDate)});return n.map(t=>{let n=bM({collectionName:e.name,keyPath:t}),r={key:t,label:bB({collection:e,key:t})};return yB({key:t,fieldConfig:n})===Number&&(r.type=`number`),r})}),CEe=e=>{let t=e,n=!0;for(;n;){let e=t;t=t.replaceAll(/([_*`~])([^_*`~]+)\1/g,`$2`),t=t.replaceAll(/([_*`~]{2,3})(.+?)\1/g,`$2`),n=t!==e}return t},wEe=new lr,TEe=RegExp(`<(?:br|hr)\\b[^>]*>|</(?:address|article|aside|blockquote|caption|dd|details|div|dl|dt|figcaption|figure|footer|h[1-6]|header|li|main|nav|ol|p|pre|section|summary|table|tbody|td|tfoot|th|thead|tr|ul)\\s*>`,`gi`),EEe=e=>Cz(_t(wEe.parse(e).replaceAll(TEe,`$& `),{ALLOWED_TAGS:[]})).replaceAll(/\s+/g,` `).trim(),DEe=1e3,OEe=[`title`,`summary`,`description`],SB=e=>e==null||e===``,kEe=({key:e,type:t,collection:n,locale:r,collectionName:i,dateFieldConfig:a,isMarkdownField:o})=>e===`_summary`?e=>jz(n,e,{locale:r,useTemplate:!0}):a?t=>{let n=iP(LB({entry:t,locale:r,collectionName:i,key:e}),a,r)?.getTime()??NaN;return Number.isNaN(n)?void 0:n}:t===String?t=>{let n=LB({entry:t,locale:r,collectionName:i,key:e});if(SB(n))return;let a=String(n);return o?CEe(a.slice(0,DEe)):a}:t===Boolean?t=>+(LB({entry:t,locale:r,collectionName:i,key:e})===!0):t=>{let n=LB({entry:t,locale:r,collectionName:i,key:e}),a=SB(n)?NaN:Number(n);return Number.isNaN(a)?void 0:a},CB=({collection:e,key:t,locale:n})=>{let{name:r}=e,i=bM({collectionName:r,keyPath:t}),a=yB({key:t,fieldConfig:i}),o=i?.widget===`datetime`?i:void 0;return{getSortKey:kEe({key:t,type:a,collection:e,locale:n,collectionName:r,dateFieldConfig:o,isMarkdownField:Rk.includes(i?.widget??``)||OEe.includes(t)}),isStringType:!o&&a===String}},AEe=(e,t)=>{let n=e.findIndex(e=>aA(t,e));return n>-1&&e.unshift(e.splice(n,1)[0]),e},wB=(e,t,{key:n,order:r}={})=>{let i=[...e];if(n===void 0)return i;let{_i18n:{defaultLocale:a}}=t,{getSortKey:o,isStringType:s}=n===`_manual`||n===sz(t)?{getSortKey:lz(t),isStringType:!1}:CB({collection:t,key:n,locale:a});return Zz(i,o,s,r),AEe(i,t)},jEe=({collection:e,key:t,locale:n})=>{if(t===`_manual`||t===sz(e))return{getSortKey:lz(e),isStringType:!1};let{defaultLocale:r}=e._i18n,i=CB({collection:e,key:t,locale:n}),a=n===r?i:CB({collection:e,key:t,locale:r});return{getSortKey:e=>e.locales[n]?i.getSortKey(e):a.getSortKey(e),isStringType:i.isStringType}},MEe=({groups:e,collection:t,sortBy:n,locale:r})=>{let{field:i,direction:a}=n,{getSortKey:o,isStringType:s}=jEe({collection:t,key:i,locale:r}),c=a===`descending`?-1:1,l=e.flatMap(({refEntry:e,options:t})=>{let n=o(e);return t.map(e=>({option:e,sortKey:n}))});return l.sort((e,t)=>{if(e.sortKey!==t.sortKey){if(e.sortKey===void 0)return 1;if(t.sortKey===void 0)return-1;let n=Xz(e.sortKey,t.sortKey,s);if(n)return n*c}return TE(e.option.label,t.option.label)}),l.map(({option:e})=>e)},NEe=new Map,PEe=100,TB=new Set,EB=new WeakMap,FEe=(e,t,n=[])=>{if(!n.length)return e;let r=EB.get(e);r||(r=new WeakMap,EB.set(e,r));let i=r.get(n);if(i?.count===n.length)return i.entries;let a=n.filter(e=>e.collectionName===t).map(({entry:e})=>e),o=a.length?[...e,...a]:e;return r.set(n,{count:n.length,entries:o}),o},DB=({locale:e,fieldConfig:t,refEntries:n,entryFilters:r=[],pendingEntries:i=void 0})=>{let{collection:a,file:o}=t,s=fj(a);if(!s)return[];let{_type:c,_i18n:{defaultLocale:l}}=s,u=dz(c===`entry`?s:void 0),d=$Te(t,u);return pEe({refEntries:n,collection:s,locale:e,fileName:o,entryFilters:r,defaultLocale:l}).map(({refEntry:t,content:n})=>({refEntry:t,options:lEe({refEntry:t,content:n,collection:s,templates:d,fileName:o,locale:e,identifierField:u,pendingEntries:i})}))},OB=e=>DB(e).flatMap(({options:e})=>e),IEe=({collection:e,file:t})=>{if(t){let n=Tj(e,t);return n?[n]:[]}return rz(e)},kB=({locale:e,fieldConfig:t,refEntries:n,currentLocaleValues:r=void 0,currentSlug:i=void 0,pendingEntries:a=void 0})=>{let{collection:o,file:s,filters:c,sort_by:l}=t,u=fEe(c??[],r,i),d=JSON.stringify(u.map(({values:e})=>e)),f=`${e}|${`${pz(t)}|${pz(n)}`}|${a?.length??0}|${d}`;return TB.has(f)?[]:FA(NEe,f,()=>{TB.add(f);try{let r=fj(o);if(r&&!s&&l?.field)return MEe({groups:DB({locale:e,fieldConfig:t,refEntries:n,entryFilters:u,pendingEntries:a}),collection:r,sortBy:l,locale:e});let i=!s&&oz(r),c=OB({locale:e,fieldConfig:t,refEntries:i?uz(n,r):n,entryFilters:u,pendingEntries:a});return s||i?c:c.sort((e,t)=>TE(e.label,t.label))}finally{TB.delete(f)}},PEe)},AB=({locale:e,fieldConfig:t,refEntry:n,pendingEntries:r=void 0})=>OB({locale:e,fieldConfig:t,refEntries:[n],pendingEntries:r}),jB=({fieldConfig:e,valueMap:t,keyPath:n,locale:r,pendingEntries:i=void 0})=>{let{multiple:a,collection:o}=e,s=FTe(kB({locale:r,fieldConfig:e,refEntries:FEe(rz(o),o,i),pendingEntries:i})),c=e=>s.get(e)||e;return a?XO(t,n).map(e=>c(t[e])):c(t[n])},LEe=new Map,REe=1e3,zEe=new WeakMap,BEe=e=>PA(zEe,e,()=>JSON.stringify(e)),VEe=({fieldConfig:e,valueMap:t,keyPath:n})=>{let{multiple:r,options:i}=e,a=TO(i),o;r&&(o=XO(t,n).map(e=>t[e]));let s=`${n}|${BEe(i)}|${JSON.stringify(r?o:t[n])}`,c=e=>i.find(t=>t.value===e)?.label||e;return FA(LEe,s,()=>{if(r)return a?o.map(c):o;let e=t[n];return a?c(e):e},REe)},MB=e=>E(e)?e.value:e,NB=({fieldConfig:e,value:t})=>e.options.some(e=>MB(e)===t),HEe=({fieldConfig:e,currentValue:t})=>{let{options:n,multiple:r=!1}=e,i=TO(n),a=e=>i&&n.find(t=>t.value===e)?.label||String(e);return r?Array.isArray(t)?t.map(a).sort():[]:t===void 0||t===null&&!NB({fieldConfig:e,value:null})?[]:[a(t)]},PB=e=>e===null?`number`:typeof e,FB=e=>e===void 0||typeof e==`string`?``:null,UEe=e=>Rk.includes(e?.widget),IB=({collectionName:e,fileName:t,componentName:n=void 0,valueMap:r={},keyPath:i,locale:a,transformations:o,isIndexFile:s=!1,pendingEntries:c=void 0,plainText:l=!1})=>{let u=bM({collectionName:e,fileName:t,componentName:n,valueMap:r,keyPath:i,isIndexFile:s}),d=Object.hasOwn(r,i)?r[i]:void 0;if(d===void 0&&o?.length)return``;if(u?.widget===`datetime`&&(o?.some(({method:e})=>e===`date`)||(d=vP({locale:a,fieldConfig:u,currentValue:d}))),u?.widget===`relation`&&(d=jB({fieldConfig:u,valueMap:r,keyPath:i,locale:a,pendingEntries:c})),u?.widget===`select`&&(d=VEe({fieldConfig:u,valueMap:r,keyPath:i})),u?.widget===`list`){let{field:o}=u,{fields:f}=u,{types:p}=u;if(!(f||p)){let u=XO(r,i);d=qA(a).format((o?u.map(i=>IB({collectionName:e,fileName:t,componentName:n,valueMap:r,keyPath:i,locale:a,isIndexFile:s,pendingEntries:c,plainText:l})):u.map(e=>r[e]).filter(e=>typeof e==`string`)).filter(e=>!!e))}}if(u&&wP(u)&&d!=null&&d!==``){let e=Number(d);Number.isNaN(e)||(d=yP(WA(a)).format(e))}return l&&UEe(u)&&typeof d==`string`&&(d=EEe(d)),Array.isArray(d)&&(d=qA(a).format(d)),o?.length&&(d=cP({fieldConfig:u,value:d,transformations:o,locale:a})),String(d??``)},WEe=({valueMap:e,locale:t,keyPath:n,keyPathPrefix:r,getFieldArgs:i,plainText:a=!1})=>{let o=[`${n}.title`,`${n}.name`,...qO(e,r)].find(t=>{let n=e[t];if(!t.startsWith(r)||!(mA(n)||typeof n==`number`&&!Number.isNaN(n)))return!1;let a=bM({...i,keyPath:t});return!!a&&a.widget!==`hidden`});return o?IB({...i,keyPath:o,locale:t,plainText:a}):``},LB=({entry:e,locale:t,collectionName:n,key:r,resolveRef:i=!0})=>{let{slug:a,locales:o,commitAuthor:s,commitDate:c}=e;if(r===`slug`)return a;if(r===`commit_author`)return wz(s);if(r===`commit_date`)return c;let{content:l}=o[t]??{};if(l===void 0)return;let u=fj(n);if(!u)return;let d=bM({collectionName:n,keyPath:r,isIndexFile:aA(u,e)});if(i&&d?.widget===`relation`)return jB({fieldConfig:d,valueMap:l,keyPath:r,locale:t});if(d&&(d.widget===`list`||_M(d))){let e=XO(l,r);if(e.length)return e.map(e=>l[e])}let f=Object.hasOwn(l,r)?l[r]:void 0;if(f===void 0&&(d?.widget===`object`||d?.widget===`list`)){let e=qO(l,`${r}.`);if(e.length)return e.map(e=>l[e])}return f},GEe=/\s*(?:(?<number>\d+(?:\.\d+)?|\.\d+)|(?<tag>\0)|(?<name>[A-Za-z_]\w*)|(?<punctuator>[-+*/%(),]))/y,KEe=/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[-+]?\d+)?$/i,RB=e=>e.reduce((e,t)=>e+t,0),zB={abs:{minArgs:1,maxArgs:1,fn:Math.abs},ceil:{minArgs:1,maxArgs:1,fn:Math.ceil},floor:{minArgs:1,maxArgs:1,fn:Math.floor},round:{minArgs:1,maxArgs:2,fn:(e,t=0)=>pM(e,Math.trunc(t))},avg:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length?RB(e)/e.length:void 0},count:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length,anyValue:!0},max:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length?Math.max(...e):void 0},min:{minArgs:1,maxArgs:1/0,aggregate:e=>e.length?Math.min(...e):void 0},sum:{minArgs:1,maxArgs:1/0,aggregate:RB}},qEe=100,JEe=new Map,YEe=e=>{let t=[],n=new RegExp(GEe),r=0,i=e.trimEnd().length;for(;n.lastIndex<i;){let i=n.exec(e)?.groups;if(!i)return;i.number===void 0?i.tag===void 0?i.name===void 0?t.push({type:`punctuator`,value:i.punctuator}):t.push({type:`name`,name:i.name}):(t.push({type:`tag`,index:r}),r+=1):t.push({type:`number`,value:Number(i.number)})}return t},XEe=e=>{let t=0,n=new Set,r=n=>{let r=e[t];return r?.type===`punctuator`&&r.value===n&&(t+=1,!0)},i,a=(e,t)=>{let n=t();for(;n;){let i=e.find(r);if(!i)break;let a=t();n=a?{type:`binary`,operator:i,left:n,right:a}:void 0}return n},o=()=>{let e=[];if(r(`)`))return e;do{let t=i();if(!t)return;e.push(t)}while(r(`,`));return r(`)`)?e:void 0},s=()=>{let a=e[t];if(a?.type===`number`||a?.type===`tag`)return t+=1,a;if(a?.type===`name`){t+=1;let{name:e}=a,i=Object.hasOwn(zB,e)?zB[e]:void 0,s=i&&r(`(`)?o():void 0;return!i||!s||s.length<i.minArgs||s.length>i.maxArgs?void 0:(i.aggregate&&s.forEach(e=>{e.type===`tag`&&n.add(e.index)}),{type:`call`,name:e,args:s})}if(r(`(`)){let e=i();return e&&r(`)`)?e:void 0}},c=()=>{let e=[`-`,`+`].find(r);if(!e)return s();let t=c();return t?{type:`unary`,operator:e,operand:t}:void 0},l=()=>a([`*`,`/`,`%`],c);i=()=>a([`+`,`-`],l);let u=i();return{tree:t===e.length?u:void 0,allItemsTagIndexes:n}},BB=e=>FA(JEe,e,()=>{let{tags:t,literals:n}=hN(e),r=YEe(n.join(`\0`)),{tree:i,allItemsTagIndexes:a}=r?XEe(r):{tree:void 0,allItemsTagIndexes:new Set};return{tree:i,tags:t.map((e,t)=>({content:e,allItems:a.has(t)}))}},qEe),VB=e=>String(e??``).trim(),HB=e=>{let t=VB(e);return KEe.test(t)?Number(t):void 0},ZEe=e=>!VB(e),QEe=(e,t,n,r)=>{let i=[];for(let a of t){let t=a.type===`tag`?n[a.index]:void 0;if(Array.isArray(t))for(let n of t.filter(e=>!ZEe(e))){let t=e.anyValue?0:HB(n);if(t===void 0)return;i.push(t)}else{let e=r(a);if(e===void 0)return;i.push(e)}}return e.aggregate(i)},UB=(e,t)=>{if(e.type===`number`)return e.value;if(e.type===`tag`)return t[e.index];if(e.type===`unary`){let n=UB(e.operand,t);return n===void 0?void 0:e.operator===`-`?-n:n}if(e.type===`call`){let n=zB[e.name];if(n.aggregate)return QEe(n,e.args,t,e=>UB(e,t));let r=e.args.map(e=>UB(e,t));return r.includes(void 0)?void 0:n.fn(...r)}let n=UB(e.left,t),r=UB(e.right,t);if(n!==void 0&&r!==void 0)switch(e.operator){case`+`:return n+r;case`-`:return n-r;case`*`:return n*r;case`/`:return n/r;default:return n%r}},$Ee=(e,t)=>{let{tree:n,tags:r}=BB(e);if(!n)return;let i=UB(n,r.map(({content:e,allItems:n})=>n?[t(e,{allItems:n})].flat():HB(t(e,{allItems:n}))));return i!==void 0&&Number.isFinite(i)?i:void 0},eDe=new WeakMap,WB=e=>{let t=e.split(`.`).findLast(uM);return t===void 0?void 0:Number(t)},GB=e=>Object.hasOwn(Qk,e),KB=e=>{let{tags:t,literals:n}=hN(e),r=t.map(e=>sP(e).value),i=n.map(xE),a=r.findIndex(e=>!GB(e)),o=r.findLastIndex(e=>!GB(e)),s=(e,t)=>r.slice(e,t).map((t,n)=>`${i[e+n]}(${Qk[t].pattern})`).join(``)+i[t],c=a===-1?s(0,r.length):`${s(0,a)}[\\s\\S]*${s(o+1,r.length)}`;return{uuidTags:r.map((e,t)=>({tagName:e,extractable:a===-1||t<a||t>o})).filter(({tagName:e})=>GB(e)),regex:RegExp(`^${c}$`,`i`)}},qB=(e=``)=>KB(e).uuidTags.length>0,tDe=({valueTemplate:e,keyPath:t,valueMap:n})=>{let{uuidTags:r,regex:i}=KB(e);if(!r.length)return[];let a=n[t],o=typeof a==`string`?a.match(i)?.slice(1):void 0;if(o?.length===r.length)return o;let s=PA(eDe,n,()=>new Map),c=s.get(t);if(c?.length!==r.length&&(c=r.map(({tagName:e})=>ml(Qk[e].length)),s.set(t,c)),!o)return c;let l=0;return r.map(({extractable:e},t)=>{if(!e)return c[t];let n=o[l];return l+=1,n})},nDe=(e,t)=>{let n=SP(t),r=!xP(t),i=e===void 0?void 0:(r?Math.round(e):dM(e))+0;return i===void 0||r&&!Number.isSafeInteger(i)?n?``:null:n?String(i):i},rDe=({value:e,fieldConfig:t,canonicalLocale:n})=>{let r=String(e??``),i=Number(e);return CP(t)&&r.trim()&&Number.isFinite(i)?yP(n).format(i):r},iDe=new WeakMap,aDe=({fieldKeyPath:e,ownKeyPath:t,allItems:n,valueMap:r})=>{let i=e.split(`.`),a=i.lastIndexOf(`*`);if(a===-1)return[e];let o=t.split(`.`),s=[[]];return i.forEach((e,t)=>{e===`*`?s=s.flatMap(e=>{let i=n&&t===a,s=o[t];return!i&&uM(s??``)&&e.every((e,t)=>e===o[t])?[[...e,s]]:n?pP(PA(iDe,r,()=>fP(r)),e.join(`.`)).map(t=>[...e,String(t)]):[]}):s.forEach(t=>t.push(e))}),s.map(e=>e.join(`.`))},oDe=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>e.startsWith(t)).map(([e,n])=>[e.slice(t.length),n])),sDe=(e,t)=>{let{keyPath:n,valueMap:r,keyPathPrefix:i,componentName:a,collectionName:o,fileName:s,isIndexFile:c}=e;return i?a&&bM({collectionName:o,fileName:s,isIndexFile:c,keyPath:t,componentName:a})?(e.componentValues??=oDe(r,i),{valueMap:e.componentValues,componentName:a,ownKeyPath:n.slice(i.length)}):{valueMap:e.entryValueMap,ownKeyPath:i.split(`:`)[0]}:{valueMap:r,ownKeyPath:n}},cDe=(e,t)=>!!e&&(CP(e)||t&&(e.widget===`select`||e.widget===`relation`)),JB=(e,t,n,r)=>{let{locale:i,collectionName:a,fileName:o,isIndexFile:s,numeric:c,listFormatter:l}=e,{valueMap:u,componentName:d}=n,f={collectionName:a,fileName:o,componentName:d,valueMap:u,keyPath:t,isIndexFile:s},p=u[t],m=p!==void 0;if(m){let e=bM(f);if(cDe(e,c)){let t=String(p??``);return r.length?cP({fieldConfig:e,value:t,transformations:r,locale:i}):t}}let h=IB({...f,locale:i,transformations:m?r:void 0}),g=Array.isArray(h)?l.format(h):String(h);return!m&&r.length?cP({value:g,transformations:r,locale:i}):g},lDe=({fieldConfig:e,keyPath:t,locale:n,valueMap:r,collectionName:i,fileName:a,isIndexFile:o=!1,keyPathPrefix:s=``,entryValueMap:c={}})=>{let{value:l=``}=e,u=CP(e);if(!u&&l===`{{index}}`)return WB(t)??``;let d=u?[]:tDe({valueTemplate:l,keyPath:t,valueMap:r}),f=0,p={keyPath:t,locale:n,valueMap:r,collectionName:i,fileName:a,isIndexFile:o,keyPathPrefix:s,entryValueMap:c,componentName:s?r[`${s}__sc_component_name`]:void 0,numeric:u,listFormatter:qA(n)},m=(e,{allItems:r=!1}={})=>{let{value:i,transformations:a}=sP(e);if(i===`index`){let e=String(WB(t)??``);return r?[e]:e}let o=fN(a,e=>GB(sP(e).value)?``:m(e));if(Zk.test(i)){let e=_N(i),t=sDe(p,e),n=aDe({fieldKeyPath:e,ownKeyPath:t.ownKeyPath,allItems:r,valueMap:t.valueMap});return r?n.map(e=>JB(p,e,t,o)):JB(p,n[0]??e,t,o)}if(!GB(i))return r?[]:``;let s=d[f];return f+=1,o.length&&(s=cP({value:s,transformations:o,locale:n})),r?[s]:s};return u?nDe($Ee(l,m),e):mN(l,(e,t)=>m(t))},uDe=B(`<p> </p>`);function dDe(e,t){O(t,!0);let n=A(()=>WA(t.locale));var r=uDe(),i=F(r,!0);R((e,t)=>{q(r,`lang`,z(n)),q(r,`dir`,e),W(i,t),r.dir=r.dir},[()=>GA(t.locale),()=>rDe({value:t.currentValue,fieldConfig:t.fieldConfig,canonicalLocale:z(n)})]),U(e,r),k()}var YB=(e,{slugificationEnabled:t=!1,assetNamesInSameFolder:n=[]}={})=>{let r=VP(e).replace(/^\.+/,``);if(t){let{filename:e,extension:t}=Uk(r);r=`${jN(e)}${t?`.${t.toLowerCase()}`:``}`}return BP(r,n)},XB=(e,t)=>YB(e).normalize().toLowerCase()===YB(t).normalize().toLowerCase(),fDe=({name:e,fileName:t,otherNames:n,folderNames:r=[]})=>{if(!e)return`empty`;if(e.includes(`/`)||!t)return`character`;if(e.startsWith(`.`))return`leading_dot`;let i=t.normalize().toLowerCase(),a=e=>e.some(e=>e.normalize().toLowerCase()===i);if(a(n))return`duplicate`;if(a(r))return`folder_duplicate`},ZB={"application/prs.cww":[`cww`],"application/prs.xsf+xml":[`xsf`],"application/vnd.1000minds.decision-model+xml":[`1km`],"application/vnd.3gpp.pic-bw-large":[`plb`],"application/vnd.3gpp.pic-bw-small":[`psb`],"application/vnd.3gpp.pic-bw-var":[`pvb`],"application/vnd.3gpp2.tcap":[`tcap`],"application/vnd.3m.post-it-notes":[`pwn`],"application/vnd.accpac.simply.aso":[`aso`],"application/vnd.accpac.simply.imp":[`imp`],"application/vnd.acucobol":[`acu`],"application/vnd.acucorp":[`atc`,`acutc`],"application/vnd.adobe.air-application-installer-package+zip":[`air`],"application/vnd.adobe.formscentral.fcdt":[`fcdt`],"application/vnd.adobe.fxp":[`fxp`,`fxpl`],"application/vnd.adobe.xdp+xml":[`xdp`],"application/vnd.adobe.xfdf":[`*xfdf`],"application/vnd.age":[`age`],"application/vnd.ahead.space":[`ahead`],"application/vnd.airzip.filesecure.azf":[`azf`],"application/vnd.airzip.filesecure.azs":[`azs`],"application/vnd.amazon.ebook":[`azw`],"application/vnd.americandynamics.acc":[`acc`],"application/vnd.amiga.ami":[`ami`],"application/vnd.android.package-archive":[`apk`],"application/vnd.anser-web-certificate-issue-initiation":[`cii`],"application/vnd.anser-web-funds-transfer-initiation":[`fti`],"application/vnd.antix.game-component":[`atx`],"application/vnd.apple.installer+xml":[`mpkg`],"application/vnd.apple.keynote":[`key`],"application/vnd.apple.mpegurl":[`m3u8`],"application/vnd.apple.numbers":[`numbers`],"application/vnd.apple.pages":[`pages`],"application/vnd.apple.pkpass":[`pkpass`],"application/vnd.aristanetworks.swi":[`swi`],"application/vnd.astraea-software.iota":[`iota`],"application/vnd.audiograph":[`aep`],"application/vnd.autodesk.fbx":[`fbx`],"application/vnd.balsamiq.bmml+xml":[`bmml`],"application/vnd.blueice.multipass":[`mpm`],"application/vnd.bmi":[`bmi`],"application/vnd.businessobjects":[`rep`],"application/vnd.chemdraw+xml":[`cdxml`],"application/vnd.chipnuts.karaoke-mmd":[`mmd`],"application/vnd.cinderella":[`cdy`],"application/vnd.citationstyles.style+xml":[`csl`],"application/vnd.claymore":[`cla`],"application/vnd.cloanto.rp9":[`rp9`],"application/vnd.clonk.c4group":[`c4g`,`c4d`,`c4f`,`c4p`,`c4u`],"application/vnd.cluetrust.cartomobile-config":[`c11amc`],"application/vnd.cluetrust.cartomobile-config-pkg":[`c11amz`],"application/vnd.commonspace":[`csp`],"application/vnd.contact.cmsg":[`cdbcmsg`],"application/vnd.cosmocaller":[`cmc`],"application/vnd.crick.clicker":[`clkx`],"application/vnd.crick.clicker.keyboard":[`clkk`],"application/vnd.crick.clicker.palette":[`clkp`],"application/vnd.crick.clicker.template":[`clkt`],"application/vnd.crick.clicker.wordbank":[`clkw`],"application/vnd.criticaltools.wbs+xml":[`wbs`],"application/vnd.ctc-posml":[`pml`],"application/vnd.cups-ppd":[`ppd`],"application/vnd.curl.car":[`car`],"application/vnd.curl.pcurl":[`pcurl`],"application/vnd.dart":[`dart`],"application/vnd.data-vision.rdz":[`rdz`],"application/vnd.dbf":[`dbf`],"application/vnd.dcmp+xml":[`dcmp`],"application/vnd.dece.data":[`uvf`,`uvvf`,`uvd`,`uvvd`],"application/vnd.dece.ttml+xml":[`uvt`,`uvvt`],"application/vnd.dece.unspecified":[`uvx`,`uvvx`],"application/vnd.dece.zip":[`uvz`,`uvvz`],"application/vnd.denovo.fcselayout-link":[`fe_launch`],"application/vnd.dna":[`dna`],"application/vnd.dolby.mlp":[`mlp`],"application/vnd.dpgraph":[`dpg`],"application/vnd.dreamfactory":[`dfac`],"application/vnd.ds-keypoint":[`kpxx`],"application/vnd.dvb.ait":[`ait`],"application/vnd.dvb.service":[`svc`],"application/vnd.dynageo":[`geo`],"application/vnd.ecowin.chart":[`mag`],"application/vnd.enliven":[`nml`],"application/vnd.epson.esf":[`esf`],"application/vnd.epson.msf":[`msf`],"application/vnd.epson.quickanime":[`qam`],"application/vnd.epson.salt":[`slt`],"application/vnd.epson.ssf":[`ssf`],"application/vnd.eszigno3+xml":[`es3`,`et3`],"application/vnd.ezpix-album":[`ez2`],"application/vnd.ezpix-package":[`ez3`],"application/vnd.fdf":[`*fdf`],"application/vnd.fdsn.mseed":[`mseed`],"application/vnd.fdsn.seed":[`seed`,`dataless`],"application/vnd.flographit":[`gph`],"application/vnd.fluxtime.clip":[`ftc`],"application/vnd.framemaker":[`fm`,`frame`,`maker`,`book`],"application/vnd.frogans.fnc":[`fnc`],"application/vnd.frogans.ltf":[`ltf`],"application/vnd.fsc.weblaunch":[`fsc`],"application/vnd.fujitsu.oasys":[`oas`],"application/vnd.fujitsu.oasys2":[`oa2`],"application/vnd.fujitsu.oasys3":[`oa3`],"application/vnd.fujitsu.oasysgp":[`fg5`],"application/vnd.fujitsu.oasysprs":[`bh2`],"application/vnd.fujixerox.ddd":[`ddd`],"application/vnd.fujixerox.docuworks":[`xdw`],"application/vnd.fujixerox.docuworks.binder":[`xbd`],"application/vnd.fuzzysheet":[`fzs`],"application/vnd.genomatix.tuxedo":[`txd`],"application/vnd.geogebra.file":[`ggb`],"application/vnd.geogebra.slides":[`ggs`],"application/vnd.geogebra.tool":[`ggt`],"application/vnd.geometry-explorer":[`gex`,`gre`],"application/vnd.geonext":[`gxt`],"application/vnd.geoplan":[`g2w`],"application/vnd.geospace":[`g3w`],"application/vnd.gmx":[`gmx`],"application/vnd.google-apps.document":[`gdoc`],"application/vnd.google-apps.drawing":[`gdraw`],"application/vnd.google-apps.form":[`gform`],"application/vnd.google-apps.jam":[`gjam`],"application/vnd.google-apps.map":[`gmap`],"application/vnd.google-apps.presentation":[`gslides`],"application/vnd.google-apps.script":[`gscript`],"application/vnd.google-apps.site":[`gsite`],"application/vnd.google-apps.spreadsheet":[`gsheet`],"application/vnd.google-earth.kml+xml":[`kml`],"application/vnd.google-earth.kmz":[`kmz`],"application/vnd.gov.sk.xmldatacontainer+xml":[`xdcf`],"application/vnd.grafeq":[`gqf`,`gqs`],"application/vnd.groove-account":[`gac`],"application/vnd.groove-help":[`ghf`],"application/vnd.groove-identity-message":[`gim`],"application/vnd.groove-injector":[`grv`],"application/vnd.groove-tool-message":[`gtm`],"application/vnd.groove-tool-template":[`tpl`],"application/vnd.groove-vcard":[`vcg`],"application/vnd.hal+xml":[`hal`],"application/vnd.handheld-entertainment+xml":[`zmm`],"application/vnd.hbci":[`hbci`],"application/vnd.hhe.lesson-player":[`les`],"application/vnd.hp-hpgl":[`hpgl`],"application/vnd.hp-hpid":[`hpid`],"application/vnd.hp-hps":[`hps`],"application/vnd.hp-jlyt":[`jlt`],"application/vnd.hp-pcl":[`pcl`],"application/vnd.hp-pclxl":[`pclxl`],"application/vnd.hydrostatix.sof-data":[`sfd-hdstx`],"application/vnd.ibm.minipay":[`mpy`],"application/vnd.ibm.modcap":[`afp`,`listafp`,`list3820`],"application/vnd.ibm.rights-management":[`irm`],"application/vnd.ibm.secure-container":[`sc`],"application/vnd.iccprofile":[`icc`,`icm`],"application/vnd.igloader":[`igl`],"application/vnd.immervision-ivp":[`ivp`],"application/vnd.immervision-ivu":[`ivu`],"application/vnd.insors.igm":[`igm`],"application/vnd.intercon.formnet":[`xpw`,`xpx`],"application/vnd.intergeo":[`i2g`],"application/vnd.intu.qbo":[`qbo`],"application/vnd.intu.qfx":[`qfx`],"application/vnd.ipunplugged.rcprofile":[`rcprofile`],"application/vnd.irepository.package+xml":[`irp`],"application/vnd.is-xpr":[`xpr`],"application/vnd.isac.fcs":[`fcs`],"application/vnd.jam":[`jam`],"application/vnd.jcp.javame.midlet-rms":[`rms`],"application/vnd.jisp":[`jisp`],"application/vnd.joost.joda-archive":[`joda`],"application/vnd.kahootz":[`ktz`,`ktr`],"application/vnd.kde.karbon":[`karbon`],"application/vnd.kde.kchart":[`chrt`],"application/vnd.kde.kformula":[`kfo`],"application/vnd.kde.kivio":[`flw`],"application/vnd.kde.kontour":[`kon`],"application/vnd.kde.kpresenter":[`kpr`,`kpt`],"application/vnd.kde.kspread":[`ksp`],"application/vnd.kde.kword":[`kwd`,`kwt`],"application/vnd.kenameaapp":[`htke`],"application/vnd.kidspiration":[`kia`],"application/vnd.kinar":[`kne`,`knp`],"application/vnd.koan":[`skp`,`skd`,`skt`,`skm`],"application/vnd.kodak-descriptor":[`sse`],"application/vnd.las.las+xml":[`lasxml`],"application/vnd.llamagraphics.life-balance.desktop":[`lbd`],"application/vnd.llamagraphics.life-balance.exchange+xml":[`lbe`],"application/vnd.lotus-1-2-3":[`123`],"application/vnd.lotus-approach":[`apr`],"application/vnd.lotus-freelance":[`pre`],"application/vnd.lotus-notes":[`nsf`],"application/vnd.lotus-organizer":[`org`],"application/vnd.lotus-screencam":[`scm`],"application/vnd.lotus-wordpro":[`lwp`],"application/vnd.macports.portpkg":[`portpkg`],"application/vnd.mapbox-vector-tile":[`mvt`],"application/vnd.mcd":[`mcd`],"application/vnd.medcalcdata":[`mc1`],"application/vnd.mediastation.cdkey":[`cdkey`],"application/vnd.mfer":[`mwf`],"application/vnd.mfmp":[`mfm`],"application/vnd.micrografx.flo":[`flo`],"application/vnd.micrografx.igx":[`igx`],"application/vnd.mif":[`mif`],"application/vnd.mobius.daf":[`daf`],"application/vnd.mobius.dis":[`dis`],"application/vnd.mobius.mbk":[`mbk`],"application/vnd.mobius.mqy":[`mqy`],"application/vnd.mobius.msl":[`msl`],"application/vnd.mobius.plc":[`plc`],"application/vnd.mobius.txf":[`txf`],"application/vnd.mophun.application":[`mpn`],"application/vnd.mophun.certificate":[`mpc`],"application/vnd.mozilla.xul+xml":[`xul`],"application/vnd.ms-artgalry":[`cil`],"application/vnd.ms-cab-compressed":[`cab`],"application/vnd.ms-excel":[`xls`,`xlm`,`xla`,`xlc`,`xlt`,`xlw`],"application/vnd.ms-excel.addin.macroenabled.12":[`xlam`],"application/vnd.ms-excel.sheet.binary.macroenabled.12":[`xlsb`],"application/vnd.ms-excel.sheet.macroenabled.12":[`xlsm`],"application/vnd.ms-excel.template.macroenabled.12":[`xltm`],"application/vnd.ms-fontobject":[`eot`],"application/vnd.ms-htmlhelp":[`chm`],"application/vnd.ms-ims":[`ims`],"application/vnd.ms-lrm":[`lrm`],"application/vnd.ms-officetheme":[`thmx`],"application/vnd.ms-outlook":[`msg`],"application/vnd.ms-pki.seccat":[`cat`],"application/vnd.ms-pki.stl":[`*stl`],"application/vnd.ms-powerpoint":[`ppt`,`pps`,`pot`],"application/vnd.ms-powerpoint.addin.macroenabled.12":[`ppam`],"application/vnd.ms-powerpoint.presentation.macroenabled.12":[`pptm`],"application/vnd.ms-powerpoint.slide.macroenabled.12":[`sldm`],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":[`ppsm`],"application/vnd.ms-powerpoint.template.macroenabled.12":[`potm`],"application/vnd.ms-project":[`*mpp`,`mpt`],"application/vnd.ms-visio.viewer":[`vdx`],"application/vnd.ms-word.document.macroenabled.12":[`docm`],"application/vnd.ms-word.template.macroenabled.12":[`dotm`],"application/vnd.ms-works":[`wps`,`wks`,`wcm`,`wdb`],"application/vnd.ms-wpl":[`wpl`],"application/vnd.ms-xpsdocument":[`xps`],"application/vnd.mseq":[`mseq`],"application/vnd.musician":[`mus`],"application/vnd.muvee.style":[`msty`],"application/vnd.mynfc":[`taglet`],"application/vnd.nato.bindingdataobject+xml":[`bdo`],"application/vnd.neurolanguage.nlu":[`nlu`],"application/vnd.nitf":[`ntf`,`nitf`],"application/vnd.noblenet-directory":[`nnd`],"application/vnd.noblenet-sealer":[`nns`],"application/vnd.noblenet-web":[`nnw`],"application/vnd.nokia.n-gage.ac+xml":[`*ac`],"application/vnd.nokia.n-gage.data":[`ngdat`],"application/vnd.nokia.n-gage.symbian.install":[`n-gage`],"application/vnd.nokia.radio-preset":[`rpst`],"application/vnd.nokia.radio-presets":[`rpss`],"application/vnd.novadigm.edm":[`edm`],"application/vnd.novadigm.edx":[`edx`],"application/vnd.novadigm.ext":[`ext`],"application/vnd.oasis.opendocument.chart":[`odc`],"application/vnd.oasis.opendocument.chart-template":[`otc`],"application/vnd.oasis.opendocument.database":[`odb`],"application/vnd.oasis.opendocument.formula":[`odf`],"application/vnd.oasis.opendocument.formula-template":[`odft`],"application/vnd.oasis.opendocument.graphics":[`odg`],"application/vnd.oasis.opendocument.graphics-template":[`otg`],"application/vnd.oasis.opendocument.image":[`odi`],"application/vnd.oasis.opendocument.image-template":[`oti`],"application/vnd.oasis.opendocument.presentation":[`odp`],"application/vnd.oasis.opendocument.presentation-template":[`otp`],"application/vnd.oasis.opendocument.spreadsheet":[`ods`],"application/vnd.oasis.opendocument.spreadsheet-template":[`ots`],"application/vnd.oasis.opendocument.text":[`odt`],"application/vnd.oasis.opendocument.text-master":[`odm`],"application/vnd.oasis.opendocument.text-template":[`ott`],"application/vnd.oasis.opendocument.text-web":[`oth`],"application/vnd.olpc-sugar":[`xo`],"application/vnd.oma.dd2+xml":[`dd2`],"application/vnd.openblox.game+xml":[`obgx`],"application/vnd.openofficeorg.extension":[`oxt`],"application/vnd.openstreetmap.data+xml":[`osm`],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[`pptx`],"application/vnd.openxmlformats-officedocument.presentationml.slide":[`sldx`],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":[`ppsx`],"application/vnd.openxmlformats-officedocument.presentationml.template":[`potx`],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[`xlsx`],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":[`xltx`],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[`docx`],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":[`dotx`],"application/vnd.osgeo.mapguide.package":[`mgp`],"application/vnd.osgi.dp":[`dp`],"application/vnd.osgi.subsystem":[`esa`],"application/vnd.palm":[`pdb`,`pqa`,`oprc`],"application/vnd.pawaafile":[`paw`],"application/vnd.pg.format":[`str`],"application/vnd.pg.osasli":[`ei6`],"application/vnd.picsel":[`efif`],"application/vnd.pmi.widget":[`wg`],"application/vnd.pocketlearn":[`plf`],"application/vnd.powerbuilder6":[`pbd`],"application/vnd.previewsystems.box":[`box`],"application/vnd.procrate.brushset":[`brushset`],"application/vnd.procreate.brush":[`brush`],"application/vnd.procreate.dream":[`drm`],"application/vnd.proteus.magazine":[`mgz`],"application/vnd.publishare-delta-tree":[`qps`],"application/vnd.pvi.ptid1":[`ptid`],"application/vnd.pwg-xhtml-print+xml":[`xhtm`],"application/vnd.quark.quarkxpress":[`qxd`,`qxt`,`qwd`,`qwt`,`qxl`,`qxb`],"application/vnd.rar":[`rar`],"application/vnd.realvnc.bed":[`bed`],"application/vnd.recordare.musicxml":[`mxl`],"application/vnd.recordare.musicxml+xml":[`musicxml`],"application/vnd.rig.cryptonote":[`cryptonote`],"application/vnd.rim.cod":[`cod`],"application/vnd.rn-realmedia":[`rm`],"application/vnd.rn-realmedia-vbr":[`rmvb`],"application/vnd.route66.link66+xml":[`link66`],"application/vnd.sailingtracker.track":[`st`],"application/vnd.seemail":[`see`],"application/vnd.sema":[`sema`],"application/vnd.semd":[`semd`],"application/vnd.semf":[`semf`],"application/vnd.shana.informed.formdata":[`ifm`],"application/vnd.shana.informed.formtemplate":[`itp`],"application/vnd.shana.informed.interchange":[`iif`],"application/vnd.shana.informed.package":[`ipk`],"application/vnd.simtech-mindmapper":[`twd`,`twds`],"application/vnd.smaf":[`mmf`],"application/vnd.smart.teacher":[`teacher`],"application/vnd.software602.filler.form+xml":[`fo`],"application/vnd.solent.sdkm+xml":[`sdkm`,`sdkd`],"application/vnd.spotfire.dxp":[`dxp`],"application/vnd.spotfire.sfs":[`sfs`],"application/vnd.stardivision.calc":[`sdc`],"application/vnd.stardivision.draw":[`sda`],"application/vnd.stardivision.impress":[`sdd`],"application/vnd.stardivision.math":[`smf`],"application/vnd.stardivision.writer":[`sdw`,`vor`],"application/vnd.stardivision.writer-global":[`sgl`],"application/vnd.stepmania.package":[`smzip`],"application/vnd.stepmania.stepchart":[`sm`],"application/vnd.sun.wadl+xml":[`wadl`],"application/vnd.sun.xml.calc":[`sxc`],"application/vnd.sun.xml.calc.template":[`stc`],"application/vnd.sun.xml.draw":[`sxd`],"application/vnd.sun.xml.draw.template":[`std`],"application/vnd.sun.xml.impress":[`sxi`],"application/vnd.sun.xml.impress.template":[`sti`],"application/vnd.sun.xml.math":[`sxm`],"application/vnd.sun.xml.writer":[`sxw`],"application/vnd.sun.xml.writer.global":[`sxg`],"application/vnd.sun.xml.writer.template":[`stw`],"application/vnd.sus-calendar":[`sus`,`susp`],"application/vnd.svd":[`svd`],"application/vnd.symbian.install":[`sis`,`sisx`],"application/vnd.syncml+xml":[`xsm`],"application/vnd.syncml.dm+wbxml":[`bdm`],"application/vnd.syncml.dm+xml":[`xdm`],"application/vnd.syncml.dmddf+xml":[`ddf`],"application/vnd.tao.intent-module-archive":[`tao`],"application/vnd.tcpdump.pcap":[`pcap`,`cap`,`dmp`],"application/vnd.tmobile-livetv":[`tmo`],"application/vnd.trid.tpt":[`tpt`],"application/vnd.triscape.mxs":[`mxs`],"application/vnd.trueapp":[`tra`],"application/vnd.ufdl":[`ufd`,`ufdl`],"application/vnd.uiq.theme":[`utz`],"application/vnd.umajin":[`umj`],"application/vnd.unity":[`unityweb`],"application/vnd.uoml+xml":[`uoml`,`uo`],"application/vnd.vcx":[`vcx`],"application/vnd.visio":[`vsd`,`vst`,`vss`,`vsw`,`vsdx`,`vtx`],"application/vnd.visionary":[`vis`],"application/vnd.vsf":[`vsf`],"application/vnd.wap.wbxml":[`wbxml`],"application/vnd.wap.wmlc":[`wmlc`],"application/vnd.wap.wmlscriptc":[`wmlsc`],"application/vnd.webturbo":[`wtb`],"application/vnd.wolfram.player":[`nbp`],"application/vnd.wordperfect":[`wpd`],"application/vnd.wqd":[`wqd`],"application/vnd.wt.stf":[`stf`],"application/vnd.xara":[`xar`],"application/vnd.xfdl":[`xfdl`],"application/vnd.yamaha.hv-dic":[`hvd`],"application/vnd.yamaha.hv-script":[`hvs`],"application/vnd.yamaha.hv-voice":[`hvp`],"application/vnd.yamaha.openscoreformat":[`osf`],"application/vnd.yamaha.openscoreformat.osfpvg+xml":[`osfpvg`],"application/vnd.yamaha.smaf-audio":[`saf`],"application/vnd.yamaha.smaf-phrase":[`spf`],"application/vnd.yellowriver-custom-menu":[`cmp`],"application/vnd.zul":[`zir`,`zirz`],"application/vnd.zzazz.deck+xml":[`zaz`],"application/x-7z-compressed":[`7z`],"application/x-abiword":[`abw`],"application/x-ace-compressed":[`ace`],"application/x-apple-diskimage":[`*dmg`],"application/x-arj":[`arj`],"application/x-authorware-bin":[`aab`,`x32`,`u32`,`vox`],"application/x-authorware-map":[`aam`],"application/x-authorware-seg":[`aas`],"application/x-bcpio":[`bcpio`],"application/x-bdoc":[`*bdoc`],"application/x-bittorrent":[`torrent`],"application/x-blender":[`blend`],"application/x-blorb":[`blb`,`blorb`],"application/x-bzip":[`bz`],"application/x-bzip2":[`bz2`,`boz`],"application/x-cbr":[`cbr`,`cba`,`cbt`,`cbz`,`cb7`],"application/x-cdlink":[`vcd`],"application/x-cfs-compressed":[`cfs`],"application/x-chat":[`chat`],"application/x-chess-pgn":[`pgn`],"application/x-chrome-extension":[`crx`],"application/x-cocoa":[`cco`],"application/x-compressed":[`*rar`],"application/x-conference":[`nsc`],"application/x-cpio":[`cpio`],"application/x-csh":[`csh`],"application/x-debian-package":[`*deb`,`udeb`],"application/x-dgc-compressed":[`dgc`],"application/x-director":[`dir`,`dcr`,`dxr`,`cst`,`cct`,`cxt`,`w3d`,`fgd`,`swa`],"application/x-doom":[`wad`],"application/x-dtbncx+xml":[`ncx`],"application/x-dtbook+xml":[`dtb`],"application/x-dtbresource+xml":[`res`],"application/x-dvi":[`dvi`],"application/x-envoy":[`evy`],"application/x-eva":[`eva`],"application/x-font-bdf":[`bdf`],"application/x-font-ghostscript":[`gsf`],"application/x-font-linux-psf":[`psf`],"application/x-font-pcf":[`pcf`],"application/x-font-snf":[`snf`],"application/x-font-type1":[`pfa`,`pfb`,`pfm`,`afm`],"application/x-freearc":[`arc`],"application/x-futuresplash":[`spl`],"application/x-gca-compressed":[`gca`],"application/x-glulx":[`ulx`],"application/x-gnumeric":[`gnumeric`],"application/x-gramps-xml":[`gramps`],"application/x-gtar":[`gtar`],"application/x-hdf":[`hdf`],"application/x-httpd-php":[`php`],"application/x-install-instructions":[`install`],"application/x-ipynb+json":[`ipynb`],"application/x-iso9660-image":[`*iso`],"application/x-iwork-keynote-sffkey":[`*key`],"application/x-iwork-numbers-sffnumbers":[`*numbers`],"application/x-iwork-pages-sffpages":[`*pages`],"application/x-java-archive-diff":[`jardiff`],"application/x-java-jnlp-file":[`jnlp`],"application/x-keepass2":[`kdbx`],"application/x-latex":[`latex`],"application/x-lua-bytecode":[`luac`],"application/x-lzh-compressed":[`lzh`,`lha`],"application/x-makeself":[`run`],"application/x-mie":[`mie`],"application/x-mobipocket-ebook":[`*prc`,`mobi`],"application/x-ms-application":[`application`],"application/x-ms-shortcut":[`lnk`],"application/x-ms-wmd":[`wmd`],"application/x-ms-wmz":[`wmz`],"application/x-ms-xbap":[`xbap`],"application/x-msaccess":[`mdb`],"application/x-msbinder":[`obd`],"application/x-mscardfile":[`crd`],"application/x-msclip":[`clp`],"application/x-msdos-program":[`*exe`],"application/x-msdownload":[`*exe`,`*dll`,`com`,`bat`,`*msi`],"application/x-msmediaview":[`mvb`,`m13`,`m14`],"application/x-msmetafile":[`*wmf`,`*wmz`,`*emf`,`emz`],"application/x-msmoney":[`mny`],"application/x-mspublisher":[`pub`],"application/x-msschedule":[`scd`],"application/x-msterminal":[`trm`],"application/x-mswrite":[`wri`],"application/x-netcdf":[`nc`,`cdf`],"application/x-ns-proxy-autoconfig":[`pac`],"application/x-nzb":[`nzb`],"application/x-perl":[`pl`,`pm`],"application/x-pilot":[`*prc`,`*pdb`],"application/x-pkcs12":[`p12`,`pfx`],"application/x-pkcs7-certificates":[`p7b`,`spc`],"application/x-pkcs7-certreqresp":[`p7r`],"application/x-rar-compressed":[`*rar`],"application/x-redhat-package-manager":[`rpm`],"application/x-research-info-systems":[`ris`],"application/x-sea":[`sea`],"application/x-sh":[`sh`],"application/x-shar":[`shar`],"application/x-shockwave-flash":[`swf`],"application/x-silverlight-app":[`xap`],"application/x-sql":[`*sql`],"application/x-stuffit":[`sit`],"application/x-stuffitx":[`sitx`],"application/x-subrip":[`srt`],"application/x-sv4cpio":[`sv4cpio`],"application/x-sv4crc":[`sv4crc`],"application/x-t3vm-image":[`t3`],"application/x-tads":[`gam`],"application/x-tar":[`tar`],"application/x-tcl":[`tcl`,`tk`],"application/x-tex":[`tex`],"application/x-tex-tfm":[`tfm`],"application/x-texinfo":[`texinfo`,`texi`],"application/x-tgif":[`*obj`],"application/x-ustar":[`ustar`],"application/x-virtualbox-hdd":[`hdd`],"application/x-virtualbox-ova":[`ova`],"application/x-virtualbox-ovf":[`ovf`],"application/x-virtualbox-vbox":[`vbox`],"application/x-virtualbox-vbox-extpack":[`vbox-extpack`],"application/x-virtualbox-vdi":[`vdi`],"application/x-virtualbox-vhd":[`vhd`],"application/x-virtualbox-vmdk":[`vmdk`],"application/x-wais-source":[`src`],"application/x-web-app-manifest+json":[`webapp`],"application/x-x509-ca-cert":[`der`,`crt`,`pem`],"application/x-xfig":[`fig`],"application/x-xliff+xml":[`*xlf`],"application/x-xpinstall":[`xpi`],"application/x-xz":[`xz`],"application/x-zip-compressed":[`*zip`],"application/x-zmachine":[`z1`,`z2`,`z3`,`z4`,`z5`,`z6`,`z7`,`z8`],"audio/vnd.dece.audio":[`uva`,`uvva`],"audio/vnd.digital-winds":[`eol`],"audio/vnd.dra":[`dra`],"audio/vnd.dts":[`dts`],"audio/vnd.dts.hd":[`dtshd`],"audio/vnd.lucent.voice":[`lvp`],"audio/vnd.ms-playready.media.pya":[`pya`],"audio/vnd.nuera.ecelp4800":[`ecelp4800`],"audio/vnd.nuera.ecelp7470":[`ecelp7470`],"audio/vnd.nuera.ecelp9600":[`ecelp9600`],"audio/vnd.rip":[`rip`],"audio/x-aac":[`*aac`],"audio/x-aiff":[`aif`,`aiff`,`aifc`],"audio/x-caf":[`caf`],"audio/x-flac":[`flac`],"audio/x-m4a":[`*m4a`],"audio/x-matroska":[`mka`],"audio/x-mpegurl":[`m3u`],"audio/x-ms-wax":[`wax`],"audio/x-ms-wma":[`wma`],"audio/x-pn-realaudio":[`ram`,`ra`],"audio/x-pn-realaudio-plugin":[`rmp`],"audio/x-realaudio":[`*ra`],"audio/x-wav":[`*wav`],"chemical/x-cdx":[`cdx`],"chemical/x-cif":[`cif`],"chemical/x-cmdf":[`cmdf`],"chemical/x-cml":[`cml`],"chemical/x-csml":[`csml`],"chemical/x-xyz":[`xyz`],"image/prs.btif":[`btif`,`btf`],"image/prs.pti":[`pti`],"image/vnd.adobe.photoshop":[`psd`],"image/vnd.airzip.accelerator.azv":[`azv`],"image/vnd.blockfact.facti":[`facti`],"image/vnd.dece.graphic":[`uvi`,`uvvi`,`uvg`,`uvvg`],"image/vnd.djvu":[`djvu`,`djv`],"image/vnd.dvb.subtitle":[`*sub`],"image/vnd.dwg":[`dwg`],"image/vnd.dxf":[`dxf`],"image/vnd.fastbidsheet":[`fbs`],"image/vnd.fpx":[`fpx`],"image/vnd.fst":[`fst`],"image/vnd.fujixerox.edmics-mmr":[`mmr`],"image/vnd.fujixerox.edmics-rlc":[`rlc`],"image/vnd.microsoft.icon":[`ico`],"image/vnd.ms-dds":[`dds`],"image/vnd.ms-modi":[`mdi`],"image/vnd.ms-photo":[`wdp`],"image/vnd.net-fpx":[`npx`],"image/vnd.pco.b16":[`b16`],"image/vnd.tencent.tap":[`tap`],"image/vnd.valve.source.texture":[`vtf`],"image/vnd.wap.wbmp":[`wbmp`],"image/vnd.xiff":[`xif`],"image/vnd.zbrush.pcx":[`pcx`],"image/x-3ds":[`3ds`],"image/x-adobe-dng":[`dng`],"image/x-cmu-raster":[`ras`],"image/x-cmx":[`cmx`],"image/x-freehand":[`fh`,`fhc`,`fh4`,`fh5`,`fh7`],"image/x-icon":[`*ico`],"image/x-jng":[`jng`],"image/x-mrsid-image":[`sid`],"image/x-ms-bmp":[`*bmp`],"image/x-pcx":[`*pcx`],"image/x-pict":[`pic`,`pct`],"image/x-portable-anymap":[`pnm`],"image/x-portable-bitmap":[`pbm`],"image/x-portable-graymap":[`pgm`],"image/x-portable-pixmap":[`ppm`],"image/x-rgb":[`rgb`],"image/x-tga":[`tga`],"image/x-xbitmap":[`xbm`],"image/x-xpixmap":[`xpm`],"image/x-xwindowdump":[`xwd`],"message/vnd.wfa.wsc":[`wsc`],"model/vnd.bary":[`bary`],"model/vnd.cld":[`cld`],"model/vnd.collada+xml":[`dae`],"model/vnd.dwf":[`dwf`],"model/vnd.gdl":[`gdl`],"model/vnd.gtw":[`gtw`],"model/vnd.mts":[`*mts`],"model/vnd.opengex":[`ogex`],"model/vnd.parasolid.transmit.binary":[`x_b`],"model/vnd.parasolid.transmit.text":[`x_t`],"model/vnd.pytha.pyox":[`pyo`,`pyox`],"model/vnd.sap.vds":[`vds`],"model/vnd.usda":[`usda`],"model/vnd.usdz+zip":[`usdz`],"model/vnd.valve.source.compiled-map":[`bsp`],"model/vnd.vtu":[`vtu`],"text/prs.lines.tag":[`dsc`],"text/vnd.curl":[`curl`],"text/vnd.curl.dcurl":[`dcurl`],"text/vnd.curl.mcurl":[`mcurl`],"text/vnd.curl.scurl":[`scurl`],"text/vnd.dvb.subtitle":[`sub`],"text/vnd.familysearch.gedcom":[`ged`],"text/vnd.fly":[`fly`],"text/vnd.fmi.flexstor":[`flx`],"text/vnd.graphviz":[`gv`],"text/vnd.in3d.3dml":[`3dml`],"text/vnd.in3d.spot":[`spot`],"text/vnd.sun.j2me.app-descriptor":[`jad`],"text/vnd.wap.wml":[`wml`],"text/vnd.wap.wmlscript":[`wmls`],"text/x-asm":[`s`,`asm`],"text/x-c":[`c`,`cc`,`cxx`,`cpp`,`h`,`hh`,`dic`],"text/x-component":[`htc`],"text/x-fortran":[`f`,`for`,`f77`,`f90`],"text/x-handlebars-template":[`hbs`],"text/x-java-source":[`java`],"text/x-lua":[`lua`],"text/x-markdown":[`mkd`],"text/x-nfo":[`nfo`],"text/x-opml":[`opml`],"text/x-org":[`*org`],"text/x-pascal":[`p`,`pas`],"text/x-processing":[`pde`],"text/x-sass":[`sass`],"text/x-scss":[`scss`],"text/x-setext":[`etx`],"text/x-sfv":[`sfv`],"text/x-suse-ymp":[`ymp`],"text/x-uuencode":[`uu`],"text/x-vcalendar":[`vcs`],"text/x-vcard":[`vcf`],"video/vnd.dece.hd":[`uvh`,`uvvh`],"video/vnd.dece.mobile":[`uvm`,`uvvm`],"video/vnd.dece.pd":[`uvp`,`uvvp`],"video/vnd.dece.sd":[`uvs`,`uvvs`],"video/vnd.dece.video":[`uvv`,`uvvv`],"video/vnd.dvb.file":[`dvb`],"video/vnd.fvt":[`fvt`],"video/vnd.mpegurl":[`mxu`,`m4u`],"video/vnd.ms-playready.media.pyv":[`pyv`],"video/vnd.uvvu.mp4":[`uvu`,`uvvu`],"video/vnd.vivo":[`viv`],"video/x-f4v":[`f4v`],"video/x-fli":[`fli`],"video/x-flv":[`flv`],"video/x-m4v":[`m4v`],"video/x-matroska":[`mkv`,`mk3d`,`mks`],"video/x-mng":[`mng`],"video/x-ms-asf":[`asf`,`asx`],"video/x-ms-vob":[`vob`],"video/x-ms-wm":[`wm`],"video/x-ms-wmv":[`wmv`],"video/x-ms-wmx":[`wmx`],"video/x-ms-wvx":[`wvx`],"video/x-msvideo":[`avi`],"video/x-sgi-movie":[`movie`],"video/x-smv":[`smv`],"x-conference/x-cooltalk":[`ice`]};Object.freeze(ZB);var QB={"application/andrew-inset":[`ez`],"application/appinstaller":[`appinstaller`],"application/applixware":[`aw`],"application/appx":[`appx`],"application/appxbundle":[`appxbundle`],"application/atom+xml":[`atom`],"application/atomcat+xml":[`atomcat`],"application/atomdeleted+xml":[`atomdeleted`],"application/atomsvc+xml":[`atomsvc`],"application/atsc-dwd+xml":[`dwd`],"application/atsc-held+xml":[`held`],"application/atsc-rsat+xml":[`rsat`],"application/automationml-aml+xml":[`aml`],"application/automationml-amlx+zip":[`amlx`],"application/bdoc":[`bdoc`],"application/calendar+xml":[`xcs`],"application/ccxml+xml":[`ccxml`],"application/cdfx+xml":[`cdfx`],"application/cdmi-capability":[`cdmia`],"application/cdmi-container":[`cdmic`],"application/cdmi-domain":[`cdmid`],"application/cdmi-object":[`cdmio`],"application/cdmi-queue":[`cdmiq`],"application/cpl+xml":[`cpl`],"application/cu-seeme":[`cu`],"application/cwl":[`cwl`],"application/dash+xml":[`mpd`],"application/dash-patch+xml":[`mpp`],"application/davmount+xml":[`davmount`],"application/dicom":[`dcm`],"application/docbook+xml":[`dbk`],"application/dssc+der":[`dssc`],"application/dssc+xml":[`xdssc`],"application/ecmascript":[`ecma`],"application/emma+xml":[`emma`],"application/emotionml+xml":[`emotionml`],"application/epub+zip":[`epub`],"application/exi":[`exi`],"application/express":[`exp`],"application/fdf":[`fdf`],"application/fdt+xml":[`fdt`],"application/font-tdpfr":[`pfr`],"application/geo+json":[`geojson`],"application/gml+xml":[`gml`],"application/gpx+xml":[`gpx`],"application/gxf":[`gxf`],"application/gzip":[`gz`],"application/hjson":[`hjson`],"application/hyperstudio":[`stk`],"application/inkml+xml":[`ink`,`inkml`],"application/ipfix":[`ipfix`],"application/its+xml":[`its`],"application/java-archive":[`jar`,`war`,`ear`],"application/java-serialized-object":[`ser`],"application/java-vm":[`class`],"application/javascript":[`*js`],"application/json":[`json`,`map`],"application/json5":[`json5`],"application/jsonml+json":[`jsonml`],"application/ld+json":[`jsonld`],"application/lgr+xml":[`lgr`],"application/lost+xml":[`lostxml`],"application/mac-binhex40":[`hqx`],"application/mac-compactpro":[`cpt`],"application/mads+xml":[`mads`],"application/manifest+json":[`webmanifest`],"application/marc":[`mrc`],"application/marcxml+xml":[`mrcx`],"application/mathematica":[`ma`,`nb`,`mb`],"application/mathml+xml":[`mathml`],"application/mbox":[`mbox`],"application/media-policy-dataset+xml":[`mpf`],"application/mediaservercontrol+xml":[`mscml`],"application/metalink+xml":[`metalink`],"application/metalink4+xml":[`meta4`],"application/mets+xml":[`mets`],"application/mmt-aei+xml":[`maei`],"application/mmt-usd+xml":[`musd`],"application/mods+xml":[`mods`],"application/mp21":[`m21`,`mp21`],"application/mp4":[`*mp4`,`*mpg4`,`mp4s`,`m4p`],"application/msix":[`msix`],"application/msixbundle":[`msixbundle`],"application/msword":[`doc`,`dot`],"application/mxf":[`mxf`],"application/n-quads":[`nq`],"application/n-triples":[`nt`],"application/node":[`cjs`],"application/octet-stream":[`bin`,`dms`,`lrf`,`mar`,`so`,`dist`,`distz`,`pkg`,`bpk`,`dump`,`elc`,`deploy`,`exe`,`dll`,`deb`,`dmg`,`iso`,`img`,`msi`,`msp`,`msm`,`buffer`],"application/oda":[`oda`],"application/oebps-package+xml":[`opf`],"application/ogg":[`ogx`],"application/omdoc+xml":[`omdoc`],"application/onenote":[`onetoc`,`onetoc2`,`onetmp`,`onepkg`,`one`,`onea`],"application/oxps":[`oxps`],"application/p2p-overlay+xml":[`relo`],"application/patch-ops-error+xml":[`xer`],"application/pdf":[`pdf`],"application/pgp-encrypted":[`pgp`],"application/pgp-keys":[`asc`],"application/pgp-signature":[`sig`,`*asc`],"application/pics-rules":[`prf`],"application/pkcs10":[`p10`],"application/pkcs7-mime":[`p7m`,`p7c`],"application/pkcs7-signature":[`p7s`],"application/pkcs8":[`p8`],"application/pkix-attr-cert":[`ac`],"application/pkix-cert":[`cer`],"application/pkix-crl":[`crl`],"application/pkix-pkipath":[`pkipath`],"application/pkixcmp":[`pki`],"application/pls+xml":[`pls`],"application/postscript":[`ai`,`eps`,`ps`],"application/provenance+xml":[`provx`],"application/pskc+xml":[`pskcxml`],"application/raml+yaml":[`raml`],"application/rdf+xml":[`rdf`,`owl`],"application/reginfo+xml":[`rif`],"application/relax-ng-compact-syntax":[`rnc`],"application/resource-lists+xml":[`rl`],"application/resource-lists-diff+xml":[`rld`],"application/rls-services+xml":[`rs`],"application/route-apd+xml":[`rapd`],"application/route-s-tsid+xml":[`sls`],"application/route-usd+xml":[`rusd`],"application/rpki-ghostbusters":[`gbr`],"application/rpki-manifest":[`mft`],"application/rpki-roa":[`roa`],"application/rsd+xml":[`rsd`],"application/rss+xml":[`rss`],"application/rtf":[`rtf`],"application/sbml+xml":[`sbml`],"application/scvp-cv-request":[`scq`],"application/scvp-cv-response":[`scs`],"application/scvp-vp-request":[`spq`],"application/scvp-vp-response":[`spp`],"application/sdp":[`sdp`],"application/senml+xml":[`senmlx`],"application/sensml+xml":[`sensmlx`],"application/set-payment-initiation":[`setpay`],"application/set-registration-initiation":[`setreg`],"application/shf+xml":[`shf`],"application/sieve":[`siv`,`sieve`],"application/smil+xml":[`smi`,`smil`],"application/sparql-query":[`rq`],"application/sparql-results+xml":[`srx`],"application/sql":[`sql`],"application/srgs":[`gram`],"application/srgs+xml":[`grxml`],"application/sru+xml":[`sru`],"application/ssdl+xml":[`ssdl`],"application/ssml+xml":[`ssml`],"application/swid+xml":[`swidtag`],"application/tei+xml":[`tei`,`teicorpus`],"application/thraud+xml":[`tfi`],"application/timestamped-data":[`tsd`],"application/toml":[`toml`],"application/trig":[`trig`],"application/ttml+xml":[`ttml`],"application/ubjson":[`ubj`],"application/urc-ressheet+xml":[`rsheet`],"application/urc-targetdesc+xml":[`td`],"application/voicexml+xml":[`vxml`],"application/wasm":[`wasm`],"application/watcherinfo+xml":[`wif`],"application/widget":[`wgt`],"application/winhlp":[`hlp`],"application/wsdl+xml":[`wsdl`],"application/wspolicy+xml":[`wspolicy`],"application/xaml+xml":[`xaml`],"application/xcap-att+xml":[`xav`],"application/xcap-caps+xml":[`xca`],"application/xcap-diff+xml":[`xdf`],"application/xcap-el+xml":[`xel`],"application/xcap-ns+xml":[`xns`],"application/xenc+xml":[`xenc`],"application/xfdf":[`xfdf`],"application/xhtml+xml":[`xhtml`,`xht`],"application/xliff+xml":[`xlf`],"application/xml":[`xml`,`xsl`,`xsd`,`rng`],"application/xml-dtd":[`dtd`],"application/xop+xml":[`xop`],"application/xproc+xml":[`xpl`],"application/xslt+xml":[`*xsl`,`xslt`],"application/xspf+xml":[`xspf`],"application/xv+xml":[`mxml`,`xhvml`,`xvml`,`xvm`],"application/yang":[`yang`],"application/yin+xml":[`yin`],"application/zip":[`zip`],"application/zip+dotlottie":[`lottie`],"audio/3gpp":[`*3gpp`],"audio/aac":[`adts`,`aac`],"audio/adpcm":[`adp`],"audio/amr":[`amr`],"audio/basic":[`au`,`snd`],"audio/midi":[`mid`,`midi`,`kar`,`rmi`],"audio/mobile-xmf":[`mxmf`],"audio/mp3":[`*mp3`],"audio/mp4":[`m4a`,`mp4a`,`m4b`],"audio/mpeg":[`mpga`,`mp2`,`mp2a`,`mp3`,`m2a`,`m3a`],"audio/ogg":[`oga`,`ogg`,`spx`,`opus`],"audio/s3m":[`s3m`],"audio/silk":[`sil`],"audio/wav":[`wav`],"audio/wave":[`*wav`],"audio/webm":[`weba`],"audio/xm":[`xm`],"font/collection":[`ttc`],"font/otf":[`otf`],"font/ttf":[`ttf`],"font/woff":[`woff`],"font/woff2":[`woff2`],"image/aces":[`exr`],"image/apng":[`apng`],"image/avci":[`avci`],"image/avcs":[`avcs`],"image/avif":[`avif`],"image/bmp":[`bmp`,`dib`],"image/cgm":[`cgm`],"image/dicom-rle":[`drle`],"image/dpx":[`dpx`],"image/emf":[`emf`],"image/fits":[`fits`],"image/g3fax":[`g3`],"image/gif":[`gif`],"image/heic":[`heic`],"image/heic-sequence":[`heics`],"image/heif":[`heif`],"image/heif-sequence":[`heifs`],"image/hej2k":[`hej2`],"image/ief":[`ief`],"image/jaii":[`jaii`],"image/jais":[`jais`],"image/jls":[`jls`],"image/jp2":[`jp2`,`jpg2`],"image/jpeg":[`jpg`,`jpeg`,`jpe`],"image/jph":[`jph`],"image/jphc":[`jhc`],"image/jpm":[`jpm`,`jpgm`],"image/jpx":[`jpx`,`jpf`],"image/jxl":[`jxl`],"image/jxr":[`jxr`],"image/jxra":[`jxra`],"image/jxrs":[`jxrs`],"image/jxs":[`jxs`],"image/jxsc":[`jxsc`],"image/jxsi":[`jxsi`],"image/jxss":[`jxss`],"image/ktx":[`ktx`],"image/ktx2":[`ktx2`],"image/pjpeg":[`jfif`],"image/png":[`png`],"image/sgi":[`sgi`],"image/svg+xml":[`svg`,`svgz`],"image/t38":[`t38`],"image/tiff":[`tif`,`tiff`],"image/tiff-fx":[`tfx`],"image/webp":[`webp`],"image/wmf":[`wmf`],"message/disposition-notification":[`disposition-notification`],"message/global":[`u8msg`],"message/global-delivery-status":[`u8dsn`],"message/global-disposition-notification":[`u8mdn`],"message/global-headers":[`u8hdr`],"message/rfc822":[`eml`,`mime`,`mht`,`mhtml`],"model/3mf":[`3mf`],"model/gltf+json":[`gltf`],"model/gltf-binary":[`glb`],"model/iges":[`igs`,`iges`],"model/jt":[`jt`],"model/mesh":[`msh`,`mesh`,`silo`],"model/mtl":[`mtl`],"model/obj":[`obj`],"model/prc":[`prc`],"model/step":[`step`,`stp`,`stpnc`,`p21`,`210`],"model/step+xml":[`stpx`],"model/step+zip":[`stpz`],"model/step-xml+zip":[`stpxz`],"model/stl":[`stl`],"model/u3d":[`u3d`],"model/vrml":[`wrl`,`vrml`],"model/x3d+binary":[`*x3db`,`x3dbz`],"model/x3d+fastinfoset":[`x3db`],"model/x3d+vrml":[`*x3dv`,`x3dvz`],"model/x3d+xml":[`x3d`,`x3dz`],"model/x3d-vrml":[`x3dv`],"text/cache-manifest":[`appcache`,`manifest`],"text/calendar":[`ics`,`ifb`],"text/coffeescript":[`coffee`,`litcoffee`],"text/css":[`css`],"text/csv":[`csv`],"text/html":[`html`,`htm`,`shtml`],"text/jade":[`jade`],"text/javascript":[`js`,`mjs`],"text/jsx":[`jsx`],"text/less":[`less`],"text/markdown":[`md`,`markdown`],"text/mathml":[`mml`],"text/mdx":[`mdx`],"text/n3":[`n3`],"text/plain":[`txt`,`text`,`conf`,`def`,`list`,`log`,`in`,`ini`],"text/richtext":[`rtx`],"text/rtf":[`*rtf`],"text/sgml":[`sgml`,`sgm`],"text/shex":[`shex`],"text/slim":[`slim`,`slm`],"text/spdx":[`spdx`],"text/stylus":[`stylus`,`styl`],"text/tab-separated-values":[`tsv`],"text/troff":[`t`,`tr`,`roff`,`man`,`me`,`ms`],"text/turtle":[`ttl`],"text/uri-list":[`uri`,`uris`,`urls`],"text/vcard":[`vcard`],"text/vtt":[`vtt`],"text/wgsl":[`wgsl`],"text/xml":[`*xml`],"text/yaml":[`yaml`,`yml`],"video/3gpp":[`3gp`,`3gpp`],"video/3gpp2":[`3g2`],"video/h261":[`h261`],"video/h263":[`h263`],"video/h264":[`h264`],"video/iso.segment":[`m4s`],"video/jpeg":[`jpgv`],"video/jpm":[`*jpm`,`*jpgm`],"video/mj2":[`mj2`,`mjp2`],"video/mp2t":[`ts`,`m2t`,`m2ts`,`mts`],"video/mp4":[`mp4`,`mp4v`,`mpg4`],"video/mpeg":[`mpeg`,`mpg`,`mpe`,`m1v`,`m2v`],"video/ogg":[`ogv`],"video/quicktime":[`qt`,`mov`],"video/webm":[`webm`]};Object.freeze(QB);var $B=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},eV,tV,nV,pDe=class{constructor(...e){eV.set(this,new Map),tV.set(this,new Map),nV.set(this,new Map);for(let t of e)this.define(t)}define(e,t=!1){for(let[n,r]of Object.entries(e)){n=n.toLowerCase(),r=r.map(e=>e.toLowerCase()),$B(this,nV,`f`).has(n)||$B(this,nV,`f`).set(n,new Set);let e=$B(this,nV,`f`).get(n),i=!0;for(let a of r){let r=a.startsWith(`*`);if(a=r?a.slice(1):a,e?.add(a),i&&$B(this,tV,`f`).set(n,a),i=!1,r)continue;let o=$B(this,eV,`f`).get(a);if(o&&o!=n&&!t)throw Error(`"${n} -> ${a}" conflicts with "${o} -> ${a}". Pass \`force=true\` to override this definition.`);$B(this,eV,`f`).set(a,n)}}return this}getType(e){if(typeof e!=`string`)return null;let t=e.replace(/^.*[/\\]/s,``).toLowerCase(),n=t.replace(/^.*\./s,``).toLowerCase(),r=t.length<e.length;return!(n.length<t.length-1)&&r?null:$B(this,eV,`f`).get(n)??null}getExtension(e){return typeof e==`string`?(e=e?.split?.(`;`)[0],(e&&$B(this,tV,`f`).get(e.trim().toLowerCase()))??null):null}getAllExtensions(e){return typeof e==`string`?(e=e.split(`;`)[0].trim().toLowerCase(),$B(this,nV,`f`).get(e)??null):null}_freeze(){this.define=()=>{throw Error(`define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances`)},Object.freeze(this);for(let e of $B(this,nV,`f`).values())Object.freeze(e);return this}_getTestState(){return{types:$B(this,eV,`f`),extensions:$B(this,tV,`f`)}}};eV=new WeakMap,tV=new WeakMap,nV=new WeakMap;var rV=new pDe(QB,ZB)._freeze(),iV=[`image`,`video`,`audio`],aV=[`image`,`video`],oV=e=>/\.pdf$/i.test(e),sV=e=>aV.includes(e.kind)||oV(e.name),mDe=[...iV,`document`,`other`],hDe=/\.(?:csv|docx?|odp|ods|odt|pdf|pptx?|rtf|xlsx?)$/i,gDe=/^(?<type>image|video|audio)\//,cV=e=>iV.includes(e),lV=(e,t)=>{let n=rV.getType(t);return cV(e)||n===`application/pdf`||!!n&&Hk(n)},uV=e=>lV(e.kind,e.path),dV=e=>{if(!e)return;let[t,n]=e.split(`/`);if(cV(t)&&n&&!n.startsWith(`x-`))return t},fV=e=>{if(e.startsWith(`data:`))return dV(e.slice(5).split(/[;,]/)[0]);if(wE(e)){let{hostname:t,pathname:n}=new URL(e);if(t.startsWith(`images.`))return`image`;e=n}return dV(rV.getType(e)??``)},_De=async e=>{if(typeof e==`string`){if(!e.startsWith(`blob:`))return fV(e);try{return dV((await(await fetch(e)).blob()).type)}catch{return}}if(e instanceof Blob)return dV(e.type)},vDe=e=>{let t=rV.getType(e.path);return!!t&&Hk(t)},pV=e=>rV.getType(e)?.match(gDe)?.groups?.type??(hDe.test(e)?`document`:`other`),yDe=(e,t)=>{let n=t.toLowerCase();return e.filter(({fileName:e,description:t})=>e.toLowerCase().includes(n)||t.toLowerCase().includes(n))},mV=({prefix:e=``})=>e&&!e.endsWith(`/`)?`${e}/`:e,hV=(e,t)=>`${mV(e)}${t}/`,gV=(e,t)=>`${mV(e)}${t}`,_V=(e,t)=>{let n=mV(e);return n&&t.startsWith(n)?t.slice(n.length):t},vV=async(e,{maxPages:t=10}={})=>{let n=[],r;for(let i=1;i<=t;i+=1){let{results:a,next:o}=await e(r);if(n.push(...a),!o||i===t)break;r=o,await pl(50)}return n},yV=async(e,t,{allowNotFound:n=!1}={})=>{if(!e.ok&&!(n&&e.status===404)){let n=await e.text();throw Error(`${t}: ${n}`)}},bV=(e,t)=>t?hV(e,t):mV(e),xV=async(e,t,n,{maxPages:r=10,dirPath:i,delimiter:a}={})=>{let o=e.requireCredential(n),s=bV(t,i),c=[],l=[],u=!1;return(await vV(async n=>{let r=await e.listPage({config:t,credential:o,prefix:s,cursor:n,...a&&{delimiter:a}});return u=!!r.cursor,{results:r.items,next:r.cursor}},{maxPages:r})).forEach(n=>{let r=e.getKey(n);if(r.endsWith(`/`)){let e=_V(t,r).replace(/\/$/,``);e&&l.push(e)}else c.push(n)}),{files:c,folders:l,truncated:u}},SV=(e,t,{kind:n})=>n?t.filter(t=>pV(e.getKey(t))===n):t,CV=async(e,t,n,r={})=>{let{files:i}=await xV(e,t,n,r);return e.parseResults(SV(e,i,n),t,n.apiKey)},bDe=async(e,t,n)=>{let{files:r,folders:i,truncated:a}=await xV(e,t,n);return{assets:e.parseResults(SV(e,r,n),t,n.apiKey),folders:i,truncated:a}},xDe=async(e,t,n,r)=>{let{files:i,folders:a}=await xV(e,n,r,{maxPages:1/0,dirPath:t});return{assets:e.parseResults(i,n,r.apiKey),folders:a}},SDe=async(e,t,n,r)=>yDe(await CV(e,n,r,{maxPages:5}),t),CDe=async(e,t,n,r)=>{let i=bV(t,r),{files:a}=await xV(e,t,n,{maxPages:1/0,dirPath:r,delimiter:`/`});return a.map(t=>e.getKey(t).slice(i.length).normalize()).filter(e=>!e.includes(`/`))},wDe=async(e,t,n,r)=>{if(t.length===0)return[];let i=e.requireCredential(r),{dirPath:a=``}=r,o=await CDe(e,n,r,a),s=t.map(e=>{let t=YB(e.name.split(/[/\\]/).filter(Boolean).at(-1)??``,{assetNamesInSameFolder:o});if(!t)throw Error(`Invalid file name: ${e.name}`);return o.push(t),gV(n,a?`${a}/${t}`:t)}),c=[];for(let[r,a]of t.entries())c.push(await e.putObject({key:s[r],file:a,config:n,credential:i})),t.length>1&&await pl(50);return e.parseResults(c,n,i)},TDe=async(e,t,n,r)=>{let i=e.requireCredential(r);for(let{id:r}of t)await e.deleteObject({key:r,config:n,credential:i}),t.length>1&&await pl(50)},EDe=async(e,t,n,r,i)=>{let a=e.requireCredential(i),o=await e.putObject({key:t.id,file:n,config:r,credential:a});return e.parseResults([o],r,a)[0]},DDe=async(e,t,n,r,i)=>{let a=e.requireCredential(i),o=gV(r,n),s=await e.copyObject({asset:t,key:o,config:r,credential:a});return await e.deleteObject({key:t.id,config:r,credential:a}),e.parseResults([s],r,a)[0]},ODe=async(e,t,n,r)=>{let i=e.requireCredential(r);await e.putFolderObject({key:hV(n,t),config:n,credential:i})},kDe=async(e,t,n,r)=>{let i=e.requireCredential(r);await e.deleteObject({key:hV(n,t),config:n,credential:i,allowNotFound:!0})},ADe=(e,t,n)=>{let r=_V(e,t.id).split(`/`).slice(0,-1).join(`/`);return r?`${r}/${n}`:n},wV=e=>{let t=(t,n,r,i)=>DDe(e,t,n,r,i);return{list:(t,n)=>CV(e,t,n),browse:(t,n)=>bDe(e,t,n),listFolder:(t,n,r)=>xDe(e,t,n,r),search:(t,n,r)=>SDe(e,t,n,r),upload:(t,n,r)=>wDe(e,t,n,r),delete:(t,n,r)=>TDe(e,t,n,r),rename:(e,n,r,i)=>t(e,ADe(r,e,n),r,i),replace:(t,n,r,i)=>EDe(e,t,n,r,i),move:t,createFolder:(t,n,r)=>ODe(e,t,n,r),deleteFolder:(t,n,r)=>kDe(e,t,n,r)}},TV=(e,t)=>{let n=t?.media_libraries?.[e];if(n!=null)return n;let{media_library:r}=t??{},i=r?.name??xk.current?.media_library?.name;return r&&i===e?r:void 0},EV=(e,t)=>{if(t===void 0)return e;if(!t||!e)return t;let n={...e,...t};return Object.entries(t).forEach(([t,r])=>{E(r)&&E(e[t])&&(n[t]={...e[t],...r})}),n},DV=(e,t)=>EV(TV(e,xk.current),TV(e,t)),OV=pk(!1),kV=pk(!1),AV=pk(!1),jV=new URL(`https://console.cloudinary.com/console/media_library`).origin,jDe=[`cloud_name`,`api_key`,`username`,`timestamp`,`signature`,`integration`,`use_saml`,`saml_iframe_support`],MDe=[`integration`,`inline_container`,`z_index`,`multiple`,`max_files`,`default_transformations`,`insert_caption`,`remove_header`,`folder`,`search`,`collection`,`asset`,`transformation`,`sandboxNotAllowedAttributes`,`theme`],NDe=(e=xk.current)=>TV(`cloudinary`,e),MV=new Map,NV=e=>{let t=e?JSON.stringify(e):`global`,n=MV.get(t);if(n)return n;let r=DV(`cloudinary`,e)||{},i={...r,config:{...r.config}};return MV.set(t,i),i},PV=e=>{let t=DV(`cloudinary`,e),{cloud_name:n,api_key:r}=(t?t.config:void 0)??{};return{cloudName:n,apiKey:r}},PDe={serviceType:`cloud_storage`,serviceId:`cloudinary`,serviceLabel:`Cloudinary`,serviceURL:`https://cloudinary.com/`,showServiceLink:!0,hotlinking:!0,authType:`widget`,developerURL:`https://cloudinary.com/documentation/`,apiKeyURL:`https://console.cloudinary.com/settings/api-keys`,apiKeyPattern:/^[A-Za-z0-9_-]{15,}$/,isEnabled:e=>{let{cloudName:t,apiKey:n}=PV(e);return!!(t&&n)},isAssetURL:e=>{let{cloudName:t}=PV();return!!t&&e.startsWith(`https://res.cloudinary.com/${t}/`)}},FV=(e,{noopener:t=!0}={})=>{if(!e)return null;let n=t?`noopener,noreferrer`:``;return window.open(e,`_blank`,n)},FDe=B(`<!> <div role="none"> </div>`,1);function IV(e,t){O(t,!0);let n=J(t,`multiple`,3,!1),r=J(t,`hidden`,3,!1),i=A(()=>NV(t.fieldConfig)),a=null,o=()=>{let{folder:e}=z(i).config,r={...Object.fromEntries(Object.entries(z(i).config).filter(([e])=>MDe.includes(e))),multiple:n(),max_files:t.fieldConfig?.max??z(i).config.max_files??20,folder:{path:e?.path??``,resource_type:e?.resource_type??t.kind}},o={type:`ML_WIDGET_SHOW`,data:{mlId:a?.dataset?.mlId,config:r}};console.debug(`Cloudinary Panel sending message:`,o),a?.contentWindow?.postMessage(JSON.stringify(o),jV)},s=({assets:e})=>{let{output_filename_only:n=!1,use_transformations:r=!0}=z(i),a=e.map(e=>{let t=e.secure_url;if(n){let{public_id:t,format:n}=e;return{url:n?`${t}.${n}`:t}}return r?{url:e.derived?.[0]?.secure_url??t}:{url:t}});t.onSelect(a)},c=({origin:e,data:t})=>{if(e===jV){if(typeof t==`string`)try{t=JSON.parse(t)}catch{return}E(t)&&(console.debug(`Cloudinary Panel received message:`,t),t.type===`login`&&t.consoleDomain&&(OV.current=!0,AV.current=!0),t.type===`consoleLoaded`&&(kV.current=!0),t.type===`ML_WIDGET_INSERT_DATA`&&(AV.current=!1,s(t.data)),t.type===`ML_WIDGET_HIDE`&&(AV.current=!1))}};js(()=>(a=document.querySelector(`iframe#cloudinary-iframe`),window.addEventListener(`message`,c),()=>{window.removeEventListener(`message`,c)})),L(()=>{z(i)&&kV.current&&o()});var l=H(),u=P(l),d=e=>{VO(e,{children:(e,t)=>{var n=H(),r=P(n),i=e=>{{let t=A(()=>Y(`cloud_storage.cloudinary.open_library`));Al(e,{variant:`primary`,get label(){return z(t)},onclick:()=>{AV.current=!0}})}},a=e=>{var t=FDe(),n=P(t);{let e=A(()=>Y(`cloud_storage.cloudinary.activate.button_label`));Al(n,{variant:`primary`,get label(){return z(e)},onclick:()=>{FV(`https://console.cloudinary.com/console/media_library/cms_login?cms=true`,{noopener:!1})}})}var r=F(I(n,2),!0);R(e=>W(r,e),[()=>Y(`cloud_storage.cloudinary.activate.description`)]),U(e,t)};G(r,e=>{OV.current?e(i):e(a,-1)}),U(e,n)},$$slots:{default:!0}})};G(u,e=>{r()||e(d)}),U(e,l),k()}var IDe=B(`<strong></strong>`),LDe=B(`<!>/`,1),RDe=B(`<span class="name svelte-1ngvthn" dir="ltr" aria-hidden="true"><!> <!></span>`),zDe={hash:`svelte-1ngvthn`,code:`.name.svelte-1ngvthn {color:var(--sui-tertiary-foreground-color);strong {color:var(--sui-primary-foreground-color);font-weight:var(--sui-font-weight-normal);}}`};function LV(e,t){O(t,!0),K(e,zDe);let n={ALLOWED_TAGS:[`wbr`],ALLOWED_ATTR:[]},r=J(t,`children`,3,void 0),i=A(()=>t.path?CE(t.path).split(`/`):t.caption?[t.caption]:[]),a=e=>_t(e.replace(/([-_.])/g,`$1<wbr>`),n);var o=H(),s=P(o),c=e=>{var t=RDe(),n=N(t);fl(n,{lines:2,children:(e,t)=>{var n=H();Bo(P(n),19,()=>z(i),(e,t)=>`${e}-${t}`,(e,t,n)=>{var r=H(),o=P(r),s=e=>{var n=IDe();Wo(n,()=>a(z(t)),!0),D(n),U(e,n)},c=e=>{var n=LDe();Wo(P(n),()=>a(z(t))),Qr(),U(e,n)};G(o,e=>{z(n)===z(i).length-1?e(s):e(c,-1)}),U(e,r)}),U(e,n)},$$slots:{default:!0}}),Go(I(n,2),()=>r()??kr),D(t),R(()=>t.dir=t.dir),U(e,t)};G(s,e=>{z(i).length&&e(c)}),U(e,o),k()}var RV=e=>{{let t=A(()=>qc()?`chevron_left`:`chevron_right`);Xc(e,{get name(){return z(t)},class:`separator`})}},zV=(e,t)=>{let n=()=>(t?.()).label,r=()=>(t?.()).onClick;var i=VDe(),a=P(i);Al(a,{variant:`link`,class:`crumb`,get onclick(){return r()},children:(e,t)=>{var r=BDe(),i=F(r,!0);R(()=>W(i,n())),U(e,r)},$$slots:{default:!0}}),RV(I(a,2)),U(e,i)},BDe=B(`<bdi class="svelte-r6xh9b"> </bdi>`),VDe=B(`<!> <!>`,1),HDe=B(`<!> <!> <!>`,1),UDe=B(`<span class="crumb svelte-r6xh9b"><bdi> </bdi></span> <!>`,1),WDe=B(`<nav><!> <span class="current svelte-r6xh9b"><bdi> </bdi></span> <div class="copy svelte-r6xh9b" aria-hidden="true" inert=""><!> <span class="current svelte-r6xh9b"><bdi> </bdi></span></div></nav>`),GDe={hash:`svelte-r6xh9b`,code:`.breadcrumb.svelte-r6xh9b {position:relative;display:flex;align-items:center;gap:4px;min-width:0;white-space:nowrap;
/* A name is cut short with an ellipsis rather than wrapped, down to the least width the script
above gives it, so the trail stays one line tall */& > .crumb,
& > .current:where(.svelte-r6xh9b) {flex:0 1 auto;overflow:hidden;min-width:0;text-overflow:ellipsis;}.current:where(.svelte-r6xh9b) {display:block;}.copy:where(.svelte-r6xh9b) {position:absolute;inset-block-start:0;inset-inline-start:0;display:flex;align-items:center;gap:4px;visibility:hidden;pointer-events:none;& > :where(.svelte-r6xh9b) {flex:none;}}.sui.button.crumb {display:block;color:var(--sui-secondary-foreground-color);font-size:inherit;.label {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}&:hover .label {color:var(--sui-primary-foreground-color);}}.separator,
.more {flex:none;color:var(--sui-secondary-foreground-color);}}`};function BV(e,t){O(t,!0),K(e,GDe);let n=J(t,`class`,3,``),r=j(void 0),i=j(void 0),a=j(!1),o=A(()=>t.items.slice(0,-1)),s=A(()=>t.items.at(-1)),c=A(()=>z(o).slice(1)),l=A(()=>z(c).length>0),u=e=>e.querySelector(`bdi`)?.textContent??``,d=()=>{if(!z(r)||!z(i))return;let e=parseFloat(getComputedStyle(z(r)).fontSize),t={},n=(z(i).children.length-1)*4;[...z(i).children].forEach(r=>{let{classList:i}=r,{width:a}=r.getBoundingClientRect();if(i.contains(`crumb`)||i.contains(`current`)){let o=Math.min(a,e*(i.contains(`current`)?6:4.5));t[u(r)]=o,n+=o}else n+=a}),[...z(r).children].forEach(e=>{let{classList:n}=e;(n.contains(`crumb`)||n.contains(`current`))&&(e.style.minWidth=`${t[u(e)]}px`)}),M(a,z(l)&&n>z(r).clientWidth+1,!0)};L(()=>{t.items;let e=z(r);if(!e)return;let n=new ResizeObserver(()=>{requestAnimationFrame(()=>{d()})});return n.observe(e),fo(()=>{d()}),document.fonts.ready.then(()=>{d()}),()=>{n.disconnect()}}),L(()=>{z(a),fo(()=>{d()})});var f=WDe(),p=N(f),m=e=>{var t=HDe(),n=P(t);zV(n,()=>z(o)[0]);var r=I(n,2);{let e=e=>{Xc(e,{name:`more_horiz`})},t=e=>{{let t=A(()=>Y(`more_folders`));Eu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();Bo(P(n),17,()=>z(c),Ro,(e,t)=>{let n=()=>z(t).label,r=()=>z(t).onClick;Du(e,{variant:`ghost`,get label(){return n()},get onclick(){return r()},startIcon:e=>{Xc(e,{name:`folder`})},$$slots:{startIcon:!0}})}),U(e,n)},$$slots:{default:!0}})}},n=A(()=>Y(`more_folders`));Xl(r,{variant:`ghost`,iconic:!0,size:`small`,class:`more`,get"aria-label"(){return z(n)},endIcon:e,popup:t,$$slots:{endIcon:!0,popup:!0}})}RV(I(r,2)),U(e,t)},h=e=>{var t=H();Bo(P(t),17,()=>z(o),Ro,(e,t)=>{zV(e,()=>z(t))}),U(e,t)};G(p,e=>{z(a)?e(m):e(h,-1)});var g=I(p,2),_=F(N(g),!0);D(g);var v=I(g,2),y=N(v);Bo(y,17,()=>z(o),Ro,(e,t)=>{let n=()=>z(t).label;var r=UDe(),i=P(r),a=F(N(i),!0);D(i),RV(I(i,2)),R(()=>W(a,n())),U(e,r)});var b=I(y,2),x=F(N(b),!0);D(b),D(v),Ds(v,e=>M(i,e),()=>z(i)),D(f),Ds(f,e=>M(r,e),()=>z(r)),R(e=>{os(f,1,ns([`breadcrumb`,n(),{folded:z(a)}]),`svelte-r6xh9b`),q(f,`aria-label`,e),W(_,z(s).label),W(x,z(s).label)},[()=>Y(`folder`)]),U(e,f),k()}var VV=[`admin`,`cms`],HV=[``,`static`,`public`],UV=e=>CE(e).normalize().toLowerCase(),KDe=e=>VV.includes(UV(e)),qDe=(e,t)=>{if(typeof e!=`string`||typeof t!=`string`)return;let n=CE(e).replace(/^\.(?:\/|$)/,``),r=CE(t);if(!(gN(n)||gN(r)||/^[.@]/.test(r)))return!r||n===r?r?``:n:n.endsWith(`/${r}`)?n.slice(0,-r.length-1):void 0},WV=e=>{let t=e.split(`/`).filter(Boolean);t.at(-1)?.includes(`.`)&&t.pop();try{let e=t.map(decodeURIComponent);return e.map((t,n)=>e.slice(n).join(`/`))}catch{return[]}},GV,JDe=()=>{let{media_folder:e,public_folder:t}=xk.current??{},n=globalThis.location?.pathname??``,r=JSON.stringify([e,t,n]);if(GV?.key!==r){let i=qDe(e,t),a=i===void 0?HV:[...HV,i],o=[...VV,...WV(n)];GV={key:r,paths:a.flatMap(e=>o.map(t=>UV(`${e}/${t}`)))}}return GV.paths},KV=e=>{let t=UV(e);return JDe().some(e=>t===e||t.startsWith(`${e}/`))},YDe=/^(?:index\.html|config\.(?:ya?ml|toml|json))$/,XDe=(e,t)=>{if(!YDe.test(UV(t)))return!1;let n=[...VV,...WV(globalThis.location?.pathname??``).slice(-1).map(UV)];return UV(e).split(`/`).some(e=>n.includes(e))},qV=e=>{let t=e.lastIndexOf(`/`),n=e.slice(0,Math.max(t,0));return KV(n)||XDe(n,e.slice(t+1))},JV=e=>{if(e.some(qV))throw Error(`Cannot change a file in a folder the CMS is served from`)},YV=pk(),XV=pk(),ZV=async(e,t)=>{let n={};if(e)try{n=await t(e)}catch{}YV.current=n.canPush===!1?e:void 0,XV.current=n.canMerge===!1?e:void 0},QV=pk(),$V=hk(()=>!!QV.current),eH=pk(!1),tH=e=>e?.message===`entry_already_published`,nH=e=>e?`${e.owner}/${e.repo}`:``,ZDe=(e,t)=>{let{repoURL:n,owner:r,repo:i}=e??{};return!t||!n?``:n.slice(0,-`${r}/${i}`.length)+nH(t)},rH=pk(),QDe=async e=>(rH.current?.respond(!1),new Promise(t=>{let n={repo:e,respond:e=>{rH.current===n&&(rH.current=void 0),t(e)}};rH.current=n})),iH=pk([]),aH=hk(()=>iH.current.find(({collectionName:e,componentName:t,typedKeyPath:n,internalPath:r})=>e===void 0&&t===void 0&&n===void 0&&r!==void 0)),oH=pk(),sH=hk(()=>{let{current:e}=oH;return e?.internalPath===void 0?aH.current:e}),cH=e=>{let t=`typedKeyPath`in e?e.typedKeyPath?.match(/[^:]+$/)?.[0]:e.typedKeyPath;return iH.current.find(n=>(`typedKeyPath`in e?n.typedKeyPath===t:!n.typedKeyPath)?e.componentName?n.componentName===(aM(e.componentName)??e.componentName):n.collectionName===e.collectionName&&n.fileName===e.fileName&&!!n.isIndexFile==!!e.isIndexFile:!1)},$De=({internalPath:e,internalSubPath:t,localeFolderNames:n})=>{let r=n?.length?`(?:(?:${n.map(xE).join(`|`)})\\/)?`:``,i=e;if(zA(i))return RegExp(`^${UA(i,r)}`);if(i)return RegExp(`^${r}${xE(i)}\\/`);let a=t,[o]=a.split(`/`);if(!o||o===`..`||gN(o))return/(?!)/;let s=xE(a).replace(Jk,`[^/]+`);return RegExp(`^${r}${s}\\/`)},eOe=RA(()=>iH.current,e=>{let t=[],n=[];return e.forEach(e=>{let{internalPath:r,entryRelative:i}=e;if(r!==void 0){if(i)n.push({folder:e,regex:$De(e)});else{let n=xE(r).replace(Jk,`.+?`);t.push({folder:e,regexSub:RegExp(`^${n}${r?`(?=\\/|$)`:`$`}`),regexExact:RegExp(`^${n}$`)})}}}),{items:t,entryRelative:n}}),lH=(e,{matchSubFolders:t=!0}={})=>{let{filename:n,dirname:r}=Uk(e);if(n.startsWith(`+`))return[];let{items:i,entryRelative:a}=eOe(),o=r??``;return[...a.filter(({regex:t})=>t.test(e)).map(({folder:e})=>e),...i.filter(({regexSub:e,regexExact:n})=>(t?e:n).test(o)).map(({folder:e})=>e)].sort((e,t)=>t.internalPath.localeCompare(e.internalPath))},tOe=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i,internalPath:a,internalSubPath:o,publicPath:s})=>JSON.stringify([e,t,n,r,i,a,o,s]),uH=e=>!!e&&!e.entryRelative&&!e.hasTemplateTags&&!e.readonly,dH=hk(()=>$V.current||!!YV.current),nOe=RA(()=>iH.current,e=>new Set(e.filter(({readonly:e,entryRelative:t})=>e&&!t).map(({internalPath:e})=>e))),fH=e=>e.some(({folder:e,path:t})=>!!e?.readonly||!e?.entryRelative&&nOe().has(e?.internalPath)||qV(t)),pH=pk([]),mH=hk(()=>pH.current.some(({workflow:e})=>e)?pH.current.filter(({workflow:e})=>!e):pH.current),hH=pk([]),rOe=hk(()=>new Set(hH.current.map(e=>e.path))),gH=pk(),iOe=hk(()=>hH.current.length?[...hH.current]:gH.current?[gH.current]:[]),_H=pk(),vH=pk({folder:void 0,files:[]}),yH=pk(),bH=pk(),xH=/^(?:.+\/)?(\.git(?:attributes|ignore|keep))$/,SH=pk([]),CH=({libraryName:e=`default`,fieldConfig:t}={})=>{let n=Sk.current,r=n?.media_library?.name??`default`,i=()=>{let n=t?.media_libraries?.[e];if(n!=null)return n;let i=t?.media_library;return i&&r===e&&(i.name===e||i.name===void 0)?i:void 0},a=n?.media_libraries?.[e]??(n?.media_library&&r===e?n.media_library:void 0),o=i(),s=EV(a,o);if(s===!1)return!1;if(e!=="default")return{...s};let c={...n?.media_libraries?.all,...a?a.config:void 0,...t?.media_libraries?.all,...o?o.config:void 0};return s?.config!==void 0||Object.keys(c).length>0?{...s,config:c}:{...s}},wH=[`avif`,`gif`,`heic`,`jpeg`,`png`,`webp`],aOe=[`image/heic`,`image/heif`],TH=wH.filter(e=>e!==`heic`).map(e=>`image/${e}`),EH=/\b(?:avif|gif|heic|heif|jfif|jpe?g|jpe|png|webp)$/i,DH=[`svg`],oOe=[`image/svg+xml`],sOe=/\b(?:svg)$/i,cOe=[...wH,...DH],OH=[...TH,...oOe],kH=[...OH,...aOe],lOe={avif:`AVIF`,gif:`GIF`,heic:`HEIC`,jpeg:`JPEG`,png:`PNG`,webp:`WebP`,svg:`SVG`},AH=e=>{let t=e===kH.join(`,`);if(t||e===OH.join(`,`))return cOe.filter(e=>t||e!==`heic`).map(e=>lOe[e])},uOe=[`webp`],jH=(e,t,n)=>[...n].every((n,r)=>e[t+r]===n.charCodeAt(0)),MH=e=>e&128?3*2**((e&7)+1):0,NH=(e,t)=>{let n=t;for(;n<e.length&&e[n]!==0;)n+=e[n]+1;return n+1},dOe=e=>{let t=13+MH(e[10]),n=0;for(;t<e.length;){let r=e[t];if(r===33)t=NH(e,t+2);else if(r===44){if(n+=1,n>1)return!0;t=NH(e,t+10+MH(e[t+9])+1)}else break}return!1},fOe=e=>jH(e,12,`VP8X`)&&!!(e[20]&2),pOe=e=>{let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=8;for(;n+8<=e.length;){if(jH(e,n+4,`acTL`))return!0;if(jH(e,n+4,`IDAT`))return!1;n+=t.getUint32(n)+12}return!1},mOe=async(e,t)=>{if(t!==`gif`&&t!==`webp`&&t!==`png`)return!1;let n;try{n=new Uint8Array(await e.arrayBuffer())}catch{return!1}return t===`gif`?dOe(n):t===`webp`?fOe(n):pOe(n)},hOe=64,gOe=new Set([`heic`,`heix`,`heim`,`heis`,`hevc`,`hevx`,`hevm`,`hevs`,`mif1`,`msf1`]),_Oe=new Set([`avif`,`avis`]),PH=(e,t,n=0)=>[...t].every((t,r)=>e[n+r]===t.charCodeAt(0)),FH=(e,t)=>String.fromCharCode(...e.subarray(t,t+4)),vOe=e=>{if(e.length<12||FH(e,4)!==`ftyp`)return[];let t=new DataView(e.buffer,e.byteOffset).getUint32(0),n=Math.min(t,e.length),r=[FH(e,8)];for(let t=16;t+4<=n;t+=4)r.push(FH(e,t));return r},IH=async e=>{let t;try{t=new Uint8Array(await e.slice(0,hOe).arrayBuffer())}catch{return}if(t.length<12)return;if(PH(t,`ÿØÿ`))return`jpeg`;if(PH(t,`‰PNG`))return`png`;if(PH(t,`GIF8`))return`gif`;if(PH(t,`RIFF`)&&PH(t,`WEBP`,8))return`webp`;let n=vOe(t);if(n.some(e=>_Oe.has(e)))return`avif`;if(n.some(e=>gOe.has(e)))return`heic`},LH={},yOe=async e=>{if(e in LH)return LH[e];let t=`image/${e}`,n=new OffscreenCanvas(1,1);n.getContext(`2d`);let r=(await n.convertToBlob({type:t})).type===t;return LH[e]=r,r},bOe=e=>{let{data:t}=e.getContext(`2d`).getImageData(0,0,e.width,e.height);for(let e=3;e<t.length;e+=4)if(t[e]<255)return!0;return!1},RH=async(e,{format:t=`webp`,quality:n=85,nativeOnly:r=!1}={})=>{let i=`image/${t}`,a=await yOe(t);if(!a&&r)return e.convertToBlob({type:bOe(e)?`image/png`:`image/jpeg`,quality:n/100});if(!a&&uOe.includes(t)){let r=e.getContext(`2d`).getImageData(0,0,e.width,e.height);try{let e=(await RN(`@jsquash/${t}`,`encode.js?module`)).default,a=await e(r,{quality:n});return new Blob([a],{type:i})}catch{}}return e.convertToBlob({type:i,quality:n/100})},xOe=1e4,zH,BH=!1,VH,SOe=LR(1),COe=()=>{let e=`${LN(`@discourse/heic`)}/index.js`;return`
import(${JSON.stringify(e)}).then(
({ decode }) => {
self.onmessage = async ({ data }) => {
try {
const { width, height, data: pixels } = await decode(data);
postMessage({ width, height, data: pixels }, [pixels.buffer]);
} catch (error) {
postMessage({ error: String(error?.message ?? error) });
}
};
postMessage({ ready: true });
},
(error) => postMessage({ error: String(error?.message ?? error) }),
);
`},HH=class extends Error{},wOe=()=>new Promise((e,t)=>{let n=new Blob([COe()],{type:`text/javascript`}),r=URL.createObjectURL(n),i;try{i=new Worker(r,{type:`module`})}catch(e){URL.revokeObjectURL(r),t(new HH(`Failed to create a worker`,{cause:e}));return}let a=({data:n})=>{s(),n.ready?e(i):(i.terminate(),t(Error(n.error)))},o=e=>{s(),i.terminate(),t(new HH(e.message))},s=()=>{i.removeEventListener(`message`,a),i.removeEventListener(`error`,o),URL.revokeObjectURL(r)};i.addEventListener(`message`,a),i.addEventListener(`error`,o)}),TOe=()=>(clearTimeout(VH),zH??=wOe().catch(e=>{throw zH=void 0,e}),zH),EOe=async()=>{let e=await zH;zH=void 0,e?.terminate()},DOe=(e,t)=>new Promise((n,r)=>{let i=({data:e})=>{if(o(),VH=setTimeout(EOe,xOe),e.error)r(Error(e.error));else try{n(new ImageData(e.data,e.width,e.height))}catch(e){r(e)}},a=t=>{o(),zH=void 0,e.terminate(),r(Error(t.message))},o=()=>{e.removeEventListener(`message`,i),e.removeEventListener(`error`,a)};e.addEventListener(`message`,i),e.addEventListener(`error`,a),e.postMessage(t,[t])}),OOe=async e=>{let{decode:t}=await RN(`@discourse/heic`,`index.js`);return t(e)},kOe=async e=>{if(!BH){let t;try{t=await TOe()}catch(e){if(!(e instanceof HH))throw e;BH=!0}if(t)return DOe(t,e)}return OOe(e)},AOe=e=>SOe(async()=>kOe(await e.arrayBuffer())),UH=({format:e=`png`,quality:t=85,width:n=void 0,height:r=void 0,fit:i=`scale-down`,nativeOnly:a=!1}={})=>({format:e,quality:t,width:n,height:r,fit:i,nativeOnly:a}),jOe=({width:e,height:t},{width:n=e,height:r=t,fit:i=`scale-down`}={})=>{let a={scale:1,width:e,height:t};if(e===n&&t===r)return a;let o=e<=n&&t<=r,s=1,c=0,l=0;if(i===`scale-down`){if(o)return a;i=`contain`}return i===`contain`&&(s=Math.min(n/e,r/t),c=e*s,l=t*s),{scale:s,width:c,height:l}},WH=(e,t,n)=>{let{scale:r,width:i,height:a}=jOe(t,n);return e.width=i,e.height=a,{scale:r,width:i,height:a}},GH={format:`webp`,quality:85,width:512,height:512,fit:`contain`,nativeOnly:!0},MOe=async({blob:e})=>{let t=URL.createObjectURL(e),n=new Image;return new Promise((e,r)=>{n.addEventListener(`load`,()=>{e({source:n,naturalWidth:n.naturalWidth,naturalHeight:n.naturalHeight}),URL.revokeObjectURL(t)},{once:!0}),n.addEventListener(`error`,()=>{URL.revokeObjectURL(t),r(Error(`Failed to decode image`))},{once:!0}),n.src=t})},NOe=async({blob:e})=>{let t=URL.createObjectURL(e),n=document.createElement(`video`);return new Promise((e,r)=>{n.addEventListener(`canplay`,()=>{n.pause(),e({source:n,naturalWidth:n.videoWidth,naturalHeight:n.videoHeight}),URL.revokeObjectURL(t)},{once:!0}),n.addEventListener(`error`,()=>{document.body.removeChild(n),URL.revokeObjectURL(t),r(Error(`Failed to decode video`))},{once:!0}),n.muted=!0,n.autoplay=!0,n.playsInline=!0,n.style.opacity=`0`,n.style.pointerEvents=`none`,document.body.appendChild(n),n.src=t})},POe=async e=>e.type.startsWith(`video/`)?NOe({blob:e}):MOe({blob:e}),FOe=async e=>{if(await IH(e)===`heic`)return createImageBitmap(await AOe(e))},KH=async(e,t={})=>{let{format:n,quality:r,width:i,height:a,fit:o,nativeOnly:s}=UH(t),c,l=0,u=0;try{c=await createImageBitmap(e)}catch{c=await FOe(e)}c?{width:l,height:u}=c:{source:c,naturalWidth:l,naturalHeight:u}=await POe(e);let d=i??l,f=a??u,p=new OffscreenCanvas(512,512),m=p.getContext(`2d`);return WH(p,{width:l,height:u},{fit:o,width:d,height:f}),m.drawImage(c,0,0,p.width,p.height),c instanceof HTMLVideoElement?document.body.removeChild(c):`close`in c&&c.close(),RH(p,{format:n,quality:r,nativeOnly:s})},IOe=async e=>{let t=await e.text();try{let{optimize:n}=await RN(`svgo`,`dist/svgo.browser.js`),{data:r}=n(t);return new Blob([r],{type:e.type})}catch{}return e},qH=e=>typeof e==`string`&&e.trim()?e.trim():void 0,JH=({fieldConfig:e}={})=>{let t=CH({fieldConfig:e}),{max_file_size:n,multiple:r,slugify_filename:i,filename_template:a,transformations:o}=typeof t==`boolean`?{}:t?.config??{};return{enabled:t!==!1,config:{max_file_size:typeof n==`number`&&Number.isInteger(n)?n:1/0,multiple:typeof r==`boolean`&&r,slugify_filename:typeof i==`boolean`&&i,filename_template:qH(a),transformations:E(o)?o:void 0}}},YH=e=>e&&wH.includes(e)?e:void 0,LOe=async e=>{let[t,n]=e.type.split(`/`);if(t!==`image`&&!EH.test(e.name))return{};let r=YH(n);return{sourceFormat:YH(await IH(e))??r,declaredFormat:r}},XH=e=>!!(e?.heic??e?.raster_image),ROe=e=>XH(e)?kH:OH,ZH=({accept:e,image:t,transformations:n})=>e??(t?ROe(n).join(`,`):void 0),QH=({name:e,type:t},n)=>Wk({name:e,type:t||rV.getType(e)||``},(n??``).split(`,`).map(e=>e.trim()).filter(Boolean)),zOe=async(e,t)=>{let[n,r]=e.type.split(`/`);if(n===`image`&&r===`svg+xml`)return t.svg?.optimize?new File([await IOe(e)],e.name,{type:e.type}):e;let{sourceFormat:i,declaredFormat:a}=await LOe(e);if(!i)return e;let o=t,s=o[i]??(a?o[a]:void 0)??t.raster_image;if(!s||await mOe(e,i))return e;let{format:c=`webp`,quality:l=85,width:u,height:d}=s,f;try{f=await KH(e,{format:c,quality:l,width:u,height:d})}catch(t){if(i===`heic`)throw Error(`Failed to decode HEIC image`,{cause:t});return e}let[,p]=f.type.split(`/`),m=EH.test(e.name)?e.name.replace(EH,p):`${e.name}.${p}`;return new File([f],m,{type:f.type})},$H=pk(``),eU=pk(),tU=pk(),nU=pk(),rU=e=>!!e&&e.internalPath!==void 0&&!e.entryRelative&&!e.hasTemplateTags,iU=(e,t)=>t===``?e:e.startsWith(`${t}/`)?e.slice(t.length+1):``,aU=(e,t)=>rU(e)?iU(t,e.internalPath):``,oU=(e,t=void 0)=>{if(t)return{folder:t,subfolderPath:aU(t,e)};let n=iH.current,r=n.find(({internalPath:t,collectionName:n})=>e===`-/all`?t===void 0&&n===void 0:t===e);if(r)return{folder:r,subfolderPath:``};let i=n.filter(t=>rU(t)&&(t.internalPath===``||e.startsWith(`${t.internalPath}/`))).sort((e,t)=>t.internalPath.length-e.internalPath.length)[0];return i?{folder:i,subfolderPath:aU(i,e)}:void 0},sU=hk(()=>{let e=oH.current;return rU(e)?UP([e.internalPath,$H.current]):void 0}),cU=hk(()=>KV(sU.current??``)),lU=({dirPath:e,paths:t})=>{let n=e?`${e}/`:``,r=new Set;return t.forEach(e=>{if(!e.startsWith(n))return;let t=e.indexOf(`/`,n.length);t>n.length&&r.add(e.slice(n.length,t))}),[...r].sort(TE).map(t=>({name:t,path:UP([e,t])}))},uU=({subfolders:e,fileNames:t,exclude:n=void 0,dirPath:r=void 0})=>[...e.map(({name:e})=>e).filter(e=>e!==n),...t,...r===void 0?[]:lU({dirPath:r,paths:iH.current.filter(({internalPath:e,hasTemplateTags:t})=>e&&!t).map(({internalPath:e})=>`${e}/`)}).map(({name:e})=>e)],BOe=e=>uU({subfolders:lU({dirPath:e,paths:[...pH.current,...SH.current].map(({path:e})=>e)}),fileNames:[],dirPath:e}),dU=({rootLabel:e,subfolderNames:t,onBrowse:n})=>t.length?[...[e,...t.slice(0,-1)].map((e,r)=>({label:e,onClick:()=>{n({depth:r,path:t.slice(0,r).join(`/`)})}})),{label:t.at(-1)}]:[],fU=e=>oU(e)?.folder.internalPath,pU=({dirPath:e,assets:t})=>{let n=fU(e),r=SH.current.filter(({path:e})=>fU(WP(e))===n);return lU({dirPath:e,paths:[...t,...r].map(({path:e})=>e)})},mU=({dirPath:e,assets:t})=>t.filter(({path:t})=>WP(t)===e),hU=({folder:e,subfolderPath:t})=>e?.internalPath===void 0?void 0:UP([e.internalPath,t]),gU=e=>{let{slugify_filename:t}=JH().config,n=VP(e.trim());return t?jN(n,{fallback:!1}):n},VOe=({name:e,takenNames:t})=>{let n=e.trim();if(!n)return`empty`;let r=gU(n);if(!r||n.includes(`/`)||r.startsWith(`.`))return`invalid`;if(KDe(r))return`reserved`;let i=r.normalize().toLowerCase();return t.some(e=>e.normalize().toLowerCase()===i)?`duplicate`:void 0},HOe={hash:`svelte-mz75if`,code:`.picker-breadcrumb {flex:none;padding:0 8px 8px;.current {font-weight:var(--sui-font-weight-bold);}}`};function _U(e,t){O(t,!0),K(e,HOe);let n=J(t,`onNavigate`,3,void 0),r=A(()=>dU({rootLabel:t.rootLabel,subfolderNames:t.path?t.path.split(`/`):[],onBrowse:({path:e})=>{n()?.(e)}}));var i=H(),a=P(i),o=e=>{BV(e,{class:`picker-breadcrumb`,get items(){return z(r)}})};G(a,e=>{z(r).length&&e(o)}),U(e,i),k()}var UOe=B(`<span role="none" class="icon check-background"><!></span>`),WOe=B(`<div role="none"><!></div>`),GOe={hash:`svelte-1fitgoo`,code:`.wrapper.svelte-1fitgoo {display:contents;[role='option'] {position:relative;& > .icon.check {display:none;}&[aria-selected='false'] {.check-background {border-color:var(--sui-checkbox-border-color);background-color:var(--sui-checkbox-background-color);.icon {display:none;}}}&[aria-selected='true'] {.check-background {border-color:var(--sui-primary-accent-color);color:var(--sui-primary-accent-color-inverted);background-color:var(--sui-primary-accent-color);}}.check-background {display:flex;justify-content:center;align-items:center;border-width:1px;border-radius:var(--sui-checkbox-border-radius);width:20px;height:20px;pointer-events:none;.icon {color:inherit !important;font-size:20px;}}}&.grid {.check-background {position:absolute;inset-block-start:8px;inset-inline-start:8px;z-index:1;}}&.list {.check-background {margin-inline-start:16px;}}}`};function vU(e,t){K(e,GOe);let n=J(t,`viewType`,3,`grid`);var r=WOe();Tu(N(r),{label:``,get"aria-label"(){return t.ariaLabel},get value(){return t.value},get selected(){return t.selected},get onChange(){return t.onChange},startIcon:e=>{var n=H(),r=P(n),i=e=>{var t=UOe();Xc(N(t),{name:`check`,class:`icon check`}),D(t),U(e,t)};G(r,e=>{t.multiple&&e(i)}),U(e,n)},children:(e,n)=>{var r=H();Go(P(r),()=>t.children??kr),U(e,r)},$$slots:{startIcon:!0,default:!0}}),D(r),R(()=>os(r,1,`wrapper ${n()??``}`,`svelte-1fitgoo`)),U(e,r)}var KOe=B(`<div role="none" class="wrapper svelte-umbokg"><!></div>`),qOe={hash:`svelte-umbokg`,code:`.wrapper.svelte-umbokg {display:contents;.listbox {gap:4px;border-width:0;.option {button {border-radius:var(--sui-control-medium-border-radius);padding:4px;width:100%;height:auto;transition:none;&:focus-visible {outline-color:transparent;}.preview {flex:none;border-radius:var(--sui-control-medium-border-radius);aspect-ratio:1 / 1;object-fit:contain;}}}.name {min-height:calc(var(--sui-font-size-default) * 2);white-space:normal;line-height:var(--sui-line-height-compact);}}.listbox.grid {display:grid;grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));.option {button {flex-direction:column;justify-content:flex-start;.preview {width:100%;height:auto;}.name {flex:none;margin:4px 0 12px;padding:0 8px;width:100%;min-height:calc(var(--sui-font-size-default) * 3);&:empty {display:none;}}}}button[aria-selected='true'] {outline-offset:-2px;outline-width:2px !important;outline-style:solid;outline-color:var(--sui-primary-accent-color-light);}}.listbox.list {.option {button {gap:16px;.preview {width:64px;}.name {flex:auto;padding-inline:0 8px;}}button[aria-selected='true'] {outline-offset:-2px;outline-width:2px !important;outline-style:solid;outline-color:var(--sui-primary-accent-color-light);}}}}`};function yU(e,t){O(t,!0),K(e,qOe);let n=J(t,`viewType`,3,`grid`),r=J(t,`gridId`,3,void 0),i=J(t,`multiple`,3,!1),a=J(t,`ariaLabel`,3,void 0),o=J(t,`onChange`,3,void 0),s=J(t,`children`,3,void 0);var c=KOe(),l=N(c);{let e=A(()=>a()??Y(`assets_dialog.available_images`));Cu(l,{get id(){return r()},get class(){return n()},get multiple(){return i()},get ariaLabel(){return z(e)},onChange:e=>{o()?.(e.detail)},children:(e,t)=>{var n=H();Go(P(n),()=>s()??kr),U(e,n)},$$slots:{default:!0}})}D(c),U(e,c),k()}var JOe=()=>{let e=document.querySelector(`#page-container`);e instanceof HTMLElement&&(e.tabIndex=-1,e.focus())},bU=()=>{let e=document.activeElement;return()=>{e.isConnected&&e!==document.body&&!e.closest(`[inert]`)?e.focus():JOe()}},xU=({timeout:e=2e3}={})=>{let t=document.querySelector(`#page-container`);if(!(t instanceof HTMLElement))return;let n=performance.now(),r=()=>{let e=t.querySelector(`[role="grid"] [tabindex="0"]`);e instanceof HTMLElement?e.focus():(t.tabIndex=-1,t.focus())},i=()=>{let{activeElement:a}=document;if(a===document.body||a===t)r();else if(!t.contains(a))return;performance.now()-n<e&&window.requestAnimationFrame(i)};r(),window.requestAnimationFrame(i)},SU=async e=>{await co();let t=e();t&&(t.tabIndex=0,t.focus())},YOe=(e,{timeout:t=2e3}={})=>{let n=performance.now(),r=()=>{let{activeElement:i}=document;if(i!==document.body&&i!==e)return;let a=e.querySelector(`[role="listbox"]`);a instanceof HTMLElement?a.focus():(i===document.body&&e.isConnected&&(e.tabIndex=-1,e.focus()),performance.now()-n<t&&window.requestAnimationFrame(r))};window.requestAnimationFrame(r)},XOe=e=>{},ZOe=B(`<div role="none" class="wrapper svelte-82chpg"><!></div>`),QOe={hash:`svelte-82chpg`,code:`.wrapper.svelte-82chpg {display:contents;.listbox.subfolders {gap:4px;margin-bottom:8px;border-width:0;padding:0;min-width:0;background-color:transparent;&.grid {display:grid;grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));}.option button {border-radius:var(--sui-control-medium-border-radius);min-width:0;height:40px;.label {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}}}}`};function CU(e,t){O(t,!0),K(e,QOe);let n=J(t,`viewType`,3,`grid`),r=J(t,`onOpen`,3,void 0),i=J(t,`multiple`,3,!1),a=J(t,`selectedPaths`,19,()=>[]),o=J(t,`onSelect`,3,void 0),s=j(void 0),c=!1,l=e=>{let t=z(s)?.closest(`[data-focus-scope]`),n=!!z(s)?.contains(document.activeElement);r()?.(e),n&&t instanceof HTMLElement&&YOe(t)},u=(e,t)=>{o()?!i()&&e.detail===1&&c&&o()(t,!1):l(t)},d=e=>{if(!o()||e.key!==`Enter`)return;let n=z(s)?.querySelector(`[role="option"].focused`)?.getAttribute(`data-value`),r=t.subfolders.find(e=>e.path===n);r&&(e.preventDefault(),e.stopPropagation(),l(r))};var f=ZOe(),p=N(f);{let e=A(()=>!!o()&&i()),r=A(()=>Y(`folders`));Cu(p,{get class(){return`subfolders ${n()??``}`},get multiple(){return z(e)},get ariaLabel(){return z(r)},children:(e,n)=>{var r=H();Bo(P(r),17,()=>t.subfolders,e=>e.path,(e,t)=>{{let n=e=>{Xc(e,{name:`folder`})},r=A(()=>!!o()&&a().includes(z(t).path)),i=A(()=>Y(`folder`)),s=A(()=>o()?void 0:XOe);Tu(e,{get label(){return z(t).name},get value(){return z(t).path},get selected(){return z(r)},get"aria-description"(){return z(i)},get checkIcon(){return z(s)},onChange:e=>{o()?.(z(t),e.detail.selected)},onclickcapture:()=>{c=a().includes(z(t).path)},onclick:e=>{u(e,z(t))},ondblclick:()=>{o()&&l(z(t))},startIcon:n,$$slots:{startIcon:!0}})}}),U(e,r)},$$slots:{default:!0}})}D(f),Ds(f,e=>M(s,e),()=>z(s)),yo(`keydown`,f,d,!0),U(e,f),k()}var $Oe=B(`<p role="alert" class="warning svelte-1py0tnw"> </p>`),eke=B(`<p class="svelte-1py0tnw"> </p> <!> <div role="none" class="svelte-1py0tnw"><!></div> <div role="none" class="error svelte-1py0tnw"><!></div>`,1),tke={hash:`svelte-1py0tnw`,code:`p.svelte-1py0tnw {margin:0 0 8px;}.warning.svelte-1py0tnw {color:var(--sui-warning-foreground-color);}div.svelte-1py0tnw {display:flex;align-items:center;gap:4px;}.error.svelte-1py0tnw {margin:0;color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-small);}`};function wU(e,t){let n=Eo();O(t,!0),K(e,tke);let r=J(t,`open`,15,!1),i=J(t,`warning`,3,void 0),a=J(t,`name`,3,``),o=J(t,`onClose`,3,void 0),s=j(``),c=j(!1),l=A(()=>VOe({name:z(s),takenNames:t.takenNames})),u=A(()=>z(c)&&!!z(l)),d=A(()=>!!a()&&gU(z(s))===a());L(()=>{r()&&(M(s,a()),M(c,!1))});{let a=A(()=>!!z(l)||z(d));tu(e,{get title(){return t.title},get okLabel(){return t.okLabel},get okDisabled(){return z(a)},onOk:()=>{t.onSubmit(gU(z(s)))},get onClose(){return o()},get open(){return r()},set open(e){r(e)},children:(e,r)=>{var a=eke(),o=P(a),d=F(o,!0),f=I(o,2),p=e=>{var t=$Oe(),n=F(t,!0);R(()=>W(n,i())),U(e,t)};G(f,e=>{i()&&e(p)});var m=I(f,2),h=N(m);{let e=A(()=>Y(`new_folder_name`));fu(h,{dir:`auto`,flex:!0,get ariaLabel(){return z(e)},get invalid(){return z(u)},get"aria-errormessage"(){return`${n}-error`},oninput:()=>{M(c,!0)},get value(){return z(s)},set value(e){M(s,e,!0)}})}D(m);var g=I(m,2),_=N(g),v=e=>{var t=V();R(e=>W(t,e),[()=>Y(`new_folder_error.${z(l)}`)]),U(e,t)};G(_,e=>{z(u)&&e(v)}),D(g),R(()=>{W(d,t.description),q(g,`id`,`${n}-error`)}),U(e,a)},$$slots:{default:!0}})}k()}var nke=(e,t)=>Yk.includes(e)?t[e]:void 0,rke=e=>Object.hasOwn(Qk,e)?ml(Qk[e].length):void 0,ike=(e,t)=>{if(e!==`slug`)return;let{type:n,isIndexFile:r,currentSlug:i,content:a,identifierField:o,collection:s}=t;if(n===`preview_path`&&r)return``;let c=i??Ez(a,{identifierField:o});return n===`preview_path`&&s?c===OA(s)?``:kA(s,c):c},ake=(e,t,n,r=[],i=void 0)=>{if(!t)return``;switch(e){case`dirname`:return tF(t,{basePath:n,fullPathRegEx:i});case`filename`:case`extension`:return vN(t,r)[e];default:return}},TU=({randomValues:e},t,n)=>e?PA(e,t,n):n(),EU=(e,t)=>{let{type:n,collection:r,content:i,entryFilePath:a,locale:o,dateTimeParts:s,basePath:c,fullPathRegEx:l,assetFileName:u}=t,d=nke(e,s);if(d!==void 0)return d;let f=ike(e,t);if(f!==void 0)return f;if(Object.hasOwn(Qk,e))return TU(t,`${o}:${e}`,()=>rke(e));if(u!==void 0&&(e===`filename`||e===`extension`))return Uk(u)[e]??``;if(n===`preview_path`&&e===`locale`)return o;if(n===`preview_path`||n===`media_folder`){let t=ake(e,a,c,yN(r),l);if(t!==void 0)return t;if(n===`media_folder`)return}let p=_N(e);return Object.hasOwn(i,p)?i[p]:void 0},DU=(e,t)=>{let{replaceSubContext:n,getFieldArgs:r}=t,{value:i,transformations:a}=sP(e),o=EU(i,n),s=fN(a,e=>String(EU(e,n)??``)),c=a.some(e=>e.args.defaultValue!==void 0),l=a.some(e=>sk.has(e.method)),u=o===void 0,{type:d,locale:f}=n,p=()=>{if(d===`preview_path`)throw Error(`Unresolvable template tag in preview path: ${i}`)},m=()=>(p(),TU(n,`${f}:fallback:${e}`,()=>ml(`short`)));return u&&!c&&!l||(s.length&&(o=cP({fieldConfig:bM({...r,keyPath:_N(i)}),value:o,transformations:s,locale:f})),u&&!c&&o===``)?m():(o=qSe(String(o)),d?o:jN(o,{locale:f,maxLength:1/0,fallback:!1})||TU(n,`${f}:fallback:${e}`,()=>ml(`short`)))},oke=(e,{ignoreCase:t=!1}={})=>{let n=e.includes(`/`),r=e.replace(/^\//,``),i=``;for(let e=0;e<r.length;e+=1){let t=r[e];if(r.startsWith(`**/`,e))i+=`(?:.*/)?`,e+=2;else if(r.startsWith(`/**`,e)&&e+3===r.length)i+=`/.*`,e+=2;else if(t===`*`)i+=`[^/]*`;else if(t===`?`)i+=`[^/]`;else if(t===`[`&&r.indexOf(`]`,e+2)>0){let t=r.indexOf(`]`,e+2),n=r.slice(e+1,t).replace(/^!/,`^`).replaceAll(`\\`,`\\\\`);i+=`[${n}]`,e=t}else i+=t.replace(/[$()+.[\\\]^{|}]/,`\\$&`)}return RegExp(n?`^${i}$`:`(?:^|/)${i}$`,t?`i`:``)},ske=(e,{ignoreCase:t=!1}={})=>e.split(/\r?\n/).flatMap(e=>{let[n,...r]=e.trim().split(/\s+/);if(!n||/^[#"]|^\[attr\]/.test(n)||n.endsWith(`/`))return[];let i=r.findLast(e=>/^[-!]?filter(?:=|$)/.test(e));return i?[{regex:oke(n,{ignoreCase:t}),lfs:i===`filter=lfs`}]:[]}),cke=async(e,t,{ignoreCase:n=!1}={})=>{let r=new Map,i=t=>{let i=r.get(t);return i||(i=e.readFile(t,{encoding:`utf8`}).then(e=>ske(e,{ignoreCase:n}),()=>[]),r.set(t,i)),i};for(let e of t){let t=e.split(`/`),n=!1,r=[...t.map((e,n)=>{let r=t.slice(0,n).join(`/`);return{file:r?`${r}/.gitattributes`:`.gitattributes`,relativePath:t.slice(n).join(`/`)}}),{file:`.git/info/attributes`,relativePath:e}];for(let{file:e,relativePath:t}of r)for(let r of await i(e))r.regex.test(t)&&({lfs:n}=r);if(n)return e}},OU=[[`MERGE_HEAD`,`merge`],[`CHERRY_PICK_HEAD`,`cherry_pick`],[`REVERT_HEAD`,`revert`],[`rebase-merge`,`rebase`],[`rebase-apply`,`rebase`],[`sequencer`,`cherry_pick`]],lke=`0`.repeat(40),kU=e=>typeof e==`string`?e.split(`/`).filter(e=>e&&e!==`.`).join(`/`):``,AU=()=>kU(Sk.current?.backend?.root_dir),jU=(e,t=AU())=>t?KP(`${t}/${e}`):e,MU=(e,t=AU())=>{if(!t)return e;if(e.startsWith(`${t}/`))return e.slice(t.length+1);let n=t.split(`/`),r=e.split(`/`),i=0;for(;i<n.length&&i<r.length-1&&n[i]===r[i];)i+=1;return[...n.slice(i).map(()=>`..`),...r.slice(i)].join(`/`)},NU=e=>!e.startsWith(`../`),PU=e=>{let t=AU();return t?e.map(({previousPath:e,...n})=>({...n,path:jU(n.path,t),...e!==void 0&&{previousPath:jU(e,t)}})):e},FU=e=>e?.name===`NotFoundError`,IU=e=>e?.name===`TypeMismatchError`,LU=e=>e.normalize(`NFC`)!==e.normalize(`NFD`),RU=(e,t)=>{if(e.includes(t))return t;let n=t.normalize();return e.find(e=>e.normalize()===n)},zU=async(e,t)=>{if(!LU(t))return t;try{return await e.getFileHandle(t),t}catch(e){if(IU(e))return t;if(!FU(e))throw e}return RU(await Array.fromAsync(e.keys()),t)??t},BU=async(e,t,n=`file`,{create:r=!0}={})=>{let i=CE(t??``),a=e;if(!i){if(n===`directory`)return a;throw Error(`Path is required for file handle retrieval`)}let o=i.split(`/`),s=o.length-1;for await(let[e,t]of o.entries()){let i=await zU(a,t);a=await(e===s&&n===`file`?a.getFileHandle(i,{create:r}):a.getDirectoryHandle(i,{create:r}))}return a},VU=(e,t)=>BU(e,t,`file`),HU=(e,t)=>BU(e,t,`directory`),UU=async(e,t)=>(await BU(e,t,`file`,{create:!1})).getFile(),WU=async(e,t)=>{try{return await UU(e,t)}catch(e){if(FU(e))return;throw e}},GU=async(e,{create:t=!1}={})=>BU(e,AU(),`directory`,{create:t}),uke={NotFoundError:`ENOENT`,TypeMismatchError:`ENOTDIR`,InvalidModificationError:`ENOTEMPTY`},KU=(e,t)=>Object.assign(Error(`${e}: ${t}`),{code:e,path:t}),dke=(e,t)=>{let n=uke[e?.name];return n?KU(n,t):e},qU=e=>e.split(`/`).filter(e=>e&&e!==`.`),JU=async(e,t)=>{let n=e;for(let e of t)n=await n.getDirectoryHandle(e);return n},YU=async(e,t)=>{if(!t.length)return e;let n=await JU(e,t.slice(0,-1)),r=t.at(-1);try{return await n.getFileHandle(r)}catch(e){if(!IU(e))throw e;return n.getDirectoryHandle(r)}},fke=async(e,t,n)=>{let r=await e.createWritable?.(n);if(!r)throw KU(`ENOTSUP`,t);return r},pke=async e=>{let t=e.kind===`directory`,{size:n,lastModified:r}=t?{size:0,lastModified:0}:await e.getFile();return{mode:t?16384:33188,size:n,mtimeMs:r,ctimeMs:r,ino:0,uid:0,gid:0,dev:0,isFile:()=>!t,isDirectory:()=>t,isSymbolicLink:()=>!1}},mke=(e,{Buffer:t})=>{let n=async(e,t)=>{try{return await t(qU(e))}catch(t){throw dke(t,e)}},r=async t=>({parentHandle:await JU(e,t.slice(0,-1)),name:t.at(-1)}),i=async(e,t,n,r)=>{let i=await fke(e,t,n);try{await r(i),await i.close()}catch(e){throw await i.abort().catch(()=>void 0),e}},a=t=>n(t,async t=>pke(await YU(e,t)));return{readFile:(r,i)=>n(r,async n=>{let a=await YU(e,n);if(a.kind!==`file`)throw KU(`EISDIR`,r);let o=await a.getFile();return(typeof i==`string`?i:i?.encoding)===`utf8`?o.text():t.from(await o.arrayBuffer())}),writeFile:(e,t)=>n(e,async n=>{let{parentHandle:a,name:o}=await r(n),s=await a.getFileHandle(o,{create:!0});await i(s,e,void 0,async e=>{await e.write(t)})}),appendFile:(e,t)=>n(e,async n=>{let{parentHandle:a,name:o}=await r(n),s=await a.getFileHandle(o,{create:!0}),{size:c}=await s.getFile();await i(s,e,{keepExistingData:!0},async e=>{await e.write({type:`write`,position:c,data:t})})}),mkdir:e=>n(e,async e=>{let{parentHandle:t,name:n}=await r(e);await t.getDirectoryHandle(n,{create:!0})}),rmdir:e=>n(e,async e=>{let{parentHandle:t,name:n}=await r(e);await t.getDirectoryHandle(n),await t.removeEntry(n)}),unlink:e=>n(e,async e=>{let{parentHandle:t,name:n}=await r(e);await t.getFileHandle(n),await t.removeEntry(n)}),readdir:t=>n(t,async n=>{let r=await YU(e,n);if(r.kind!==`directory`)throw KU(`ENOTDIR`,t);let i=[];for await(let e of r.keys())i.push(e);return i}),stat:a,lstat:a,readlink:async e=>{throw KU(`ENOTSUP`,e)},symlink:async(e,t)=>{throw KU(`ENOTSUP`,t)}}},XU=e=>[`ENOENT`,`ENOTDIR`].includes(e?.code),ZU=async(e,t)=>{try{return await e.stat(t),!0}catch(e){if(XU(e))return!1;throw e}},QU=new TextEncoder,$U=new TextDecoder,eW=(e,t)=>{let n=Math.min(e.length,t.length);for(let r=0;r<n;r+=1)if(e[r]!==t[r])return e[r]-t[r];return e.length-t.length},tW=e=>{let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{t.set(e,n),n+=e.length}),t},nW=e=>Array.from(new Uint8Array(e),e=>e.toString(16).padStart(2,`0`)).join(``),rW=e=>Uint8Array.from(e.match(/../g)??[],e=>Number.parseInt(e,16)),iW=async(e,t)=>{let n=new TextEncoder,r=await crypto.subtle.importKey(`raw`,typeof e==`string`?n.encode(e):e,{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]),i=await crypto.subtle.sign(`HMAC`,r,n.encode(t));return new Uint8Array(i)},aW=62,hke=e=>{let t=new Map,n=0,r=t=>{let r=e.indexOf(t,n),i=$U.decode(e.subarray(n,r));return n=r+1,i},i=a=>{let o=r(0),s=a?`${a}/${o}`:o,[c,l]=r(10).split(` `).map(Number);c>=0&&(t.set(s,nW(e.subarray(n,n+20))),n+=20);for(let e=0;e<l;e+=1)i(s)};return e.length&&i(void 0),t},gke=e=>{let t=new DataView(e),n=new Uint8Array(e);if($U.decode(n.subarray(0,4))!==`DIRC`)throw Error(`Invalid index file`);let r=t.getUint32(4),i=[],a=[];if(r!==2)return{version:r,entries:i,extensions:a};let o=t.getUint32(8),s=12;for(let e=0;e<o;e+=1){let e=t.getUint16(s+60),r=s+aW,a=(e&4095)<4095?e&4095:n.indexOf(0,r)-r,o=s+(aW+a+8&-8);i.push({path:$U.decode(n.subarray(r,r+a)),mode:t.getUint32(s+24),oid:nW(n.subarray(s+40,s+40+20)),stage:e>>12&3,raw:n.subarray(s,o)}),s=o}let c;for(;s<n.length-20;){let e=$U.decode(n.subarray(s,s+4)),r=t.getUint32(s+4);a.push(e),e===`TREE`&&(c=hke(n.subarray(s+8,s+8+r))),s+=8+r}return{version:r,entries:i,extensions:a,...c?{cacheTree:c}:{}}},_ke=({extensions:e})=>e.some(e=>/^[a-z]/.test(e)),vke=({path:e,mode:t,oid:n,size:r,mtimeMs:i})=>{let a=QU.encode(e),o=new Uint8Array(aW+a.length+8&-8),s=new DataView(o.buffer),c=Math.floor(i/1e3),l=Math.round((i-c*1e3)*1e6);return[0,8].forEach(e=>{s.setUint32(e,c%2**32),s.setUint32(e+4,l)}),s.setUint32(24,t),s.setUint32(36,r%2**32),o.set(rW(n),40),s.setUint16(60,Math.min(a.length,4095)),o.set(a,aW),{path:e,mode:t,oid:n,stage:0,raw:o}},yke=(e,t)=>eW(QU.encode(e),QU.encode(t)),oW=(e,t)=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>>1,a=yke(e[i].path,t);if(!a)return{position:i,found:!0};a<0?n=i+1:r=i}return{position:n,found:!1}},bke=(e,{removedPaths:t,addedEntries:n})=>{let r=e.filter(({path:e})=>!t.has(e));return n.forEach(e=>{let{position:t,found:n}=oW(r,e.path);r.splice(t,+!!n,e)}),r},xke=e=>{let t=new Map,n=e=>{let r=e.entries.filter(({type:e})=>e!==`tree`).length;return e.subtrees.forEach(e=>{r+=n(e)}),t.set(e,r),r},r=[],i=(e,n)=>{r.push(QU.encode(`${n}\0${t.get(e)} ${e.subtrees.size}\n`),rW(e.oid)),e.subtrees.forEach((e,t)=>{i(e,t)})};return n(e),i(e,``),tW(r)},Ske=async(e,{tree:t}={})=>{let n=t?xke(t):void 0,r=e.reduce((e,{raw:t})=>e+t.length,12)+(n?8+n.length:0),i=new Uint8Array(r+20),a=new DataView(i.buffer),o=12;return i.set(QU.encode(`DIRC`)),a.setUint32(4,2),a.setUint32(8,e.length),e.forEach(({raw:e})=>{i.set(e,o),o+=e.length}),n&&(i.set(QU.encode(`TREE`),o),a.setUint32(o+4,n.length),i.set(n,o+8)),i.set(rW(await _l(i.subarray(0,r))),r),i},sW={1:`commit`,2:`tree`,3:`blob`,4:`tag`},Cke=6,wke=7,Tke=1e3,cW=(e,t)=>tW([QU.encode(`${e} ${t.length}\0`),t]),Eke=(e,t)=>_l(cW(e,t)),lW=async e=>{let t=new Blob([e]).stream().pipeThrough(new DecompressionStream(`deflate`));return new Uint8Array(await new Response(t).arrayBuffer())},Dke=async e=>{let{readable:t,writable:n}=new CompressionStream(`deflate`),r=n.getWriter(),[,,i]=await Promise.all([r.write(e),r.close(),new Response(t).arrayBuffer()]);return new Uint8Array(i)},uW=async(e,t,n)=>{let r=cW(t,n),i=await _l(r),a=`.git/objects/${i.slice(0,2)}`,o=`${a}/${i.slice(2)}`,s=0;try{({size:s}=await e.stat(o))}catch(e){if(!XU(e))throw e}return s||(await e.mkdir(a),await e.writeFile(o,await Dke(r))),i},Oke=(e,t)=>{let n=0,r=()=>{let e=0,r=1,i;do i=t[n],n+=1,e+=(i&127)*r,r*=128;while(i&128);return e};if(r()!==e.length)throw Error(`Delta base size mismatch`);let i=new Uint8Array(r()),a=0;for(;n<t.length;){let r=t[n];if(n+=1,r&128){let o=0,s=0;for(let e=0;e<4;e+=1)r&1<<e&&(o+=t[n]*2**(8*e),n+=1);for(let e=0;e<3;e+=1)r&16<<e&&(s+=t[n]*2**(8*e),n+=1);s||=65536,i.set(e.subarray(o,o+s),a),a+=s}else if(r)i.set(t.subarray(n,n+r),a),n+=r,a+=r;else throw Error(`Invalid delta instruction`)}if(a!==i.length)throw Error(`Delta result size mismatch`);return i},kke=e=>{let t=e.indexOf(0),[n,r]=$U.decode(e.subarray(0,t)).split(` `),i=e.subarray(t+1);if(!Object.values(sW).includes(n))throw Error(`Invalid object type: ${n}`);if(Number(r)!==i.length)throw Error(`Object size mismatch`);return{type:n,content:i}},Ake=e=>{let t=new DataView(e);if(t.getUint32(0)!==4285812579||t.getUint32(4)!==2)throw Error(`Unsupported pack index version`);let n=t.getUint32(1028),r=1032,i=r+n*20+n*4,a=i+n*4,o=Array.from({length:256},(e,n)=>t.getUint32(8+n*4)),s=new Float64Array(n);for(let e=0;e<n;e+=1){let n=t.getUint32(i+e*4);s[e]=n&2147483648?t.getUint32(a+(n&2147483647)*8)*2**32+t.getUint32(a+(n&2147483647)*8+4):n}return{fanout:o,oids:new Uint8Array(e,r,n*20),offsets:s}},jke=({fanout:e,oids:t,offsets:n},r)=>{let i=r[0]?e[r[0]-1]:0,a=e[r[0]];for(;i<a;){let e=i+a>>>1,o=0;for(let n=0;n<20&&!o;n+=1)o=t[e*20+n]-r[n];if(!o)return n[e];o<0?i=e+1:a=e}},Mke=(e,t)=>{e.sortedOffsets??=Float64Array.from(e.index.offsets).sort();let{sortedOffsets:n}=e,r=0,i=n.length;for(;r<i;){let e=r+i>>>1;n[e]<=t?r=e+1:i=e}return r<n.length?n[r]:e.file.size-20},Nke=e=>{let t,n=async()=>{let t=[],n;try{n=await(await e.getDirectoryHandle(`objects`)).getDirectoryHandle(`pack`)}catch{return t}for await(let[e,r]of n.entries()){if(r.kind!==`file`||!e.endsWith(`.idx`))continue;let i=await r.getFile(),a=await n.getFileHandle(e.replace(/\.idx$/,`.pack`));t.push({index:Ake(await i.arrayBuffer()),file:await a.getFile()})}return t},r=async e=>{t??=n();let r=rW(e);for(let e of await t){let t=jke(e.index,r);if(t!==void 0)return{pack:e,offset:t}}},i=async t=>{let n=await WU(e,`objects/${t.slice(0,2)}/${t.slice(2)}`);if(n)return kke(await lW(new Uint8Array(await n.arrayBuffer())))},a=async(e,t,n)=>{if(n>Tke)throw Error(`Delta chain too long`);let r=Mke(e,t),i=new Uint8Array(await e.file.slice(t,r).arrayBuffer()),s=0,c=i[s],l=c>>4&7;for(;c&128;)s+=1,c=i[s];s+=1;let u;if(l===Cke){c=i[s],s+=1;let r=c&127;for(;c&128;)c=i[s],s+=1,r=(r+1)*128+(c&127);u=await a(e,t-r,n+1)}else if(l===wke){let e=nW(i.subarray(s,s+20));if(s+=20,u=await o(e,n+1),!u)throw Error(`Delta base not found: ${e}`)}let d=await lW(i.subarray(s));if(u)return{type:u.type,content:Oke(u.content,d)};let f=sW[l];if(!f)throw Error(`Invalid packed object type: ${l}`);return{type:f,content:d}},o=async(e,t)=>{let n=await i(e);if(n)return n;let o=await r(e);return o?a(o.pack,o.offset,t):void 0};return{readObject:e=>o(e,0)}},Pke=e=>{let t=new Map(e.map(e=>[e,QU.encode(e.type===`tree`?`${e.path}/`:e.path)]));return e.toSorted((e,n)=>eW(t.get(e),t.get(n)))},dW=e=>tW(e.flatMap(({mode:e,path:t,oid:n})=>[QU.encode(`${e} ${t}\0`),rW(n)])),Fke=e=>{let t=new Map,n=0;for(;n<e.length;){let r=e.indexOf(32,n),i=e.indexOf(0,r);t.set($U.decode(e.subarray(r+1,i)),{mode:$U.decode(e.subarray(n,r)),oid:nW(e.subarray(i+1,i+1+20))}),n=i+1+20}return t},Ike=e=>/^tree ([0-9a-f]{40})\n/.exec($U.decode(e))?.[1],Lke=e=>{let t=e.split(`/`).slice(0,-1);return[``,...t.map((e,n)=>t.slice(0,n+1).join(`/`))]},fW=async(e,{previous:t,changedPaths:n=[],cacheTree:r}={})=>{let i=new Set(n.flatMap(Lke)),a={files:[],dirs:new Map};e.forEach(({path:e,mode:t,oid:n})=>{let r=e.split(`/`),i=r.pop(),o=a;r.forEach(e=>{let t=o.dirs.get(e);t||(t={files:[],dirs:new Map},o.dirs.set(e,t)),o=t}),o.files.push({mode:t.toString(8),path:i,oid:n,type:t===57344?`commit`:`blob`})});let o=async({files:e,dirs:t},n,a)=>{if(a&&!i.has(n))return a;let s=new Map(await Promise.all([...t].map(async([e,t])=>[e,await o(t,n?`${n}/${e}`:e,a?.subtrees.get(e))]))),c=Pke([...e,...[...s].map(([e,{oid:t}])=>({mode:`40000`,path:e,oid:t,type:`tree`}))]);return{oid:r?.get(n)??await Eke(`tree`,dW(c)),entries:c,subtrees:s}};return o(a,``,t)},pW=async(e,t,{readObject:n,writeTree:r})=>{if(e.oid===t)return;let i=t?await n(t):void 0,a=i?.type===`tree`?Fke(i.content):new Map;for(let[t,i]of e.subtrees){let e=a.get(t);await pW(i,e?.mode===`40000`?e.oid:void 0,{readObject:n,writeTree:r})}let o=await r(e.entries);if(o!==e.oid)throw Error(`Tree object ID mismatch: expected ${e.oid}, got ${o}`)},mW,hW=()=>{mW=void 0},Rke=e=>{mW=e},gW=e=>nW(e.subarray(-20)),_W=async(e,t,n)=>{try{return await e.resolveRef({fs:t,dir:`/`,ref:n})}catch(e){if(e?.code===`NotFoundError`)return;throw e}},zke=async(e,t)=>{if(mW?.checksum===t&&mW.tree)return mW.tree;let n=await fW(e.entries,{cacheTree:e.cacheTree});return mW={checksum:t,index:e,tree:n},n},Bke=async e=>{let t=await(await WU(e,`index`))?.arrayBuffer(),n=t?gW(new Uint8Array(t)):``;return mW?.checksum===n?{index:mW.index,buffer:t,checksum:n}:{index:t?gke(t):{version:2,entries:[],extensions:[]},buffer:t,checksum:n}},Vke=async(e,t,n)=>t===`rebase-apply`&&await ZU(e,`.git/rebase-apply/applying`)?`am`:t===`sequencer`&&await ZU(e,`.git/sequencer/todo`)?(await e.readFile(`.git/sequencer/todo`,{encoding:`utf8`})).trimStart().startsWith(`revert`)?`revert`:`cherry_pick`:n,Hke=async(e,t,n)=>{try{let r=await e.getConfig({fs:t,dir:`/`,path:n});return r===!0||/^(?:true|yes|on|[+-]?0*[1-9]\d*)$/i.test(String(r).trim())}catch{return!1}},vW=async(e,{onLock:t}={})=>{let n;try{n=await e.getDirectoryHandle(`.git`)}catch(e){if(IU(e))return{ready:!1,reason:`unsupported_repository`};throw e}let r=await BN(`git`),i=mke(e,{Buffer:r.Buffer}),[[a,o,s,c,l],u]=await Promise.all([Promise.all([`extensions.objectformat`,`extensions.refstorage`,`user.name`,`user.email`,`core.autocrlf`].map(e=>r.getConfig({fs:i,dir:`/`,path:e}))),Hke(r,i,`core.ignorecase`)]);if(a&&a!==`sha1`||o&&o!==`files`)return{ready:!1,reason:`unsupported_repository`};if(!s||!c)return{ready:!1,reason:`missing_identity`};let d={name:s,email:c};if(await ZU(i,`.git/index.lock`))return{ready:!1,reason:`locked`,author:d};t&&(await i.writeFile(`.git/index.lock`,``),t(i));let f=await Promise.all(OU.map(([e])=>ZU(i,`.git/${e}`))),p=OU.find((e,t)=>f[t]);if(p)return{ready:!1,reason:`operation_in_progress`,detail:await Vke(i,...p),author:d};let m=await r.currentBranch({fs:i,dir:`/`,fullname:!0});if(!m)return{ready:!1,reason:`detached_head`,author:d};let{index:h,buffer:g,checksum:_}=await Bke(n);if(h.version!==2||_ke(h))return{ready:!1,reason:`unsupported_repository`,author:d,branch:m};if(h.entries.some(({stage:e})=>e))return{ready:!1,reason:`operation_in_progress`,detail:`conflict`,author:d,branch:m};let v=Nke(n),y=await _W(r,i,m),b;if(y){let e=await v.readObject(y);if(b=e?.type===`commit`?Ike(e.content):void 0,!b)return{ready:!1,reason:`unsupported_repository`,author:d,branch:m}}let x=await zke(h,_);return(b?x.oid!==b:h.entries.length>0)?{ready:!1,reason:`staged_changes`,author:d,branch:m}:{ready:!0,author:d,branch:m,repository:{git:r,fs:i,gitDirHandle:n,reader:v,branch:m,author:d,headOid:y,headTreeOid:b,index:h,indexBuffer:g,indexTree:x,autocrlf:[`true`,`input`].includes(String(l)),ignoreCase:u}}},yW=async(e,t,{concurrency:n=10}={})=>{let r=0,i=async()=>{for(;r<e.length;){let n=e[r];r+=1,await t(n)}};await Promise.all(Array(Math.min(n,e.length)).fill(void 0).map(()=>i()))},bW=async(e,t,n)=>{let r=Array(e.length);return await yW([...e.keys()],async n=>{r[n]=await t(e[n])},n),r},xW=class extends Error{},SW=(e,t,n)=>Error(e,{cause:new xW(n?Y(t,{values:n}):Y(t))}),CW=(e,t)=>e?.cause instanceof xW&&e.cause.message||Y(t),wW=e=>SW(`Not a collaborator of the repository`,`repository_no_access`,{repo:e}),Uke=e=>SW(`Not a collaborator of the repository`,`repository_no_write_access`,{repo:e}),TW=(e,t)=>t?Uke(e):wW(e),EW=({owner:e,repo:t},n,{reportNotFound:r=!1}={})=>n===404&&r?SW(`Failed to check repository access`,`repository_not_found`,{repo:t}):n===401||n===403||n===404?wW(t):SW(`Failed to check the repository permission.`,`open_authoring.permission_check_failed`,{repo:`${e}/${t}`}),DW=[`decap-cms-user`,`netlify-cms-user`],OW=ta({account:void 0});Ca(()=>{L(()=>{let e=OW.account;(async()=>{try{e?await kE.set(`sveltia-cms.user`,e):e===null&&await kE.delete(`sveltia-cms.user`)}catch{}})()})});var kW={create:`Create {{collection}} “{{slug}}”`,update:`Update {{collection}} “{{slug}}”`,delete:`Delete {{collection}} “{{slug}}”`,uploadMedia:`Upload “{{path}}”`,deleteMedia:`Delete “{{path}}”`,openAuthoring:`{{message}}`},Wke=/\[(?:skip[ -](?:ci|actions)|(?:ci|actions)[ -]skip|no[ -]ci|cf-pages-skip)\]/i,Gke=e=>Wke.test(e),AW=(e,t)=>e.replace(/\{\{([\w-]+)\}\}/g,(e,n)=>Object.hasOwn(t,n)?t[n]:e),jW=()=>Sk.current?.backend??{},MW=()=>{let{email:e=``,login:t=``,name:n=``}=OW.account;return{"author-email":e,"author-login":t,"author-name":n}},NW=(e,{commitType:t=`update`,collection:n},r=jW())=>{let{commit_messages:i={}}=r,[a=``]=e.map(e=>e.slug).filter(Boolean),[o,...s]=e.map(({path:e})=>e),c=n?pj(n,{useSingular:!0}):``,l=i[t]||kW[t]||``,u=MW();return[`create`,`update`,`delete`].includes(t)&&(l=AW(l,{slug:a,collection:c,path:o,...u})),[`uploadMedia`,`deleteMedia`].includes(t)&&(l=AW(l,{path:o,...u})),s.length&&(l+=` +${s.length}`),l},Kke=(e,t,n)=>{let r=t?.trim();return r?n===!0?r:n===`prefix`?`${r} ${e}`:n===`suffix`?`${e} ${r}`:e:e},PW=(e,t)=>{let{commitType:n=`update`,skipCI:r=void 0,userMessage:i}=t,a=jW(),{commit_messages:o={},skip_ci:s,automatic_deployments:c,prompt_commit_messages:l}=a,u=Kke(NW(e,t,a),i,l);return $V.current&&(u=AW(o.openAuthoring||kW.openAuthoring,{message:u,...MW()})),![`delete`,`deleteMedia`].includes(n)&&(r??(s===!0||c===!1))&&(u=`[skip ci] ${u}`),u},FW=e=>{let t=new Map;return e.forEach(e=>{t.has(e.sha)||t.set(e.sha,e)}),[...t.values()].sort((e,t)=>t.date.getTime()-e.date.getTime())},IW=(e,t)=>SW(`Failed to retrieve the last commit hash.`,e,t),LW=async(e,t)=>{let n=await t().catch(()=>void 0);if(n&&n.hash!==e)throw SW(`The branch has moved since the site data was loaded.`,`save_conflict.branch_moved`)},RW=async(e,t,n)=>FW((await bW(e,t)).flat().map(n)),zW=4,qke=e=>{let t=new Map;return e.forEach(({path:e})=>{if(e===e.normalize())return;let n=e.split(`/`);n.forEach((e,r)=>{let i=n.slice(0,r+1).join(`/`);i!==i.normalize()&&t.set(i.normalize(),i)})}),e=>{let n=e.split(`/`);for(let e=n.length;e>0;--e){let r=t.get(n.slice(0,e).join(`/`));if(r)return[r,...n.slice(e)].join(`/`)}return e}},Jke=async(e,t,n)=>{if(!LU(n)||oW(t,n).found||await ZU(e,n))return n;let r=[];for(let t of qU(n)){let i=RU(await e.readdir(r.join(`/`)),t);if(!i)return n;r.push(i)}return r.join(`/`)},BW=e=>e.filter(({action:e})=>[`create`,`update`,`move`].includes(e)).map(({path:e})=>e),Yke=e=>e.flatMap(({action:e,path:t,previousPath:n})=>e===`delete`?[t]:e===`move`&&n?[n]:[]),Xke=e=>{let t;try{t=new TextDecoder(`utf-8`,{fatal:!0}).decode(e)}catch{return e}return QU.encode(t.replaceAll(`\r
`,`
`))},Zke=async({git:e,fs:t,index:n,autocrlf:r},i)=>(await bW(i,async i=>{let{position:a,found:o}=oW(n.entries,i);if(!o&&await e.isIgnored({fs:t,dir:`/`,filepath:i}))return;let{size:s,mtimeMs:c}=await t.stat(i),l=await t.readFile(i);return r&&(l=Xke(l)),vke({path:i,mode:o&&n.entries[a].mode===33261?33261:33188,oid:await uW(t,`blob`,l),size:s,mtimeMs:c})},{concurrency:zW})).filter(Boolean),Qke=e=>{let t=Math.abs(e),n=String(Math.floor(t/60)).padStart(2,`0`);return`${e>0?`-`:`+`}${n}${String(t%60).padStart(2,`0`)}`},$ke=async(e,{branch:t,oldOid:n,newOid:r,signature:i,message:a})=>{let{name:o,email:s,timestamp:c,timezoneOffset:l}=i,u=n?`commit`:`commit (initial)`,d=a.split(`
`)[0],f=`${o} <${s}> ${c} ${Qke(l)}`,p=`${n??lke} ${r} ${f}\t${u}: ${d}\n`;for(let n of[`.git/logs/HEAD`,`.git/logs/${t}`])await ZU(e,n)&&await e.appendFile(n,p)},eAe=async(e,t,n)=>{let{git:r,fs:i,reader:a,branch:o,author:s,headOid:c,headTreeOid:l}=e,{index:u,indexTree:d}=e,f=qke(u.entries),p=new Set(Yke(t).map(f)),m=await bW(BW(t),e=>Jke(i,u.entries,f(e)),{concurrency:zW}),h=await Zke(e,m);if(h.length||u.entries.some(({path:e})=>p.has(e))){let e=bke(u.entries,{removedPaths:p,addedEntries:h});d=await fW(e,{previous:d,changedPaths:[...p,...m]});let t=await Ske(e,{tree:d});await i.writeFile(`.git/index`,t),u={version:2,entries:e,extensions:[`TREE`]},Rke({checksum:gW(t),index:u,tree:d})}if(l?d.oid===l:!u.entries.length)return;if(await pW(d,l,{readObject:a.readObject,writeTree:e=>uW(i,`tree`,dW(e))}),await _W(r,i,o)!==c)throw Error(`The branch has been updated by another program.`);let g=Math.floor(Date.now()/1e3),_={...s,timestamp:g,timezoneOffset:new Date(g*1e3).getTimezoneOffset()},v=PW(t,n);return{oid:await r.commit({fs:i,dir:`/`,ref:o,message:v,tree:d.oid,author:_,committer:_}),signature:_,message:v}},tAe=async(e,t,n)=>{let{fs:r,indexBuffer:i,branch:a,headOid:o}=e,s;try{s=await eAe(e,t,n)}catch(e){throw i?await r.writeFile(`.git/index`,new Uint8Array(i)):await ZU(r,`.git/index`)&&await r.unlink(`.git/index`),e}if(!s)return;let{oid:c,signature:l,message:u}=s;try{await $ke(r,{branch:a,oldOid:o,newOid:c,signature:l,message:u})}catch(e){console.error(e)}return{oid:c,date:new Date(l.timestamp*1e3)}},VW=pk(),HW=LR(1),UW=e=>{let{message:t,data:n}=Object(e);return n?.message??t??String(e)},nAe=e=>HW(async()=>{try{let{repository:t,...n}=await vW(e);return n}catch(e){return{ready:!1,reason:`error`,detail:UW(e)}}}),rAe=({repoRootDirHandle:e,changes:t,options:n,save:r})=>HW(async()=>{let i=PU(t),a;try{let t;try{if(t=await vW(e,{onLock:e=>{a=e}}),t.repository){let{fs:e,ignoreCase:n}=t.repository,r=await cke(e,BW(i),{ignoreCase:n});r&&(t={ready:!1,reason:`lfs`,detail:r})}}catch(e){t={ready:!1,reason:`error`,detail:UW(e)}}let{repository:o,reason:s=`error`,detail:c}=t,l=await r();if(!o)return VW.current={reason:s,detail:c},l;try{let e=await tAe(o,i,n);return e?{...l,sha:e.oid,date:e.date}:l}catch(e){return console.error(e),VW.current={reason:`error`,detail:UW(e)},l}}finally{try{await a?.unlink(`.git/index.lock`)}catch{}}}),iAe=e=>{let t=e.split(`/`),n=t.findIndex(e=>e.includes(`{{`));return(n===-1?t:t.slice(0,n)).join(`/`)},WW=(e,t)=>e===t||e.startsWith(`${t}/`),GW=()=>{let e=[],t=[];return _j.current.forEach(({filePathMap:n,folderPathMap:r})=>{n?e.push(...Object.values(n)):t.push(...Object.values(r??{}))}),iH.current.forEach(({internalPath:e})=>{e!==void 0&&t.push(e)}),{filePaths:e,folderPaths:t}},aAe=()=>{let{filePaths:e,folderPaths:t}=GW(),n=e.filter(e=>!e.includes(`{{`)),r=[...e.filter(e=>e.includes(`{{`)),...t].map(e=>iAe(CE(e)));if(r.some(e=>!e))return;let i=[...new Set(r)].filter(e=>!e.startsWith(`../`)).sort().filter((e,t,n)=>!n.slice(0,t).some(t=>WW(e,t)));return{dirs:i,files:[...new Set(n.map(e=>CE(e)))].filter(e=>!e.startsWith(`../`)&&!i.some(t=>WW(e,t)))}},oAe=6e4,sAe=LR(8),KW=e=>e?RP(e,e=>xE(e).replace(Jk,`.+?`)):/^.+$/,cAe=async(e,t)=>{try{let{lastModified:n}=await t.getFile();Date.now()-n>=oAe&&await e.removeEntry(t.name)}catch{}},qW=async(e,t,n=``)=>{let{scanningPaths:r,scanningPathsRegEx:i,fileHandles:a,pathRegexCache:o}=t,s=[],c=[];await sAe(async()=>{for await(let[t,a]of e.entries()){if(t.startsWith(`.`)&&!xH.test(t)){a.kind===`file`&&t.startsWith(`.sveltia-tmp-`)&&await cAe(e,a);continue}let l=n?`${n}/${t}`:t,u=l.normalize(),d=i.some(e=>e.test(u));if(a.kind===`file`&&d&&s.push({handle:a,path:l}),a.kind===`directory`){let e=o.get(u);if(e||(e=KW(u),o.set(u,e)),d||r.some(t=>e.test(t))){let e=[];s.push(e),c.push({handle:a,path:l,fileHandles:e})}}}}),await Promise.all(c.map(({handle:e,path:n,fileHandles:r})=>qW(e,{...t,fileHandles:r},n))),s.forEach(e=>{(Array.isArray(e)?e:[e]).forEach(e=>{a.push(e)})})},lAe=()=>{let{filePaths:e,folderPaths:t}=GW();return EO([...e,...t].map(e=>CE(e).normalize()))},uAe=async e=>{let t=[],n=lAe();return await qW(e,{rootDirHandle:e,scanningPaths:n,scanningPathsRegEx:n.map(KW),fileHandles:t,pathRegexCache:new Map}),t.map(({handle:e,path:t})=>({handle:e,path:t.normalize(),name:e.name.normalize(),size:0,sha:``}))},JW=e=>(e.catch(()=>{}),e),YW=e=>{let t=[],n=[],r=[],i=new Set;e.forEach(e=>{let{path:a,name:o}=e;if(o.startsWith(`.`))xH.test(o)&&r.push({...e,type:`config`});else{let[r]=kP(a);if(r){t.push({...e,type:`entry`,folder:r}),i.add(a);return}if(i.has(a)||RR(a))return;let[o]=lH(a);o&&n.push({...e,type:`asset`,folder:o})}});let a=[...t,...n,...r];return{entryFiles:t,assetFiles:n,configFiles:r,allFiles:a,count:a.length}},XW=({entryFiles:e,assetFiles:t,configFiles:n})=>`${e.length} entry files, ${t.length} asset files, ${n.length} config files`,ZW=e=>{let t=performance.now(),n=t;return(r,...i)=>{let a=performance.now(),o=Math.round(a-n),s=Math.round(a-t);n=a,console.debug(`[${e}] ${r} (+${o} ms, ${s} ms total)`,...i)}},dAe=10485760,QW=10,$W=async e=>{let{name:t,handle:n}=e;if(t===`.gitkeep`)return e;try{let r=await n.getFile();if(r.size>dAe)return console.warn(`File ${t} is too large (${r.size} bytes), skipping content read`),e;let i=await gbe(r);return{...e,text:i}}catch(t){return console.error(t),e}},fAe=async(e,{cachedHashes:t,newHashes:n}={})=>{let{name:r,path:i,handle:a}=e,o=pV(r);try{let r=await a.getFile(),{size:s,lastModified:c}=r,l=t?.get(i),u;return l&&l.size===s&&l.lastModified===c?{sha:u}=l:(u=await XP(r),n?.set(i,{sha:u,size:s,lastModified:c})),{...e,kind:o,size:s,sha:u}}catch(t){return console.error(t),{...e,kind:o}}},pAe=async e=>{try{return new Map(await e?.entries()??[])}catch(e){return console.error(e),new Map}},mAe=async(e,{cachedHashes:t,newHashes:n,currentPaths:r})=>{if(!e)return;let i=[...t.keys()].filter(e=>!r.has(e));try{n.size&&await e.saveEntries([...n]),i.length&&await e.deleteEntries(i)}catch(e){console.error(e)}},eG=async(e,{hashCacheDB:t=null}={})=>{let n=ZW(`Loading site data`);n(`Started: local repository ${e.name}`);let r=pAe(t),i=YW(await uAe(e)),{entryFiles:a,assetFiles:o,configFiles:s}=i;n(`Scanned the directory: ${XW(i)}`);let c=new Map,l=JW(r.then(e=>bW(o,t=>fAe(t,{cachedHashes:e,newHashes:c}),{concurrency:QW}))),u=await bW(a,$W,{concurrency:QW});n(`Read ${u.length} entry files`);let d=await bW(s,$W,{concurrency:QW});n(`Read ${d.length} config files`);let{entries:f,errors:p}=await JR(u);n(`Parsed ${f.length} entries (${p.length} errors)`);let m=await l,h=await r;n(`Hashed ${c.size} of ${m.length} asset files (${h.size} cached)`),vj.current=f,pH.current=m,SH.current=d,bj.current=p,hj.current=!0,n(`The site data is ready`),await mAe(t,{cachedHashes:h,newHashes:c,currentPaths:new Set(o.map(({path:e})=>e))})},hAe=/^(.+\.)?localhost$/,tG=e=>[`127.0.0.1`,`[::1]`].includes(e)||hAe.test(e),nG=(e,t=globalThis.window?.location?.origin??globalThis.location?.origin??`https://localhost`)=>{try{let{hostname:n,protocol:r}=new URL(e,t);return r===`https:`||tG(n)}catch{return!1}},rG=async(e,t={},{responseType:n=`json`,refreshAccessToken:r=void 0,retries:i=1}={})=>{let a;if(t.cache=`no-cache`,t.headers=new Headers(t.headers),t.headers.has(`Authorization`)&&!nG(e))throw Error(`Refusing to send credentials over an insecure connection`);n===`json`&&t.headers.set(`Accept`,`application/json`),E(t.body)&&(t.headers.set(`Content-Type`,`application/json`),t.body=JSON.stringify(t.body));try{a=await fetch(e,t)}catch(e){throw Error(`Failed to send the request`,{cause:e})}if(n===`raw`)return a;let{ok:o,status:s}=a,c;if(o)try{if(n===`blob`)return await a.blob();if(n===`text`)return await a.text();c=await a.json()}catch(e){throw Error(`Failed to parse the response`,{cause:e})}else try{c=await a.json()}catch{c=void 0}if(o&&!(e.endsWith(`/graphql`)&&E(c)&&c.errors))return c;if(s===502&&i>0)return await pl(1e3),rG(e,t,{responseType:n,refreshAccessToken:r,retries:i-1});if(s===401&&r){let[i]=t.headers.get(`Authorization`)?.split(` `)??[`token`],{token:a}=await r();return t.headers.set(`Authorization`,`${i} ${a}`),rG(e,t,{responseType:n})}if(!E(c))throw Error(`Server responded with an error`,{cause:{status:s}});let l=``;throw typeof c.error==`string`&&(l=c.error),typeof c.message==`string`&&(l=c.message),Array.isArray(c.errors)&&(typeof c.errors[0]==`string`&&(l=c.errors.join(`, `)),E(c.errors[0])&&typeof c.errors[0].message==`string`&&(l=c.errors.map(e=>e.message).join(`, `))),Error(`Server responded with an error`,{cause:{status:s,message:l}})},iG=ta({isLocalHost:!1,isLocalBackendSupported:!1,isBrave:!1,isMacOS:!1,isSmallScreen:!1,isMediumScreen:!1,isLargeScreen:!1,hasMouse:!0}),gAe=()=>{let{location:{hostname:e},navigator:{userAgentData:t,platform:n},matchMedia:r}=globalThis;iG.isLocalHost=tG(e),iG.isLocalBackendSupported=`showDirectoryPicker`in globalThis,iG.isBrave=t?.brands.some(({brand:e})=>e===`Brave`)??!1,iG.isMacOS=t?.platform===`macOS`||n.startsWith(`Mac`);let i=r(`(width < 768px)`),a=r(`(768px <= width < 1024px)`),o=r(`(1024px <= width)`),s=r(`(pointer: fine)`),c=()=>{iG.isSmallScreen=i.matches},l=()=>{iG.isMediumScreen=a.matches},u=()=>{iG.isLargeScreen=o.matches},d=()=>{iG.hasMouse=s.matches};c(),l(),u(),d(),i.addEventListener(`change`,c),a.addEventListener(`change`,l),o.addEventListener(`change`,u),s.addEventListener(`change`,d)},aG=e=>iG.isSmallScreen||iG.isMediumScreen||e.detail===0||e.pointerType===`touch`||!iG.hasMouse,_Ae=3,vAe=150,oG=()=>`move`in FileSystemFileHandle.prototype&&!iG.isBrave,sG=async(e,t)=>{let n=await e.createWritable?.();try{await n?.write(t)}finally{try{await n?.close()}catch{}}},yAe=async({rootDirHandle:e,previousPath:t,path:n})=>{let{dirname:r,basename:i}=Uk(n),{dirname:a}=Uk(t),o=await VU(e,t);if(oG()){let t=await HU(e,r);return await o.move(t,await zU(t,i)),o}let s=await VU(e,n),c=await HU(e,a);return await sG(s,await o.getFile()),await c.removeEntry(o.name),s},bAe=async(e,t,n)=>{for(let r=1;;r+=1)try{await e.move(t,n);return}catch(e){if(r===_Ae)throw e;await pl(vAe*r)}},xAe=async({rootDirHandle:e,fileHandle:t,path:n,data:r})=>{let i;if(!t){if(oG()){let{dirname:r,basename:a}=Uk(CE(n)),o=await HU(e,r);t=await o.getFileHandle(`.sveltia-tmp-${crypto.randomUUID()}`,{create:!0}),i={dirHandle:o,basename:a}}else t=await VU(e,n)}if(!i)return await sG(t,r),t.getFile();let{dirHandle:a,basename:o}=i;try{await sG(t,r),await bAe(t,a,await zU(a,o))}catch(e){try{await a.removeEntry(t.name)}catch{}throw e}return t.getFile()},SAe=async(e,t)=>{for(let n=t.length;n>0;--n){let r=t[n-1],i=t.slice(0,n-1).join(`/`);try{let t=await BU(e,i,`directory`,{create:!1}),n=await zU(t,r),a=await t.getDirectoryHandle(n);for await(let e of a.entries())return;await t.removeEntry(n)}catch(e){if(!FU(e))throw e}}},CAe=async({rootDirHandle:e,path:t})=>{let{dirname:n=``,basename:r}=Uk(CE(t)),i=await HU(e,n);try{await i.removeEntry(await zU(i,r))}catch(e){if(!FU(e))throw e}},wAe=async(e,t)=>{for(let n of new Set(t))n&&await SAe(e,n.split(`/`))},TAe=async(e,{action:t,path:n,previousPath:r,data:i})=>{let a;return t===`move`&&r&&(a=await yAe({rootDirHandle:e,previousPath:r,path:n})),[`create`,`update`,`move`].includes(t)&&i!==void 0?xAe({rootDirHandle:e,fileHandle:a,path:n,data:i}):(t===`delete`&&await CAe({rootDirHandle:e,path:n}),null)},cG=({slug:e,data:t})=>e!==void 0||typeof t==`string`,lG=async(e,t)=>Promise.all(t.map(async t=>{let{path:n,data:r}=t,i=e?await TAe(e,t):null;if(!i){if(r===void 0)return null;i=qP(r)}return[n,{file:i,sha:await XP(i)}]})),uG=async(e,t)=>{let n=t.filter(e=>!cG(e)),r=t.filter(cG),i=[...await lG(e,n),...await lG(e,r)];return e&&await wAe(e,t.map(({action:e,path:t,previousPath:n})=>{if(e===`delete`)return t;if(e===`move`&&n)return n}).filter(e=>e!==void 0).map(e=>WP(CE(e)))),{sha:await XP(new Date().toJSON()),files:Object.fromEntries(i.filter(e=>!!e))}},dG={clientId:``,authScope:``,authURL:``,tokenURL:``,authScheme:`token`,restBaseURL:``,graphqlBaseURL:``,includeCredentials:!1},fG={},pG=async(e,t,{includeCredentials:n=!1}={})=>{if(nG(e))try{return await fetch(e,{method:`POST`,headers:{Accept:`application/json`,"Content-Type":`application/json`},body:JSON.stringify(t),...n&&{credentials:`include`}})}catch{return}},mG=new Map,EAe=async({clientId:e,tokenURL:t,refreshToken:n})=>{let r=await pG(t,{grant_type:`refresh_token`,client_id:e,refresh_token:n},{includeCredentials:dG.includeCredentials});if(!r?.ok)throw Error(Y(`sign_in_error.TOKEN_REFRESH_FAILED`));let i;try{i=await r.json()}catch{}if(!mA(i?.access_token))throw Error(Y(`sign_in_error.TOKEN_REFRESH_FAILED`));let a=i?.access_token;if(mA(i?.refresh_token)&&(n=i?.refresh_token),OW.account){OW.account={...OW.account,token:a,refreshToken:n};try{await kE.set(`sveltia-cms.user`,OW.account)}catch{}}return{token:a,refreshToken:n}},DAe=({clientId:e,tokenURL:t,refreshToken:n})=>{let r=mG.get(n);return r||(r=EAe({clientId:e,tokenURL:t,refreshToken:n}).finally(()=>{mG.delete(n)}),mG.set(n,r)),r},OAe=`sveltia-cms.token-refresh`,kAe=e=>{let t=globalThis.navigator?.locks;return t?t.request(OAe,e):e()},hG=e=>{let{account:t}=OW,n=mA(e?.refreshToken)?e.refreshToken:void 0;if(t&&mA(e?.token)&&e.backendName===t.backendName&&e.id===t.id&&(!t.refreshToken||n))return{token:e.token,refreshToken:n}},AAe=async()=>{try{return hG(await kE.get(`sveltia-cms.user`))}catch{return}},gG=(e,{token:t,refreshToken:n})=>!!e?.token&&e.token!==t&&e.refreshToken!==n;globalThis.addEventListener?.(`storage`,({key:e,newValue:t})=>{if(e!==`sveltia-cms.user`||!t)return;let n;try{n=JSON.parse(t)}catch{return}let r=hG(n),{account:i}=OW;r&&(r.token!==i.token||r.refreshToken!==i.refreshToken)&&(OW.account={...i,...r})});var _G=async(e,{method:t=`GET`,headers:n={},body:r=null,isGraphQL:i=!1,responseType:a=`json`,token:o=void 0,refreshToken:s=void 0}={})=>{let{clientId:c,tokenURL:l,restBaseURL:u,graphqlBaseURL:d,authScheme:f=`token`,includeCredentials:p}=dG,m=OW.account,h=i?d:u;o??=m?.token,s??=m?.refreshToken,n.Authorization=`${f} ${o}`;let g=!!m&&o===m.token&&s===m.refreshToken;return rG(`${h}${e}`,{method:t,headers:n,body:r,...p&&{credentials:`include`}},{responseType:a,refreshAccessToken:s?()=>kAe(async()=>{if(g){let{account:e}=OW;if(e&&gG(e,{token:o,refreshToken:s}))return{token:e.token,refreshToken:e.refreshToken};let t=await AAe();if(t&&gG(t,{token:o,refreshToken:s}))return OW.account={...OW.account,...t},t}return DAe({clientId:c,tokenURL:l,refreshToken:s})}):void 0})},vG=async(e,t={})=>{e=e.replace(/\n\s*/g,` `),Object.entries(fG).forEach(([n,r])=>{e.includes(`$${n}`)&&(t[n]??=r)});let{data:n}=await _G(``,{method:`POST`,body:{query:e,variables:t},isGraphQL:!0});return n},yG=async({token:e,refreshToken:t},n,r)=>{let i=OW.account?.token,a=await _G(`/user`,{token:e,refreshToken:t}),o=OW.account;return o?.token&&o.token!==e&&o.token!==i&&(e=o.token,t=o.refreshToken),{backendName:n,id:a.id,name:a[r.name],login:a[r.login],email:a.email,avatarURL:a.avatar_url,profileURL:a[r.profileURL],bot:a.bot??!1,token:e,refreshToken:t}},jAe=e=>yG(e,`gitea`,{name:`full_name`,login:`login`,profileURL:`html_url`}),bG=pk(!1),xG=pk(),SG=`sveltia-cms.auth`,CG=`sveltia-cms.auth-popup`,wG=e=>`sveltia-cms.auth.${e}`,TG=e=>`authorizing:${e}`,EG=(e,t,n)=>`authorization:${e}:${t}:${JSON.stringify(n)}`,MAe=(e,t)=>t.match(`^authorization:${e}:(success|error):(?<result>.+)`)?.groups?.result,NAe=()=>{try{return window.sessionStorage.getItem(CG)}catch{return null}},DG=e=>{try{e?window.sessionStorage.setItem(CG,e):window.sessionStorage.removeItem(CG)}catch{}},OG=async()=>{DG(),await kE.delete(SG)},kG=()=>Object.assign(Error(`Authentication aborted`),{name:`AbortError`}),AG=({authURL:e})=>{let{availHeight:t,availWidth:n}=window.screen,r=t/2-400,i=n/2-300;return window.open(e,`auth`,`width=600,height=800,top=${r},left=${i}`)},jG=async({backendName:e,authURL:t,popup:n,state:r})=>{let i=n??AG({authURL:t});if(!i)throw kG();return new Promise((n,a)=>{let o=new AbortController,s=e,c=r?new BroadcastChannel(wG(r)):void 0,l,u=()=>{o.abort(),clearInterval(l),c?.close(),xG.current=void 0},d=()=>{u(),i.close(),a(kG())};(e===`github`||e===`gitea`)&&(l=setInterval(()=>{i.closed&&d()},1e3));let f=e=>{let t=MAe(s,e),r;try{r=t?JSON.parse(t):{error:`No data`},E(r)||(r={error:`Malformed data`})}catch{r={error:`Malformed data`}}`token`in r?n(r):a(Error(`Authentication failed`,{cause:Error(r.errorCode?Y(`sign_in_error.${r.errorCode}`,{default:r.error}):r.error)})),u(),i.close()};window.addEventListener(`message`,({origin:e,data:n,source:r})=>{r===i&&e===new URL(t).origin&&typeof n==`string`&&(n===TG(s)?i.postMessage(n,e):f(n))},{signal:o.signal}),c&&(c.onmessage=({data:e})=>{typeof e==`string`&&f(e)}),xG.current=d})},PAe=async({backendName:e,siteDomain:t,authURL:n,scope:r})=>{let{hostname:i}=window.location;t??=i===`localhost`?`cms.netlify.com`:i;try{new URL(n).origin===`https://api.netlify.com`&&(t=new URL(`https://${t}`).hostname)}catch{}return jG({backendName:e,authURL:`${n}?${new URLSearchParams({provider:e,site_id:t,scope:r})}`})},FAe=async()=>{let e=`${gl()}${gl()}`,t=btoa(await _l(e,{algorithm:`SHA-256`,format:`binary`})).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);return{csrfToken:ml().replaceAll(`-`,``),codeVerifier:e,codeChallenge:t}},IAe=async({backendName:e,clientId:t,authURL:n,scope:r})=>{let{origin:i,pathname:a}=window.location,o=`${i}${a}`,s=AG({authURL:o});if(!s)throw kG();let{csrfToken:c,codeVerifier:l,codeChallenge:u}=await FAe(),d=new URLSearchParams({client_id:t,redirect_uri:o,response_type:`code`,state:c,scope:r,code_challenge:u,code_challenge_method:`S256`});if(await kE.set(SG,{csrfToken:c,codeVerifier:l,realAuthURL:`${n}?${d}`}),await kE.set(`sveltia-cms.user`,{backendName:e}),s.closed)throw kG();try{return await jG({backendName:e,authURL:o,popup:s,state:c})}catch(e){throw await kE.delete(SG),e}},MG=({provider:e=`unknown`,state:t,token:n,refreshToken:r,error:i,errorCode:a})=>{let o=i?`error`:`success`,s=i?{provider:e,error:i,errorCode:a}:{provider:e,token:n,refreshToken:r};if(!window.opener){if(t){let n=new BroadcastChannel(wG(t));n.postMessage(EG(e,o,s)),n.close(),window.close()}return}let c=({data:t,origin:n,source:r})=>{r===window.opener&&n===window.location.origin&&t===TG(e)&&(window.opener?.postMessage(EG(e,o,s),n),window.removeEventListener(`message`,c))};window.addEventListener(`message`,c),window.opener?.postMessage(TG(e),window.location.origin)},LAe=async({backendName:e,apiConfig:t,code:n,state:r})=>{let{clientId:i,tokenURL:a,includeCredentials:o=!1}=t,{origin:s,pathname:c}=new URL(window.location.href),{csrfToken:l,codeVerifier:u}=await kE.get(SG)??{},d=e,f=`${s}${c}`;if(await OG(),!l||!u||r!==l)return MG({provider:d,state:r,error:Y(`sign_in_error.CSRF_DETECTED`),errorCode:`CSRF_DETECTED`});let p=``,m=``,h=``,g=await pG(a,{grant_type:`authorization_code`,client_id:i,code:n,redirect_uri:f,code_verifier:u},{includeCredentials:o});if(!g)return MG({provider:d,state:r,error:Y(`sign_in_error.TOKEN_REQUEST_FAILED`),errorCode:`TOKEN_REQUEST_FAILED`});try{({access_token:p,refresh_token:m,error:h}=await g.json())}catch{return MG({provider:d,state:r,error:Y(`sign_in_error.MALFORMED_RESPONSE`),errorCode:`MALFORMED_RESPONSE`})}return MG({provider:d,state:r,token:p,refreshToken:m,error:h})},RAe=async({backendName:e,apiConfig:t})=>{bG.current=!0;let{search:n}=window.location,{code:r,state:i,error:a,error_description:o}=Object.fromEntries(new URLSearchParams(n));if(r&&i)await LAe({backendName:e,apiConfig:t,code:r,state:i});else if(a)await OG(),MG({provider:e,state:i,error:o||a,errorCode:`AUTH_CODE_REQUEST_FAILED`});else{let{csrfToken:e,realAuthURL:t}=await kE.get(SG)??{};t&&(DG(e),window.location.href=t)}},zAe=()=>{try{if(window.opener)return window.opener.origin===window.location.origin&&window.name===`auth`}catch{return!1}let e=new URLSearchParams(window.location.search).get(`state`);return!!e&&e===NAe()},BAe=async({auto:e,apiConfig:t})=>{let{backend:n}=Sk.current,{name:r,site_domain:i,auth_type:a}=n,{clientId:o,authScope:s,authURL:c}=t,l={backendName:r,authURL:c,scope:s};if(r===`gitea`||a===`pkce`){let n=zAe();return n&&await RAe({backendName:r,apiConfig:t}),n||e?void 0:IAe({...l,clientId:o})}if(!e)return PAe({...l,siteDomain:i})},VAe=async({options:{token:e,refreshToken:t,auto:n=!1},apiConfig:r})=>{if(!e){let i=await BAe({auto:n,apiConfig:r});if(!i)return;({token:e,refreshToken:t}=i)}return{token:e,refreshToken:t}},NG=async({options:e,getUserProfile:t})=>{let{token:n,refreshToken:r}=await VAe({options:e,apiConfig:dG})??{};if(n)return t({token:n,refreshToken:r})},PG=async()=>void 0,HAe=e=>`${e}/user/settings/applications`,UAe=e=>NG({options:e,getUserProfile:jAe}),FG=ta({current:void 0}),IG=ta({}),LG=!1,RG=ta({current:void 0});Ca(()=>{(async()=>{FG.current=void 0;try{let e=await kE.get(`sveltia-cms.prefs`),t=E(e)?e:{};t.apiKeys??={},t.useDraftBackup??=!0,t.closeOnSave??=!0,t.closeWithEscape??=!0,t.underlineLinks??=!0,t.devModeEnabled??=!1,t.localGitCommits??=!1,t.defaultTranslationService??=`google`,t.locale??=`auto`,t.locale===`en`&&(t.locale=`auto`),delete t.beta,Object.assign(IG,t)}catch{FG.current={type:`permission_denied`}}})(),L(()=>{if(!Object.keys(IG).length)return;let e=ni(IG);(async()=>{try{(0,yr.default)(e,await kE.get(`sveltia-cms.prefs`))||await kE.set(`sveltia-cms.prefs`,e)}catch{}})();let{theme:t,underlineLinks:n=!0,devModeEnabled:r=!1}=IG,i=!t||t===`auto`,a=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;Object.assign(document.documentElement.dataset,{theme:i?a:t,autoTheming:i,underlineLinks:n,devMode:r})}),L(()=>{let{locale:e}=IG,t=e===`auto`?RG.current:e;if(!t||!Ec.includes(t))return;let n=fo(()=>Jc.current),r=LG&&e!==`auto`;LG=!0,Kc(t).then(()=>{t in Dc?Jc.set(t):r&&n&&(IG.locale=n)})})});var zG={service:``,label:``,owner:``,repo:``,branch:``,repoURL:``,treeBaseURL:``,blobBaseURL:``,isSelfHosted:!1,databaseName:``},WAe=/^(?<origin>(?:[a-z][a-z\d+.-]*:)?\/\/[^/]*)?(?<path>.*?)\/api(?:\/.*)?$/i,BG=e=>e===`https://api.github.com`?`https://github.com`:e.replace(WAe,`$<origin>$<path>`),GAe=(e,t)=>`${BG(e)}/${t}`,VG=({tree:e,blob:t,commit:n})=>(r,i)=>({treeBaseURL:i?`${r}${e}/${IP(i)}`:r,blobBaseURL:i?`${r}${t}/${IP(i)}`:``,commitBaseURL:`${r}${n}`}),HG=(e,t,n)=>{let r=e(t,n),i=AU();return!i||!n?r:{...r,treeBaseURL:`${r.treeBaseURL}/${IP(i)}`,blobBaseURL:`${r.blobBaseURL}/${IP(i)}`}},KAe=(e,{service:t,label:n,owner:r,repo:i,branch:a,restApiRoot:o,defaultApiRoot:s,getTokenPageURL:c,getBaseURLs:l})=>{o=CE(o);let u=`${r}/${i}`,d=GAe(o,u),f=AU();return Object.assign(e,{service:t,label:n,owner:r,repo:i,branch:a,repoURL:d,tokenPageURL:c(BG(o)),databaseName:f?`${t}:${u}:${f}`:`${t}:${u}`,isSelfHosted:o!==s},HG(l,d,a)),IG.devModeEnabled&&console.info(`repositoryInfo`,e),e},UG=(e,{found:t,branch:n,getBaseURLs:r})=>{let{repo:i,repoURL:a=``}=e;if(!t)throw SW(`Failed to retrieve the default branch name.`,`repository_not_found`,{repo:i});if(!n)throw SW(`Failed to retrieve the default branch name.`,`repository_empty`,{repo:i});return Object.assign(e,{branch:n},HG(r,a,n)),n},WG={...zG},GG=new Map,KG,qG=VG({tree:`/src/branch`,blob:`/src/branch`,commit:`/commit`}),JG=()=>{let{owner:e,repo:t}=WG,n=OW.account?.id;return GG.has(n)||GG.clear(),LA(GG,n,()=>_G(`/repos/${e}/${t}`))},qAe=async()=>{let{owner:e,repo:t}=WG,n=String(WG.branch),r=OW.account?.id,i=await _G(`/repos/${e}/${t}/branches/${IP(n)}`);return KG={branch:n,userId:r,result:i},i},JAe=async()=>{let{repo:e}=WG,t;try{t=await JG()}catch(e){throw EW(WG,e?.cause?.status,{reportNotFound:!0})}if(!t.permissions?.push)throw TW(e,t.permissions?.pull)},YAe=async()=>{let{owner:e,repo:t,branch:n}=WG,r=KG;KG=void 0,await ZV(n,async n=>{let i=r?.branch===n&&r.userId===OW.account?.id?r.result:await _G(`/repos/${e}/${t}/branches/${IP(n)}`);return{canPush:i.user_can_push,canMerge:i.user_can_merge}})},YG=async()=>{let e=await JG().catch(()=>void 0);return UG(WG,{found:!!e,branch:e?.default_branch,getBaseURLs:qG})},XG={isForgejo:!1},XAe=28,ZAe=async e=>{let{restBaseURL:t,includeCredentials:n}=dG;try{let e=new URL(`../forgejo/v1/version`,`${t}/`).href,{ok:r,status:i,redirected:a}=await rG(e,n?{credentials:`include`}:{},{responseType:`raw`});if(!a&&(r||i===404))return r}catch{}return e<XAe},ZG=async()=>{let{version:e}=await _G(`/version`),t=Number.parseFloat(e),n=/\+gitea-/.test(e??``)||t>=2&&await ZAe(t),r=n?`Forgejo`:`Gitea`,i=n?12:1.24;if(Object.assign(XG,{isForgejo:n}),Object.assign(WG,{label:r}),t<i)throw Error(`Unsupported ${r} version`,{cause:Error(Y(`backend_unsupported_version`,{values:{name:r,version:i}}))})},QG={attempts:10,interval:1e3},$G=async(e,t,{attempts:n,interval:r})=>{let i=await e();return t(i)||n<=1?i:(await pl(r),$G(e,t,{attempts:n-1,interval:r}))},eK={interval:1e3,attempts:30},tK=e=>{let{backend:t}=Sk.current??{};return t?.name===e&&`open_authoring`in t&&t.open_authoring===!0},nK=({owner:e,repo:t})=>QV.current??{owner:e,repo:t},QAe=async({repoPath:e,allowForking:t})=>{if(!t)throw SW(`The repository does not allow forking`,`open_authoring.forking_disabled`,{repo:e});if(!await QDe(e))throw SW(`Permission to fork the repository was declined`,`open_authoring.fork_declined`)},rK=(e,t)=>(console.error(`Failed to fork the repository.`,t),SW(`Failed to fork the repository.`,`open_authoring.fork_failed`,{repo:e})),iK=async({repoPath:e,requestFork:t,requestRenamedFork:n,conflictStatuses:r,isNameTaken:i})=>{try{return await t()}catch(t){if(!r.includes(t.cause?.status)||!await i())throw rK(e,t)}try{return await n()}catch(t){throw rK(e,t)}},aK=async({repoPath:e,checkFork:t,attemptsLeft:n=eK.attempts})=>{let r=await $G(t,e=>e!==`pending`,{...eK,attempts:n});if(r!==`ready`)throw SW(r===`failed`?`The fork could not be created.`:`Timed out waiting for the fork to be created.`,`open_authoring.fork_failed`,{repo:e})},oK=async e=>{QV.current=void 0,eH.current=!1,await e(),eH.current=!0},sK=async e=>{let{repoPath:t,fetchAccess:n,prepare:r,fetchFork:i,prepareFork:a,fetchForkingAllowed:o}=e,s=await n();if(s.canWrite)return;await r?.();let c=await i();c?(await a?.(c),QV.current=c):(await QAe({repoPath:t,allowForking:await o(s)}),QV.current=await e.createFork())},cK=()=>{if($V.current)throw SW(`Cannot publish as an Open Authoring contributor`,`open_authoring.publish_unsupported`)},lK=({branch:e})=>{if($V.current&&!e)throw SW(`Cannot commit directly to the configured repository`,`open_authoring.direct_commit_unsupported`)},$Ae=e=>{if(e===`pending_publish`)throw SW(`Cannot mark an entry ready to publish as an Open Authoring contributor`,`open_authoring.publish_unsupported`)},eje=async({branch:e,mergedSHA:t,fetchBranchHead:n,deleteBranch:r})=>{let i=await n(e);if(!(i&&i!==t))throw i&&await r(e),SW(`entry_already_published`,`open_authoring.entry_already_published`)},uK=async(e,t,n)=>{let r=[],i=[];return e.forEach((e,n)=>{let a=t(e,n);`leftover`in a?r.push(a.leftover):i.push(a.pending)}),await yW(r,n),i},dK=async e=>{let{pullRequest:t,status:n,requestKey:r,createRequest:i,fetchRequest:a,applyStatus:o}=e,{fetchBranchHead:s,deleteBranch:c}=e;$Ae(n);let{branch:l,title:u}=t;if(t[r]===void 0)return n===`draft`?{...t,status:n,updatedDate:new Date}:i({branch:l,title:u,status:n});let d=await a(t);if(d){let{merged:n,isEntryRequest:r,getMergedSHA:i}=d;if(n&&r&&await eje({branch:l,mergedSHA:await i(),fetchBranchHead:s,deleteBranch:c}),n||!r)return dK({...e,pullRequest:{...t,number:void 0,nodeId:void 0,url:void 0}})}return await o({pullRequest:t,status:n,state:d?.state,draft:d?.draft}),{...t,status:n,updatedDate:new Date}},tje=({commit:e,branch:t,title:n})=>({title:n,branch:t,status:`draft`,createdDate:e.date,updatedDate:e.date,files:[],canMerge:!1}),nje=50,rje=()=>tK(`gitea`),fK=()=>nK(WG),pK=({full_name:e})=>{let[t,n]=e.split(`/`);return{owner:t,repo:n}},ije=async()=>{let{owner:e,repo:t}=WG,n=`${e}/${t}`,r;try{r=await JG()}catch(e){throw[403,404].includes(e.cause?.status)?wW(n):SW(`Failed to check the repository permission.`,`open_authoring.permission_check_failed`,{repo:n})}return{canWrite:!!r.permissions?.push}},aje=async()=>{let{owner:e,repo:t}=WG,n=OW.account?.login,r=await _G(`/repos/${encodeURIComponent(n)}/${t}`,{responseType:`raw`});if(!r.ok)return;let i=await r.json(),a=i.parent?.full_name?.toLowerCase();if(i.fork&&a===`${e}/${t}`.toLowerCase()&&i.owner?.login?.toLowerCase()===n.toLowerCase())return pK(i)},oje=async()=>{let{owner:e,repo:t}=WG,{id:n,login:r}=OW.account,i=`${e}/${t}`.toLowerCase();try{let{data:e=[]}=await _G(`/repos/search?uid=${n}&exclusive=true&mode=fork&limit=${nje}`),t=e.find(e=>e.owner?.login===r&&e.parent?.full_name?.toLowerCase()===i);return t?pK(t):void 0}catch{return}},sje=async()=>await aje()??oje(),cje=async()=>{if(!XG.isForgejo)return!0;try{let{forks_disabled:e}=await _G(`/settings/repository`);return!e}catch{return!0}},lje=async e=>{let t=OW.account?.login;return(await _G(`/repos/${encodeURIComponent(t)}/${e}`,{responseType:`raw`})).ok},uje=async()=>{let{owner:e,repo:t}=WG,n=`/repos/${e}/${t}/forks`;return pK(await iK({repoPath:`${e}/${t}`,requestFork:()=>_G(n,{method:`POST`,body:{}}),requestRenamedFork:()=>_G(n,{method:`POST`,body:{name:`${e}-${t}`}}),conflictStatuses:[409],isNameTaken:()=>lje(t)}))},dje=async({owner:e,repo:t},n)=>{let{allowed:r,fork_commit:i,base_commit:a}=await _G(`/repos/${e}/${t}/sync_fork/${IP(n)}`);return i&&i===a?`current`:r?`behind`:`diverged`},fje=async e=>{let{owner:t,repo:n}=e,{branch:r}=WG,i;try{if(XG.isForgejo){let i=await dje(e,r);if(i===`current`)return;if(i===`diverged`){console.warn(`The ${t}/${n} fork could not be fast-forwarded to the upstream repository.`);return}}i=await _G(XG.isForgejo?`/repos/${t}/${n}/sync_fork/${IP(r)}`:`/repos/${t}/${n}/merge-upstream`,{method:`POST`,...XG.isForgejo?{}:{body:{branch:r}},responseType:`raw`})}catch(e){console.warn(`Failed to sync the ${t}/${n} fork with the upstream repository.`,e);return}i.ok||console.warn(`The ${t}/${n} fork could not be fast-forwarded to the upstream repository.`)},pje=async({owner:e,repo:t})=>{let{branch:n}=WG;if(!(await _G(`/repos/${e}/${t}/branches/${IP(n)}`,{responseType:`raw`})).ok)throw SW(`The fork does not have the configured branch`,`open_authoring.fork_branch_missing`,{fork:`${e}/${t}`,branch:n,repo:`${WG.owner}/${WG.repo}`})},mje=async()=>{let{owner:e,repo:t}=WG;await sK({repoPath:`${e}/${t}`,fetchAccess:ije,prepare:async()=>{WG.branch||await YG()},fetchFork:sje,prepareFork:async e=>{await fje(e),await pje(e)},fetchForkingAllowed:cje,createFork:uje})},hje=async()=>{await oK(mje)},mK=pk(``),hK={current:0},gK=()=>{let e=hK.current;return()=>e!==hK.current},_K=async()=>{let{repo:e,branch:t}=WG;try{let{commit:{id:e,message:t}}=await qAe();return{hash:e,message:t}}catch(n){throw n.cause?.status===404?IW(`branch_not_found`,{repo:e,branch:t}):n}},gje=async({action:e,path:t,previousPath:n,previousSha:r},i)=>{if(e===`create`||r)return r;let{owner:a,repo:o}=i?fK():WG,s=i??mK.current,c=e===`move`&&n||t;if(!s)throw Error(`The last known version of ${c} could not be determined.`);let{sha:l}=await _G(`/repos/${a}/${o}/contents/${IP(c)}?ref=${encodeURIComponent(s)}`);return l},vK=async(e,t)=>{lK(t);let{owner:n,repo:r}=t.branch?fK():WG,{branch:i=WG.branch,startBranch:a}=t,o=PW(e,t),{name:s,email:c}=OW.account,l=new Date().toJSON(),u=await Promise.all(e.map(async e=>{let{action:n,path:r,previousPath:i,data:a=``}=e,[o,s]=await Promise.all([Gk(a),gje(e,t.branch)]);return{operation:n===`move`?`update`:n,path:r,content:o,from_path:i,sha:s}})),d=t.branch?void 0:mK.current,f;try{f=await _G(`/repos/${n}/${r}/contents`,{method:`POST`,body:{...a?{branch:a,new_branch:i}:{branch:i},author:{name:s,email:c},committer:{name:s,email:c},dates:{author:l,committer:l},message:o,files:u}})}catch(e){throw d&&[409,422].includes(e.cause?.status)&&await LW(d,_K),e}let{commit:p,files:m}=f;return{sha:p.sha,date:new Date(p.created),parentSha:p.parents?.[0]?.sha,files:Object.fromEntries(m.map((t,n)=>[t?.path??e[n].path,{sha:t?.sha??``}]))}},_je=async e=>{let{owner:t,repo:n,branch:r}=WG;return RW(e,e=>_G(`/repos/${t}/${n}/commits?sha=${encodeURIComponent(r??``)}&path=${encodeURIComponent(e)}&limit=100`),e=>({sha:e.sha,message:(e.commit?.message??``).split(/\r?\n/)[0],authorName:e.commit?.author?.name??``,authorEmail:e.commit?.author?.email,authorAvatarURL:e.author?.avatar_url,authorLogin:e.author?.login,date:new Date(e.commit?.author?.date??e.created)}))},yK=/netlify|vercel|cloudflare|workers|deploy|preview|pages|render|surge|amplify|firebase/i,vje=/prod/i,yje=/canceled|cancelled|skipped|no (?:changes|build)/i,bje={deployment:2,status:1,check:0},xje=()=>{let{backend:e}=Sk.current??{};return(e??{}).preview_context??``},bK=e=>{if(!e)return;let t;try{t=new URL(e)}catch{return}if(t.protocol===`https:`)return t.href.replace(/\/$/,``)},Sje=(e,t)=>{if(!e)return;let n=``;try{n=new URL(t??``).host}catch{}return(e.match(/https:\/\/[^\s"'<>)\]]+/g)??[]).map(e=>bK(e)).find(e=>!!e&&new URL(e).host!==n)},Cje=(e,t)=>{try{return new URL(e).host===new URL(t).host}catch{return!1}},xK=({name:e,source:t},n)=>!!n||t===`deployment`||yK.test(e),wje=(e,t)=>e.source!==`check`||xK(e,t),Tje=(e,{kind:t,previewContext:n})=>{let{name:r,url:i,state:a,source:o}=e,s=vje.test(r);return(xK(e,n)?0:-64)+(i?32:0)+(a===`ready`?16:0)+bje[o]*4+(t===`production`===s?2:0)+ +!!yK.test(r)},Eje=(e,{kind:t,selfURL:n})=>{let r=xje(),i=e;if(r){let e=r.toLowerCase(),t=i.filter(({name:t})=>t.toLowerCase()===e);i=t.length?t:i.filter(({name:t})=>t.toLowerCase().includes(e))}if(i=i.filter(({description:e})=>!e||!yje.test(e)),i=i.map(e=>({...e,url:e.state===`ready`&&wje(e,r)&&!Cje(e.url,n)?bK(e.url):void 0})),!i.length)return{state:`unknown`,checkedTime:Date.now()};let[a]=i.map((e,n)=>({candidate:e,index:n,score:Tje(e,{kind:t,previewContext:r})})).sort((e,t)=>t.score-e.score||t.index-e.index).map(({candidate:e})=>e);return{state:a.state,url:a.url,context:a.name,checkedTime:Date.now()}},SK=async e=>{try{await e()}catch(e){console.warn(`Failed to fetch the deployment info.`,e)}},CK=async(e,{collect:t,selfURL:n})=>{let r=e.filter(({sha:e})=>!!e),i=[...new Set(r.map(({sha:e})=>e))];if(!i.length)return{};let a=Object.fromEntries(i.map(e=>[e,[]]));return await t(i,a),Object.fromEntries(r.map(({sha:e,kind:t})=>[e,Eje(a[e],{kind:t,selfURL:n})]))},Dje=50,Oje={success:`ready`,warning:`ready`,pending:`pending`,failure:`error`,error:`error`},kje=async()=>{let{owner:e,repo:t,branch:n}=WG;if(n)return(await _G(`/repos/${e}/${t}/branches/${IP(n)}`))?.commit?.id??void 0},Aje=async(e,t)=>{let{owner:n,repo:r}=WG;[...(await _G(`/repos/${n}/${r}/commits/${encodeURIComponent(e)}/status?limit=${Dje}`))?.statuses??[]].sort((e,t)=>Date.parse(e.updated_at)-Date.parse(t.updated_at)).forEach(({context:n,status:r,target_url:i,description:a})=>{let o=Oje[r];o&&t[e].push({name:n??``,url:i||void 0,state:o,description:a||void 0,source:`status`})})},jje=async(e,t)=>{await yW(e,e=>SK(()=>Aje(e,t)))},Mje=async e=>CK(e,{collect:jje,selfURL:WG.repoURL}),Nje=50,Pje=10,Fje=new Map,wK=()=>LA(Fje,`settings`,async()=>await _G(`/settings/api`)),Ije=async()=>Number((await wK()).max_response_items)||Nje,TK=async e=>{let t=await Ije(),n=e.includes(`?`)?`&`:`?`,r=[];for(let i=1;i<=Pje;i+=1){let a=await _G(`${e}${n}page=${i}&limit=${t}`);if(r.push(...a),a.length<t)return{items:r,complete:!0}}return{items:r,complete:!1}},EK=async e=>(await TK(e)).items,DK=async(...e)=>{try{return await _G(...e)}catch(e){if(e?.cause?.status===404)return;throw e}},OK=({arrayIndex:e},t)=>e===void 0?t:`${t}#${e}`,Lje=({entries:e,previous:t,changedPaths:n})=>{if(!t.length)return e;let r=new Map(t.flatMap(e=>Object.values(e.locales).map(({path:t})=>[OK(e,t),e]))),i=new Set;return e.map(e=>{let t=Object.values(e.locales).map(({path:e})=>e),a=t.map(t=>r.get(OK(e,t))).find(e=>!!e&&!i.has(e));if(!a)return e;i.add(a);let o=Object.values(a.locales).map(({path:e})=>e);return t.length===o.length&&t.every(e=>o.includes(e)&&!n.has(e))?a:{...e,id:a.id}})},Rje=({assets:e,previous:t,changedPaths:n})=>{if(!t.length)return e;let r=new Map(t.map(e=>[e.path,e])),i=new Set(e.map(({path:e})=>e)),a=(e,t)=>{let{workflow:n}=e;return n.replacedAsset===t?e:{...e,workflow:{...n,replacedAsset:t}}};return[...e.map(e=>{let t=r.get(e.path),i=t?.workflow?t.workflow.replacedAsset:t,o=i&&!n.has(e.path)?i:e;return t?.workflow?a(t,o):o}),...t.filter(({path:e,workflow:t})=>!!t&&!i.has(e)).map(e=>a(e,void 0))]},zje=({collectionName:e,fileName:t})=>{let n=fj(e),{structureMap:r}=((n&&t?xj(n,t):void 0)??n)?._i18n??{};return!!(r?.i18nMultiFile||r?.i18nMultiFolder||r?.i18nMultiRootFolder)},Bje=({entryFiles:e,previous:t,changedPaths:n})=>{let r=new Set(e.map(({path:e})=>e)),i=new Map,a=new Set;t.forEach(e=>{$P(e).forEach(t=>{i.has(t)&&a.add(t),i.set(t,e)})});let o=({path:e},t)=>{let o=i.get(e);if(!o||n.has(e)||a.has(e))return;let s=$P(o);if(t||s.length===1&&s[0]===e)return s.every(e=>r.has(e)&&!n.has(e)&&!a.has(e))?o:void 0},s=new Map,c=[],l=new Map,u=new Map;return e.forEach(e=>{let{collectionName:t,fileName:n}=e.folder,r=`${t}\n${n??``}`,i=l.get(r);i===void 0&&(i=zje(e.folder),l.set(r,i));let a=o(e,i);if(i){let n=u.get(t)??[];n.push({file:e,entry:a}),u.set(t,n)}else a?s.set(e.path,a):c.push(e)}),u.forEach(e=>{e.every(({entry:e})=>!!e)?e.forEach(({file:e,entry:t})=>{s.set(e.path,t)}):c.push(...e.map(({file:e})=>e))}),{reusedEntries:s,dirtyFiles:c}},Vje=({entryFiles:e,reusedEntries:t,parsedEntries:n})=>{let r=new Map;n.forEach(e=>{$P(e).forEach(t=>{PA(r,t,()=>[]).push(e)})});let i=new Set;return e.forEach(({path:e})=>{let n=t.get(e);(n?[n]:r.get(e)??[]).forEach(e=>{i.add(e)})}),[...i]},kK=({fileInfo:e,fetchedFileMap:t})=>{let{meta:n,size:r,text:i}=t[e.path]??{};return{...e,size:e.size??r,text:e.text??i,meta:e.meta??n}},AK=e=>{let{name:t,meta:n={},...r}=e,i=pV(t);return{...r,...n,name:t,kind:i}},Hje=e=>`locales`in e?Object.values(e.locales).map(({path:e})=>e):[e.path],Uje=({entries:e,assets:t,configFiles:n,errors:r=[],changedPaths:i})=>{let a=i??new Set([...e,...t].flatMap(Hje));vj.current=Lje({entries:e,previous:vj.current,changedPaths:a}),pH.current=Rje({assets:t,previous:pH.current,changedPaths:a}),SH.current=n,bj.current=r,hj.current=!0},Wje=({fetchedFileMap:e,metadataMap:t})=>{Object.entries(t).forEach(([t,n])=>{e[t]&&(e[t].meta=n)});let n=!1,r=!1,i=vj.current.map(e=>{if(e.commitDate)return e;let r=Object.values(e.locales).map(({path:e})=>t[e]).find(Boolean);return r?(n=!0,{...e,...r}):e}),a=pH.current.map(e=>{let n=e.commitDate?void 0:t[e.path];return n?(r=!0,{...e,...n}):e});n&&(vj.current=i),r&&(pH.current=a)},Gje=async({entryFiles:e,changedPaths:t,parsedFileMap:n})=>{let r=vj.current;if(!t||!r.length)return JR(e,{parsedFileMap:n});let{reusedEntries:i,dirtyFiles:a}=Bje({entryFiles:e,previous:r,changedPaths:t}),{entries:o,errors:s}=await JR(a,{parsedFileMap:n});return{entries:Vje({entryFiles:e,reusedEntries:i,parsedEntries:o}),errors:s}},Kje=async({fileList:{entryFiles:e,assetFiles:t,configFiles:n},fetchedFileMap:r,changedPaths:i,parsedFileMap:a})=>{let{entries:o,errors:s}=await Gje({entryFiles:e.map(e=>kK({fileInfo:e,fetchedFileMap:r})),changedPaths:i,parsedFileMap:a});return{entries:o,errors:s,assets:t.map(e=>AK(kK({fileInfo:e,fetchedFileMap:r}))),configFiles:n.map(e=>kK({fileInfo:e,fetchedFileMap:r}))}},jK=(e,{sha:t=``,size:n=0,...r}={})=>({path:e,name:Uk(e).basename,sha:t,size:n,...r}),MK=e=>e.filter(({type:e})=>e===`blob`).map(({path:e,sha:t,size:n})=>jK(e,{sha:t,size:n})),qje=async({metaEntries:e,lastCommitHash:t,cachedFileEntries:n,fetchFileList:r,log:i})=>{let a=wk.current,{last_config_hash:o,last_commit_hash:s,git_config_fetched:c}=Object.fromEntries(e);if(o&&o===a&&s&&s===t&&c&&n.length){let e=YW(n.map(([e,t])=>jK(e,t)));return i(`Restored the file list from the cache: ${XW(e)}`),e}let l=YW(await r(t));return i(`Fetched the file list: ${XW(l)}`),l},Jje=async({metaDB:e,lastConfigHash:t,lastCommitHash:n})=>{await e.saveEntries(Object.entries({last_config_hash:t,last_commit_hash:n,git_config_fetched:!0}))},Yje=async({databaseName:e},t,n)=>{mK.current=n;try{let r=new DE(e,`meta`);await r.get(`last_commit_hash`)===t&&await r.set(`last_commit_hash`,n)}catch(e){console.error(`Failed to update the file cache.`,e)}},Xje=({allFiles:e,cachedFiles:t})=>{e.forEach(({sha:n,path:r},i)=>{t[r]?.sha===n&&Object.assign(e[i],t[r])})},Zje=({parsedFileMap:e,fetchedFileMap:t,cachedFiles:n})=>{let r={};return e.forEach((e,i)=>{t[i]?t[i].parsed=e:n[i]&&(r[i]={...n[i],parsed:e})}),r},NK=async({cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a={}})=>{let o=new Set(t.map(({path:e})=>e)),s=Object.keys(n).filter(e=>!o.has(e)),c=[...r.length?Object.entries(i):[],...Object.entries(a)];await Promise.all([c.length?e.saveEntries(c):void 0,s.length?e.deleteEntries(s):void 0])},Qje=({metaDB:e,cacheDB:t})=>JW((async()=>{try{let n=await t.entries();return{metaEntries:await e.entries(),cachedFileEntries:n}}catch(e){return console.error(`Failed to read the file cache.`,e),{metaEntries:[],cachedFileEntries:[]}}})()),$je=async({cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a,fetchFileMetadata:o,log:s})=>{let c={cacheDB:e,allFiles:t,cachedFiles:n,fetchingFiles:r,fetchedFileMap:i,reparsedFileMap:a},l=!0;if(o&&r.length){try{await NK(c),s(`Cached the contents of ${r.length} files`)}catch(e){console.error(`Failed to cache the contents.`,e)}try{Wje({fetchedFileMap:i,metadataMap:await o(r)}),s(`Fetched the commit metadata of ${r.length} files`)}catch(e){console.error(`Failed to fetch the commit metadata.`,e),l=!1}}await NK(c),s(l?`Cached ${r.length} files with their metadata`:`Cached ${r.length} files without their metadata; they are fetched again next time`)},eMe=async({metaDB:e,lastConfigHash:t,lastCommitHash:n,cacheUpdate:r})=>{try{await r,await Jje({metaDB:e,lastConfigHash:t,lastCommitHash:n})}catch(e){console.error(`Failed to update the file cache.`,e)}},PK=(e,t)=>((...n)=>{let r=AU();return r?t(r,...n):e(...n)}),FK=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[t(e),n])),IK=(e,t)=>({...e,path:t(e.path),...e.previousPath!==void 0&&{previousPath:t(e.previousPath)}}),LK=(e,t)=>({...e,files:e.files.map(e=>IK(e,t))}),RK=(e,t)=>({...e,files:FK(e.files,e=>MU(e,t))}),tMe=({repository:e,fetchFileList:t,fetchFileContents:n,fetchFileMetadata:r})=>{let i=(e,t)=>e.map(e=>({...e,path:jU(e.path,t)}));return{fetchFileList:PK(t,async(n,r)=>{let i=(await t(r)).flatMap(e=>{let t=MU(e.path,n);return NU(t)?[{...e,path:t}]:[]});if(!i.length)throw SW(`Failed to list the files.`,`root_dir_not_found`,{repo:`${e.owner}/${e.repo}`,dir:n});return i}),fetchFileContents:PK(n,async(e,t,r)=>FK(await n(i(t,e),r),t=>MU(t,e))),fetchFileMetadata:r&&PK(r,async(e,t)=>FK(await r(i(t,e)),t=>MU(t,e)))}},nMe=e=>{let t=(e,t)=>LK(e,e=>jU(e,t)),n=(e,t)=>LK(e,e=>MU(e,t));return{...e,fetchPullRequests:PK(e.fetchPullRequests,async t=>(await e.fetchPullRequests()).map(e=>n(e,t))),savePullRequest:PK(e.savePullRequest,async(r,i)=>{let{commit:a,pullRequest:o}=await e.savePullRequest({...i,changes:PU(i.changes),pullRequest:i.pullRequest&&t(i.pullRequest,r)});return{commit:RK(a,r),pullRequest:n(o,r)}}),updateStatus:PK(e.updateStatus,async(r,i,a)=>n(await e.updateStatus(t(i,r),a),r)),fetchMergeState:PK(e.fetchMergeState,async(n,r)=>{let i=await e.fetchMergeState(t(r,n)),a=i.files.some(({path:e,previousPath:t})=>[e,t].some(e=>e!==void 0&&e.split(`/`).some(e=>e===`.`||e===`..`)));return{...i,files:i.files.map(e=>IK(e,e=>MU(e,n))),...a&&{complete:!1}}}),fetchUnchangedPaths:PK(e.fetchUnchangedPaths,async(t,{headSHA:n,paths:r})=>(await e.fetchUnchangedPaths({headSHA:n,paths:r.map(e=>jU(e,t))})).map(e=>MU(e,t))),publish:PK(e.publish,(n,r)=>e.publish(t(r,n))),discard:PK(e.discard,(n,r)=>e.discard(t(r,n)))}},zK=e=>{let{fetchBlob:t,commitChanges:n,fetchFileCommits:r,workflow:i}=e;return{...e,fetchBlob:t&&PK(t,(e,n)=>t({...n,path:jU(n.path,e)})),commitChanges:PK(n,async(e,t,r)=>RK(await n(PU(t),r),e)),fetchFileCommits:r&&PK(r,(e,t)=>r(t.map(t=>jU(t,e)))),workflow:i&&nMe(i)}},BK=pk({}),VK=pk(``),HK=pk({published:!0,time:0}),UK=pk(!1),rMe=e=>{let t=e.filter(e=>!!e);t.length&&(BK.current=Object.fromEntries(Object.entries(BK.current).filter(([e])=>!t.includes(e))))},iMe=()=>{BK.current={},VK.current=``,UK.current=!1,HK.current={published:!0,time:0}},WK=e=>{HK.current={published:e,time:Date.now()}},GK,aMe=e=>`${e}\n${wk.current}`,oMe=async({repository:e,accessPromise:t,fetchDefaultBranchName:n,fetchLastCommit:r,lastCommit:i,log:a})=>{let{branch:o}=e;if(o&&i)return await t,i;if(!o){let r=JW(n());await t,o=await r,e.branch=o,a(`Fetched the default branch name: ${o}`)}let s=JW(r());await t;let c=await s;return a(`Fetched the last commit on ${o}: ${c.hash}`),c},sMe=async({fileList:{allFiles:e},lastCommitHash:t,cachedFileEntries:n,fetchFileContents:r,fetchFileMetadata:i,log:a})=>{let o=Object.fromEntries(n);Xje({allFiles:e,cachedFiles:o});let s=new Set(e.filter(({path:e,sha:t})=>o[e]?.sha!==t).map(({path:e})=>e)),c=e.filter(({meta:e})=>!e),l=i?c.filter(({type:e,text:t})=>e!==`asset`&&t===void 0):c,u=Object.fromEntries(c.map(({path:e,sha:t,size:n,text:r})=>[e,{sha:t,size:n,text:r,meta:void 0}]));return a(`Restored ${e.length-c.length} files from the cache; fetching ${c.length} files`),l.length&&(Object.assign(u,await r(l,t)),a(`Fetched the contents of ${l.filter(({type:e})=>e!==`asset`).length} files`)),{cachedFiles:o,changedPaths:s,fetchingFiles:c,fetchedFileMap:u}},KK=async({data:e,isStale:t,parseKey:n,metaDB:r,lastConfigHash:i,lastCommitHash:a,startCacheUpdate:o,log:s,readyMessage:c})=>{t()?s(`Discarded: the site data was reset while loading`):(Uje(e),GK=n,mK.current=a,s(c),await eMe({metaDB:r,lastConfigHash:i,lastCommitHash:a,cacheUpdate:o()}))},cMe=async({repository:e,checkAccess:t,checkBranchAccess:n,fetchDefaultBranchName:r,fetchLastCommit:i,lastCommit:a,...o})=>{let{service:s,owner:c,repo:l,databaseName:u}=e,{fetchFileList:d,fetchFileContents:f,fetchFileMetadata:p}=tMe({repository:e,...o}),m=ZW(`Loading site data`);m(`Started: ${s} ${c}/${l}`);let h=aMe(u),g=gK(),_=!!mK.current&&GK===h,v=new DE(u,`meta`),y=new DE(u,`file-cache`),b=!mK.current,x=t&&b?JW(t()):void 0,S=Qje({metaDB:v,cacheDB:y}),{hash:C,message:w}=await oMe({repository:e,accessPromise:x,fetchDefaultBranchName:r,fetchLastCommit:i,lastCommit:a,log:m}),T=n&&b?n():void 0,{metaEntries:ee,cachedFileEntries:te}=await S;m(`Read the file cache: ${te.length} files`);let ne=wk.current,re=await qje({metaEntries:ee,lastCommitHash:C,cachedFileEntries:te,fetchFileList:d,log:m});WK(!Gke(w)),await T;let ie={isStale:g,parseKey:h,metaDB:v,lastConfigHash:ne,lastCommitHash:C,log:m};if(!re.count){await KK({...ie,data:{entries:[],assets:[],configFiles:[]},readyMessage:`The site data is ready: no files to load`,startCacheUpdate:()=>NK({cacheDB:y,allFiles:[],cachedFiles:Object.fromEntries(te),fetchingFiles:[],fetchedFileMap:{}})});return}let{cachedFiles:ae,changedPaths:oe,fetchingFiles:se,fetchedFileMap:ce}=await sMe({fileList:re,lastCommitHash:C,cachedFileEntries:te,fetchFileContents:f,fetchFileMetadata:p,log:m}),le=new Map,{entries:ue,errors:de,assets:fe,configFiles:pe}=await Kje({fileList:re,fetchedFileMap:ce,changedPaths:_?oe:void 0,parsedFileMap:le}),me=Zje({parsedFileMap:le,fetchedFileMap:ce,cachedFiles:ae});m(`Parsed ${ue.length} entries (${de.length} errors)`),await KK({...ie,data:{entries:ue,assets:fe,configFiles:pe,errors:de,changedPaths:oe},readyMessage:`The site data is ready`,startCacheUpdate:()=>$je({cacheDB:y,allFiles:re.allFiles,cachedFiles:ae,fetchingFiles:se,fetchedFileMap:ce,reparsedFileMap:me,fetchFileMetadata:p,log:m})})},qK=async({isOpenAuthoringConfigured:e,initOpenAuthoring:t,checkAccess:n,checkBranchAccess:r,...i})=>{let a=e();a&&!eH.current&&await t(),await cMe({...i,checkAccess:a?void 0:n,checkBranchAccess:QV.current?void 0:r})},lMe=10485760,JK=new Map,uMe=4,dMe=async(e,t)=>{let{owner:n,repo:r}=WG,{dirname:i,basename:a}=Uk(t),o=await DK(`/repos/${n}/${r}/contents${i?`/${IP(i)}`:``}?ref=${encodeURIComponent(e)}`);return Array.isArray(o)?o.find(({type:e,name:t})=>e===`dir`&&t===a)?.sha:void 0},YK=async(e,t)=>{let n=`${WG.owner}/${WG.repo}:${e}:${t}`;if(JK.has(n))return JK.get(n);let r=await dMe(e,t);return/^[\da-f]{40,64}$/.test(e)&&(JK.set(n,r),JK.size>uMe&&JK.delete(JK.keys().next().value)),r},fMe=async e=>{let{owner:t,repo:n,branch:r}=WG,i=e??r,a=AU(),o=a?await YK(i,a):i;if(!o)return[];let s=`/repos/${t}/${n}/git/trees/${IP(o)}?recursive=1`,c=a?`${a}/`:``,l=async e=>await _G(`${s}&page=${e}`),u=await l(1),d=[u];if(u.tree&&u.truncated){let{tree:{length:e},total_count:t}=u;if(t&&e){let n=Array.from({length:Math.ceil(t/e)-1},(e,t)=>t+2);d.push(...await bW(n,l))}else for(let e=2;;e+=1){let t=await l(e);if(d.push(t),!t.tree||!t.truncated)break}}return MK(d.flatMap(({tree:e})=>(e??[]).map(e=>({...e,path:`${c}${e.path}`}))))},pMe=async(e,t)=>{let n=await Promise.all(e.map(async({path:e,sha:n,size:r,type:i})=>{let a=t[e];if(!a&&i!==`asset`)return[e,{sha:n,size:r??0,text:void 0,meta:void 0}];let{content:o,encoding:s}=a??{};return[e,{sha:n,size:r??0,text:o&&s===`base64`?await vbe(o):``,meta:{}}]}));return Object.fromEntries(n)},XK=async({owner:e,repo:t,path:n,ref:r})=>_G(`/repos/${e}/${t}/raw/${IP(n)}?ref=${encodeURIComponent(r)}`,{responseType:`text`}),mMe=async(e,t)=>{let{owner:n,repo:r}=t?fK():WG,{branch:i=``}=WG;return XK({owner:n,repo:r,path:e,ref:t??i})},hMe=(e,{maxItems:t,maxResponseSize:n})=>{let r=[],i=[],a=0;return e.forEach(e=>{let o=(e.size??0)*4/3;i.length&&(i.length===t||a+o>n)&&(r.push(i),i=[],a=0),i.push(e),a+=o}),i.length&&r.push(i),r},gMe=async(e,t)=>{let{owner:n,repo:r,branch:i}=WG,{isForgejo:a}=XG,o=String(t??i),s=a?`/repos/${n}/${r}/git/blobs`:`/repos/${n}/${r}/file-contents?ref=${encodeURIComponent(o)}`,c=a?`sha`:`path`,l=e.filter(({type:e})=>e!==`asset`);if(!l.length)return{};gj.current=0;try{let{default_paging_num:t=30,max_response_items:i=1/0,default_max_blob_size:u,default_max_response_size:d=1/0}=await wK(),f=Number(u)||lMe,p=l.filter(({size:e=0})=>e>=f),m=hMe(l.filter(({size:e=0})=>e<f),{maxItems:Math.min(t,i),maxResponseSize:d}),h={},g=0,_=e=>{g+=e,gj.current=Math.ceil(g/l.length*100)};await yW(m,async e=>{let t=await(a?_G(`${s}?shas=${e.map(({sha:e})=>e).join(`,`)}`):_G(s,{method:`POST`,body:{files:e.map(({path:e})=>e)}})),n=new Map(t.filter(e=>!!e).map(e=>[e[c],e]));e.forEach(e=>{let t=n.get(e[c]);t&&(h[e.path]=t)}),_(e.length)});let v=await pMe(e,h);return await yW(p,async({path:e})=>{let t=await XK({owner:n,repo:r,path:e,ref:o});Object.assign(v[e],{text:t,meta:{}}),_(1)}),v}finally{gj.current=void 0}},_Me=async()=>{let e=JAe();e.catch(()=>void 0),await ZG(),await e},vMe=async()=>{await ZG(),await hje()},yMe=async({lastCommit:e}={})=>{await qK({isOpenAuthoringConfigured:rje,initOpenAuthoring:vMe,repository:WG,checkAccess:_Me,checkBranchAccess:YAe,fetchDefaultBranchName:YG,fetchLastCommit:_K,lastCommit:e,fetchFileList:fMe,fetchFileContents:gMe})},bMe=async e=>{let{path:t}=e,{owner:n,repo:r}=e.workflow?fK():WG,i=e.workflow?.branch??WG.branch;return _G(`/repos/${n}/${r}/media/${`${IP(String(i))}/${IP(t)}`}`,{responseType:`blob`})},ZK=({regex:e,prefix:t})=>({strip:t=>{let n=t;for(;e.test(n);)n=n.replace(e,``);return n},format:(e,n)=>n?`${t}${e}`:e}),QK=()=>{let{backend:e}=Sk.current??{};return e&&`squash_merges`in e?!!e.squash_merges:!1},$K=async({branch:e,path:t,goneStatuses:n})=>{try{await _G(t,{method:`DELETE`,responseType:`text`})}catch(t){if(n.includes(t.cause?.status))return;console.warn(`Failed to delete the ${e} branch.`,t)}},eq=async({commit:e,branch:t,title:n,status:r,createPullRequest:i})=>$V.current&&r===`draft`?tje({commit:e,branch:t,title:n}):i({branch:t,title:n,status:r}),tq=async({changes:e,options:t,branch:n,title:r,status:i,pullRequest:a},{commitToNewBranch:o,commitToExistingBranch:s,createPullRequest:c})=>{if(a)return{commit:await s(e,{...t,branch:n},a),pullRequest:a};let l=await o(e,{...t,branch:n});return{commit:l,pullRequest:await eq({commit:l,branch:n,title:r,status:i,createPullRequest:c})}},nq=async({branch:e,branchExistsStatus:t,commitFromStart:n,commitOnBranch:r,findOpenPullRequest:i,inUseMessage:a,deleteBranch:o})=>{try{return await n()}catch(e){if(e.cause?.status!==t)throw e}if($V.current)return r();let s=await i();if(s)throw SW(a,`workflow.branch_in_use`,{number:s});return await o(e),n()},rq=async({branch:e,headSHA:t,fetchBranchHead:n,getWorkflowRepository:r})=>{let i=await n(e);if(i===void 0)throw SW(`Failed to save the changes.`,`branch_not_found`,{repo:r().repo,branch:e});if(!t||i!==t)throw SW(`The workflow branch has moved since the entry was loaded.`,`save_conflict.branch_moved`);return t},iq=async(e,t,{updateForkStatus:n,updateLabels:r,updateDraftState:i})=>{if($V.current)return n(e,t);let a=t===`draft`;return await r(e,t),a!==(e.status===`draft`)&&await i(e,a),{...e,status:t,updatedDate:new Date}},aq=e=>[...new Set(e.map(e=>e.slice(0,Math.max(e.lastIndexOf(`/`),0))))],oq=async(e,{statusMap:t,headSHA:n,fetchFileModes:r})=>{let i=e.map(({filename:e,status:n,previous_filename:r})=>({path:e,status:t[n]??`modified`,previousPath:r||void 0})),a=await r({headSHA:n,paths:i.filter(({status:e})=>e!==`removed`).map(({path:e})=>e)});return i.map(e=>({...e,mode:a.get(e.path)}))},sq=(e,t)=>t===e.headSHA?void 0:{headSHA:t,onConfiguredBranches:!0,files:[],complete:!0},xMe=async({owner:e,repo:t},n)=>(await _G(`/repos/${e}/${t}/pulls/${n}/merge`,{responseType:`raw`})).ok,SMe=async({owner:e,repo:t},n)=>{await _G(`/repos/${e}/${t}/pulls/${n}`,{method:`PATCH`,body:{state:`open`}})},cq=async({pullRequest:e,status:t,state:n,draft:r},{repository:i,updateDraftState:a})=>{let o=n?.toLowerCase();t===`draft`?o===`open`&&!r&&await a(e,!0):(o===`closed`&&await SMe(i,e.number),r&&await a(e,!1))},lq={interval:1e4,maxDuration:36e5},CMe=e=>{let t=e?.cause?.status;return typeof t==`number`&&t>=400&&t<500&&t!==429},uq=async({read:e,evaluate:t,cancel:n,label:r,deadline:i=Date.now()+lq.maxDuration})=>{if(Date.now()>=i)throw await n(),Error(`Timed out waiting for ${r} to be merged`);await pl(lq.interval);let a;try{a={item:await e()}}catch(e){if(CMe(e))throw e;console.warn(`Failed to read ${r}, still waiting.`,e)}a&&await t(a.item)||await uq({read:e,evaluate:t,cancel:n,label:r,deadline:i})},wMe=[`netlify-cms/`,`decap-cms/`],dq=[`draft`,`pending_review`,`pending_publish`],fq=[`draft`,`pending_review`],pq=[...dq,`pending_deletion`],mq={draft:`status.draft`,pending_review:`status.in_review`,pending_publish:`status.ready`,pending_deletion:`status.pending_deletion`},hq=()=>{let{backend:e}=Sk.current??{};return(e&&`cms_label_prefix`in e?e.cms_label_prefix:void 0)||`sveltia-cms/`},gq=()=>[...new Set([hq(),`sveltia-cms/`,...wMe])],_q=e=>`${hq()}${e}`,vq=()=>gq().flatMap(e=>pq.map(t=>`${e}${t}`)),yq=(e,t)=>{let n=vq();return[...e.filter(e=>!n.includes(e)),_q(t)]},bq=e=>{let t;return gq().some(n=>(t=pq.find(t=>e.includes(`${n}${t}`)),!!t)),t},xq=ZK({regex:/^\s*(?:\[wip\]|wip:)\s*/i,prefix:`WIP: `}),TMe={draft:`#ededed`,pending_review:`#fbca04`,pending_publish:`#0e8a16`,pending_deletion:`#d93f0b`},EMe=`Editorial Workflow status managed by Sveltia CMS`,Sq=({head:e,base:t})=>typeof e?.repo_id==`number`&&e.repo_id!==-1&&e.repo_id===t?.repo_id,DMe=e=>{let t=bq((e.labels??[]).map(({name:e})=>e));if(!t)return;let{ref:n,sha:r}=e.head??{};if(!n||!Sq(e)||e.base?.ref!==WG.branch)return;let{full_name:i,login:a,email:o,id:s}=e.user??{};return{number:e.number,nodeId:String(e.id),title:xq.strip(e.title),url:e.html_url,branch:n,headSHA:r,status:t,createdDate:new Date(e.created_at),updatedDate:new Date(e.updated_at),author:a?{name:i||a,email:o??``,id:s,login:a}:void 0,files:[]}},Cq=async e=>{let{owner:t,repo:n}=WG,r=`refs/pull/${e}/head`,i=await DK(`/repos/${t}/${n}/git/${r}`);if(i)return(Array.isArray(i)?i:[i]).find(e=>e.ref===r)?.object?.sha},wq=QG,OMe=3,kMe=({contents_url:e})=>{try{return new URL(e).searchParams.get(`ref`)}catch{return null}},Tq=(e,t,n=wq.attempts)=>$G(async()=>{let{owner:n,repo:r}=WG,{items:i,complete:a}=await TK(`/repos/${n}/${r}/pulls/${e}/files`),o=i.length?[...new Set(i.map(e=>kMe(e)))]:[await Cq(e)],s=o.length===1?o[0]??void 0:void 0;return{files:i,complete:a&&s===t,commit:s}},({commit:e})=>e===t,{...wq,attempts:n}),Eq=async e=>{let{owner:t,repo:n}=WG,{number:r,headSHA:i}=e,a;if(i){let t=await Tq(r,i,OMe);a=t.files,e.headSHA=t.commit}else a=await EK(`/repos/${t}/${n}/pulls/${r}/files`);e.files=a.map(({filename:e,status:t,previous_filename:n})=>({path:e,sha:``,size:0,deleted:t===`deleted`,previousPath:n||void 0}))},AMe=e=>{try{return new TextDecoder(`utf-8`,{fatal:!0}).decode(Uint8Array.fromBase64(e))}catch{return}},jMe=async(e,t)=>{let{owner:n,repo:r}=fK(),{path:i}=t,a=e.headSHA??e.branch,o=await DK(`/repos/${n}/${r}/contents/${IP(i)}?ref=${encodeURIComponent(a)}`);if(!o){t.deleted=!0;return}let{sha:s,size:c,content:l,encoding:u}=o;Object.assign(t,{sha:s??``,size:Number(c)||0,text:l&&u===`base64`?AMe(l):void 0}),!l&&t.size&&Hk(rV.getType(i)??``)&&(t.text=await mMe(i,a))},Dq=async e=>{await yW(e.files.filter(({deleted:e})=>!e),async t=>jMe(e,t))},Oq=async e=>{let{owner:t,repo:n}=fK();return(await DK(`/repos/${t}/${n}/branches/${IP(e)}`))?.commit?.id},kq=async e=>{let{owner:t,repo:n}=fK();await $K({branch:e,path:`/repos/${t}/${n}/branches/${IP(e)}`,goneStatuses:[404]})},MMe=async e=>{let{owner:t,repo:n}=WG;await _G(`/repos/${t}/${n}/labels`,{method:`POST`,body:{name:_q(e),color:TMe[e],description:EMe}})},Aq=async(e,t,n,r)=>{let{owner:i,repo:a}=WG,o=`/repos/${i}/${a}/issues/${e}/labels`,s=_q(n);(await _G(o,{method:r,body:{labels:t}})).some(({name:e,url:t})=>e===s&&!String(t??``).includes(`/api/v1/orgs/`))||(await MMe(n),await _G(o,{method:r,body:{labels:t}}))},NMe=async(e,t)=>{let{owner:n,repo:r}=WG,{number:i}=e;await Aq(i,yq((await _G(`/repos/${n}/${r}/issues/${i}/labels`)).map(({name:e})=>e),t),t,`PUT`)},jq=async(e,t)=>{let{owner:n,repo:r}=WG,{number:i,title:a}=e;await _G(`/repos/${n}/${r}/pulls/${i}`,{method:`PATCH`,body:{title:xq.format(a,t)}})},Mq=async({branch:e,title:t,status:n})=>{let{owner:r,repo:i,branch:a}=WG,o=QV.current,s=n===`draft`,c=await _G(`/repos/${r}/${i}/pulls`,{method:`POST`,body:{title:xq.format(t,s),head:o?`${o.owner}:${e}`:e,base:a,body:`Automatically generated by Sveltia CMS`}});return o||await Aq(c.number,[_q(n)],n,`POST`),{number:c.number,nodeId:String(c.id),title:t,url:c.html_url,branch:e,headSHA:c.head?.sha,status:n,createdDate:new Date(c.created_at),updatedDate:new Date(c.updated_at),files:[]}},Nq=({action:e,path:t,previousPath:n})=>e===`move`&&n?n:t,Pq=async(e,t,{owner:n,repo:r}=fK())=>(await DK(`/repos/${n}/${r}/contents/${IP(e)}?ref=${encodeURIComponent(t)}`))?.sha,Fq=async(e,t)=>{let n=EO(e.filter(({action:e})=>e!==`create`).map(e=>Nq(e)));if(!n.length)return e;let r=new Map;return await yW(n,async e=>{let n=await Pq(e,t);n&&r.set(e,n)}),e.flatMap(e=>{if(e.action===`create`)return e;let t=r.get(Nq(e));if(t)return{...e,previousSha:t};if(e.action===`delete`)return[];let{previousPath:n,previousSha:i,...a}=e;return{...a,action:`create`}})},PMe=`cms`,Iq=e=>{let t=QV.current;return[PMe,t?.owner,t?.repo,e].filter(Boolean).map(e=>`${e}/`).join(``)},Lq=()=>Iq(AU()),Rq=()=>Iq(``),FMe=e=>e.replaceAll(`%`,`%25`).replaceAll(`/`,`%2F`),IMe=e=>e.replaceAll(`%2F`,`/`).replaceAll(`%25`,`%`),LMe=({collectionName:e,slug:t})=>`${Lq()}${e}/${FMe(t)}`,zq=e=>{let t=Lq(),n=Rq(),r=!e.startsWith(t);if(r&&(t===n||!e.startsWith(n)))return;let i=e.slice(r?n.length:t.length),a=i.indexOf(`/`);if(!(a<1||a===i.length-1))return{collectionName:i.slice(0,a),slug:IMe(i.slice(a+1)),...r&&{legacy:r}}},RMe=({branch:e,collectionName:t,slug:n})=>{let r=zq(e);return r?.collectionName===t&&r.slug===n},zMe=async()=>{let{owner:e,repo:t}=fK(),n=Rq();return(await EK(`/repos/${e}/${t}/branches`)).filter(({name:e})=>e.startsWith(n))},Bq=e=>{let t=QV.current,n=OW.account?.id;return!!t&&e.head?.repo?.full_name?.toLowerCase()===`${t.owner}/${t.repo}`.toLowerCase()&&e.base?.ref===WG.branch&&n!==void 0&&e.user?.id===n},BMe=async()=>{let{owner:e,repo:t}=WG,n=OW.account?.login,r=await EK(`/repos/${e}/${t}/pulls?state=all&sort=recentupdate&poster=${encodeURIComponent(n)}`),i=new Map;return r.filter(Bq).forEach(e=>{let t=e.head.ref,n=i.get(t);(!n||n.state!==`open`&&e.state===`open`)&&i.set(t,e)}),i},VMe=(e,t)=>{let{name:n,commit:r}=e,{id:i,message:a,timestamp:o,author:s}=r,c=t?.merged?void 0:t,l=c?.state===`open`&&!c.draft;return{number:c?.number,nodeId:c?String(c.id):void 0,title:xq.strip(c?.title??a??``),url:c?.html_url,branch:n,headSHA:i,status:l?`pending_review`:`draft`,createdDate:new Date(c?.created_at??o),updatedDate:new Date(c?.updated_at??o),author:s?.name?{name:s.name,email:s.email??``,login:s.username}:void 0,files:[],canMerge:!1}},HMe=async e=>{let{owner:t,repo:n}=fK(),{commits:r=[]}=await _G(`/repos/${t}/${n}/compare/${IP(WG.branch)}...${IP(e.headSHA??e.branch)}`),i=new Map;r.forEach(({files:e=[]})=>{e.forEach(({filename:e})=>{i.set(e,{path:e,sha:``,size:0,deleted:!1})})}),e.files=[...i.values()]},UMe=async()=>{let e=await zMe();if(!e.length)return[];let t=await BMe(),n=new Map;await yW(e.map(({name:e})=>t.get(e)).filter(e=>!!e?.merged),async({number:e})=>{n.set(e,await Cq(e))});let r=await uK(e,e=>{let r=t.get(e.name);return r?.merged&&n.get(r.number)===e.commit?.id?{leftover:e.name}:{pending:VMe(e,r)}},kq);return await yW(r,async e=>{e.status===`pending_review`?await Eq(e):await HMe(e),await Dq(e)}),r.filter(({files:e})=>e.length)},WMe=async({number:e})=>{let{owner:t,repo:n}=WG,r=await _G(`/repos/${t}/${n}/pulls/${e}`);return{merged:!!r.merged,isEntryRequest:Bq(r),getMergedSHA:async()=>await Cq(e)??``,state:r.state,draft:r.draft}},GMe=e=>cq(e,{repository:WG,updateDraftState:jq}),KMe=async(e,t)=>dK({pullRequest:e,status:t,requestKey:`number`,createRequest:Mq,fetchRequest:WMe,applyStatus:GMe,fetchBranchHead:Oq,deleteBranch:kq}),qMe=async()=>{let{owner:e,repo:t}=WG,n=vq(),r=(await EK(`/repos/${e}/${t}/labels`)).filter(({name:e})=>n.includes(e)).map(({id:e})=>e);if(!r.length)return[];let i=await EK(`/repos/${e}/${t}/pulls?state=open&sort=recentupdate${r.map(e=>`&labels=${e}`).join(``)}`),a=[...new Set(i.map(({number:e})=>e))],o=[];return await yW(a,async n=>{let r=DMe(await _G(`/repos/${e}/${t}/pulls/${n}`));r&&o.push(r)}),o.sort((e,t)=>t.updatedDate.getTime()-e.updatedDate.getTime()),await yW(o,async e=>{await Eq(e),await Dq(e)}),o},JMe=async()=>$V.current?UMe():qMe(),YMe=async e=>{let{owner:t,repo:n}=WG;return(await EK(`/repos/${t}/${n}/pulls?state=open&sort=recentupdate`)).find(t=>t.head?.ref===e&&Sq(t))},XMe=async(e,t)=>{let{branch:n=``}=t,r=WG.branch,i=await Fq(e,r);return nq({branch:n,branchExistsStatus:422,commitFromStart:()=>vK(i,{...t,startBranch:r}),commitOnBranch:async()=>vK(await Fq(e,n),t),findOpenPullRequest:async()=>{let e=await YMe(n);return e?`#${e.number}`:void 0},inUseMessage:`The workflow branch is in use by another pull request.`,deleteBranch:kq})},ZMe=async(e,t,n)=>{let{branch:r=``}=t;return vK(await Fq(e,await rq({branch:r,headSHA:n.headSHA,fetchBranchHead:Oq,getWorkflowRepository:fK})),t)},QMe=async e=>tq(e,{commitToNewBranch:XMe,commitToExistingBranch:ZMe,createPullRequest:Mq}),$Me=(e,t)=>iq(e,t,{updateForkStatus:KMe,updateLabels:NMe,updateDraftState:jq}),eNe=async e=>{let{owner:t,repo:n}=WG;await _G(`/repos/${t}/${n}/pulls/${e.number}/reviews`,{method:`POST`,body:{event:`APPROVED`,commit_id:e.headSHA}})},tNe=async e=>{let{owner:t,repo:n}=WG,r=`/repos/${t}/${n}/pulls/${e.number}/reviews`,i=await EK(r);await Promise.all(i.filter(({state:e,dismissed:t,user:n})=>e===`APPROVED`&&!t&&n?.login===OW.account?.login).map(({id:e})=>_G(`${r}/${e}`,{method:`DELETE`,responseType:`raw`})))},nNe={added:`added`,copied:`added`,deleted:`removed`,renamed:`renamed`},Vq={file:`100644`,symlink:`120000`,submodule:`160000`,dir:`040000`},rNe=async({headSHA:e,paths:t})=>{let{owner:n,repo:r}=WG,i=new Map;return await yW(aq(t),async t=>{(await _G(`/repos/${n}/${r}/contents${t?`/${IP(t)}`:``}?ref=${encodeURIComponent(e)}`)).forEach(({path:e,type:t})=>{t in Vq&&i.set(e,Vq[t])})}),i},iNe={fetchPullRequests:JMe,savePullRequest:QMe,updateStatus:$Me,approve:eNe,withdrawApproval:tNe,fetchBranchHead:Oq,fetchMergeState:async e=>{let{owner:t,repo:n}=WG,{number:r}=e,i=await _G(`/repos/${t}/${n}/pulls/${r}`),a=i.head?.sha,o=i.base?.ref===WG.branch&&Sq(i);if(!a||!o)return{headSHA:a,onConfiguredBranches:!1,files:[],complete:!1};let s=sq(e,a);if(s)return s;let{files:c,complete:l}=await Tq(r,a);return{headSHA:a,onConfiguredBranches:o,files:await oq(c,{statusMap:nNe,headSHA:a,fetchFileModes:rNe}),complete:l}},fetchUnchangedPaths:async({headSHA:e,paths:t})=>{let{branch:n}=WG,r=new Set;return await yW(t,async t=>{let[i,a]=await Promise.all([Pq(t,n,WG),Pq(t,e,WG)]);i===a&&r.add(t)}),t.filter(e=>r.has(e))},publish:async e=>{cK();let{owner:t,repo:n}=WG,{number:r}=e,i=QK(),a=await _G(`/repos/${t}/${n}/pulls/${r}/merge`,{method:`POST`,responseType:`raw`,body:{Do:i?`squash`:`merge`,MergeTitleField:e.title,MergeMessageField:``,head_commit_id:e.headSHA}});if(a.status===405&&await xMe(WG,r))await kq(e.branch);else{if(!a.ok){let{message:e}=await a.json().catch(()=>({}));throw Error(`Failed to merge the pull request`,{cause:{status:a.status,message:e}})}await kq(e.branch)}},discard:async e=>{let{owner:t,repo:n}=WG;if(e.number!==void 0)try{await _G(`/repos/${t}/${n}/pulls/${e.number}`,{method:`PATCH`,body:{state:`closed`}})}catch(e){if(e.cause?.status!==412)throw e}await kq(e.branch)}},Hq=(e,{authRoot:t,authPath:n,tokenPath:r,api:i,...a})=>{let o=`${CE(t)}/${CE(n)}`;return KAe(e,a),Object.assign(dG,{...i,authURL:o,tokenURL:o.replace(`/authorize`,r)}),e},Uq=[`preview`,`editorial_workflow`],Wq=e=>typeof e==`string`?e?{type:e}:{}:E(e)?e:{},aNe=e=>Array.isArray(e)?dq.filter(t=>t===`draft`||e.includes(t)):dq,Gq=({cmsConfig:e,collection:t})=>{let{type:n,stages:r,direct_publish:i=!1,allow_incomplete_drafts:a=!0}={...Wq(e?.publish_mode),...Wq(t?.publish_mode)},o=n&&Uq.includes(n)?n:`simple`;return{type:o,stages:o===`preview`?[`draft`]:aNe(r),directPublish:o!==`simple`&&i===!0,allowIncompleteDrafts:a!==!1}},Kq=({cmsConfig:e,collection:t})=>Gq({cmsConfig:e,collection:t}).type,qq=e=>Uq.includes(e),Jq=e=>[void 0,...Array.isArray(e?.collections)?e.collections.filter(e=>E(e)&&!(`divider`in e)):[]],Yq=e=>Jq(e).some(t=>qq(Kq({cmsConfig:e,collection:t}))),oNe={isGit:!0,name:`gitea`,label:`Gitea / Forgejo`,repository:WG,init:()=>{let{backend:e}=Sk.current??{};if(e?.name!==`gitea`)return;let{repo:t,branch:n,base_url:r=`https://gitea.com`,auth_endpoint:i=`login/oauth/authorize`,app_id:a=``,api_root:o=`https://gitea.com/api/v1`,include_credentials:s=!1}=e,[c,l]=t.split(`/`);return Hq(WG,{service:`gitea`,label:`Gitea / Forgejo`,owner:c,repo:l,branch:n,restApiRoot:o,defaultApiRoot:`https://gitea.com/api/v1`,getTokenPageURL:HAe,getBaseURLs:qG,authRoot:r,authPath:i,tokenPath:`/access_token`,api:{clientId:a,authScope:[`read:repository`,`write:repository`,...Yq(Sk.current)?[`read:issue`,`write:issue`]:[],`read:user`].join(`,`),restBaseURL:CE(o),includeCredentials:s}}),WG},signIn:UAe,signOut:PG,fetchFiles:yMe,fetchLastCommit:_K,fetchBlob:bMe,fetchDirSHA:YK,commitChanges:vK,fetchFileCommits:_je,fetchBranchHeadSHA:kje,fetchDeployments:Mje,workflow:iNe},sNe=e=>(e=CE(e),e===`https://api.github.com`||e.endsWith(`/api/v3`)?e:e.endsWith(`/api`)?`${e}/v3`:`${e}/api/v3`),cNe=e=>(e=CE(e),e===`https://api.github.com`?`${e}/graphql`:e.endsWith(`/graphql`)?e:e.endsWith(`/api/v3`)?e.replace(/\/v3$/,`/graphql`):e.endsWith(`/api`)?`${e}/graphql`:`${e}/api/graphql`),lNe=e=>yG(e,`github`,{name:`name`,login:`login`,profileURL:`html_url`}),uNe=e=>{let{origin:t}=new URL(e),n=new URLSearchParams({name:`Sveltia CMS`,contents:`write`});return Yq(Sk.current)&&n.set(`pull_requests`,`write`),`${t}/settings/personal-access-tokens/new?${n}`},dNe=e=>NG({options:e,getUserProfile:lNe}),Xq=2,Zq=pk(),fNe=e=>{Zq.current=e>=Xq?{phase:`preparing`,done:0,total:e,approximate:!1}:void 0},pNe=()=>{let e=Zq.current;e?.phase===`preparing`&&(Zq.current={...e,done:Math.min(e.done+1,e.total)})},mNe=(e,t)=>{let n=Math.max(e,t);Zq.current=n>=Xq?{phase:`committing`,done:e,total:n,approximate:!0}:void 0},Qq=()=>{Zq.current=void 0},$q={...zG},eJ=VG({tree:`/tree`,blob:`/blob`,commit:`/commit`}),tJ=({status:e,headers:t})=>e===429||t.get(`retry-after`)!==null||t.get(`x-ratelimit-remaining`)===`0`,hNe=async()=>{let{owner:e,repo:t}=$q,n=await _G(`/repos/${e}/${t}`,{headers:{Accept:`application/json`},responseType:`raw`});if(!n.ok)throw EW($q,tJ(n)?void 0:n.status);let{permissions:r}=await n.json();if(!r?.push)throw TW(t,r?.pull)},gNe=`
query($owner: String!, $repo: String!, $qualifiedName: String!) {
repository(owner: $owner, name: $repo) {
ref(qualifiedName: $qualifiedName) {
refUpdateRule {
viewerCanPush
}
}
}
}
`,_Ne=async()=>{await ZV($q.branch,async e=>({canPush:(await vG(gNe,{qualifiedName:`refs/heads/${e}`})).repository?.ref?.refUpdateRule?.viewerCanPush}))},vNe=`
query($owner: String!, $repo: String!) {
repository(owner: $owner, name: $repo) {
defaultBranchRef {
name
}
}
}
`,nJ=async()=>{let e=await vG(vNe),t=UG($q,{found:!!e.repository,branch:e.repository?.defaultBranchRef?.name,getBaseURLs:eJ});return Object.assign(fG,{branch:t}),t},yNe=()=>tK(`github`),rJ=()=>nK($q),bNe=[403,404],xNe=async()=>{let{owner:e,repo:t}=$q,n=`${e}/${t}`.toLowerCase();try{return(await _G(`/user/repository_invitations`)).some(({repository:e})=>e?.full_name?.toLowerCase()===n)}catch{return!1}},SNe=async e=>{let{owner:t,repo:n}=$q,r=`${t}/${n}`;if(await xNe())return Y(`open_authoring.invitation_pending`,{values:{repo:r}});let i=e.headers.get(`x-oauth-scopes`);return i!==null&&!i.split(/,\s*/).includes(`repo`)?Y(`open_authoring.private_repo_scope_required`,{values:{repo:r}}):Y(`repository_no_access`,{values:{repo:r}})},CNe=async()=>{let{owner:e,repo:t}=$q,n=`${e}/${t}`,r=await _G(`/repos/${e}/${t}`,{headers:{Accept:`application/json`},responseType:`raw`});if(r.ok){let{permissions:e,private:t,owner:i,allow_forking:a}=await r.json();return t&&i?.type===`User`&&console.warn(`Open Authoring is enabled, but the ${n} repository is private and owned by a personal account. GitHub does not allow read-only collaborators there, so everyone who can sign in can also write to the repository and no one is treated as a contributor. Transfer the repository to an organization to use Open Authoring with it.`),{canWrite:!!e?.push,allowForking:a!==!1}}throw bNe.includes(r.status)&&!tJ(r)?Error(`No access to the repository`,{cause:Error(await SNe(r))}):SW(`Failed to check the repository permission.`,`open_authoring.permission_check_failed`,{repo:n})},wNe=async()=>{let{owner:e,repo:t}=$q,n=OW.account?.login,r=await _G(`/repos/${encodeURIComponent(n)}/${t}`,{headers:{Accept:`application/json`},responseType:`raw`});if(!r.ok)return;let i=await r.json(),a=i.parent?.full_name?.toLowerCase();if(!i.fork||a!==`${e}/${t}`.toLowerCase()||i.owner?.login?.toLowerCase()!==n.toLowerCase())return;let[o,s]=i.full_name.split(`/`);return{owner:o,repo:s}},TNe=`
query($owner: String!, $repo: String!) {
repository(owner: $owner, name: $repo) {
forks(ownerAffiliations: [OWNER], first: 1) {
nodes {
nameWithOwner
owner {
login
}
}
}
}
}
`,ENe=async()=>{let e=OW.account?.login;try{let{repository:t}=await vG(TNe),[n]=t?.forks?.nodes??[];if(n?.owner?.login!==e)return;let[r,i]=n.nameWithOwner.split(`/`);return{owner:r,repo:i}}catch{return}},DNe=async()=>await wNe()??ENe(),ONe=async({owner:e,repo:t},n)=>{await aK({repoPath:`${e}/${t}`,attemptsLeft:n,checkFork:async()=>(await _G(`/repos/${e}/${t}`,{headers:{Accept:`application/json`},responseType:`raw`})).ok?`ready`:`pending`})},kNe=async()=>{let{owner:e,repo:t}=$q,n;try{n=await _G(`/repos/${e}/${t}/forks`,{method:`POST`})}catch(n){throw rK(`${e}/${t}`,n)}let[r,i]=n.full_name.split(`/`),a={owner:r,repo:i};return await ONe(a),a},ANe=async({owner:e,repo:t})=>{let n;try{n=await _G(`/repos/${e}/${t}/merge-upstream`,{method:`POST`,body:{branch:$q.branch},responseType:`raw`})}catch(n){console.warn(`Failed to sync the ${e}/${t} fork with the upstream repository.`,n);return}n.ok||console.warn(`The ${e}/${t} fork could not be fast-forwarded to the upstream repository.`)},jNe=async()=>{let{owner:e,repo:t}=$q;await sK({repoPath:`${e}/${t}`,fetchAccess:CNe,prepare:async()=>{$q.branch||await nJ()},fetchFork:DNe,prepareFork:ANe,fetchForkingAllowed:({allowForking:e})=>e,createFork:kNe})},MNe=async()=>{await oK(jNe)},iJ=(e,t,n,r=(e,t)=>e===t)=>{let i=e.some(e=>r(e,t));return n&&!i?[...e,t]:!n&&i?e.filter(e=>!r(e,t)):e},aJ=(e,t)=>Array.from({length:Math.ceil(e.length/t)},(n,r)=>e.slice(r*t,(r+1)*t)),NNe=(e,t,{useBranch:n=!1}={})=>{let r=e.map(({index:e,fragment:n})=>`${t}_${e}: ${n}`).join(`
`);return`
query($owner: String!, $repo: String!${n?`, $branch: String!`:``}) {
repository(owner: $owner, name: $repo) {
${r}
}
}
`},oJ=async({items:e,alias:t,getFragment:n,chunkSize:r,useBranch:i=!1,variables:a={}})=>{let o=Array(e.length).fill(void 0);return await yW(aJ(e.map((e,t)=>({index:t,fragment:n(e)})).filter(({fragment:e})=>!!e),r),async e=>{let n=await vG(NNe(e,t,{useBranch:i}),{...a});e.forEach(({index:e})=>{o[e]=n?.repository?.[`${t}_${e}`]})}),o},PNe=`
query($owner: String!, $repo: String!, $branch: String!) {
repository(owner: $owner, name: $repo) {
ref(qualifiedName: $branch) {
target {
... on Commit {
history(first: 1) {
nodes {
oid
message
}
}
}
}
}
}
}
`,sJ=async e=>{let{owner:t,repo:n}=e?rJ():$q,r=e??$q.branch,i=await vG(PNe,{owner:t,repo:n,...e?{branch:r}:{}});if(!i.repository)throw IW(`repository_not_found`,{repo:n});if(!i.repository.ref)throw IW(`branch_not_found`,{repo:n,branch:r});let{oid:a,message:o}=i.repository.ref.target.history.nodes[0];return{hash:a,message:o}},cJ=10485760,FNe=async({headOid:e,branch:t})=>e||(!t&&mK.current?mK.current:(await sJ(t)).hash),INe=5e3,LNe=[408,413,499,502,504],RNe=(e,t=new Set)=>({queue:e.filter(({path:e})=>!t.has(e)).toSorted((e,t)=>Number(typeof e.data==`string`)-Number(typeof t.data==`string`)),addedAgain:e.filter(({path:e})=>t.has(e))}),zNe=(e,t)=>{let n=[],r=0;for(;e.length&&(!n.length||r+e[0].contents.length<=t);){let t=e.shift();n.push(t),r+=t.contents.length}return n},lJ=e=>e.reduce((e,{contents:t})=>e+t.length,0),BNe=(e,t)=>Math.max(1,Math.ceil(lJ(e)/t)),VNe=(e,t)=>Math.min(16777216,Math.max(262144,Math.floor(e/Math.max(t,1)*INe))),HNe=e=>e?.message===`Failed to send the request`||LNe.includes(e?.cause?.status),UNe=async({owner:e,repo:t,branch:n,expectedHeadOid:r,additions:i,deletions:a,message:o,onWorkflowBranch:s})=>{let c=`
mutation($input: CreateCommitOnBranchInput!) {
createCommitOnBranch(input: $input) {
commit {
oid
committedDate
${i.map(({index:e,path:t,data:n})=>JP(n??``)<=cJ?`file_${e}: file(path: ${JSON.stringify(t)}) { oid }`:``).filter(Boolean).join(` `)}
}
}
}
`,l={branch:{repositoryNameWithOwner:`${e}/${t}`,branchName:n},expectedHeadOid:r,fileChanges:{additions:i.map(({path:e,contents:t})=>({path:e,contents:t})),deletions:a},message:{headline:o}};try{let{createCommitOnBranch:{commit:e}}=await vG(c,{input:l});return e}catch(e){throw s||await LW(r,sJ),e}},uJ=async(e,t)=>{lK(t);let{owner:n,repo:r}=t.branch?rJ():$q,i=t.branch??$q.branch,a=await Promise.all(e.filter(({action:e})=>[`create`,`update`,`move`].includes(e)).map(async({path:e,data:t},n)=>({index:n,path:e,contents:await Gk(t??``),data:t}))),o=e.filter(({action:e})=>[`move`,`delete`].includes(e)).map(({previousPath:e,path:t})=>({path:e??t})),{queue:s,addedAgain:c}=RNe(a,new Set(o.map(({path:e})=>e))),l=PW(e,t),u=await FNe(t),d=2097152,f=1/0,p=0,m={},h={};try{do{mNe(p,p+BNe(s,d));let e=zNe(s,d),a=!s.length,g=lJ(e),_=performance.now();try{m=await UNe({owner:n,repo:r,branch:i,expectedHeadOid:u,additions:a?[...e,...c]:e,deletions:a?o:[],message:l,onWorkflowBranch:!!t.branch})}catch(n){if(e.length>1&&HNe(n)&&(await sJ(t.branch).catch(()=>void 0))?.hash===u){s.unshift(...e),f=Math.min(f,g),d=Math.floor(g/2);continue}throw p&&!t.branch&&(mK.current=u),n}d=Math.min(VNe(g,performance.now()-_),f-1),p+=1,Object.assign(h,m),u=m.oid}while(s.length)}finally{Qq()}return{sha:m.oid,date:new Date(m.committedDate),files:Object.fromEntries(a.map(({index:e,path:t,data:n})=>[t,{sha:h[`file_${e}`]?.oid,...n instanceof Blob&&n.size>cJ?{file:n}:{}}]))}},WNe=50,GNe=async e=>FW((await oJ({items:e,alias:`history`,useBranch:!0,getFragment:e=>`
ref(qualifiedName: $branch) {
target {
... on Commit {
history(first: 100, path: ${JSON.stringify(e)}) {
nodes {
oid
messageHeadline
author {
name
email
avatarUrl
user { login }
}
committedDate
}
}
}
}
}
`,chunkSize:WNe})).flatMap(e=>(e?.target?.history?.nodes??[]).map(e=>({sha:e.oid,message:e.messageHeadline??``,authorName:e.author?.name??``,authorEmail:e.author?.email,authorAvatarURL:e.author?.avatarUrl,authorLogin:e.author?.user?.login,date:new Date(e.committedDate)})))),KNe=async()=>{let{owner:e,repo:t}=$q;return _G(`/repos/${e}/${t}/dispatches`,{method:`POST`,body:{event_type:`sveltia-cms-publish`},responseType:`raw`})},dJ={commits:20,deployments:10,checkSuites:10,checkRuns:20},qNe={SUCCESS:`ready`,PENDING:`pending`,EXPECTED:`pending`,FAILURE:`error`,ERROR:`error`},JNe={SUCCESS:`ready`,PENDING:`pending`,QUEUED:`pending`,IN_PROGRESS:`pending`,WAITING:`pending`,FAILURE:`error`,ERROR:`error`},YNe={SUCCESS:`ready`,NEUTRAL:`ready`,FAILURE:`error`,TIMED_OUT:`error`,STARTUP_FAILURE:`error`,ACTION_REQUIRED:`error`},XNe=/preview/i,ZNe=async()=>{let{repository:e}=await vG(`
query($owner: String!, $repo: String!, $branch: String!) {
repository(owner: $owner, name: $repo) {
ref(qualifiedName: $branch) {
target {
... on Commit {
oid
}
}
}
}
}
`);return e?.ref?.target?.oid??void 0},fJ=(e,t)=>oJ({items:e,alias:`commit`,getFragment:e=>`object(oid: ${JSON.stringify(e)}) { ... on Commit { ${t} } }`,chunkSize:dJ.commits}),pJ={status:{selection:`status { contexts { context state targetUrl description } }`,parse:(e,t,n)=>{(e?.status?.contexts??[]).forEach(({context:e,state:r,targetUrl:i,description:a})=>{let o=qNe[r];o&&n[t].push({name:e??``,url:i??void 0,state:o,description:a??void 0,source:`status`})})}},deployments:{selection:`deployments(
last: ${dJ.deployments}
orderBy: { field: CREATED_AT, direction: ASC }
) {
nodes {
environment
latestStatus {
state
environmentUrl
description
}
}
}`,parse:(e,t,n)=>{(e?.deployments?.nodes??[]).forEach(({environment:e,latestStatus:r})=>{let i=JNe[r?.state];i&&n[t].push({name:e??``,url:r?.environmentUrl??void 0,state:i,description:r?.description??void 0,source:`deployment`})})}},checks:{selection:`checkSuites(last: ${dJ.checkSuites}) {
nodes {
checkRuns(last: ${dJ.checkRuns}) {
nodes {
name
status
conclusion
detailsUrl
summary
}
}
}
}`,parse:(e,t,n)=>{(e?.checkSuites?.nodes??[]).forEach(e=>{(e?.checkRuns?.nodes??[]).forEach(({name:e,status:r,conclusion:i,detailsUrl:a,summary:o})=>{let s=r===`COMPLETED`?YNe[i]:`pending`;s&&n[t].push({name:e??``,url:Sje(o,a)??(XNe.test(e??``)?a??void 0:void 0),state:s,source:`check`})})})}}},mJ=!1,QNe=async(e,t)=>{let n=await fJ(e,Object.values(pJ).map(({selection:e})=>e).join(`
`));e.forEach((e,r)=>{Object.values(pJ).forEach(({parse:i})=>i(n[r],e,t))})},$Ne=async(e,t)=>{await Promise.all(Object.values(pJ).map(({selection:n,parse:r})=>SK(async()=>{let i=await fJ(e,n);e.forEach((e,n)=>r(i[n],e,t))})))},ePe=async(e,t)=>{await yW(aJ(e,dJ.commits),async e=>{if(!mJ)try{await QNe(e,t);return}catch(e){console.warn(`Falling back to a request per deployment source.`,e),mJ=!0}await $Ne(e,t)})},tPe=async e=>CK(e,{collect:ePe,selfURL:$q.repoURL}),nPe=10,hJ=e=>{let t=Math.max(100/(Math.max(e,1)*nPe)*100,.1),n=0;gj.current=n;let r=window.setInterval(()=>{n=Math.min(n+t,99),gj.current=n},100);return()=>{window.clearInterval(r),gj.current=void 0}},gJ=async(e,t)=>{let{owner:n,repo:r}=$q,i=t?`?recursive=1`:``;return await _G(`/repos/${n}/${r}/git/trees/${IP(e)}${i}`)},rPe=async e=>{let t=e??$q.branch,n=AU(),r=[],i=[n?{sha:`${t}:${n}`,prefix:`${n}/`}:{sha:t,prefix:``}];for(;i.length;){let e=await bW(i,async({sha:e,prefix:r})=>{let{tree:i,truncated:a}=await gJ(e,!0).catch(r=>{throw n&&e===`${t}:${n}`&&r?.cause?.status===404?SW(`Failed to list the files.`,`root_dir_not_found`,{repo:`${$q.owner}/${$q.repo}`,dir:n}):r});if(!a)return{prefix:r,entries:i,subtrees:[]};let{tree:o,truncated:s}=await gJ(e,!1);if(s)throw Error(`The directory '${r||`/`}' has too many files to list.`);return{prefix:r,entries:o,subtrees:o.filter(({type:e})=>e===`tree`)}});i=e.flatMap(({prefix:e,subtrees:t})=>t.map(({path:t,sha:n})=>({sha:n,prefix:`${e}${t}/`}))),e.forEach(({prefix:e,entries:t})=>{t.forEach(t=>{t.type===`blob`&&r.push({...t,path:`${e}${t.path}`})})})}return MK(r)},iPe=`
query($owner: String!, $repo: String!, $expression: String!) {
repository(owner: $owner, name: $repo) {
object(expression: $expression) {
oid
}
}
}
`,aPe=async(e,t)=>{let{owner:n,repo:r}=$q;return(await vG(iPe,{owner:n,repo:r,expression:`${e}:${t}`})).repository?.object?.oid},oPe=250,sPe=({type:e,sha:t})=>e===`asset`?``:`object(oid: ${JSON.stringify(t)}) { ... on Blob { text isTruncated } }`,cPe=({path:e})=>`
ref(qualifiedName: $branch) {
target {
... on Commit {
history(first: 1, path: ${JSON.stringify(e)}) {
nodes {
author {
name
email
user {
id: databaseId
login
}
}
committedDate
}
}
}
}
}
`,_J=async({owner:e,repo:t,sha:n,responseType:r})=>_G(`/repos/${e}/${t}/git/blobs/${n}`,{headers:{Accept:`application/vnd.github.raw`},responseType:r}),vJ=async({owner:e,repo:t,sha:n})=>_J({owner:e,repo:t,sha:n,responseType:`text`}),lPe=async(e,t)=>{let n=[],r=e.map(({path:e,sha:r,size:i},a)=>{let{text:o,isTruncated:s}=t[a]??{},c={sha:r,size:i,text:o,meta:void 0};return s&&n.push({sha:r,data:c}),[e,c]}),{owner:i,repo:a}=$q;return await yW(n,async({sha:e,data:t})=>{t.text=await vJ({owner:i,repo:a,sha:e})}),Object.fromEntries(r)},uPe=(e,t)=>Object.fromEntries(e.flatMap(({path:e},n)=>{let r=t[n]?.target?.history?.nodes?.[0];if(!r)return[];let{author:i,committedDate:a}=r,o=i?.user;return[[e,{commitAuthor:i?{name:i.name,email:i.email,id:o?.id,login:o?.login}:void 0,commitDate:new Date(a)}]]})),yJ=(e,t,n,{useBranch:r=!1}={})=>oJ({items:e,alias:t,getFragment:n,chunkSize:oPe,useBranch:r}),dPe=async e=>{let t=hJ(e.length),n;try{n=await yJ(e,`content`,sPe)}finally{t()}return lPe(e,n)},fPe=async e=>uPe(e,await yJ(e,`commit`,cPe,{useBranch:!0})),pPe=async({lastCommit:e}={})=>{await qK({isOpenAuthoringConfigured:yNe,initOpenAuthoring:MNe,repository:$q,checkAccess:hNe,checkBranchAccess:_Ne,fetchDefaultBranchName:nJ,fetchLastCommit:sJ,lastCommit:e,fetchFileList:rPe,fetchFileContents:dPe,fetchFileMetadata:fPe})},mPe=async e=>{let{owner:t,repo:n}=e.workflow?rJ():$q,{sha:r}=e,i=await _J({owner:t,repo:n,sha:r,responseType:`raw`});if(!i.ok)throw Error(`Failed to fetch the blob`,{cause:{status:i.status}});return i.blob()},hPe=`https://www.githubstatus.com/api/v2/status.json`,gPe=async()=>{try{let{status:{indicator:e}}=await rG(hPe);if(e===`none`)return`none`;if(e===`minor`)return`minor`;if(e===`major`||e===`critical`)return`major`}catch{}return`unknown`},bJ=[`PENDING`,`EXPECTED`],_Pe=[`REVIEW_REQUIRED`,`CHANGES_REQUESTED`],vPe=[`CLEAN`,`HAS_HOOKS`,`UNSTABLE`],yPe=QG,bPe=`
query($owner: String!, $repo: String!, $number: Int!) {
repository(owner: $owner, name: $repo) {
pullRequest(number: $number) {
id
state
merged
mergeStateStatus
reviewDecision
viewerCanEnableAutoMerge
autoMergeRequest {
enabledAt
}
commits(last: 1) {
nodes {
commit {
statusCheckRollup {
state
}
}
}
}
}
}
}
`,xPe=`
mutation($input: EnablePullRequestAutoMergeInput!) {
enablePullRequestAutoMerge(input: $input) {
clientMutationId
}
}
`,SPe=`
mutation($input: DisablePullRequestAutoMergeInput!) {
disablePullRequestAutoMerge(input: $input) {
clientMutationId
}
}
`,xJ=async e=>{let{owner:t,repo:n}=$q,{repository:r}=await vG(bPe,{owner:t,repo:n,number:e.number}),i=r?.pullRequest;if(i)return{...i,checkState:i.commits?.nodes?.[0]?.commit?.statusCheckRollup?.state}},SJ=e=>e?.state===`OPEN`&&e.mergeStateStatus===`UNKNOWN`,CPe=e=>$G(()=>xJ(e),e=>!SJ(e),yPe),wPe=e=>e.state===`OPEN`&&e.mergeStateStatus===`BLOCKED`&&(!!e.viewerCanEnableAutoMerge||!!e.autoMergeRequest)&&bJ.includes(e.checkState)&&!_Pe.includes(e.reviewDecision),CJ=async(e,t)=>{try{await vG(SPe,{input:{pullRequestId:e}})}catch(e){console.warn(`Failed to cancel the auto-merge on pull request #${t}.`,e)}},TPe=async(e,t)=>{let{number:n}=e;await uq({read:()=>xJ(e),evaluate:async e=>{if(e?.merged)return!0;let{state:r,autoMergeRequest:i,checkState:a}=e??{},o=!!i,s=!bJ.includes(a)&&a!==`SUCCESS`;if(r!==`OPEN`||!o||s)throw r===`OPEN`&&o&&await CJ(t,n),Error(`Pull request #${n} was not merged: ${r}, checks ${a}, auto-merge ${o?`on`:`off`}`);return!1},cancel:()=>CJ(t,n),label:`pull request #${n}`})},EPe=async({pullRequest:e,node:t,squash:n,merge:r})=>{if(t.autoMergeRequest)return!0;let{title:i,headSHA:a}=e;try{return await vG(xPe,{input:{pullRequestId:t.id,mergeMethod:n?`SQUASH`:`MERGE`,commitHeadline:i,...a?{expectedHeadOid:a}:{}}}),!0}catch{let t=await xJ(e);return t?.merged?!1:t?.autoMergeRequest?!0:(await r(),!1)}},DPe=async({pullRequest:e,squash:t,merge:n,refusal:r})=>{let i=await CPe(e);if(!i?.merged){if(SJ(i))throw Error(`Timed out waiting for GitHub to check whether pull request #${e.number} can be merged`,{cause:r});if(vPe.includes(i?.mergeStateStatus))await n();else if(i&&wPe(i))await EPe({pullRequest:e,node:i,squash:t,merge:n})&&await TPe(e,i.id);else throw r}},wJ={pullRequests:100,files:100,labels:100,branches:100,branchPullRequests:2},TJ=e=>e.map(({path:e,changeType:t})=>({path:e,sha:``,size:0,deleted:t===`DELETED`,renamed:t===`RENAMED`})),EJ=e=>e.map(({filename:e,status:t,previous_filename:n})=>({path:e,sha:``,size:0,deleted:t===`removed`,previousPath:n})),DJ=async e=>{let{owner:t,repo:n}=$q;e.files=EJ(await _G(`/repos/${t}/${n}/pulls/${e.number}/files?per_page=${wJ.files}`))},OPe=100,OJ=async e=>{let t=[];if(e.forEach(e=>{e.files.forEach(n=>{n.deleted||t.push({pullRequest:e,file:n})})}),!t.length)return;let n=rJ(),r=await oJ({items:t,alias:`file`,getFragment:({pullRequest:{headSHA:e,branch:t},file:n})=>`
object(expression: ${JSON.stringify(`${e??t}:${n.path}`)}) {
... on Blob {
oid
byteSize
isBinary
isTruncated
text
}
}
`,chunkSize:OPe,variables:n}),i=[];t.forEach(({file:e},t)=>{let n=r[t];n?(Object.assign(e,{sha:n.oid,size:n.byteSize,text:n.isBinary?void 0:n.text??void 0}),!n.isBinary&&n.isTruncated&&i.push(e)):e.deleted=!0}),await yW(i,async e=>{e.text=await vJ({...n,sha:e.sha})})},kPe=`
query($owner: String!, $repo: String!, $branch: String!) {
repository(owner: $owner, name: $repo) {
branchHead: ref(qualifiedName: $branch) {
target {
oid
}
}
}
}
`,kJ=async e=>{let{owner:t,repo:n}=rJ(),{repository:r}=await vG(kPe,{owner:t,repo:n,branch:`refs/heads/${e}`});return r?.branchHead?.target?.oid},AJ=async e=>{let{owner:t,repo:n}=rJ();await $K({branch:e,path:`/repos/${t}/${n}/git/refs/heads/${IP(e)}`,goneStatuses:[404,422]})},APe=async(e,t)=>{let{owner:n,repo:r}=$q,{labels:i=[]}=await _G(`/repos/${n}/${r}/pulls/${e.number}`),a=yq(i.map(({name:e})=>e),t);await _G(`/repos/${n}/${r}/issues/${e.number}`,{method:`PATCH`,body:{labels:a}})},jJ=async(e,t)=>{await vG(`
mutation($input: ${t?`ConvertPullRequestToDraftInput`:`MarkPullRequestReadyForReviewInput`}!) {
${t?`convertPullRequestToDraft`:`markPullRequestReadyForReview`}(input: $input) {
pullRequest {
isDraft
}
}
}
`,{input:{pullRequestId:e.nodeId}})},MJ=async({branch:e,title:t,status:n})=>{let{owner:r,repo:i,branch:a}=$q,o=QV.current,s=n===`draft`,c=await _G(`/repos/${r}/${i}/pulls`,{method:`POST`,body:{title:t,head:o?`${o.owner}:${e}`:e,base:a,draft:s,body:`Automatically generated by Sveltia CMS`}}),l={number:c.number,nodeId:c.node_id,title:c.title,url:c.html_url,branch:e,headSHA:c.head?.sha,status:n,createdDate:new Date(c.created_at),updatedDate:new Date(c.updated_at),files:[]};return o||await _G(`/repos/${r}/${i}/issues/${c.number}/labels`,{method:`POST`,body:{labels:[_q(n)]}}),l},jPe=()=>`
query($owner: String!, $repo: String!, $prefix: String!) {
repository(owner: $owner, name: $repo) {
refs(refPrefix: $prefix, first: ${wJ.branches}) {
nodes {
name
target {
... on Commit {
oid
message
committedDate
author {
name
email
user {
login
databaseId
}
}
}
}
}
}
}
}
`,MPe=50,NPe=e=>`
pullRequests(
headRefName: ${JSON.stringify(e)}
baseRefName: ${JSON.stringify($q.branch)}
states: [OPEN, CLOSED, MERGED]
first: ${wJ.branchPullRequests}
orderBy: { field: CREATED_AT, direction: DESC }
) {
nodes {
id
number
title
url
state
isDraft
createdAt
updatedAt
headRefOid
headRepositoryOwner {
login
}
author {
login
}
files(first: ${wJ.files}) {
nodes {
path
changeType
}
}
}
}
`,NJ=e=>{let t=OW.account?.login?.toLowerCase();return e.headRepositoryOwner?.login===QV.current?.owner&&!!t&&e.author?.login?.toLowerCase()===t},PPe=async e=>{let t=new Map;if(!e.length)return t;let n=await oJ({items:e,alias:`pr`,getFragment:NPe,chunkSize:MPe});return e.forEach((e,r)=>{let[i]=(n[r]?.nodes??[]).filter(NJ);i&&t.set(e,i)}),t},FPe=(e,t,n)=>{let{message:r,committedDate:i,author:a}=e.target??{},o=n?.state===`MERGED`?void 0:n,{login:s,databaseId:c}=a?.user??{},l=o?.state===`OPEN`,u=l&&!o.isDraft;return{number:o?.number,nodeId:o?.id,title:o?.title??r??``,url:o?.url,branch:t,headSHA:e.target?.oid,status:u?`pending_review`:`draft`,createdDate:new Date(o?.createdAt??i),updatedDate:new Date(o?.updatedAt??i),author:a?.name?{name:a.name,email:a.email??``,id:c,login:s}:void 0,files:l?TJ(o.files?.nodes??[]):[]}},IPe=async()=>{let{owner:e,repo:t}=rJ(),n=Rq(),{repository:r}=await vG(jPe(),{owner:e,repo:t,prefix:`refs/heads/${n}`}),i=r?.refs?.nodes??[];i.length===wJ.branches&&console.warn(`Only the first ${wJ.branches} Editorial Workflow branches in the fork are listed. Publish or discard some entries to see the rest.`);let a=i.map(({name:e})=>`${n}${e}`),o=await PPe(a);return uK(i,(e,t)=>{let n=a[t],r=o.get(n);return r?.state===`MERGED`&&r.headRefOid===e.target?.oid?{leftover:n}:{pending:FPe(e,n,r)}},AJ)},LPe=async e=>{let{owner:t,repo:n,branch:r}=$q,{owner:i}=rJ(),{files:a=[]}=await _G(`/repos/${t}/${n}/compare/${IP(r)}...${`${encodeURIComponent(i)}:${IP(e.branch)}`}?per_page=${wJ.files}`);e.files=EJ(a)},RPe=async()=>{let e=await IPe();await yW(e.filter(({files:e})=>!e.length),LPe),await yW(e.filter(({files:e})=>e.some(({renamed:e})=>e)),DJ);let t=e.filter(({files:e})=>e.length);return await OJ(t),t},zPe=`
query($id: ID!) {
node(id: $id) {
... on PullRequest {
state
isDraft
baseRefName
headRefOid
headRepositoryOwner {
login
}
author {
login
}
}
}
}
`,BPe=async({nodeId:e})=>{let{node:t}=await vG(zPe,{id:e});if(t)return{merged:t.state===`MERGED`,isEntryRequest:t.baseRefName===$q.branch&&NJ(t),getMergedSHA:async()=>t.headRefOid,state:t.state,draft:t.isDraft}},VPe=e=>cq(e,{repository:$q,updateDraftState:jJ}),HPe=async(e,t)=>dK({pullRequest:e,status:t,requestKey:`nodeId`,createRequest:MJ,fetchRequest:BPe,applyStatus:VPe,fetchBranchHead:kJ,deleteBranch:AJ}),UPe=()=>`
id
number
title
url
isDraft
isCrossRepository
baseRefName
createdAt
updatedAt
headRefName
headRefOid
author {
login
avatarUrl
... on User {
name
email
databaseId
}
}
labels(first: ${wJ.labels}) {
nodes {
name
}
}
files(first: ${wJ.files}) {
nodes {
path
changeType
}
}
`,WPe=()=>`
query($owner: String!, $repo: String!) {
repository(owner: $owner, name: $repo) {
pullRequests(
states: OPEN
labels: ${JSON.stringify(vq())}
first: ${wJ.pullRequests}
orderBy: { field: UPDATED_AT, direction: DESC }
) {
nodes {
${UPe()}
}
}
}
}
`,GPe=(e,t)=>{let{login:n,name:r,email:i,databaseId:a}=e.author??{};return{number:e.number,nodeId:e.id,title:e.title,url:e.url,branch:e.headRefName,headSHA:e.headRefOid,status:t,createdDate:new Date(e.createdAt),updatedDate:new Date(e.updatedAt),author:n?{name:r??n,email:i??``,id:a,login:n}:void 0,files:TJ(e.files?.nodes??[])}},KPe=e=>{if(e.isCrossRepository||e.baseRefName!==$q.branch)return;let t=bq(e.labels.nodes.map(e=>e.name));if(t)return GPe(e,t)},qPe=async()=>{let{repository:e}=await vG(WPe()),t=(e?.pullRequests?.nodes??[]).map(KPe).filter(Boolean);return await yW(t.filter(({files:e})=>e.some(({renamed:e})=>e)),DJ),await OJ(t),t},JPe=async()=>$V.current?RPe():qPe(),YPe=`
query(
$forkOwner: String!
$forkRepo: String!
$owner: String!
$repo: String!
$branch: String!
) {
fork: repository(owner: $forkOwner, name: $forkRepo) {
id
ref(qualifiedName: $branch) {
name
}
defaultBranchRef {
name
}
}
base: repository(owner: $owner, name: $repo) {
ref(qualifiedName: $branch) {
target {
oid
}
}
}
}
`,XPe=`
mutation($input: CreateRefInput!) {
createRef(input: $input) {
ref {
name
}
}
}
`,ZPe=()=>`
query($owner: String!, $repo: String!, $branch: String!) {
repository(owner: $owner, name: $repo) {
pullRequests(headRefName: $branch, states: OPEN, first: ${wJ.pullRequests}) {
nodes {
number
isCrossRepository
}
}
}
}
`,QPe=async e=>{let{owner:t,repo:n}=$q,{repository:r}=await vG(ZPe(),{owner:t,repo:n,branch:e});return(r?.pullRequests?.nodes??[]).filter(({isCrossRepository:e})=>!e)},$Pe=async(e,t)=>{let{owner:n,repo:r}=$q;await _G(`/repos/${n}/${r}/git/refs/heads/${IP(e)}`,{method:`PATCH`,body:{sha:t,force:!0}})},PJ=e=>e.cause?.message??``,FJ=async(e,t,n)=>{try{await vG(XPe,{input:{repositoryId:e,name:`refs/heads/${t}`,oid:n}});return}catch(e){return e}},eFe=async(e,t)=>{let{owner:n,repo:r,branch:i}=$q,a=IP(i),o=`${encodeURIComponent(e)}:${IP(t)}`;try{let{merge_base_commit:e}=await _G(`/repos/${n}/${r}/compare/${a}...${o}?per_page=1`);return e?.sha}catch{return}},tFe=async e=>{let{repo:t}=$q,{owner:n,repo:r}=rJ(),{fork:i,base:a}=await vG(YPe,{forkOwner:n,forkRepo:r});if(!i)throw SW(`Failed to create the branch.`,`repository_not_found`,{repo:r});if(!a)throw SW(`Failed to create the branch.`,`repository_not_found`,{repo:t});if(!a.ref)throw SW(`Failed to create the branch.`,`branch_not_found`,{repo:t,branch:$q.branch});let o=a.ref.target.oid,s=await FJ(i.id,e,o);if(s&&$V.current&&/permission/i.test(PJ(s))){let t=i.ref?.name??i.defaultBranchRef?.name,r=t?await eFe(n,t):void 0;r&&r!==o&&(o=r,s=await FJ(i.id,e,o))}if(s){let t=PJ(s);if(!t.includes(`already exists`))throw Error(`Failed to create the branch.`,{cause:Error(t||s.message)});if($V.current)return{};let[n]=await QPe(e);if(n)throw SW(`The workflow branch is in use by another pull request.`,`workflow.branch_in_use`,{number:`#${n.number}`});await $Pe(e,o)}return{headOid:o}},nFe=(e,t)=>iq(e,t,{updateForkStatus:HPe,updateLabels:APe,updateDraftState:jJ}),rFe=async e=>{let{owner:t,repo:n}=$q;await _G(`/repos/${t}/${n}/pulls/${e.number}/reviews`,{method:`POST`,body:{event:`APPROVE`,commit_id:e.headSHA}})},iFe=`The entry is no longer ready to publish.`,aFe=async e=>{let{owner:t,repo:n}=$q,r=`/repos/${t}/${n}/pulls/${e.number}/reviews`,i=await _G(`${r}?per_page=100`);await Promise.all(i.filter(({state:e,user:t})=>e===`APPROVED`&&t?.login===OW.account?.login).map(({id:e})=>_G(`${r}/${e}/dismissals`,{method:`PUT`,body:{message:iFe,event:`DISMISS`}})))},oFe=async({changes:e,options:t,branch:n,title:r,status:i,pullRequest:a})=>{let{headOid:o}=a?{headOid:a.headSHA}:await tFe(n),s;try{s=await uJ(e,{...t,branch:n,headOid:o})}catch(e){throw a&&await kJ(n).then(e=>e===void 0,()=>!1)?SW(`Failed to save the changes.`,`branch_not_found`,{repo:rJ().repo,branch:n}):e}return a?{commit:s,pullRequest:a}:{commit:s,pullRequest:await eq({commit:s,branch:n,title:r,status:i,createPullRequest:MJ})}},sFe=300,cFe={added:`added`,copied:`added`,removed:`removed`,renamed:`renamed`},lFe=async({headSHA:e,paths:t})=>{let n=aq(t),r=await oJ({items:n,alias:`tree`,getFragment:t=>`
object(expression: ${JSON.stringify(`${e}:${t}`)}) {
... on Tree {
entries {
name
mode
}
}
}
`,chunkSize:50}),i=new Map;return n.forEach((e,t)=>{(r[t]?.entries??[]).forEach(({name:t,mode:n})=>{i.set(e?`${e}/${t}`:t,Number(n).toString(8))})}),i},uFe={isGit:!0,name:`github`,label:`GitHub`,repository:$q,statusDashboardURL:`https://www.githubstatus.com/`,checkStatus:gPe,init:()=>{let{backend:e}=Sk.current??{};if(e?.name!==`github`)return;let{repo:t,branch:n,auth_type:r=``,base_url:i=r===`pkce`?`https://github.com`:`https://api.netlify.com`,auth_endpoint:a=r===`pkce`?`login/oauth/authorize`:`auth`,app_id:o=``,api_root:s=`https://api.github.com`,graphql_api_root:c=s,include_credentials:l=!1,auth_scope:u=`repo`}=e,[d,f]=t.split(`/`);return Hq($q,{service:`github`,label:`GitHub`,owner:d,repo:f,branch:n,restApiRoot:s,defaultApiRoot:`https://api.github.com`,getTokenPageURL:uNe,getBaseURLs:eJ,authRoot:i,authPath:a,tokenPath:`/access_token`,api:{clientId:o,authScope:[u,`user`].flat().join(`,`),restBaseURL:sNe(s),graphqlBaseURL:cNe(c),includeCredentials:l}}),Object.assign(fG,{owner:d,repo:f,branch:n}),$q},signIn:dNe,signOut:PG,fetchFiles:pPe,fetchLastCommit:sJ,fetchBlob:mPe,fetchDirSHA:aPe,commitChanges:uJ,fetchFileCommits:GNe,triggerDeployment:KNe,fetchBranchHeadSHA:ZNe,fetchDeployments:tPe,workflow:{fetchPullRequests:JPe,savePullRequest:oFe,updateStatus:nFe,approve:rFe,withdrawApproval:aFe,fetchBranchHead:kJ,fetchMergeState:async e=>{let{owner:t,repo:n,branch:r}=$q,{head:i,base:a}=await _G(`/repos/${t}/${n}/pulls/${e.number}`),o=i?.sha,s=`${t}/${n}`.toLowerCase(),c=a?.ref===r&&a?.repo?.full_name?.toLowerCase()===s&&i?.repo?.full_name?.toLowerCase()===s;if(!o||!c)return{headSHA:o,onConfiguredBranches:!1,files:[],complete:!1};let l=sq(e,o);if(l)return l;let{files:u=[]}=await _G(`/repos/${t}/${n}/compare/${IP(r)}...${o}`);return{headSHA:o,onConfiguredBranches:c,files:await oq(u,{statusMap:cFe,headSHA:o,fetchFileModes:lFe}),complete:u.length<sFe}},fetchUnchangedPaths:async({headSHA:e,paths:t})=>{let n=[$q.branch,e],r=await oJ({items:t.flatMap(e=>n.map(t=>`${t}:${e}`)),alias:`file`,getFragment:e=>`object(expression: ${JSON.stringify(e)}) { oid }`,chunkSize:100});return t.filter((e,t)=>(r[t*2]?.oid??null)===(r[t*2+1]?.oid??null))},publish:async e=>{cK();let{owner:t,repo:n}=$q,{number:r,title:i,headSHA:a}=e,o=QK(),s=()=>_G(`/repos/${t}/${n}/pulls/${r}/merge`,{method:`PUT`,body:{merge_method:o?`squash`:`merge`,commit_title:i,sha:a}});try{await s()}catch(t){if(t.cause?.status!==405)throw t;await DPe({pullRequest:e,squash:o,merge:s,refusal:t})}await AJ(e.branch)},discard:async e=>{let{owner:t,repo:n}=$q;e.number!==void 0&&await _G(`/repos/${t}/${n}/pulls/${e.number}`,{method:`PATCH`,body:{state:`closed`}}),await AJ(e.branch)}}},dFe=e=>yG(e,`gitlab`,{name:`name`,login:`username`,profileURL:`web_url`}),fFe=e=>`${e}/-/user_settings/personal_access_tokens?${new URLSearchParams({name:`Sveltia CMS`,scopes:`api,read_user`})}`,pFe=e=>NG({options:e,getUserProfile:dFe}),mFe=/(?<owner>.+)\/(?<repo>[^/]+)$/,IJ={...zG},LJ=e=>e.match(mFe)?.groups??{},RJ=e=>{let{owner:t,repo:n}=e??IJ;return encodeURIComponent(`${t}/${n}`)},zJ=(e,t)=>`/projects/${RJ(t)}/repository/branches/${encodeURIComponent(e)}`,BJ=VG({tree:`/-/tree`,blob:`/-/blob`,commit:`/-/commit`}),hFe=`
query($fullPath: ID!) {
project(fullPath: $fullPath) {
userPermissions {
pushCode
}
}
}
`,VJ=async()=>{let e=await vG(hFe);return{found:!!e.project,canPush:!!e.project?.userPermissions.pushCode}},gFe=async()=>{let{repo:e}=IJ,t;try{t=await VJ()}catch(e){let t=e?.cause?.status;throw EW(IJ,t===404?void 0:t)}if(!t.canPush)throw TW(e,t.found)},_Fe=async()=>{await ZV(IJ.branch,async e=>({canPush:(await _G(zJ(e))).can_push}))},vFe=`
query($fullPath: ID!) {
project(fullPath: $fullPath) {
repository {
rootRef
}
}
}
`,yFe=async()=>{let e=await vG(vFe),t=UG(IJ,{found:!!e.project,branch:e.project?.repository?.rootRef,getBaseURLs:BJ});return Object.assign(fG,{branch:t}),t},bFe=100,HJ={base:void 0,fork:void 0},xFe=()=>tK(`gitlab`),UJ=()=>nK(IJ),SFe=async()=>{let{owner:e,repo:t}=IJ,n=`${e}/${t}`,r;try{r=await VJ()}catch{throw SW(`Failed to check the repository permission.`,`open_authoring.permission_check_failed`,{repo:n})}if(!r.found)throw wW(n);return{canWrite:r.canPush}},CFe=async()=>{let{owner:e,repo:t}=IJ,n;try{n=await _G(`/projects/${RJ()}`)}catch{throw SW(`Failed to read the repository.`,`open_authoring.permission_check_failed`,{repo:`${e}/${t}`})}let{id:r,forking_access_level:i}=n;return HJ.base=r,{allowForking:i!==`disabled`}},wFe=async()=>{let{owner:e,repo:t}=IJ,n=OW.account?.login,r;try{r=await _G(`/projects/${RJ({owner:n,repo:t})}`)}catch{return}if(r.forked_from_project?.path_with_namespace?.toLowerCase()===`${e}/${t}`.toLowerCase()&&r.namespace?.kind===`user`&&r.namespace?.full_path===n)return HJ.fork=r.id,LJ(r.path_with_namespace)},TFe=async()=>{let e=OW.account?.login;try{let t=(await _G(`/projects/${RJ()}/forks?owned=true&per_page=${bFe}`)).find(({namespace:t})=>t?.kind===`user`&&t?.full_path===e);return t?(HJ.fork=t.id,LJ(t.path_with_namespace)):void 0}catch{return}},EFe=async()=>await wFe()??TFe(),DFe=[`none`,`finished`],OFe=async(e,t)=>{await aK({repoPath:`${e.owner}/${e.repo}`,attemptsLeft:t,checkFork:async()=>{let t;try{({import_status:t}=await _G(`/projects/${RJ(e)}`))}catch{return`pending`}return t===void 0||DFe.includes(t)?`ready`:t===`failed`?`failed`:`pending`}})},kFe=async()=>{let e=OW.account?.login;try{return await _G(`/projects/${RJ({owner:e,repo:IJ.repo})}`),!0}catch{return!1}},AFe=async()=>{let{owner:e,repo:t}=IJ,n=`/projects/${RJ()}/fork`,r=`${e.replaceAll(`/`,`-`)}-${t}`,i=await iK({repoPath:`${e}/${t}`,requestFork:()=>_G(n,{method:`POST`}),requestRenamedFork:()=>_G(n,{method:`POST`,body:{name:r,path:r}}),conflictStatuses:[400,409],isNameTaken:kFe}),a=LJ(i.path_with_namespace);return HJ.fork=i.id,await OFe(a),a},jFe=async()=>{let{owner:e,repo:t}=IJ,n=!1;await sK({repoPath:`${e}/${t}`,fetchAccess:SFe,fetchFork:async()=>{let[e,t]=await Promise.all([CFe(),EFe()]);return{allowForking:n}=e,t},fetchForkingAllowed:()=>n,createFork:AFe})},MFe=async()=>{HJ.base=void 0,HJ.fork=void 0,await oK(jFe)},NFe=`
query($fullPath: ID!, $branch: String!) {
project(fullPath: $fullPath) {
repository {
tree(ref: $branch) {
lastCommit {
sha
message
}
}
}
}
}
`,WJ=async()=>{let{repo:e,branch:t}=IJ,n=await vG(NFe);if(!n.project)throw IW(`repository_not_found`,{repo:e});let{lastCommit:r}=n.project.repository.tree??{};if(!r)throw IW(`branch_not_found`,{repo:e,branch:t});let{sha:i,message:a}=r;return{hash:i,message:a}},GJ=async(e,t)=>{lK(t);let n=t.branch?QV.current:void 0,r=t.branch??IJ.branch,i=(t.branch?t.headOid:mK.current)||void 0,a=await Promise.all(e.map(async({action:e,path:t,previousPath:n,data:r=``})=>({action:e,content:typeof r==`string`?r:await Gk(r),encoding:typeof r==`string`?`text`:`base64`,file_path:t,previous_path:n,...i&&e!==`create`?{last_commit_id:i}:{}}))),o=`/projects/${RJ(n)}/repository/commits`,s={branch:r,commit_message:PW(e,t),actions:a},{startBranch:c}=t,l=n?{start_project:HJ.base}:{},u;try{u=await _G(o,{method:`POST`,body:c?{...s,start_branch:c,...l}:s})}catch(e){throw i&&!t.branch&&e.cause?.status===400&&await LW(i,WJ),e}let{id:d,committed_date:f,parent_ids:p}=u,m=await Promise.all(e.map(async({path:e,data:t})=>t===void 0?null:[e,{sha:await XP(t)}]));return{sha:d,date:new Date(f),parentSha:p?.[0],files:Object.fromEntries(m.filter(e=>!!e))}},PFe=new Map,FFe=async e=>{try{return await LA(PFe,e,async()=>{let{avatar_url:t}=await _G(`/avatar?email=${encodeURIComponent(e)}&size=48`);return t||void 0})}catch{return}},IFe=async e=>{let{branch:t}=IJ,n=RJ(),r=await RW(e,e=>_G(`/projects/${n}/repository/commits?ref_name=${encodeURIComponent(t??``)}&path=${encodeURIComponent(e)}&per_page=100`),e=>({sha:e.id,message:e.title??``,authorName:e.author_name,authorEmail:e.author_email,authorAvatarURL:void 0,date:new Date(e.committed_date)})),i=[...new Set(r.map(e=>e.authorEmail))].filter(e=>!!e),a=new Map;return await yW(i,async e=>{a.set(e,await FFe(e))}),r.forEach(e=>{e.authorAvatarURL=a.get(e.authorEmail)}),r},KJ=100,LFe=6048e5,RFe={success:`ready`,pending:`pending`,running:`pending`,created:`pending`,preparing:`pending`,manual:`pending`,scheduled:`pending`,waiting_for_resource:`pending`,failed:`error`,canceled:`error`},zFe={success:`ready`,created:`pending`,running:`pending`,blocked:`pending`,failed:`error`,canceled:`error`},BFe=async()=>{let{branch:e}=IJ;if(e)return(await _G(zJ(e)))?.commit?.id??void 0},VFe=async e=>{let t=new Date(Date.now()-LFe).toISOString();[...await _G(`/projects/${RJ()}/deployments?order_by=updated_at&sort=desc&per_page=${KJ}&updated_after=${encodeURIComponent(t)}`)??[]].reverse().forEach(({sha:t,status:n,environment:r})=>{let i=zFe[n],a=r?.external_url??void 0;i&&t&&e[t]?.push({name:r?.name??``,url:a,state:i,source:`deployment`})})},HFe=async({sha:e},t)=>{(await _G(`/projects/${RJ()}/repository/commits/${encodeURIComponent(e)}/statuses?per_page=${KJ}`)??[]).forEach(({name:n,status:r,target_url:i,description:a})=>{let o=RFe[r];o&&t[e].push({name:n??``,url:i??void 0,state:o,description:a??void 0,source:`status`})})},UFe=async(e,t)=>{await Promise.all([SK(()=>VFe(t)),yW(e,e=>SK(()=>HFe({sha:e,branch:``,kind:`preview`},t)))])},WFe=async e=>CK(e,{collect:UFe,selfURL:IJ.repoURL}),GFe=({scoped:e})=>`
query($fullPath: ID!, $branch: String!, $cursor: String!${e?`, $path: String!`:``}) {
project(fullPath: $fullPath) {
repository {
tree(ref: $branch, ${e?`path: $path, `:``}recursive: true) {
blobs(after: $cursor) {
nodes {
type
path
sha
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
}
}
`,KFe=`
query($fullPath: ID!, $ref: String!, $path: String!, $cursor: String!) {
project(fullPath: $fullPath) {
repository {
tree(ref: $ref, path: $path) {
trees(after: $cursor) {
nodes {
name
sha
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
}
}
`,qFe=async(e,t)=>{let{dirname:n=``,basename:r}=Uk(t),i=``;for(;;){let{nodes:t=[],pageInfo:a}=(await vG(KFe,{ref:e,path:n,cursor:i})).project?.repository?.tree?.trees??{},o=t.find(({name:e})=>e===r)?.sha;if(o||!a?.hasNextPage)return o;i=a.endCursor}},JFe=`
query($fullPath: ID!, $branch: String!, $paths: [String!]!) {
project(fullPath: $fullPath) {
repository {
blobs(ref: $branch, paths: $paths) {
nodes {
path
rawTextBlob
}
}
}
}
}
`,qJ=async(e,t,n={})=>{let r;try{r=await vG(t,{...n,paths:e})}catch(r){if(e.length===1)throw r;let i=Math.ceil(e.length/2),a=await qJ(e.slice(0,i),t,n),o=await qJ(e.slice(i),t,n);return[...a,...o]}return r.project.repository.blobs.nodes},JJ=async(e,t,n={})=>{if(!e.length)return[];let{isSelfHosted:r=!1}=IJ,i=r?20:100,a=r?2:4;return(await bW(aJ(e,i),e=>qJ(e,t,n),{concurrency:a})).flat()},YJ=async({ref:e,path:t})=>{let n=GFe({scoped:!!t}),r=[],i=``;for(;;){let{nodes:a,pageInfo:{endCursor:o,hasNextPage:s}}=(await vG(n,{cursor:i,...e&&{branch:e},...t&&{path:t}})).project.repository.tree?.blobs??{nodes:[],pageInfo:{endCursor:``,hasNextPage:!1}};if(r.push(...a),i=o,!s)break}return r},YFe=async e=>{let t=AU(),n=aAe();if(n){let{dirs:t,files:r}=n,[i,a]=await Promise.all([bW(t,t=>YJ({ref:e,path:jU(t)})),JJ(r.map(e=>jU(e)),`
query($fullPath: ID!, $branch: String!, $paths: [String!]!) {
project(fullPath: $fullPath) {
repository {
blobs(ref: $branch, paths: $paths) {
nodes {
path
oid
}
}
}
}
}
`,e?{branch:e}:{})]),o=[...i.flat(),...a.map(({path:e,oid:t})=>({type:`blob`,path:e,sha:t}))];if(o.length)return MK(o)}return MK(await YJ({ref:e,path:t}))},XFe=async(e,t,n={})=>{let r=await JJ(e,t,n);return Object.fromEntries(r.map(e=>[e.path,e]))},ZFe=({fetchingFiles:e,blobs:t})=>Object.fromEntries(e.map(({path:e,sha:n})=>[e,{sha:n,size:0,text:t[e]?.rawTextBlob??void 0,meta:{}}])),QFe=async(e,t)=>{let n=hJ(e.length),r=e.filter(({type:e})=>e!==`asset`).map(({path:e})=>e),i;try{i=await XFe(r,JFe,t?{branch:t}:{})}finally{n()}return ZFe({fetchingFiles:e,blobs:i})},$Fe=async({lastCommit:e}={})=>{await qK({isOpenAuthoringConfigured:xFe,initOpenAuthoring:MFe,repository:IJ,checkAccess:gFe,checkBranchAccess:_Fe,fetchDefaultBranchName:yFe,fetchLastCommit:WJ,lastCommit:e,fetchFileList:YFe,fetchFileContents:QFe})},eIe=async e=>{let{branch:t=``}=IJ,{path:n,workflow:r}=e,i=r?.branch??t;return _G(`/projects/${RJ(r?UJ():void 0)}/repository/files/${encodeURIComponent(n)}/raw?lfs=true&ref=${encodeURIComponent(i)}`,{responseType:`blob`})},tIe=`https://status-api.hostedstatus.com/1.0/status/5b36dc6502d06804c08349f7`,nIe=async()=>{try{let{result:{status_overall:{status_code:e}}}=await rG(tIe);if(e===100)return`none`;if([200,300,400].includes(e))return`minor`;if([500,600].includes(e))return`major`}catch{}return`unknown`},XJ={mergeRequests:100,files:100,branches:100,authoredMergeRequests:100},ZJ=ZK({regex:/^\s*(?:\[draft\]|\(draft\)|draft:)\s*/i,prefix:`Draft: `}),rIe=e=>typeof e.user?.can_merge==`boolean`?e.user.can_merge:void 0,QJ=(e,t)=>{let{name:n,username:r,id:i}=e.author??{};return{number:e.iid,nodeId:String(e.id),title:ZJ.strip(e.title),url:e.web_url,branch:e.source_branch,headSHA:e.sha,status:t,createdDate:new Date(e.created_at),updatedDate:new Date(e.updated_at),author:r?{name:n??r,email:``,id:i,login:r}:void 0,files:[],canMerge:rIe(e)}},iIe=e=>{if(e.source_project_id!==e.target_project_id||e.target_branch!==IJ.branch)return;let t=bq(e.labels??[]);if(t)return QJ(e,t)},$J=e=>({path:e.deleted_file?e.old_path:e.new_path,sha:``,size:0,deleted:!!e.deleted_file,previousPath:e.renamed_file?e.old_path:void 0}),eY=async e=>(await DK(zJ(e,UJ())))?.commit?.id,aIe=async e=>{let{number:t,branch:n,headSHA:r}=e,i=`/projects/${RJ()}`,[a,o]=await Promise.all([eY(n),_G(`${i}/merge_requests/${t}/diffs?per_page=${XJ.files}`)]);if(!a||a===r){e.files=o.map($J);return}let{diffs:s=[]}=await _G(`${i}/repository/compare?from=${encodeURIComponent(IJ.branch)}&to=${encodeURIComponent(a)}&straight=false`);Object.assign(e,{headSHA:a,files:s.map($J)})},oIe=`
query($fullPath: ID!, $branch: String!, $paths: [String!]!) {
project(fullPath: $fullPath) {
repository {
blobs(ref: $branch, paths: $paths) {
nodes {
path
oid
size
rawTextBlob
}
}
}
}
}
`,sIe=`
query($fullPath: ID!, $iids: [String!]) {
project(fullPath: $fullPath) {
mergeRequests(iids: $iids, first: 100) {
nodes {
iid
userPermissions {
canMerge
}
}
}
}
}
`,cIe=async e=>{let t=new Map(e.map(e=>[String(e.number),e]));await yW(aJ([...t.keys()],XJ.mergeRequests),async e=>{try{(await vG(sIe,{iids:e})).project?.mergeRequests?.nodes.forEach(({iid:e,userPermissions:n})=>{let r=t.get(String(e));r&&typeof n?.canMerge==`boolean`&&(r.canMerge=n.canMerge)})}catch{}})},tY=async e=>{let t=e.files.filter(({deleted:e})=>!e);if(!t.length)return;let{owner:n,repo:r}=UJ(),i=await JJ(t.map(({path:e})=>e),oIe,{fullPath:`${n}/${r}`,branch:e.headSHA??e.branch}),a=new Map(i.map(e=>[e.path,e]));t.forEach(e=>{let t=a.get(e.path);t?Object.assign(e,{sha:t.oid,size:Number(t.size)||0,text:t.rawTextBlob??void 0}):e.deleted=!0})},lIe=async()=>{let e=new Map;await yW(vq(),async t=>{(await _G(`/projects/${RJ()}/merge_requests?state=opened&order_by=updated_at&per_page=${XJ.mergeRequests}&labels=${encodeURIComponent(t)}`)).forEach(t=>{let n=iIe(t);n&&e.set(t.iid,n)})});let t=[...e.values()].sort((e,t)=>t.updatedDate.getTime()-e.updatedDate.getTime());return await Promise.all([cIe(t),yW(t,async e=>{await aIe(e),await tY(e)})]),t},nY=async e=>{await $K({branch:e,path:zJ(e,UJ()),goneStatuses:[404]})},rY=async({branch:e,title:t,status:n})=>{let r=n===`draft`,i=QV.current;return{...QJ(await _G(`/projects/${RJ(i)}/merge_requests`,{method:`POST`,body:{title:ZJ.format(t,r),source_branch:e,target_branch:IJ.branch,description:`Automatically generated by Sveltia CMS`,remove_source_branch:!0,...i?{target_project_id:HJ.base,allow_collaboration:!0}:{labels:_q(n)}}}),n),title:t,branch:e}},uIe=async e=>(await _G(`/projects/${RJ()}/merge_requests?state=opened&source_branch=${encodeURIComponent(e)}&per_page=${XJ.mergeRequests}`)).filter(({source_project_id:e,target_project_id:t})=>e===t),iY=async e=>await _G(`/projects/${RJ()}/merge_requests/${e.number}`),dIe=async()=>{let e=Rq(),t=await _G(`/projects/${RJ(UJ())}/repository/branches?search=${encodeURIComponent(`^${e}`)}&per_page=${XJ.branches}`);return t.length===XJ.branches&&console.warn(`Only the first ${XJ.branches} Editorial Workflow branches in the fork are listed. Publish or discard some entries to see the rest.`),t},aY=e=>e.source_project_id===HJ.fork&&e.target_branch===IJ.branch,oY=e=>aY(e)&&OW.account?.id!==void 0&&e.author?.id===OW.account.id,fIe=async e=>{let t=new Map;if(!e.length)return t;let n=new Set(e);return(await _G(`/projects/${RJ()}/merge_requests?state=all&order_by=created_at&sort=desc&author_id=${OW.account?.id}&per_page=${XJ.authoredMergeRequests}`)).forEach(e=>{oY(e)&&n.has(e.source_branch)&&!t.has(e.source_branch)&&t.set(e.source_branch,e)}),t},pIe=(e,t)=>{let{name:n,commit:r}=e,{id:i,message:a,committed_date:o,author_name:s,author_email:c}=r??{},l=t?.state===`merged`?void 0:t,u=l?.state===`opened`&&!l.draft,{name:d,username:f,id:p}=l?.author??{},m=f?{name:d??f,email:``,id:p,login:f}:s&&{name:s,email:c??``};return{number:l?.iid,nodeId:l?String(l.id):void 0,title:l?ZJ.strip(l.title):a??``,url:l?.web_url,branch:n,headSHA:i,status:u?`pending_review`:`draft`,createdDate:new Date(l?.created_at??o),updatedDate:new Date(l?.updated_at??o),author:m||void 0,files:[],canMerge:!1}},mIe=async e=>{let{branch:t=``}=IJ,{diffs:n=[]}=await _G(`/projects/${RJ(UJ())}/repository/compare?from=${encodeURIComponent(t)}&to=${encodeURIComponent(e.branch)}&from_project_id=${HJ.base}`);e.files=n.map($J)},hIe=async()=>{let e=await dIe(),t=await fIe(e.map(({name:e})=>e)),n=await uK(e,e=>{let n=t.get(e.name);return n?.state===`merged`&&n.sha===e.commit?.id?{leftover:e.name}:{pending:pIe(e,n)}},nY);await yW(n,mIe);let r=n.filter(({files:e})=>e.length);return await yW(r,tY),r},sY=({status:e,title:t,state:n,draft:r})=>e===`draft`?n===`opened`&&!r?{title:ZJ.format(t,!0)}:{}:{...n===`closed`?{state_event:`reopen`}:{},...r?{title:t}:{}},cY=async(e,t)=>{Object.keys(t).length&&await _G(`/projects/${RJ()}/merge_requests/${e}`,{method:`PUT`,body:t})},gIe=409,_Ie=async e=>(await _G(`/projects/${RJ()}/merge_requests?state=opened&source_branch=${encodeURIComponent(e)}&per_page=${XJ.mergeRequests}`)).find(aY),vIe=async({branch:e,title:t,status:n})=>{try{return await rY({branch:e,title:t,status:n})}catch(r){if(r.cause?.status!==gIe)throw r;let i=await _Ie(e);if(!i)throw r;if(!oY(i))throw SW(`The workflow branch is in use by another merge request.`,`workflow.branch_in_use`,{number:`!${i.iid}`});return await cY(i.iid,sY({status:n,title:t,state:i.state,draft:i.draft})),{...QJ(i,n),title:t,branch:e}}},yIe=async e=>{let t=await iY(e);return{merged:t.state===`merged`,isEntryRequest:oY(t),getMergedSHA:async()=>t.sha,state:t.state,draft:t.draft}},bIe=async({pullRequest:{number:e,title:t},status:n,state:r,draft:i})=>{await cY(e,sY({status:n,title:t,state:r,draft:i}))},xIe=async(e,t)=>dK({pullRequest:e,status:t,requestKey:`number`,createRequest:vIe,fetchRequest:yIe,applyStatus:bIe,fetchBranchHead:eY,deleteBranch:nY}),lY=[`preparing`,`unchecked`,`checking`,`approvals_syncing`],SIe=QG,CIe=[...lY,`ci_still_running`,`mergeable`],wIe=QG,TIe=async()=>$V.current?hIe():lIe(),EIe=async(e,t)=>{let{branch:n=``}=t,r=IJ.branch;return nq({branch:n,branchExistsStatus:400,commitFromStart:()=>GJ(e,{...t,startBranch:r}),commitOnBranch:()=>GJ(e,t),findOpenPullRequest:async()=>{let[e]=await uIe(n);return e?`!${e.iid}`:void 0},inUseMessage:`The workflow branch is in use by another merge request.`,deleteBranch:nY})},DIe=async(e,t,n)=>{let{branch:r=``}=t,i=await rq({branch:r,headSHA:n.headSHA,fetchBranchHead:eY,getWorkflowRepository:UJ});try{return await GJ(e,{...t,headOid:i})}catch(e){throw e.cause?.status===400&&await LW(i,async()=>({hash:await eY(r)})),e}},OIe=async(e,t)=>{if($V.current)return xIe(e,t);let n=_q(t),r=t===`draft`,i=ZJ.format(e.title,r);return await _G(`/projects/${RJ()}/merge_requests/${e.number}`,{method:`PUT`,body:{title:i,add_labels:n,remove_labels:vq().filter(e=>e!==n).join(`,`)}}),{...e,status:t,updatedDate:new Date}},uY=e=>`/projects/${RJ()}/merge_requests/${e.number}`,dY=async e=>{let{user_has_approved:t,user_can_approve:n}=await _G(`${e}/approvals`);return{hasApproved:t,canApprove:n}},kIe=async e=>{let t=uY(e),{hasApproved:n,canApprove:r}=await dY(t);n||r===!1||await _G(`${t}/approve`,{method:`POST`,body:{sha:e.headSHA}})},AIe=async e=>{let t=uY(e);(await dY(t)).hasApproved&&await _G(`${t}/unapprove`,{method:`POST`})},jIe=async e=>tq(e,{commitToNewBranch:EIe,commitToExistingBranch:DIe,createPullRequest:rY}),MIe=e=>$G(async()=>{let{state:t,detailed_merge_status:n}=await iY(e);return{state:t,status:n}},({status:e})=>!lY.includes(e),SIe),fY=async e=>{try{await _G(`/projects/${RJ()}/merge_requests/${e.number}/cancel_merge_when_pipeline_succeeds`,{method:`POST`})}catch(t){console.warn(`Failed to cancel the auto-merge on merge request !${e.number}.`,t)}},NIe=e=>uq({read:()=>iY(e),evaluate:async t=>{if(!t)return!1;let{state:n,merge_when_pipeline_succeeds:r,detailed_merge_status:i}=t;if(n===`merged`)return!0;if(!(n===`locked`||n===`opened`&&r&&CIe.includes(i)))throw n===`opened`&&r&&await fY(e),Error(`Merge request !${e.number} was not merged: ${n}, ${i}, auto-merge ${r?`on`:`off`}`);return!1},cancel:()=>fY(e),label:`merge request !${e.number}`}),PIe=1e3,FIe=e=>e.new_file?`added`:e.deleted_file?`removed`:e.renamed_file?`renamed`:`modified`,IIe=e=>$G(async()=>{let t=await iY(e),{sha:n,target_branch:r,source_project_id:i,target_project_id:a}=t;return!n||r!==IJ.branch||i!==a?{item:t,branchHead:void 0}:{item:t,branchHead:await eY(e.branch)??n}},({item:t,branchHead:n})=>n===void 0||n===t.sha||n!==e.headSHA,wIe),LIe={isGit:!0,name:`gitlab`,label:`GitLab`,repository:IJ,statusDashboardURL:`https://status.gitlab.com/`,checkStatus:nIe,init:()=>{let{backend:e}=Sk.current??{};if(e?.name!==`gitlab`)return;let{repo:t,branch:n,auth_type:r=``,base_url:i=r===`pkce`?`https://gitlab.com`:`https://api.netlify.com`,auth_endpoint:a=r===`pkce`?`oauth/authorize`:`auth`,app_id:o=``,api_root:s=`https://gitlab.com/api/v4`,graphql_api_root:c=s.replace(/\/api\/.+$/,`/api/graphql`),include_credentials:l=!1}=e,{owner:u,repo:d}=LJ(t),f=`${u}/${d}`;return Hq(IJ,{service:`gitlab`,label:`GitLab`,owner:u,repo:d,branch:n,restApiRoot:s,defaultApiRoot:`https://gitlab.com/api/v4`,getTokenPageURL:fFe,getBaseURLs:BJ,authRoot:i,authPath:a,tokenPath:`/token`,api:{clientId:o,authScope:`api`,authScheme:`Bearer`,restBaseURL:CE(s),graphqlBaseURL:CE(c),includeCredentials:l}}),Object.assign(fG,{fullPath:f,branch:n}),IJ},signIn:pFe,signOut:PG,fetchFiles:$Fe,fetchLastCommit:WJ,fetchBlob:eIe,fetchDirSHA:qFe,commitChanges:GJ,fetchFileCommits:IFe,fetchBranchHeadSHA:BFe,fetchDeployments:WFe,workflow:{fetchPullRequests:TIe,savePullRequest:jIe,updateStatus:OIe,approve:kIe,withdrawApproval:AIe,fetchBranchHead:eY,fetchMergeState:async e=>{let{item:t,branchHead:n}=await IIe(e);if(!n)return{headSHA:t.sha,onConfiguredBranches:!1,files:[],complete:!1};let r=sq(e,n);if(r)return r;let{diffs:i=[]}=await _G(`/projects/${RJ()}/repository/compare?from=${encodeURIComponent(IJ.branch)}&to=${encodeURIComponent(n)}&straight=false`),a=t.sha===n?t.changes_count:void 0,o=a==null?void 0:`${a}`,s=o===void 0?i.length<PIe:!o.endsWith(`+`)&&i.length>=Number(o);return{headSHA:n,onConfiguredBranches:!0,files:i.map(e=>({path:e.new_path,status:FIe(e),previousPath:e.renamed_file?e.old_path:void 0,mode:e.deleted_file?void 0:e.b_mode})),complete:s}},fetchUnchangedPaths:async({headSHA:e,paths:t})=>{let[n,r]=await Promise.all([IJ.branch,e].map(async e=>{let n=await JJ(t,`
query($fullPath: ID!, $branch: String!, $paths: [String!]!) {
project(fullPath: $fullPath) {
repository {
blobs(ref: $branch, paths: $paths) {
nodes {
path
oid
}
}
}
}
}
`,{branch:e});return new Map(n.map(({path:e,oid:t})=>[e,t]))}));return t.filter(e=>n.get(e)===r.get(e))},publish:async e=>{cK();let t=QK(),n=`/projects/${RJ()}/merge_requests/${e.number}/merge`,r={squash:t,should_remove_source_branch:!0,...e.headSHA?{sha:e.headSHA}:{},...t?{squash_commit_message:e.title}:{merge_commit_message:e.title}};try{await _G(n,{method:`PUT`,body:r})}catch(t){if(t.cause?.status!==405)throw t;let{state:i,status:a}=await MIe(e);if(i===`merged`){await nY(e.branch);return}if(a===`mergeable`){await _G(n,{method:`PUT`,body:r}),await nY(e.branch);return}if(a!==`ci_still_running`)throw t;await _G(n,{method:`PUT`,body:{...r,auto_merge:!0,merge_when_pipeline_succeeds:!0}}),await NIe(e);return}await nY(e.branch)},discard:async e=>{e.number!==void 0&&await _G(`/projects/${RJ()}/merge_requests/${e.number}`,{method:`PUT`,body:{state_event:`close`}}),await nY(e.branch)}}},pY={github:zK(uFe),gitlab:zK(LIe),gitea:zK(oNe)},mY=`local`,RIe=`Local Repository`,hY=void 0,zIe={service:``,label:``,owner:``,repo:``,branch:``},gY=new Proxy({},{get:(e,t)=>(hY??zIe)[t]}),_Y=`root_dir_handle`,vY=void 0,yY=void 0,bY=void 0,xY=void 0,BIe=async({forceReload:e=!1,showPicker:t=!0}={})=>{if(!(`showDirectoryPicker`in window))throw Error(`unsupported`);let n=e?null:await vY?.get(_Y)??null;if(n){if(await n.requestPermission({mode:`readwrite`})!==`granted`)n=null;else try{await n.entries().next()}catch(e){n=null,console.error(e)}}if(!n&&t&&(n=await window.showDirectoryPicker(),n)){try{await n.getDirectoryHandle(`.git`)}catch(e){if(IU(e))await n.getFileHandle(`.git`);else throw e}await vY?.set(_Y,n)}return n},VIe=()=>{let{name:e}=Sk.current.backend;return hY=pY[e]?.init?.(),vY=Vz(hY,`file-system-handles`)??null,yY=Vz(hY,`asset-hashes`)??null,gY},HIe=async({auto:e=!1})=>{let t=await BIe({showPicker:!e});if(!t)throw Error(`Directory handle could not be acquired`);try{xY=await GU(t),bY=t}catch{throw SW(`Failed to open the root directory.`,`root_dir_not_found`,{repo:`${gY.owner}/${gY.repo}`,dir:AU()})}return{backendName:mY}},UIe=async()=>{try{await vY?.delete(_Y)}catch{}hW()},WIe=async()=>{await eG(xY,{hashCacheDB:yY})},GIe=async(e,t)=>{let n=()=>uG(xY,e);return IG.localGitCommits&&bY?rAe({repoRootDirHandle:bY,changes:e,options:t,save:n}):(hW(),n())},KIe=async()=>bY?nAe(bY):void 0,qIe={isGit:!1,name:mY,label:RIe,repository:gY,init:VIe,signIn:HIe,signOut:UIe,fetchFiles:WIe,fetchBlob:async({path:e})=>{if(!xY)throw Error(`Root directory handle is not available`);return UU(xY,e)},commitChanges:GIe},JIe=`link[rel="cms-seed-url"]`,YIe=6,SY=()=>document.querySelector(JIe)?.href||void 0,CY=e=>e===`test-repo`&&!!SY(),XIe=e=>typeof e==`string`&&e.split(`/`).every(e=>!!e&&e!==`.`&&e!==`..`),ZIe=async e=>{let t=await fetch(e);if(!t.ok)throw Error(`Failed to fetch the seed manifest: ${t.status}`);let{files:n}=await t.json();if(!Array.isArray(n))throw Error("The seed manifest must have a `files` array");return[...new Set(n)].filter(e=>XIe(e)?!0:(console.warn(`Skipping an invalid path in the seed manifest: ${JSON.stringify(e)}`),!1))},QIe=async(e,t)=>{let n=new URL(t.split(`/`).map(encodeURIComponent).join(`/`),e);try{let e=await fetch(n);if(!e.ok)throw Error(`HTTP ${e.status}`);return await e.blob()}catch(e){console.warn(`Failed to seed ${t}:`,e);return}},$Ie=async(e,t,n)=>{try{await sG(await VU(e,t),n)}catch(e){console.warn(`Failed to seed ${t}:`,e)}},eLe=async(e,t)=>{let n=SY();if(n){try{await e.getDirectoryHandle(t);return}catch{}try{let r=await ZIe(n),i=await bW(r,e=>QIe(n,e),{concurrency:YIe});if(!i.some(Boolean))return;let a=await e.getDirectoryHandle(t,{create:!0});await Promise.all(r.map((e,t)=>{let n=i[t];return n?$Ie(a,e,n):void 0}))}catch(e){console.warn(`Failed to seed the test repository:`,e)}}},wY=e=>e?.name===`test-repo`?`test-repo:sveltia-cms-test`:e?.repository?.databaseName,tLe=`Test`,TY=void 0,nLe={isGit:!1,name:`test-repo`,label:tLe,init:()=>void 0,signIn:async()=>{try{let e=await navigator.storage.getDirectory();await eLe(e,`sveltia-cms-test`),TY=await GU(await HU(e,`sveltia-cms-test`),{create:!0})}catch{}return{backendName:`test-repo`}},signOut:async()=>{},fetchFiles:async()=>{TY?await eG(TY):hj.current=!0},fetchBlob:async({path:e})=>{if(!TY)throw Error(`Root directory handle is not available`);return UU(TY,e)},commitChanges:async e=>uG(TY,e)},EY={...pY,local:qIe,"test-repo":nLe},rLe={azure:{label:`Azure DevOps`},bitbucket:{label:`Bitbucket`},"git-gateway":{label:`Git Gateway`,deprecated:!0}},iLe=Object.keys(EY).filter(e=>e!==`local`),DY=pk(),OY=hk(()=>DY.current?EY[DY.current]:void 0),kY=e=>{let t=e?EY[e]:void 0;return t&&t!==OY.current&&t.init(),DY.current=e,t},AY=e=>Gq({cmsConfig:Sk.current,collection:e}),jY=e=>$V.current?fq:AY(e).stages,MY=(e,t)=>{if(e===`pending_deletion`)return e;let n=dq.indexOf(e);return t.findLast(e=>dq.indexOf(e)<=n)??`draft`},NY=(e,t)=>MY(e.workflow.status,jY(t)),PY=e=>jY(fj(e.workflow.collectionName)),FY=e=>NY(e,fj(e.workflow.collectionName)),IY=(e,t)=>PY(e).includes(t),aLe=(e,t)=>{let n=jY(t),r=MY(e.workflow.status,n);return r===`pending_deletion`?void 0:n[n.indexOf(r)+1]},oLe=(e,t)=>{let n=jY(t);return MY(e.workflow.status,n)===n.at(-1)},LY=hk(()=>{if($V.current)return fq;let e=Sk.current,t=new Set([`draft`]);return Jq(e).forEach(n=>{let r=Gq({cmsConfig:e,collection:n});qq(r.type)&&r.stages.forEach(e=>t.add(e))}),dq.filter(e=>t.has(e))}),RY=hk(()=>LY.current.length===1?`drafts`:`editorial_workflow`),zY=hk(()=>Yq(Sk.current)&&!!OY.current?.workflow),BY=e=>!!OY.current?.workflow&&($V.current||qq(Kq({cmsConfig:Sk.current,collection:e}))),VY=pk([]),HY=pk(!1),UY=pk(!1),WY=pk([]),GY=hk(()=>!zY.current||UY.current),KY=e=>e?VY.current.filter(({workflow:t})=>t.collectionName===e):[],qY=(e,t=VY.current)=>t.flatMap(({workflow:t})=>(t.companions??[]).flatMap(t=>t.collectionName===e?[t.entry]:[])),JY=({collectionName:e,subPath:t})=>VY.current.find(n=>n.workflow.collectionName===e&&(n.workflow.fileName===void 0?n.subPath===t:n.workflow.fileName===t)),YY=({collectionName:e,slug:t,entry:n})=>{if(!n)return;let r=new Set($P(n));return VY.current.find(n=>RMe({branch:n.workflow.pullRequest.branch,collectionName:e,slug:t})&&$P(n,{includePrevious:!0}).some(e=>r.has(e)))},XY=e=>e?VY.current.find(t=>t.id===e):void 0,ZY=e=>VY.current.find(({workflow:t})=>t.pullRequest.branch===e),QY=({collectionName:e,fileName:t,originalEntry:n})=>{if(!n)return;let r=n.workflow?.pullRequest?.branch;return(r?ZY(r):void 0)??YY({collectionName:e,slug:t??n.slug,entry:n})},$Y=({collection:e,collectionName:t,fileName:n,originalEntry:r})=>BY(e)||!!QY({collectionName:t,fileName:n,originalEntry:r}),eX=e=>e?.workflow?.status===`pending_deletion`,tX=e=>e.canMerge!==!1&&!XV.current,nX=e=>!$V.current&&e?.publish!==!1,rX=(e,t)=>nX(t)&&tX(e.workflow.pullRequest)&&(eX(e)||oLe(e,t)||AY(t).directPublish),sLe=(e,t)=>!!e&&nX(e)&&AY(e).directPublish&&(t?tX(t.workflow.pullRequest):!YV.current),iX=(e,t)=>{if(!t.length)return e;let n=new Map;return t.forEach(e=>{$P(e,{includePrevious:!0}).forEach(t=>n.set(t,e))}),e.map(e=>Object.values(e.locales).map(({path:e})=>n.get(e)).find(Boolean)??e)},aX=(e,t)=>{let n=iX(e,t),r=new Set(n),i=t.filter(e=>!r.has(e));return i.length?[...n,...i]:n},oX=e=>{let{workflow:t}=e;return t?yj(new Set($P(e,{includePrevious:!0}))):void 0},cLe=e=>e.workflow.fileName?!0:!!oX(e),sX=e=>e?(vj.current,cLe(e)):!1,lLe=(e,t,n)=>{let r=[...iz(e),...KY(e)].map(e=>t?e.locales[t]?.slug:e.slug).filter(Boolean);if(n===void 0)return r;let i=n?`${n}/`:``;return r.filter(e=>e.startsWith(i)&&!e.slice(i.length).includes(`/`)).map(e=>e.slice(i.length))},cX=(e,t)=>{let{collection:n,content:r,currentSlug:i,locale:a,dateTimeParts:o,isIndexFile:s=!1,dirPath:c}=t,{_type:l,name:u}=n,d=dz(l===`entry`?n:void 0),{slug_length:f=void 0,_file:{basePath:p,fullPathRegEx:m}={}}=l===`entry`?n:{},h=Sk.current?.slug,g=f??h?.maxlength,_=h?.timezone===`local`?void 0:`UTC`,v={replaceSubContext:{...t,dateTimeParts:o??_z({timeZone:_}),identifierField:d,basePath:p,fullPathRegEx:m},getFieldArgs:{collectionName:u,keyPath:``,valueMap:r,isIndexFile:s}},y=mN(e,(e,t)=>DU(t,v)).trim();if(i)return y;if(typeof g==`number`){let{sanitize_replacement:e=`-`,trim:t=!0}=h??{},n=SE(y,g,{ellipsis:``});y=n!==y&&e&&t?n.replace(RegExp(`(?:${xE(e)})+$`),``):n}return BP(y,lLe(u,a,c))},lX=RA(()=>pH.current,e=>new Map(e.map(e=>[e.path,e]))),uX=e=>lX().get(e),dX=({unsaved:e,blobURL:t,path:n})=>e&&t?t:n,fX=(e,{collection:t,entry:n,localeFile:r})=>cX(e,{type:`media_folder`,collection:t,content:r.content,currentSlug:n.slug,entryFilePath:r.path,isIndexFile:aA(t,n)}),pX=({internalPath:e,collectionName:t,entry:n,locale:r})=>{if(!gN(e))return e;let i=t?fj(t):n?AP(n)[0]:void 0;return!n||!i?void 0:fX(e,{collection:i,entry:n,localeFile:ZP(n,{locale:r,defaultLocale:i._i18n.defaultLocale})})},uLe=({path:e,entry:t,collection:n,file:r,componentName:i,typedKeyPath:a,locale:o})=>{let{_i18n:{defaultLocale:s}}=r??n,c=a?cH({collectionName:n.name,fileName:r?.name,componentName:i,typedKeyPath:a}):void 0,l=r?.media_folder===void 0?n:r,u=c?c.entryRelative?c.internalSubPath??``:`/${c.internalPath}`:l.media_folder,d=c?.publicPath===void 0?l.public_folder:c.publicPath,f=ZP(t,{locale:o,defaultLocale:s}),{path:p,content:m}=f;if(!p||!m)return;u&&gN(u)&&(u=fX(u,{collection:n,entry:t,localeFile:f})),d&&gN(d)&&(d=fX(d,{collection:n,entry:t,localeFile:f}));let h=WP(p),g=e.replace(/^\.\//,``),_=u?.replace(/^\.\//,``).replace(/\/$/,``),v=GP(g,_),y;if(u?.startsWith(`/`)&&d!==void 0){let e=d.replace(/^\.\//,``);g.startsWith(`${e}/`)&&(v=g.slice(e.length+1)),y=KP(UP([u.slice(1),v]))}else y=KP(UP([h,u,v]));return lX().get(y)},mX=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,requireCollectionName:i=!1,skipTemplateFolders:a=!1})=>{let o=!i||!!e;return[n?cH({componentName:n,typedKeyPath:r}):void 0,o&&r?cH({collectionName:e,fileName:t,typedKeyPath:r}):void 0,o?cH({collectionName:e,fileName:t}):void 0,o?cH({collectionName:e}):void 0,aH.current].filter(e=>!!e&&!(a&&e.hasTemplateTags))},dLe=({path:e,entry:t,collectionName:n,fileName:r,componentName:i,typedKeyPath:a,locale:o})=>t?AP(t).values().flatMap(n=>{let r=wj(n,t),s={path:e,entry:t,collection:n,componentName:i,typedKeyPath:a,locale:o};return(r.length?r:[void 0]).values().map(e=>uLe({...s,file:e}))}).find(Boolean)??lX().get(e):mX({collectionName:n,fileName:r,componentName:i,typedKeyPath:a,requireCollectionName:!0,skipTemplateFolders:!0}).values().map(t=>{let n=GP(e,t.publicPath?.replace(/^\//,``));return lX().get(UP([t.internalPath,t.internalSubPath??``,n]))}).find(Boolean)??lX().get(e),fLe=new WeakMap,hX=e=>PA(fLe,e,()=>{let t=e.publicPath??``,n=xE(t).replace(Jk,`.+?`);return RegExp(`^${n}${t?`(?=\\/|$)`:`$`}`)}),gX=e=>!/^[/@]/.test(e),pLe=({path:e,entry:t,collectionName:n,fileName:r,componentName:i,typedKeyPath:a,locale:o})=>{let s=lX().get(CE(e));if(s)return s;let{dirname:c=``,basename:l}=Uk(e),u=e=>{let{publicPath:n,collectionName:r}=e,{internalPath:i}=e;if(!(i!==void 0&&(i=pX({internalPath:i,collectionName:r,entry:t,locale:o}),i===void 0))){if(n&&c){if(n===`/`||c.startsWith(`${n}/`))i&&=n===`/`?`${i}${c}`:c.replace(n,i);else if(!gX(n)&&!hX(e).test(c))return}return lX().get(UP([i,l]))}},d=mX({collectionName:n,fileName:r,componentName:i,typedKeyPath:a}),f;if(d.some(e=>(f=u(e),!!f)),f)return f;let p=iH.current.findLast(e=>hX(e).test(c));return p?u(p):void 0},_X=({value:e,...t})=>{let n=e=>{let n=NP(e);return gX(n)?dLe({path:n,...t}):pLe({path:n,...t})},[r]=e.split(`#`);return n(e)??(r===e?void 0:n(r))},vX=({folder:e},t)=>e===t?!0:t.entryRelative?e.collectionName===t.collectionName&&e.fileName===t.fileName&&e.typedKeyPath===t.typedKeyPath&&e.isIndexFile===t.isIndexFile&&e.internalPath===t.internalPath&&e.internalSubPath===t.internalSubPath&&e.publicPath===t.publicPath&&e.entryRelative===t.entryRelative&&e.hasTemplateTags===t.hasTemplateTags:!e.entryRelative&&e.internalPath===t.internalPath,mLe=e=>pH.current.filter(t=>vX(t,e)),yX=e=>pH.current.filter(t=>WP(t.path)===e);_k(()=>{oH.current,$H.current,gH.current=void 0,eU.current=void 0});var bX=(e,t)=>{if(!t.length||!e.length)return[];let n=new Set(t.map(({name:e})=>e.normalize().toLowerCase()));return e.filter(e=>n.has(e.name.normalize().toLowerCase()))},xX=(e,{field:t,pattern:n}={field:``,pattern:``})=>{if(!t)return e;if(t===`fileType`)return e.filter(({path:e})=>pV(e)===n);let r=XR(n);return e.filter(e=>{let i=e[t];return Yz(i,n,r)})},hLe=(e,t)=>Jz(e,t,(e,t)=>e[t]),SX=`http://www.w3.org/2000/svg`,gLe=e=>new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`load`,()=>{t(r.result)}),r.addEventListener(`error`,()=>{n(r.error)}),r.readAsDataURL(e)}),_Le=e=>!!e?.trim()&&!e.trim().endsWith(`%`),vLe=e=>{let t=(e??``).trim().split(/[\s,]+/).map(Number);if(t.length!==4||t.some(e=>!Number.isFinite(e)))return;let[n,r,i,a]=t;return i>0&&a>0?{x:n,y:r,width:i,height:a}:void 0},yLe=async e=>{let{documentElement:t}=new DOMParser().parseFromString(await e.text(),`image/svg+xml`),n=t.namespaceURI===SX&&t.localName===`svg`,r=document.createElementNS(SX,`svg`),i=document.createElementNS(SX,`image`),a=n&&[`width`,`height`].every(e=>_Le(t.getAttribute(e)))?[`width`,`height`]:[`width`,`height`,`viewBox`,`preserveAspectRatio`];n&&a.forEach(e=>{let n=t.getAttribute(e);n!==null&&r.setAttribute(e,n)});let o=vLe(r.getAttribute(`viewBox`));return Object.entries(o??{width:`100%`,height:`100%`}).forEach(([e,t])=>{i.setAttribute(e,String(t))}),i.setAttribute(`preserveAspectRatio`,`none`),i.setAttribute(`href`,await gLe(new Blob([e],{type:`image/svg+xml`}))),r.append(i),new Blob([new XMLSerializer().serializeToString(r)],{type:`image/svg+xml`})},CX=LN(`pdfjs-dist`),bLe=`${CX}/build/pdf.worker.min.mjs`,xLe={cMapUrl:`${CX}/cmaps/`,iccUrl:`${CX}/iccs/`,standardFontDataUrl:`${CX}/standard_fonts/`,wasmUrl:`${CX}/wasm/`},SLe=e=>(e.GlobalWorkerOptions.workerSrc=bLe,{options:xLe,dispose:()=>{}}),wX,CLe=async(e,t={})=>{let{format:n,quality:r,width:i,height:a,fit:o,nativeOnly:s}=UH(t);if(!wX)try{wX=await RN(`pdfjs-dist`,`build/pdf.min.mjs`)}catch{throw Error(`Failed to load PDF.js library`)}let c=URL.createObjectURL(e),l=new OffscreenCanvas(512,512),u=l.getContext(`2d`),d,f;try{f=SLe(wX),d=wX.getDocument({disableAutoFetch:!0,...f.options,url:c});let e=await(await d.promise).getPage(1),t=e.getViewport({scale:1}),{scale:n}=WH(l,{width:t.width,height:t.height},{width:i,height:a,fit:o});await e.render({canvasContext:u,viewport:n===1?t:e.getViewport({scale:n})}).promise}catch{throw Error(`Failed to render PDF`)}finally{URL.revokeObjectURL(c);try{await d?.destroy()}catch{}f?.dispose()}return RH(l,{format:n,quality:r,nativeOnly:s})},TX=new Map,EX=new Map,wLe=/[/+]xml$/,DX=async e=>{let t=e.type.split(`;`)[0].trim().toLowerCase();return t===`image/svg+xml`?yLe(e):t===`text/html`||wLe.test(t)?new Blob([e],{type:`text/plain`}):e},OX=async e=>URL.createObjectURL(await DX(e)),kX=async(e,t)=>{if(!e.blobURL){let n=await DX(t);e.blobURL??=URL.createObjectURL(n)}return t},AX=async(e,t)=>(await kX(e,t),e.blobURL&&TX.set(e.blobURL,t),t),jX=(e,t)=>IA(EX,e,t),MX=async e=>{let{name:t}=e,n=await OY.current?.fetchBlob?.(e);if(!n)throw Error(`Failed to retrieve blob`);return new Blob([n],{type:rV.getType(t)??n.type})},TLe=async e=>AX(e,await MX(e)),NX=async(e,t=async e=>e)=>{try{return await t(await e.getFile())}catch{throw Error(`Failed to retrieve blob from file handle`)}},PX=async e=>{let{file:t,handle:n,blobURL:r,path:i}=e;return t?kX(e,t):r?TX.get(r)??jX(r,()=>fetch(r).then(e=>e.blob())):n?NX(n,t=>AX(e,t)):jX(i,()=>TLe(e))},ELe=async e=>{let{file:t,handle:n,blobURL:r,path:i}=e;return t||(r?PX(e):EX.get(i)||(n?NX(n):MX(e)))},FX=async e=>(e.blobURL||await PX(e),e.blobURL),IX=void 0,LX=new Map,RX=()=>{IX===void 0&&(IX=Vz(OY.current?.repository,`asset-thumbnails`)??null)},DLe=LR(4),OLe=async e=>{let t=await IX?.get(e.sha);if(!t){let n=oV(e.name)?CLe:KH;t=await DLe(async()=>n(await ELe(e),GH)),await IX?.set(e.sha,t)}return t},kLe=async e=>{RX();let t=LX.get(e);return t?!!await t.catch(()=>void 0):!!await IX?.get(e)},zX=async(e,{cacheOnly:t=!1}={})=>{if(!sV(e))return;RX();let{sha:n}=e;if(t&&!LX.has(n)){let e=await IX?.get(n);return e?URL.createObjectURL(e):void 0}let r=await IA(LX,n,()=>OLe(e));return r?URL.createObjectURL(r):void 0},BX=new Set,VX=new Set,HX=[],UX=[],ALe=()=>{let e=new Set(BX);BX.clear(),document.querySelectorAll(`[src^="blob:"]`).forEach(t=>{e.delete(t.getAttribute(`src`))}),VX.forEach(t=>{e.delete(t)}),e.size&&(e.forEach(e=>{URL.revokeObjectURL(e),TX.delete(e)}),pH.current.forEach(t=>{t.blobURL!==void 0&&e.has(t.blobURL)&&delete t.blobURL}))},WX=e=>{if(!e?.startsWith(`blob:`))return;let t=!BX.size;BX.add(e),t&&window.requestAnimationFrame(ALe)},GX=({blobURL:e,unsaved:t})=>{t||WX(e)},jLe=({path:e,internalPath:t,publicPath:n})=>{let r=new Map,i=RP(t,e=>`${e.split(Kk).map((e,t)=>{if(t%2==0)return xE(e);let n=e.trim(),i=r.get(n);if(i)return`\\k<${i}>`;let a=`tag${r.size}`;return r.set(n,a),`(?<${a}>[^/]+?)`}).join(``)}(?=\\/|$)`);return e.replace(i,(...e)=>{let t=e.at(-1);return n.replaceAll(qk,(e,n)=>{let i=r.get(n.trim());return i?t[i]:e})})},MLe=e=>e.folder.collectionName===void 0?e.folder:lH(e.path).find(({collectionName:e})=>e!==void 0)??aH.current??e.folder,NLe=(e,t,n)=>{let r=WP(e.path),i=t?eF(t,n):void 0;if(i!==void 0){if(r===i)return e.name;let t=i?`${i}/`:``;return e.path.startsWith(t)?e.path.slice(t.length):void 0}let{internalPath:a,internalSubPath:o}=e.folder;if(e.path===UP([a,o,e.name]))return a?e.path.slice(a.length+1):e.path},KX=(e,{pathOnly:t=!1,allowSpecial:n=!1,entry:r=void 0,locale:i=void 0}={})=>{let{publicPath:a,entryRelative:o,hasTemplateTags:s}=MLe(e);if(o)return t?NLe(e,r,i):void 0;let{_baseURL:c=``,output:{encode_file_path:l=!1}={}}=Sk.current,u=e.folder.internalPath??``,d=a===`/`?``:a??``,f=s?jLe({path:e.path,internalPath:u,publicPath:d}):u?e.path.replace(u,d):`${d}/${e.path}`;if(a===``&&(f=f.replace(/^\//,``)),l&&(f=zP(f)),f.startsWith(`/`)||n)return t?f:`${c}${f}`},PLe=({folder:e,subfolderPath:t})=>{let{output:{encode_file_path:n=!1}={}}=Sk.current,r=(e.publicPath??``).replace(/\/$/,``),i=(t?`${r}/${t}`:r)||`/`;return n?zP(i):i},qX=(e,{keep:t=[]}={})=>{let n=[...e,...t],r=HX.filter(e=>!n.includes(e)),i=e.filter(e=>!UX.includes(e));HX=n,UX=e,t.forEach(e=>{e.blobURL&&VX.add(e.blobURL)}),r.forEach(e=>{e.blobURL&&VX.delete(e.blobURL),GX(e)}),i.forEach(async e=>{try{let t=await FX(e);if(!t)return;if(!HX.includes(e)){GX(e);return}if(VX.add(t),e.kind===`image`){let e=new Image;e.src=t,await e.decode()}}catch{}})},JX=class{serviceType=`cloud_storage`;showServiceLink=!0;hotlinking=!0;authType=`api_key`;constructor({serviceId:e,serviceLabel:t,serviceURL:n,developerURL:r,apiKeyURL:i,apiKeyPattern:a,resolveConfig:o=e=>e,isConfigured:s,isConfigURL:c,operations:l}){this.serviceId=e,this.serviceLabel=t,this.serviceURL=n,this.developerURL=r,this.apiKeyURL=i,this.apiKeyPattern=a,this.resolveConfig=o,this.isConfigured=s,this.isConfigURL=c,this.operations=l}getLibraryOptions(e=xk.current){return TV(this.serviceId,e)}getConfig({fieldConfig:e}){let t=DV(this.serviceId,e);if(!t)throw Error(`${this.serviceLabel} configuration is not available`);return this.resolveConfig(t)}isEnabled=e=>{let t=DV(this.serviceId,e);return!!t&&this.isConfigured(this.resolveConfig(t))};isAssetURL=e=>{try{return this.isConfigURL(this.getConfig({}),e)}catch{return!1}};list=async e=>this.operations.list(this.getConfig(e),e);browse=async e=>this.operations.browse(this.getConfig(e),e);listFolder=async(e,t)=>this.operations.listFolder(e,this.getConfig(t),t);search=async(e,t)=>this.operations.search(e,this.getConfig(t),t);upload=async(e,t)=>this.operations.upload(e,this.getConfig(t),t);delete=async(e,t)=>this.operations.delete(e,this.getConfig(t),t);rename=async(e,t,n)=>this.operations.rename(e,t,this.getConfig(n),n);replace=async(e,t,n)=>this.operations.replace(e,t,this.getConfig(n),n);move=async(e,t,n)=>this.operations.move(e,t,this.getConfig(n),n);createFolder=async(e,t)=>this.operations.createFolder(e,this.getConfig(t),t);deleteFolder=async(e,t)=>this.operations.deleteFolder(e,this.getConfig(t),t)},YX=e=>{let t=new DOMParser().parseFromString(e,`text/xml`),n=e=>{if(e.children.length===0)return e.textContent;let t={};return Array.from(e.children).forEach(e=>{let r=e.tagName,i=n(e);Object.hasOwn(t,r)?Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i}),t};return n(t.documentElement)},XX=e=>e?Array.isArray(e)?e:[e]:[],FLe=`blob.core.windows.net`,ILe=1e3,ZX=({account_name:e,container:t,endpoint:n})=>`${n?LP(n):`https://${e}.${FLe}`}/${t}`,QX=({url:e,token:t,searchParams:n})=>`${e}?${[n?.toString(),t.trim().replace(/^[?&]/,``)].filter(Boolean).join(`&`)}`,$X=(e,t,n)=>QX({url:`${ZX(e)}/${IP(t)}`,token:n}),eZ=new JX({serviceId:`azure_blob_storage`,serviceLabel:`Azure Blob Storage`,serviceURL:`https://azure.microsoft.com/products/storage/blobs/`,developerURL:`https://learn.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api`,apiKeyURL:`https://portal.azure.com/#browse/Microsoft.Storage%2FStorageAccounts`,apiKeyPattern:/^\??(?:[\w-]+=[^&]*&)*sig=[^&]+(?:&[\w-]+=[^&]*)*$/,isConfigured:({container:e,account_name:t,endpoint:n})=>!!(e&&(t||n)),isConfigURL:(e,t)=>{let{public_url:n}=e;return[`${ZX(e)}/`,...n?[`${LP(n)}/`]:[]].some(e=>t.startsWith(e))},operations:wV({requireCredential:({apiKey:e})=>{if(!e)throw Error(`Azure Blob Storage SAS token is required`);return e},listPage:async({config:e,credential:t,prefix:n,cursor:r,delimiter:i})=>{let a=new URLSearchParams({restype:`container`,comp:`list`,maxresults:String(ILe),...n&&{prefix:n},...i&&{delimiter:i},...r&&{marker:r}}),o=ZX(e),s=await fetch(QX({url:o,token:t,searchParams:a}));await yV(s,`Failed to list blobs`);let c=YX(await s.text());return{items:XX(c.Blobs?.Blob),cursor:c.NextMarker||void 0}},getKey:({Name:e})=>e,parseResults:(e,t,n)=>{let{public_url:r}=t,i=ZX(t);return e.map(({Name:e,Properties:a={}})=>{let o=e.split(`/`).pop()||e,s=_V(t,e),c=IP(e),l=`${i}/${c}`,u=r?`${LP(r)}/${c}`:l,d=a[`Last-Modified`],f=a[`Content-Length`];return{id:e,description:s,previewURL:r?u:QX({url:l,token:n}),downloadURL:u,fileName:o,...d&&{lastModified:new Date(d)},...f&&{size:Number(f)},kind:pV(e)}})},putObject:async({key:e,file:t,config:n,credential:r})=>(await yV(await fetch($X(n,e,r),{method:`PUT`,headers:{"x-ms-blob-type":`BlockBlob`,"Content-Type":t.type||`application/octet-stream`},body:t}),`Failed to upload file ${t.name}`),{Name:e,Properties:{"Last-Modified":new Date().toUTCString(),"Content-Length":String(t.size),"Content-Type":t.type}}),copyObject:async({asset:e,key:t,config:n,credential:r})=>{let{id:i,size:a,lastModified:o}=e,s=await fetch($X(n,t,r),{method:`PUT`,headers:{"x-ms-blob-type":`BlockBlob`,"x-ms-copy-source":$X(n,i,r)}});if(await yV(s,`Failed to copy blob ${i}`),s.headers.get(`x-ms-copy-status`)===`pending`)throw Error(`Failed to copy blob ${i}: the copy operation is still pending`);return{Name:t,Properties:{...o&&{"Last-Modified":o.toUTCString()},...a&&{"Content-Length":String(a)}}}},deleteObject:async({key:e,config:t,credential:n,allowNotFound:r=!1})=>{await yV(await fetch($X(t,e,n),{method:`DELETE`}),`Failed to delete blob ${e}`,{allowNotFound:r})},putFolderObject:async({key:e,config:t,credential:n})=>{await yV(await fetch($X(t,e,n),{method:`PUT`,headers:{"x-ms-blob-type":`BlockBlob`,"Content-Type":`application/x-directory`}}),`Failed to create folder ${e}`)}})}),{isEnabled:LLe,isAssetURL:RLe,list:zLe,browse:BLe,search:VLe,upload:HLe,delete:ULe,rename:WLe,replace:GLe,move:KLe,createFolder:qLe,deleteFolder:JLe}=eZ,YLe=async({method:e,url:t,headers:n,payloadHash:r,accessKeyId:i,secretAccessKey:a,region:o,service:s,date:c})=>{let l=new URL(t),u=c.toISOString().replace(/[:-]|\.\d{3}/g,``),d=u.slice(0,8),f=l.pathname,p=[...l.searchParams.entries()].sort(([e],[t])=>e<t?-1:+(e>t)).map(([e,t])=>`${FP(e)}=${FP(t)}`).join(`&`),m=Object.entries(n).map(([e,t])=>`${e.toLowerCase()}:${t.trim()}`).sort().join(`
`),h=Object.keys(n).map(e=>e.toLowerCase()).sort().join(`;`),g=[e,f,p,`${m}\n`,h,r].join(`
`),_=`AWS4-HMAC-SHA256`,v=`${d}/${o}/${s}/aws4_request`,y=[_,u,v,await _l(g,{algorithm:`SHA-256`})].join(`
`),b=nW(await iW(await iW(await iW(await iW(await iW(`AWS4${a}`,d),o),s),`aws4_request`),y));return[`${_} Credential=${i}/${v},`,`SignedHeaders=${h}, Signature=${b}`].join(` `)},tZ=async({method:e,url:t,config:n,secretAccessKey:r,body:i=``,extraHeaders:a={}})=>{let{access_key_id:o,region:s=`us-east-1`}=n;if(!o)throw Error(`S3 access key ID is required`);let c=new Date,l=new URL(t),u=await _l(i,{algorithm:`SHA-256`}),d={Host:l.host,"x-amz-date":c.toISOString().replace(/[:-]|\.\d{3}/g,``),"x-amz-content-sha256":u,...a},f=await YLe({method:e,url:t,headers:d,payloadHash:u,accessKeyId:o,secretAccessKey:r,region:s,service:`s3`,date:c});return fetch(t,{method:e,headers:{...d,Authorization:f},...i&&{body:i}})},nZ=({bucket:e,key:t,endpoint:n,region:r,forcePathStyle:i,publicUrl:a})=>a?`${LP(a)}/${t}`:n?`${LP(n)}/${e}/${t}`:i?`https://s3.${r}.amazonaws.com/${e}/${t}`:`https://${e}.s3.${r}.amazonaws.com/${t}`,XLe=(e,t)=>{let{bucket:n,region:r,endpoint:i,force_path_style:a,public_url:o}=e;return[nZ({bucket:n,key:``,endpoint:i,region:r,forcePathStyle:a,publicUrl:o}),nZ({bucket:n,key:``,endpoint:i,region:r,forcePathStyle:a})].some(e=>t.startsWith(e))},rZ=e=>IP(e,FP),iZ=(e,t)=>{let{bucket:n,region:r,endpoint:i,force_path_style:a}=e;return nZ({bucket:n,key:rZ(t),endpoint:i,region:r,forcePathStyle:a})},aZ=({acl:e})=>e?{"x-amz-acl":e}:{},ZLe=wV({requireCredential:({apiKey:e})=>{if(!e)throw Error(`S3 secret access key is required`);return e},listPage:async({config:e,credential:t,prefix:n,cursor:r,delimiter:i})=>{let{bucket:a,region:o,endpoint:s,force_path_style:c}=e,l=new URLSearchParams({"list-type":`2`,"max-keys":`1000`,...n&&{prefix:n},...i&&{delimiter:i},...r&&{"continuation-token":r}}),u=await tZ({method:`GET`,url:s?`${LP(s)}/${a}?${l}`:c?`https://s3.${o}.amazonaws.com/${a}?${l}`:`https://${a}.s3.${o}.amazonaws.com/?${l}`,config:e,secretAccessKey:t});await yV(u,`Failed to list objects`);let d=YX(await u.text());return{items:XX(d.Contents),cursor:d.IsTruncated===`true`&&d.NextContinuationToken||void 0}},getKey:({Key:e})=>e,parseResults:(e,t)=>{let{bucket:n,region:r,endpoint:i,force_path_style:a,public_url:o}=t;return e.map(e=>{let s=e.Key,c=s.split(`/`).pop()||s,l=_V(t,s),u=nZ({bucket:n,key:rZ(s),endpoint:i,region:r,forcePathStyle:a,publicUrl:o});return{id:s,description:l,previewURL:u,downloadURL:u,fileName:c,lastModified:new Date(e.LastModified),size:Number(e.Size),kind:pV(s)}})},putObject:async({key:e,file:t,config:n,credential:r})=>{let i=await t.arrayBuffer();return await yV(await tZ({method:`PUT`,url:iZ(n,e),config:n,secretAccessKey:r,body:i,extraHeaders:{"Content-Type":t.type||`application/octet-stream`,...aZ(n)}}),`Failed to upload file ${t.name}`),{Key:e,LastModified:new Date().toISOString(),ETag:``,Size:t.size,ContentType:t.type}},copyObject:async({asset:e,key:t,config:n,credential:r})=>{let{bucket:i}=n,{id:a,size:o=0}=e,s=await tZ({method:`PUT`,url:iZ(n,t),config:n,secretAccessKey:r,extraHeaders:{"x-amz-copy-source":`/${i}/${rZ(a)}`,"x-amz-metadata-directive":`COPY`,...aZ(n)}});await yV(s,`Failed to copy object ${a}`);let c=await s.text();if(/^\s*(?:<\?xml[^>]*>\s*)?<Error[\s>]/.test(c))throw Error(`Failed to copy object ${a}: ${c}`);return{Key:t,LastModified:new Date().toISOString(),ETag:``,Size:o}},deleteObject:async({key:e,config:t,credential:n,allowNotFound:r=!1})=>{await yV(await tZ({method:`DELETE`,url:iZ(t,e),config:t,secretAccessKey:n}),`Failed to delete object ${e}`,{allowNotFound:r})},putFolderObject:async({key:e,config:t,credential:n})=>{await yV(await tZ({method:`PUT`,url:iZ(t,e),config:t,secretAccessKey:n,extraHeaders:{"Content-Type":`application/x-directory`,...aZ(t)}}),`Failed to create folder ${e}`)}}),oZ=class extends JX{constructor({requiredOption:e=`region`,objectAcl:t,resolveConfig:n=e=>e,...r}){super({...r,resolveConfig:e=>({...n(e),acl:t}),isConfigured:t=>!!(t.access_key_id&&t.bucket&&t[e]),isConfigURL:XLe,operations:ZLe}),this.requiredOption=e}},QLe=new oZ({serviceId:`aws_s3`,serviceLabel:`Amazon S3`,serviceURL:`https://aws.amazon.com/s3/`,developerURL:`https://docs.aws.amazon.com/s3/`,apiKeyURL:`https://console.aws.amazon.com/iam/home#/security_credentials`,apiKeyPattern:/^[A-Za-z0-9/+=]{40,}$/}),$Le=new oZ({serviceId:`backblaze_b2`,serviceLabel:`Backblaze B2`,serviceURL:`https://www.backblaze.com/cloud-storage`,developerURL:`https://www.backblaze.com/docs/cloud-storage-s3-compatible-api`,apiKeyURL:`https://secure.backblaze.com/app_keys.htm`,apiKeyPattern:/^[A-Za-z0-9/+=]{30,}$/,resolveConfig:e=>({...e,endpoint:`https://s3.${e.region}.backblazeb2.com`,public_url:e.public_url??`https://${e.bucket}.s3.${e.region}.backblazeb2.com`})}),eRe=new oZ({serviceId:`bunny_storage`,serviceLabel:`Bunny Storage`,serviceURL:`https://bunny.net/storage/`,developerURL:`https://bunny.net/docs/storage/s3`,apiKeyURL:`https://dash.bunny.net/storage`,apiKeyPattern:/^[0-9a-f]{8}(?:-[0-9a-f]{4,12}){3,7}$/i,resolveConfig:e=>({...e,access_key_id:e.access_key_id??e.bucket,endpoint:`https://${e.region}-s3.storage.bunnycdn.com`})}),tRe={default:``,eu:`eu.`,fedramp:`fedramp.`},nRe=({account_id:e,jurisdiction:t=`default`})=>`https://${e}.${tRe[t]??``}r2.cloudflarestorage.com`,rRe=new oZ({serviceId:`cloudflare_r2`,serviceLabel:`Cloudflare R2`,serviceURL:`https://www.cloudflare.com/developer-platform/r2/`,developerURL:`https://developers.cloudflare.com/r2/`,apiKeyURL:`https://dash.cloudflare.com/?to=/:account/r2/api-tokens`,apiKeyPattern:/^[A-Za-z0-9/+=]{40,}$/,requiredOption:`account_id`,resolveConfig:e=>({...e,region:`auto`,endpoint:nRe(e)})}),iRe=new oZ({serviceId:`digitalocean_spaces`,serviceLabel:`DigitalOcean Spaces`,serviceURL:`https://www.digitalocean.com/products/spaces`,developerURL:`https://docs.digitalocean.com/products/spaces/`,apiKeyURL:`https://cloud.digitalocean.com/account/api/spaces`,objectAcl:`public-read`,apiKeyPattern:/^[A-Za-z0-9/+=]{43}$/,resolveConfig:e=>({...e,endpoint:`https://${e.region}.digitaloceanspaces.com`,public_url:e.public_url??`https://${e.bucket}.${e.region}.digitaloceanspaces.com`})}),aRe=new oZ({serviceId:`scaleway_object_storage`,serviceLabel:`Scaleway Object Storage`,serviceURL:`https://www.scaleway.com/en/object-storage/`,developerURL:`https://www.scaleway.com/en/docs/object-storage/`,apiKeyURL:`https://console.scaleway.com/iam/api-keys`,objectAcl:`public-read`,apiKeyPattern:/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,resolveConfig:e=>({...e,endpoint:`https://s3.${e.region}.scw.cloud`,public_url:e.public_url??`https://${e.bucket}.s3.${e.region}.scw.cloud`})}),oRe=({project_id:e})=>`https://${e}.storage.supabase.co/storage/v1/s3`,sRe=({project_id:e,bucket:t})=>`https://${e}.supabase.co/storage/v1/object/public/${t}`,cRe=new oZ({serviceId:`supabase_storage`,serviceLabel:`Supabase Storage`,serviceURL:`https://supabase.com/storage`,developerURL:`https://supabase.com/docs/guides/storage`,apiKeyURL:`https://supabase.com/dashboard/project/_/storage/settings`,apiKeyPattern:/^[A-Za-z0-9/+=]{40,}$/,requiredOption:`project_id`,resolveConfig:e=>({...e,endpoint:oRe(e),public_url:e.public_url??sRe(e)})}),lRe=(e=xk.current)=>TV(`uploadcare`,e),sZ=e=>{let t=DV(`uploadcare`,e);return t?t.config?.publicKey:void 0},uRe=e=>!!sZ(e),cZ=(e,{fieldConfig:t}={})=>{let{settings:{autoFilename:n=!1,defaultOperations:r=void 0}={},config:{cdnBase:i=void 0}={}}=DV(`uploadcare`,t)||{};return e.map(e=>{let{uuid:t,original_filename:a,original_file_url:o,mime_type:s,datetime_uploaded:c,size:l}=e,u=`${new URL(i??o).origin}/${t}/`,d=s.startsWith(`image/`),f=s.startsWith(`video/`);return{id:t,description:a,previewURL:`${u}${d?`-/preview/400x400/`:``}`,downloadURL:`${u}${d&&r?`-${r}`:``}${n?a:``}`,fileName:a,lastModified:new Date(c),size:l,kind:d?`image`:f?`video`:`other`}})},lZ=({fieldConfig:e,apiKey:t},{secretKeyRequired:n=!0}={})=>{let r=sZ(e);if(!r)throw Error(`Uploadcare public key is not configured`);if(n&&!t)throw Error(`Uploadcare secret key is not provided`);return{publicKey:r,secretKey:t}},uZ=({publicKey:e,secretKey:t})=>({Accept:`application/vnd.uploadcare-v0.7+json`,Authorization:`Uploadcare.Simple ${e}:${t}`}),dZ=async(e,{maxPages:t=10,filter:n}={})=>{let{kind:r,fieldConfig:i}=e,a=uZ(lZ(e,{secretKeyRequired:!1})),o=new URLSearchParams({limit:`100`,ordering:`-datetime_uploaded`,stored:`true`});return cZ(await vV(async e=>{let t=await fetch(e??`https://api.uploadcare.com/files/?${o}`,{headers:a});await yV(t,`Failed to fetch files`);let i=await t.json(),{results:s}=i;return r===`image`&&(s=s.filter(e=>e.is_image)),n&&(s=s.filter(n)),{results:s,next:i.next}},{maxPages:t}),{fieldConfig:i})},dRe=async e=>dZ(e),fRe=async(e,t)=>{let n=e.toLowerCase();return dZ(t,{filter:e=>e.original_filename.toLowerCase().includes(n)})},pRe=async(e,t)=>nW(await iW(e,String(t))),fZ={aws_s3:QLe,azure_blob_storage:eZ,backblaze_b2:$Le,bunny_storage:eRe,cloudflare_r2:rRe,cloudinary:PDe,digitalocean_spaces:iRe,scaleway_object_storage:aRe,supabase_storage:cRe,uploadcare:{serviceType:`cloud_storage`,serviceId:`uploadcare`,serviceLabel:`Uploadcare`,serviceURL:`https://uploadcare.com/`,showServiceLink:!0,hotlinking:!0,authType:`api_key`,developerURL:`https://uploadcare.com/docs/`,apiKeyURL:`https://app.uploadcare.com/projects/-/api-keys/`,apiKeyPattern:/^[a-f0-9]{20}$/,isEnabled:uRe,isAssetURL:e=>{let t=lRe();if(!t)return!1;try{let{origin:n}=new URL(t.config?.cdnBase??`https://ucarecdn.com/`);return e.startsWith(`${n}/`)}catch{return!1}},list:dRe,search:fRe,upload:async(e,t)=>{if(e.length===0)return[];let{fieldConfig:n}=t,{publicKey:r,secretKey:i}=lZ(t),a=Math.floor(Date.now()/1e3)+1800,o=await pRe(i,a),s=new FormData;s.append(`UPLOADCARE_PUB_KEY`,r),s.append(`UPLOADCARE_STORE`,`1`),s.append(`signature`,o),s.append(`expire`,String(a));let c=new Map;e.forEach(e=>{let t=YB(e.name,{assetNamesInSameFolder:[...c.keys()]});c.set(t,e),s.append(t,e)});let l=await fetch(`https://upload.uploadcare.com/base/`,{method:`POST`,body:s});await yV(l,`Failed to upload files`);let u=await l.json();return cZ(Object.entries(u).filter(([e])=>!e.startsWith(`UPLOADCARE_`)).map(([e,t])=>{let n=c.get(e),r=n?.type||`application/octet-stream`,i=r.startsWith(`image/`);return{uuid:t,original_filename:e,original_file_url:`https://ucarecdn.com/${t}/${e}`,size:n?.size||0,mime_type:r,is_image:i,is_ready:!0,content_info:null,datetime_uploaded:new Date().toISOString(),datetime_stored:new Date().toISOString(),datetime_removed:null}}),{fieldConfig:n})},delete:async(e,t)=>{let n={...uZ(lZ(t)),"Content-Type":`application/json`},r=aJ(e.map(({id:e})=>e),100);for(let e=0;e<r.length;e+=1)e>0&&await pl(50),await yV(await fetch(`https://api.uploadcare.com/files/storage/`,{method:`DELETE`,headers:n,body:JSON.stringify(r[e])}),`Failed to delete files`)}}},pZ=Object.keys(fZ),mRe=/^(?:https?|data|blob):/,hRe=e=>{if(fZ.cloudinary?.isEnabled?.(e)){let t=NV(e);if(t.output_filename_only&&t.config?.cloud_name)return`https://res.cloudinary.com/${t.config.cloud_name}`}},mZ=({value:e,entry:t,collectionName:n,fileName:r,componentName:i,fieldConfig:a,typedKeyPath:o,locale:s})=>{if(!e)return;if(mRe.test(e))return{url:e};if(gX(e)){let t=hRe(a);if(t)return{url:`${t}/${e}`}}let c=_X({value:e,entry:t,collectionName:n,fileName:r,componentName:i,typedKeyPath:o,locale:s});return c?{asset:c}:void 0},hZ=async(e,t=!1)=>{let{url:n,asset:r}=e??{};if(n)return n;if(r)return(t?await zX(r):await FX(r))??KX(r)},gZ=async({thumbnail:e=!1,...t})=>hZ(mZ(t),e),_Z=({componentNames:e,...t})=>{let n=e.map(aM).filter(Boolean);return mZ(t)??iH.current.values().filter(({componentName:e,typedKeyPath:t})=>!!t&&n.includes(e)).map(({componentName:e,typedKeyPath:n})=>mZ({...t,componentName:e,typedKeyPath:n})).find(Boolean)},gRe=async e=>hZ(_Z(e)),vZ=/^.+?:\w+:/,yZ=e=>e.replace(vZ,``),_Re=[`rich_text`,`raw`],vRe={rich_text:`rich-text`,raw:`plain-text`},yRe=[`bold`,`italic`,`strikethrough`,`code`,`link`,`heading-one`,`heading-two`,`heading-three`,`heading-four`,`heading-five`,`heading-six`,`bulleted-list`,`numbered-list`,`quote`],bRe={bold:`bold`,italic:`italic`,strikethrough:`strikethrough`,code:`code`,link:`link`,"heading-one":`heading-1`,"heading-two":`heading-2`,"heading-three":`heading-3`,"heading-four":`heading-4`,"heading-five":`heading-5`,"heading-six":`heading-6`,"bulleted-list":`bulleted-list`,"numbered-list":`numbered-list`,quote:`blockquote`,align:`align`,"code-block":`code-block`,table:`table`,hr:`horizontal-rule`},xRe=[`code-block`,`image`],bZ=e=>{if(e.widget!==`richtext`)return`markdown`;let{format:t=Sk.current?.field_defaults?.richtext?.format}=e;return t===`html`?`html`:`markdown`},xZ=e=>{let t=document.createElement(`template`);return t.innerHTML=e,t},SRe=e=>xZ(e).content.firstElementChild,SZ=e=>{let{outerHTML:t}=e,n=`</${e.localName}>`;return t.endsWith(n)?t.slice(0,-n.length):t},CRe=(e,t)=>{let n=e.lastIndexOf(`<`,t-1);return t>0&&n>e.lastIndexOf(`>`,t-1)&&/[a-z]/i.test(e[n+1]??``)},CZ={img:[`src`,`srcset`],source:[`src`,`srcset`],video:[`src`,`poster`],audio:[`src`]},wZ=Object.keys(CZ),wRe=wZ.join(`, `),TZ=wZ.join(`|`),EZ=`<(?:${TZ})[\\s/>]`,DZ=new RegExp(EZ,`i`),TRe=new RegExp(EZ,`gi`),OZ=`data-deferred-`,kZ=`:is(${Object.entries(CZ).flatMap(([e,t])=>t.flatMap(t=>[`${e}[${t}]`,`${e}[${OZ}${t}]`])).join(`, `)}):not([data-processed])`,AZ=e=>[...e.content.querySelectorAll(wRe)],ERe=e=>{if(!DZ.test(e))return e;let t=xZ(e);return AZ(t).forEach(e=>{CZ[e.localName].forEach(t=>{let n=e.getAttribute(t);e.removeAttribute(`${OZ}${t}`),n!==null&&(e.setAttribute(`${OZ}${t}`,n),e.removeAttribute(t))})}),t.innerHTML},jZ=e=>{let t=[],n=0;for(;;){let r=e.slice(n).search(/[^\s,]/);if(r===-1)break;n+=r;let i=e.slice(n).match(/^\S+/)?.[0];if(n+=i.length,i.endsWith(`,`))t.push({url:i.replace(/,+$/,``),descriptor:``});else{let r=e.indexOf(`,`,n),a=r===-1?e.length:r;t.push({url:i,descriptor:e.slice(n,a).trim()}),n=a}}return t},DRe=e=>e.map(({url:e,descriptor:t})=>[e.replace(/\s/g,encodeURIComponent),t].filter(Boolean).join(` `)).join(`, `),MZ=(e,t)=>{let n=!1,r=e.flatMap((e,r)=>{let i=t(e.url,r);return i===null?(n=!0,[]):i!==void 0&&i!==e.url?(n=!0,[{...e,url:i}]):[e]});if(n)return r.length?DRe(r):null},ORe=async(e,t)=>{let n=CZ[e.localName]??[],r=async e=>{try{return await t(e)??e}catch{return e}},i=async(e,t)=>{if(!t)return t;if(e!==`srcset`)return r(t);let n=jZ(t),i=await Promise.all(n.map(({url:e})=>r(e)));return MZ(n,(e,t)=>i[t])??t},a=await Promise.all(n.map(async t=>{let n=`${OZ}${t}`,r=e.hasAttribute(n),a=e.getAttribute(r?n:t);return a===null?void 0:{name:t,deferredName:n,deferred:r,value:a,url:await i(t,a)}})),o=!1;a.forEach(t=>{if(!t)return;let{name:n,deferredName:r,deferred:i,value:a,url:s}=t;i&&e.removeAttribute(r),(i||s!==a)&&(e.setAttribute(n,s),o=!0)});let{localName:s,parentElement:c}=e;o&&s===`source`&&/^(?:audio|video)$/.test(c?.localName??``)&&c.load()},kRe=/!\[(?:[^\]\n!]|!(?!\[)|\](?!\())*\]\(((?:[^\n!)]|!(?!\[))+?)(?:(?<!\s)\s+"(?:[^"\\\n]|\\.)*")?\)/g,ARe=[`<(?:${TZ})(?=[\\s/>])`,`(?:[^<>"']|"[^"<]*"|'[^'<]*')*>`].join(``),NZ=RegExp(`${kRe.source}|(${ARe})`,`gi`),PZ=(e,t)=>{let n=!1;return CZ[e.localName].forEach(r=>{let i=e.getAttribute(r);if(!i)return;if(r!==`srcset`){let a=t(i);a===null?(e.removeAttribute(r),n=!0):a!==void 0&&a!==i&&(e.setAttribute(r,a),n=!0);return}let a=MZ(jZ(i),e=>t(e));a!==void 0&&(a===null?e.removeAttribute(r):e.setAttribute(r,a),n=!0)}),n},FZ=({value:e,tag:t,index:n,callback:r})=>{if(CRe(e,n))return;let i=SRe(t);return PZ(i,r)?i:void 0},jRe=(e,t)=>e.replace(NZ,(n,r,i,a)=>{if(i!==void 0){let r=FZ({value:e,tag:i,index:a,callback:e=>t(e)??void 0});return r?SZ(r):n}let o=r,s=t(o);if(typeof s!=`string`)return n;let c=n.indexOf(`](`)+2;return`${n.slice(0,c)}${s}${n.slice(c+o.length)}`}),MRe=(e,t)=>{if(!DZ.test(e))return e;let n=xZ(e),r=!1;return AZ(n).forEach(e=>{r=PZ(e,t)||r}),r?n.innerHTML:e},IZ=(e,t,n)=>t===`html`?MRe(e,n):jRe(e,n),LZ=(e,t)=>{let n=new Set;return IZ(e,t,e=>{n.add(e)}),[...n]},NRe=(e,t,n)=>[...t.values()].some(e=>e!==void 0)?IZ(e,n,e=>t.get(e)):e,RZ=e=>{let t=Sk.current?._baseURL;return t&&!e.startsWith(`blob:`)?e.replace(t,``):e},PRe=e=>{let t={targets:e,byURL:new Map,byBlobURL:new Map,byPath:new Map,resolves:!1};return e.forEach(({url:e,asset:n},r)=>{let[i,a]=n?[t.byPath,n.path]:e.startsWith(`blob:`)?[t.byBlobURL,e]:[t.byURL,e];i.set(a,[...i.get(a)??[],r])}),t.resolves=!!(t.byBlobURL.size||t.byPath.size),t},zZ=(e,t,{entry:n,collectionName:r,fileName:i,locale:a})=>{let o=e.byURL.get(t)??[];if(!e.resolves)return o;let{url:s,asset:c}=mZ({entry:n,collectionName:r,fileName:i,locale:a,value:t})??{},l=s??c?.blobURL;return[...o,...l!==void 0&&e.byBlobURL.get(l)||[],...c&&e.byPath.get(c.path)||[]]},BZ=(e,t,n)=>t.map(t=>{let{newURL:r}=e.targets[t];return typeof r==`function`?r(n):r}).find(Boolean),FRe=(e,t)=>{if(e.byURL.has(t))return!0;if(!t.includes(`![`)&&!DZ.test(t))return!1;let n=t=>t.some(t=>e.byURL.has(t));if(n(LZ(t,`markdown`)))return!0;let r=[...t.matchAll(NZ)].filter(([,,e])=>e).length;return(t.match(TRe)?.length??0)>r&&n(LZ(t,`html`))},IRe=({matcher:e,collectionName:t,entry:n,content:r,keyPath:i,value:a,isIndexFile:o,collectionFile:s,locale:c})=>{let l=new Set,u=s?.name,d=bM({collectionName:t,fileName:u,valueMap:r,keyPath:i,isIndexFile:o});if(!d)return{indexes:l};let{widget:f=`string`}=d,p={entry:n,collectionName:t,fileName:u,locale:c};if(Lk.includes(f)){let t=zZ(e,a,p),n=BZ(e,t,a);return t.forEach(e=>l.add(e)),n&&(r[i]=n),{indexes:l,field:d}}if(Rk.includes(f)){let t=!1,n=IZ(a,bZ(d),n=>{let r=zZ(e,n,p);if(!r.length)return;let i=BZ(e,r,n);return r.forEach(e=>l.add(e)),t||=!!i,i||void 0});t&&(r[i]=n)}return{indexes:l,field:d}},VZ=(e,{entries:t,every:n=!1,onMatch:r})=>{let i=PRe(e.map(e=>e.url===void 0?e:{...e,url:RZ(e.url)})),a=n||e.some(({newURL:e})=>!!e),o=e.map(()=>[]);return t.forEach(t=>{let{locales:n}=t,s,c=new Set,l=()=>!a&&c.size===e.length;for(let[e,{content:a}]of Object.entries(n)){for(let[n,o]of Object.entries(a))if(typeof o==`string`&&o&&(i.resolves||FRe(i,o))){s??=AP(t).map(e=>{let n=wj(e,t);return{collection:e,isIndexFile:aA(e,t),files:n.length?n:[void 0]}});for(let{collection:u,isIndexFile:d,files:f}of s){let s={matcher:i,collectionName:u.name,entry:t,content:a,keyPath:n,locale:e};if(f.map(e=>IRe({...s,value:o,isIndexFile:d,collectionFile:e})).forEach(({indexes:i,field:a},o)=>{i.forEach(e=>c.add(e)),i.size&&r&&r({entry:t,collection:u,collectionFile:f[o],locale:e,keyPath:n,fieldConfig:a})}),l())break}if(l())break}if(l())break}c.forEach(e=>{o[e].push(t)})}),o},HZ=async(e,{entries:t=vj.current,newURL:n=``}={})=>VZ([{url:e,newURL:n}],{entries:t})[0],UZ=(e,{entries:t=vj.current}={})=>VZ(e,{entries:t}),WZ=async(e,t)=>UZ(e,t),LRe=async(e,{entries:t=vj.current}={})=>{let n=[];return VZ(e,{entries:t,every:!0,onMatch:e=>{n.push(e)}}),n},RRe=async(e,t)=>{let n=t===`image`?await PX(e):null;if(!n)return{createdDate:void 0,coordinates:void 0};let r={};try{let{parse:e}=await RN(`exifr`,`dist/lite.esm.mjs`);r=await e(n)??{}}catch{}let{latitude:i,longitude:a,DateTimeOriginal:o,CreateDate:s=o}=r;return{createdDate:s instanceof Date?s:void 0,coordinates:Number.isFinite(i)&&Number.isFinite(a)?{latitude:pM(i,7),longitude:pM(a,7)}:void 0}},GZ=({element:e,eventType:t,src:n,getInfo:r})=>new Promise(i=>{e.addEventListener(t,()=>i(r()),{once:!0}),e.addEventListener(`error`,()=>i({}),{once:!0}),e.src=n}),zRe=e=>{let t=new Image;return GZ({element:t,eventType:`load`,src:e,getInfo:()=>({dimensions:{width:t.naturalWidth,height:t.naturalHeight}})})},BRe=async(e,t)=>{let n=document.createElement(t);return GZ({element:n,eventType:`loadedmetadata`,src:e,getInfo:()=>{let{duration:e}=n;if(t===`audio`)return{duration:e};let{videoWidth:r,videoHeight:i}=n;return{dimensions:{width:r,height:i},duration:e}}})},KZ=async(e,t)=>t===`image`?zRe(e):BRe(e,t),VRe=async(e,t,n)=>{let[{dimensions:r,duration:i},{createdDate:a,coordinates:o}]=await Promise.all([KZ(t,n),RRe(e,n)]);return{dimensions:r,duration:i,createdDate:a,coordinates:o}},HRe=new Map,qZ=e=>{let{kind:t,downloadURL:n}=e;return cV(t)?LA(HRe,n,()=>KZ(n,t)):Promise.resolve({})},JZ=async({downloadURL:e})=>HZ(e),URe=async e=>{if(!e.length)return[];let t=await WZ(e.map(({downloadURL:e})=>({url:e})));return[...new Set(t.flat())]},WRe=6,YZ=pk({}),XZ=new Set,ZZ=async e=>{try{let{ok:t,status:n}=await fetch(e,{method:`HEAD`});return t?!0:n>=400&&![405,429,501].includes(n)?!1:void 0}catch{try{await fetch(e,{method:`HEAD`,mode:`no-cors`});return}catch{return!1}}},GRe=e=>window.location.protocol===`https:`&&e.startsWith(`http:`),KRe=async e=>{let{kind:t,downloadURL:n}=e;if(!GRe(n)){if(cV(t)){let t=await qZ(e);return`dimensions`in t||`duration`in t||await ZZ(n)===!0}return ZZ(n)}},qRe=async e=>{let t=e.filter(({id:e})=>!XZ.has(e));t.forEach(({id:e})=>XZ.add(e)),await yW(t,async e=>{let t=await KRe(e);t!==void 0&&(YZ.current={...YZ.current,[e.id]:t})},{concurrency:WRe})},JRe=/^https?:\/\/\S+$/,YRe=e=>{let t=Sk.current?._baseURL;return JRe.test(e)&&!(t&&e.startsWith(t))&&!Object.values(fZ).some(({isEnabled:t,isAssetURL:n})=>(t?.()??!0)&&n?.(e))},XRe=(e,t)=>{let n=e;try{n=decodeURIComponent(new URL(e).pathname.split(`/`).filter(Boolean).at(-1)??``)}catch{}n||=e;let r=pV(n);return{id:e,description:e,previewURL:e,downloadURL:e,fileName:n,kind:r===`other`&&t?`image`:r}},ZRe=(e,t,n)=>AP(e).flatMap(r=>{let i=r.name,a=aA(r,e),o=wj(r,e);return(o.length?o.map(({name:e})=>bM({collectionName:i,fileName:e,valueMap:t,keyPath:n,isIndexFile:a})):[bM({collectionName:i,valueMap:t,keyPath:n,isIndexFile:a})]).map(e=>e?.widget??`string`)}),QRe=e=>{let t=new Map;return e.forEach(e=>{Object.values(e.locales).forEach(({content:n})=>{Object.entries(n).forEach(([r,i])=>{if(typeof i!=`string`||!YRe(i))return;let a=ZRe(e,n,r);a.some(e=>Lk.includes(e))&&!t.has(i)&&t.set(i,XRe(i,a.includes(`image`)))})})}),[...t.values()]},QZ=hk(()=>QRe(vj.current)),$Z={serviceType:`cloud_storage`,serviceId:`linked`,get serviceLabel(){return Y(`linked_files`)},serviceURL:``,showServiceLink:!1,hotlinking:!0,authType:`none`,list:async()=>{let e=QZ.current;return qRe(e),e}},eQ=hk(()=>(Sk.current,Object.values(fZ).filter(({isEnabled:e})=>e?.()??!0))),$Re=e=>e===`linked`?$Z:eQ.current.find(t=>t.serviceId===e),tQ=({serviceId:e})=>`/assets/-/${e}`,nQ=(e,{id:t})=>`${tQ(e)}/${IP(t)}`,rQ=({kind:e,fileName:t})=>lV(e,t),iQ=(e,t)=>{let n=new Set(e.map(({id:e})=>e));return[...e,...t.filter(({id:e})=>!n.has(e))]},aQ=pk(),oQ=pk(),sQ=e=>!!e?.browse,cQ=pk([]),lQ=pk(``),uQ=pk(),dQ=pk(!1),fQ=pk(),pQ=pk(),mQ=pk({}),hQ=pk(),gQ=pk(!1),_Q=pk([]),eze=hk(()=>new Set(_Q.current.map(({id:e})=>e))),vQ=pk(),yQ=e=>{let t=_Q.current,n=t.filter(({id:t})=>e(t));n.length!==t.length&&(_Q.current=n),vQ.current&&!e(vQ.current.id)&&(vQ.current=void 0)},tze=hk(()=>_Q.current.length?[..._Q.current]:vQ.current?[vQ.current]:[]),bQ=pk(),xQ=pk(),SQ=pk(``),CQ=({serviceId:e})=>{let t=IG.apiKeys?.[e]??``,[n=``,r=``]=(IG.logins?.[e]??``).split(` `);return{apiKey:t,userName:n,password:r}},wQ=e=>{let{apiKey:t,password:n}=CQ(e);return e.authType===`none`||!!t||!!n},nze=()=>{oQ.current=void 0,cQ.current=[],hQ.current=void 0,gQ.current=!1,_Q.current=[],lQ.current=``,vQ.current=void 0,uQ.current=void 0,bQ.current=void 0,xQ.current=void 0,fQ.current=void 0,pQ.current=void 0,SQ.current=``},TQ=e=>{lQ.current=e,_Q.current=[],vQ.current=void 0,uQ.current=void 0},EQ=pk(),rze={type:`grid`,showInfo:!0,sort:{key:`name`,order:`ascending`}},DQ=pk({type:`grid`,showInfo:!0}),ize=()=>{let e=aQ.current;return e?`-/${e.serviceId}`:oH.current?.internalPath??`*`},aze=async({repository:e})=>{await rB(e,`assets-view`,EQ),_k(()=>{oH.current,aQ.current,fo(()=>{let e=EQ.current?.[ize()]??structuredClone(rze);(0,yr.default)(e,DQ.current)||(DQ.current=e)})}),_k(()=>{let e=DQ.current;fo(()=>{let t=ize(),n=EQ.current?.[t]??{};(0,yr.default)(e,n)||(EQ.current={...EQ.current,[t]:e})})})},oze=(e,t)=>{let{commitAuthor:n,commitDate:r}=e;return t===`commit_author`?wz(n):t===`commit_date`?r:t===`name`?e.name.split(`.`)[0]:e[t]??``},sze=(e,{key:t,order:n}={})=>{if(!t||!n)return e;let r=[...e],i={commit_author:String,commit_date:Date}[t]||r[0]?.[t]?.constructor||String;return Zz(r,e=>{let n=oze(e,t);return i===String?n??``:Number(n??0)},i===String,n),r},OQ=pk(!1),kQ=pk(!1),AQ=pk(!1),cze=hk(()=>!!vH.current.files.length),jQ=({label:e,collectionName:t,fileName:n,internalPath:r})=>{if(e)return e;if(t===void 0)return Y(r===void 0?`all_assets`:`global_assets`);let i=fj(t),a=i?pj(i):t;if(!n)return a;let o=i?xj(i,n):void 0;return`${a} › ${o?Cj(o):n}`},MQ=hk(()=>{let{current:e}=mH,{current:t}=oH;return e&&t&&t.internalPath!==void 0?e.filter(e=>vX(e,t)):e?[...e]:[]}),NQ=hk(()=>{let e=MQ.current,t=sU.current;return t===void 0?e:mU({dirPath:t,assets:e})}),PQ=hk(()=>{let e=sU.current;return e===void 0?[]:pU({dirPath:e,assets:MQ.current})}),lze=hk(()=>{let e=eU.current;if(e){let{name:t,path:n}=e,r=MQ.current;return{name:t,path:n,folderCount:pU({dirPath:n,assets:r}).length,assetCount:mU({dirPath:n,assets:r}).length}}let t=oH.current;if(!t)return;let n=sU.current;return{name:$H.current.split(`/`).at(-1)||Jc.current&&jQ(t),path:n??t.internalPath,folderCount:n===void 0?void 0:PQ.current.length,assetCount:NQ.current.length}}),FQ=(e,t)=>{let n=e.findIndex(t);return n===-1?{}:{previous:e[n-1],next:e[n+1]}},IQ={},uze=gk(()=>DQ.current.sort),LQ=gk(()=>DQ.current.filter),dze=gk(()=>DQ.current.group),fze=hk(()=>sze(NQ.current,uze.current)),pze=hk(()=>xX(fze.current,LQ.current)),RQ=hk(()=>{let e=hLe(pze.current,dze.current);return(0,yr.default)(IQ,e)||(IQ=e),IQ}),mze=hk(()=>{let e=PQ.current.length;return new Map(Object.values(RQ.current).flat(1).map((t,n)=>[t.path,n+e]))});_k(()=>{let{current:e}=OY;e&&!fo(()=>EQ.current)&&aze(e)}),_k(()=>{let e=NQ.current,t=LQ.current,n=fo(()=>gH.current);hH.current=[],n&&!xX(e.filter(({path:e})=>e===n.path),t).length&&(gH.current=void 0),fo(()=>IG.devModeEnabled)&&console.info(`listedAssets`,e)});var zQ=pk(!1),BQ=pk(!1),VQ=pk(0),HQ=mk({show:!1,multiple:!1}),UQ=mk({id:void 0,show:!1,status:`success`,message:void 0,count:1,sourceLanguage:void 0}),WQ=mk({id:0,show:!1,status:`success`,message:``}),GQ=pk(null),KQ=pk(null),qQ=pk(),JQ=hk(()=>zQ.current||OQ.current),YQ=pk(``),XQ=pk(``),ZQ=pk(``),QQ=pk(``),$Q=(e=window.location.href)=>{let[t,...n]=new URL(e).hash.substring(1).split(`#`)[0].split(`?`),r=new URLSearchParams(n.join(`?`));return{path:NP(`${t.startsWith(`/`)?``:`/`}${t}`.replace(/(?!^)\/+$/,``)),params:Object.fromEntries([...new Set(r.keys())].map(e=>[e,r.getAll(e).join(`,`)]))}},e$=null,t$=new Set,n$=!1,r$=void 0,hze=e=>{e$&&t$.add(e)},gze=async()=>{if(!t$.size||n$){t$.clear();return}let e=Promise.withResolvers();r$=e.resolve,await Promise.race([Promise.allSettled(t$),pl(300),e.promise]),r$=void 0,t$.clear()};globalThis.addEventListener?.(`keydown`,()=>{e$&&(e$.skipTransition(),n$=!0,r$?.())},{capture:!0});var i$=(e,t)=>{if(!document.startViewTransition||e$){t();return}let n={types:[e],update:async()=>{t(),await pl(50),await new Promise(e=>{Vi(()=>{e(void 0)})}),await gze()}};try{let e=document.startViewTransition(n);e$=e,n$=!1,e.ready.catch(()=>void 0),e.finished.catch(e=>{console.error(e)}).finally(()=>{e$=null,t$.clear()})}catch{e$=null,t()}},_ze=e=>{let t=window.navigation?.currentEntry?.index??-1;if(t===-1)return;let[n]=window.navigation.entries().filter(({url:n,index:r})=>n===e&&r!==t).map(({index:e})=>e).sort((e,n)=>Math.abs(e-t)-Math.abs(n-t));if(n!==void 0)return n<t?`forwards`:`backwards`},vze=(e,t,n)=>{let r=$Q(e).path,i=$Q(t).path,a=n.test(r)&&n.test(i),o=r.split(`/`).length,s=i.split(`/`).length;return!a||o===s?`unknown`:o<s?`forwards`:`backwards`},a$=(e,t,n)=>{let{isTrusted:r,oldURL:i,newURL:a}=e;r?i$(_ze(i)??vze(i,a,n),()=>t()):t()},o$=async(e,{state:t={},replaceState:n=!1,notifyChange:r=!0,transitionType:i=`unknown`}={})=>{let{path:a}=$Q();if(a===NP(e)&&!Object.keys(t).length&&!n)return;let{origin:o,pathname:s,hash:c}=window.location,l=`${o}${s}${c}`,u=`${o}${s}#${e}`,d=n?window.history.state?.from:l,f=[{...t,from:d},``,u];n?window.history.replaceState(...f):window.history.pushState(...f),r&&i$(i,()=>{window.dispatchEvent(new HashChangeEvent(`hashchange`,{oldURL:l,newURL:u}))})},yze=/^\/edit\/(?<collectionName>[^/]+)\/(?<subPath>.+)$/,bze=()=>{let{path:e,params:t}=$Q(),{collectionName:n,subPath:r}=e.match(yze)?.groups??{};if(!n||!r)return!1;let i=new URLSearchParams(t).toString();return o$(`${IP(`/collections/${n}/entries/${r}`)}${i?`?${i}`:``}`,{replaceState:!0}),!0},xze=[`workflow`,`config`,`menu`],Sze={collections:`contents`,assets:`assets`},Cze=(e,t)=>{let{pageName:n}=e.match(`^\\/(?<pageName>${t.join(`|`)})(?=\\/|$)`)?.groups??{};return n?xze.includes(n)&&e!==`/${n}`?{notFound:!0}:{pageName:n,searchMode:n===`search`?void 0:Sze[n]??null}:e===`/`?{redirect:`#/collections`}:{notFound:!0}},s$=(e,{returnTo:t,...n}={})=>{let r=`backwards`;if(window.navigation?.currentEntry){let{index:i}=window.navigation.currentEntry,{sameDocument:a,url:o}=window.navigation.entries()[i-1]??{},s=o?$Q(o).path:void 0;a&&s!==void 0&&(s===NP(e)||t?.(s))?i$(r,()=>{window.navigation.back()}):o$(e,{...n,transitionType:r})}else window.history.state?.from?i$(r,()=>{window.history.back()}):o$(e,{...n,transitionType:r})},wze=({collectionName:e,dirPath:t=``})=>e===`_singletons`?`/collections`:t?IP(`/collections/${e}/filter/${t}`):`/collections/${e}`,c$=()=>{let{display_url:e,_siteURL:t}=Sk.current;FV(e||t||`/`)},l$=!1,Tze=()=>{l$=!1,Vi()},Eze=()=>{l$||(l$=!0,queueMicrotask(Tze))},Dze=new Set([`$$slots`,`$$events`,`$$legacy`,`kind`,`loading`,`asset`,`src`,`variant`,`blurBackground`,`cover`,`checkerboard`,`dissolve`,`alt`,`controls`,`holdTransition`,`onError`]),Oze=B(`<img/>`),kze=B(`<video></video>`,2),Aze=B(`<audio></audio>`),jze=B(`<div role="none" class="blur svelte-1yaifwd"><div role="status" class="overlay svelte-1yaifwd"><!></div> <img role="none" loading="lazy" alt=""/></div>`),Mze=B(`<div role="none"><!> <!></div>`),Nze={hash:`svelte-1yaifwd`,code:`.preview.svelte-1yaifwd {display:inline-flex;align-items:center;justify-content:center;position:relative;width:100%;height:100%;&.tile {border-width:1px;border-style:solid;border-color:transparent;padding:var(--tile-padding, 12px);.sui.icon {font-size:48px;}}&.icon {border-radius:var(--sui-control-medium-border-radius);width:var(--icon-size, 32px);height:var(--icon-size, 32px);}&:is(.tile:where(.svelte-1yaifwd), .icon:where(.svelte-1yaifwd)) {overflow:hidden;aspect-ratio:1 / 1;img:where(.svelte-1yaifwd) {
/* Prevent the image from being dragged */pointer-events:none;}}.blur:where(.svelte-1yaifwd) {display:contents;& > :where(.svelte-1yaifwd) {position:absolute;inset:0;pointer-events:none;}.overlay:where(.svelte-1yaifwd) {display:flex;justify-content:center;align-items:center;z-index:-1;backdrop-filter:blur(32px) brightness(0.8);}img:where(.svelte-1yaifwd) {width:100%;height:100%;z-index:-2;object-fit:cover;transform:scale(1.2);&.loaded {opacity:1;}}}&.cover {padding:0;& > :is(img, video) {flex:auto;}}& > :is(img, video) {flex:0;max-width:100%;max-height:100%;}&.dissolve {:is(img, video) {opacity:0;transition:opacity 250ms;}&.loaded {:is(img, video) {opacity:1;}}}}
/* prettier-ignore */.checkerboard.svelte-1yaifwd img:where(.svelte-1yaifwd) {
/* hardcoded, the same color as the checkerboard in Photoshop */background-image:linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%),
linear-gradient(45deg, #ccc 25%, #fff 25%, #fff 75%, #ccc 75%);background-size:8px 8px;background-position:0 0, 4px 4px;}.svelte-1yaifwd:not(.checkerboard) img:where(.svelte-1yaifwd) {
/* hardcoded, the same color as the transparent image preview in Chrome and Firefox */background-color:#e5e5e5;}:is(img, video) {object-fit:contain;&:not([src]) {visibility:hidden;}}.cover.svelte-1yaifwd :is(img, video) {object-fit:cover;aspect-ratio:1 / 1;}`};function u$(e,t){O(t,!0),K(e,Nze);let n=J(t,`loading`,3,`lazy`),r=J(t,`asset`,3,void 0),i=J(t,`src`,3,void 0),a=J(t,`variant`,3,void 0),o=J(t,`blurBackground`,3,!1),s=J(t,`cover`,3,!1),c=J(t,`checkerboard`,3,!1),l=J(t,`dissolve`,3,!0),u=J(t,`alt`,3,``),d=J(t,`controls`,3,!1),f=J(t,`holdTransition`,3,!1),p=J(t,`onError`,3,()=>void 0),m=ks(t,Dze),h=j(void 0),g=A(()=>r()??i()),_=j(void 0),v=j(void 0),y=A(()=>!!z(g)&&z(_)===z(g)),b=A(()=>!!z(g)&&z(v)===z(g)),x=j(void 0),S=A(()=>(r(),i())),C=j(void 0),w=A(()=>!!r()&&!!a()&&!d()),T=A(()=>t.kind===`image`||!!r()&&oV(r().name)||z(w)&&aV.includes(t.kind)),ee=IR(),te,ne=[],re,ie=!1,ae,oe=()=>{ae?.(),ae=void 0},se=e=>{e&&!ne.includes(e)&&ne.push(e)},ce=e=>{let t=e?ne.indexOf(e):-1;t>-1&&(ne.splice(t,1),WX(e))},le=async()=>{if(!r()||!z(h))return;let e=ee.next(),t=r(),i=z(w);n()===`lazy`&&await Sl(z(h));let a,s=!1;try{a=i?await zX(t):await FX(t)}catch{s=!0}if(ie){WX(a);return}if(!e()){i&&WX(a);return}s?M(_,t):M(S,a);let c=te,l=s?c:a;te=l,i&&se(l),c!==l&&ce(c),o()&&!z(x)&&l&&M(x,l,!0),Eze()},ue=async()=>{if(!z(h)||!z(C))return;let e=z(h).getAttribute(`src`)===z(C)&&(z(T)?z(h).complete:!!z(h).readyState),t=z(g),n=z(C);if(!e){let e=await new Promise(e=>{z(h)?.addEventListener(z(T)?`load`:`loadedmetadata`,()=>e(!1),{once:!0}),z(h)?.addEventListener(`error`,()=>e(!0),{once:!0})});if(z(C)!==n)return;if(e){M(_,t);return}}oe(),z(h)&&(l()&&await Sl(z(h)),M(v,t))};L(()=>{o()&&r()&&!z(x)&&(async()=>{let e=await zX(r(),{cacheOnly:!0});ie?WX(e):e&&(M(x,e,!0),se(e))})()}),L(()=>{o()&&!r()&&t.kind===`image`&&z(S)&&M(x,z(S),!0)}),L(()=>{re=r()}),L(()=>{if(f()&&z(g)){oe();let{promise:e,resolve:t}=Promise.withResolvers();ae=t,hze(e)}}),L(()=>{z(y)&&(oe(),fo(()=>p()()))}),L(()=>{z(h)&&r()&&le()}),yk(()=>{if(r()||!z(S)||!z(h)||n()!==`lazy`){M(C,z(S),!0);return}M(C,void 0);let e=z(S),t=z(h);return(async()=>(await Sl(t),e))()},e=>{M(C,e,!0)}),L(()=>{z(h)&&z(C)&&ue()}),js(()=>()=>{ie=!0,oe(),re&&GX(re),ne.splice(0).forEach(e=>{WX(e)}),z(h)&&xl(z(h))});var de=Mze();let fe;var pe=N(de),me=e=>{Xc(e,{name:`draft`})},he=e=>{var t=Oze();bs(t,()=>({loading:n(),src:z(C),alt:u(),...m}),void 0,void 0,void 0,`svelte-1yaifwd`),Ds(t,e=>M(h,e),()=>z(h)),dte(t),U(e,t)},ge=e=>{var t=kze();bs(t,()=>({src:z(C),controls:d()||void 0,playsinline:!0,...m}),void 0,void 0,void 0,`svelte-1yaifwd`),Ds(t,e=>M(h,e),()=>z(h)),U(e,t)},_e=e=>{var t=H(),n=P(t),r=e=>{var t=Aze();bs(t,()=>({src:z(C),controls:!0,playsinline:!0,...m}),void 0,void 0,void 0,`svelte-1yaifwd`),Ds(t,e=>M(h,e),()=>z(h)),U(e,t)},i=e=>{Xc(e,{name:`audio_file`})};G(n,e=>{d()?e(r):e(i,-1)}),U(e,t)},ve=e=>{Xc(e,{name:`draft`})};G(pe,e=>{z(y)?e(me):z(T)?e(he,1):t.kind===`video`?e(ge,2):t.kind===`audio`?e(_e,3):e(ve,-1)});var ye=I(pe,2),be=e=>{var t=jze(),n=N(t),r=N(n),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`loading`)]),U(e,t)};G(r,e=>{!z(w)&&!z(b)&&e(i)}),D(n);var a=I(n,2);let o;D(t),R(()=>{q(a,`src`,z(x)),o=os(a,1,`svelte-1yaifwd`,null,o,{loaded:!!z(x)})}),U(e,t)};G(ye,e=>{o()&&e(be)}),D(de),R(()=>fe=os(de,1,`preview ${a()??``}`,`svelte-1yaifwd`,fe,{cover:s(),checkerboard:c(),dissolve:l(),loaded:z(b)})),U(e,de),k()}var d$=(e,{service:t,developerURL:n,apiKeyURL:r})=>_t(Y(e,{values:{service:t,homeHref:`href="${n}"`,apiKeyHref:`href="${r}"`}}).replace(/[\u2068\u2069]/g,``),vA),f$=(e,t)=>{IG.apiKeys??={},IG.apiKeys[e]=t},p$=(e,t,n)=>{let r=t.trim();if(n?.test(r))return f$(e,r),r},Pze=B(`<p role="alert" class="error svelte-6ieow"> </p>`),Fze=B(`<div role="none" class="input-outer svelte-6ieow"><!></div>`),Ize=B(`<div role="none" class="input-outer svelte-6ieow"><!></div> <div role="none" class="input-outer svelte-6ieow"><!></div> <div role="none" class="input-outer svelte-6ieow"><!></div>`,1),Lze=B(`<!> <p role="alert" class="svelte-6ieow"><!> <!></p> <!> <!>`,1),Rze={hash:`svelte-6ieow`,code:`p.svelte-6ieow {margin:0 0 8px;&.error {color:var(--sui-error-foreground-color);}}.input-outer.svelte-6ieow {width:400px;max-width:100%;text-align:center;}`};function m$(e,t){O(t,!0),K(e,Rze);let n=J(t,`error`,3,void 0),r=J(t,`onAuth`,3,void 0),i=A(()=>Mr(t.serviceProps.serviceType,`stock_assets`)),a=A(()=>Mr(t.serviceProps.serviceId,``)),o=A(()=>Mr(t.serviceProps.serviceLabel,``)),s=A(()=>Mr(t.serviceProps.authType,`api_key`)),c=A(()=>Mr(t.serviceProps.developerURL,``)),l=A(()=>Mr(t.serviceProps.apiKeyURL,``)),u=A(()=>t.serviceProps.apiKeyPattern),d=A(()=>t.serviceProps.signIn),f=A(()=>z(i)===`stock_assets`),p=ta({userName:``,password:``}),m=j(`initial`);VO(e,{children:(e,t)=>{var h=Lze(),g=P(h),_=e=>{var t=Pze(),r=F(t,!0);R(()=>W(r,n())),U(e,t)};G(g,e=>{n()&&e(_)});var v=I(g,2),y=N(v),b=e=>{var t=H();Wo(P(t),()=>d$(`prefs.media.stock_photos.description`,{service:z(o),developerURL:z(c),apiKeyURL:z(l)})),U(e,t)};G(y,e=>{z(f)&&e(b)});var x=I(y,2),S=e=>{var t=H();Wo(P(t),()=>_t(Y(`cloud_storage.${z(a)}.auth.${z(m)}`,{default:Y(`cloud_storage.auth.${z(s)}.${z(m)}`,{values:{service:z(o),key:Y(`cloud_storage.${z(a)}.auth_key_label`,{default:Y(`cloud_storage.auth.${z(s)}.key_label`)})}})}),vA)),U(e,t)};G(x,e=>{z(i)===`cloud_storage`&&e(S)}),D(v);var C=I(v,2),w=e=>{var t=Fze(),n=N(t);{let e=A(()=>Y(`prefs.media.stock_photos.field_label`,{values:{service:z(o)}}));fu(n,{dir:`ltr`,flex:!0,monospace:!0,spellcheck:`false`,get ariaLabel(){return z(e)},oninput:e=>{let{value:t}=e.target;p$(z(a),t,z(u))!==void 0&&r()?.()}})}D(t),U(e,t)};G(C,e=>{z(s)===`api_key`&&e(w)});var T=I(C,2),ee=e=>{var t=Ize(),n=P(t),i=N(n);{let e=A(()=>Y(`username`)),t=A(()=>z(m)===`requested`);fu(i,{dir:`ltr`,flex:!0,spellcheck:`false`,get ariaLabel(){return z(e)},get disabled(){return z(t)},get value(){return p.userName},set value(e){p.userName=e}})}D(n);var o=I(n,2),s=N(o);{let e=A(()=>Y(`password`)),t=A(()=>z(m)===`requested`);LO(s,{get ariaLabel(){return z(e)},get disabled(){return z(t)},get value(){return p.password},set value(e){p.password=e}})}D(o);var c=I(o,2),l=N(c);{let e=A(()=>Y(`sign_in`)),t=A(()=>!p.userName||!p.password||z(m)===`requested`);Al(l,{variant:`secondary`,get label(){return z(e)},get disabled(){return z(t)},onclick:async()=>{M(m,`requested`),p.userName=p.userName.trim(),p.password=p.password.trim(),await z(d)?.(p.userName,p.password)?(M(m,`success`),IG.logins??={},IG.logins[z(a)]=[p.userName,p.password].join(` `),r()?.()):M(m,`error`)}})}D(c),U(e,t)};G(T,e=>{z(s)===`password`&&e(ee)}),U(e,h)},$$slots:{default:!0}}),k()}var zze=new Set([`$$slots`,`$$events`,`$$legacy`]);function h$(e,t){let n=ks(t,zze);u$(e,As({kind:`image`},()=>n))}function g$(e,t){O(t,!0);let n=J(t,`variant`,3,void 0),r=J(t,`size`,3,`small`),i=J(t,`disabled`,3,!1),a=J(t,`hidden`,3,!1),o=J(t,`onclick`,3,void 0);{let t=e=>{Xc(e,{name:`close`})},s=A(()=>Y(`remove`));Al(e,{get variant(){return n()},get size(){return r()},iconic:!0,get disabled(){return i()},get hidden(){return a()},get"aria-label"(){return z(s)},get onclick(){return o()},startIcon:t,$$slots:{startIcon:!0}})}k()}var Bze=new Map,_$=e=>{let t=Jc.current,n=PA(Bze,t,()=>new Intl.NumberFormat(t,{maximumFractionDigits:1})),r=1e3,i=r*1e3,a=i*1e3,o=a*1e3;return e<r?Y(`file_size_units.b`,{values:{size:n.format(e)}}):e<i?Y(`file_size_units.kb`,{values:{size:n.format(e/r)}}):e<a?Y(`file_size_units.mb`,{values:{size:n.format(e/i)}}):e<o?Y(`file_size_units.gb`,{values:{size:n.format(e/a)}}):Y(`file_size_units.tb`,{values:{size:n.format(e/o)}})},v$=(e,{fallback:t}={})=>{let n=Uk(e).extension?.toLowerCase()??``;return Y(`file_type_labels.${n}`,{default:t??n.toUpperCase()})},Vze=B(`<span role="none" class="image svelte-lbhi1w"><!></span>`),Hze=B(`<bdi> </bdi> · <bdi> </bdi>`,1),Uze=B(`<div role="listitem" class="file svelte-lbhi1w"><!> <div role="none" class="info svelte-lbhi1w"><div role="none" class="name"><!></div> <div role="none" class="meta svelte-lbhi1w"><!> <!></div></div> <!></div>`),Wze=B(`<div role="list" class="files svelte-lbhi1w"></div>`),Gze={hash:`svelte-lbhi1w`,code:`.files.svelte-lbhi1w {display:flex;flex-direction:column;gap:16px;margin:0 8px;}.file.svelte-lbhi1w {display:flex;align-items:center;gap:16px;overflow:hidden;.preview {flex:none;}.image:where(.svelte-lbhi1w) {flex:none;display:flex;justify-content:center;align-items:center;width:40px;height:40px;aspect-ratio:1 / 1;object-fit:cover;border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-tertiary-background-color);}.info:where(.svelte-lbhi1w) {flex:auto;display:flex;flex-direction:column;gap:4px;overflow:hidden;text-align:start;.meta:where(.svelte-lbhi1w) {font-size:var(--sui-font-size-small);color:var(--sui-secondary-foreground-color);}}}`};function y$(e,t){O(t,!0),K(e,Gze);let n=J(t,`files`,31,()=>ta([])),r=J(t,`transformedFileMap`,3,void 0),i=J(t,`removable`,3,!0),a=J(t,`showThumbnail`,3,!0),o=new Map,s=e=>{let t=o.get(e);return t===void 0&&(t=URL.createObjectURL(e),o.set(e,t)),t};L(()=>{let e=new Set(n());o.forEach((t,n)=>{e.has(n)||(URL.revokeObjectURL(t),o.delete(n))})}),Ms(()=>{o.forEach(e=>URL.revokeObjectURL(e)),o.clear()});var c=Wze();Bo(c,23,n,(e,t)=>`${e.name}-${t}`,(e,t,o)=>{var c=H();Fo(P(c),pl,null,e=>{let c=A(()=>z(t)),l=A(()=>r()?.get(z(t)));var u=Uze(),d=N(u),f=e=>{{let n=A(()=>s(z(t)));h$(e,{get src(){return z(n)},variant:`icon`,checkerboard:!0})}},p=A(()=>a()&&OH.includes(z(c).type)),m=e=>{var t=Vze();Xc(N(t),{name:`draft`}),D(t),U(e,t)};G(d,e=>{z(p)?e(f):e(m,-1)});var h=I(d,2),g=N(h);fl(N(g),{children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>z(c).name.normalize()]),U(e,n)},$$slots:{default:!0}}),D(g);var _=I(g,2),v=N(_);Io(v,()=>Jc.current,e=>{var t=Hze(),n=P(t),r=F(n,!0),i=F(I(n,2),!0);R((e,t)=>{W(r,e),W(i,t)},[()=>v$(z(c).name),()=>_$(z(c).size)]),U(e,t)});var y=I(v,2),b=e=>{var t=V();R(e=>W(t,e),[()=>Y(`file_meta_converted_from_x`,{values:{type:v$(z(l).name)}})]),U(e,t)};G(y,e=>{z(l)&&z(l).type!==z(t).type&&e(b)}),D(_),D(h);var x=I(h,2);{let e=A(()=>!i()||n().length===1);g$(x,{variant:`ghost`,size:`medium`,get hidden(){return z(e)},onclick:e=>{e.stopPropagation(),n(n().toSpliced(z(o),1))}})}D(u),U(e,u)}),U(e,c)}),D(c),U(e,c),k()}var Kze=B(`<div role="alert"><!></div>`),qze=B(`<div role="none"><!></div> <div role="none"><!></div> <!>`,1),Jze=B(`<div role="none" class="content svelte-1hhq62q"><!> <!></div>`),Yze=B(`<div role="none" class="drop-indicator svelte-1hhq62q"><div role="none" class="svelte-1hhq62q"><!> <span role="none"> </span></div></div>`),Xze=B(`<div role="none" class="drop-target svelte-1hhq62q"><!> <!></div> <!> <!>`,1),Zze={hash:`svelte-1hhq62q`,code:`.drop-target.svelte-1hhq62q {display:flex;flex-direction:column;position:relative;overflow:hidden;height:100%;pointer-events:auto;& > .group {overflow-y:auto;padding:16px;width:100%;height:100%;}button:not(:disabled) {pointer-events:auto;}}.drop-indicator.svelte-1hhq62q {position:absolute;inset:0;z-index:10;border-radius:var(--sui-control-large-border-radius);background-color:hsl(var(--sui-background-color-4-hsl) / 80%);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);text-align:center;pointer-events:none;div:where(.svelte-1hhq62q) {position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;border:4px dashed var(--sui-primary-accent-color);border-radius:var(--sui-control-large-border-radius);font-size:var(--sui-font-size-x-large);.icon {color:var(--sui-secondary-foreground-color);font-size:48px;}}}.content.svelte-1hhq62q {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;overflow:auto;height:100%;min-height:320px;text-align:center;}`};function b$(e,t){O(t,!0),K(e,Zze);let n=e=>{var t=H(),n=P(t),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`dropped_image_type_mismatch`,{values:{types:x(z(v))}})]),U(e,t)},a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`dropped_file_type_mismatch`,{values:{types:x(r().split(/,\s*/))}})]),U(e,t)};G(n,e=>{z(v)?e(i):e(a,-1)}),U(e,t)},r=J(t,`accept`,3,void 0),i=J(t,`disabled`,3,!1),a=J(t,`multiple`,3,!1),o=J(t,`showUploadButton`,3,!1),s=J(t,`showFilePreview`,3,!1),c=J(t,`filterDroppedFiles`,3,!0),l=J(t,`onDrop`,3,void 0),u=J(t,`children`,3,void 0),d=j(void 0),f=j(!1),p=j(!1),m=j(!1),h=j(void 0),g=j(ta([])),_=A(()=>o()||s()&&z(g).length),v=A(()=>AH(r())),y=()=>{z(h)?.open()},b=()=>{z(g).length&&(M(g,[],!0),l()?.({files:z(g)}))},x=e=>qA(Jc.current,{type:`disjunction`}).format(e),S=e=>{M(g,a()?e:e.slice(0,1),!0),l()?.({files:z(g)})},C=e=>{l()?.({files:e.detail.files})};js(()=>(z(d)?.addEventListener(`Select`,C),()=>{z(d)?.removeEventListener(`Select`,C)})),L(()=>{!z(_)&&z(p)&&M(m,!0)});var w={openFilePicker:y,reset:b},T=Xze(),ee=P(T),te=N(ee),ne=e=>{var t=Jze(),r=N(t),c=e=>{var t=qze(),r=P(t),o=N(r),s=e=>{var t=V();R(e=>W(t,e),[()=>Y(`drop_files_or_click_to_browse`,{values:{count:a()?2:1}})]),U(e,t)},c=e=>{var t=V();R(e=>W(t,e),[()=>Y(`tap_to_browse`)]),U(e,t)};G(o,e=>{iG.hasMouse?e(s):e(c,-1)}),D(r);var l=I(r,2),u=N(l);{let e=e=>{Xc(e,{name:`cloud_upload`})},t=A(()=>Y(`choose_files`,{values:{count:a()?2:1}}));Al(u,{variant:`primary`,get label(){return z(t)},get disabled(){return i()},onclick:()=>{y()},startIcon:e,$$slots:{startIcon:!0}})}D(l);var d=I(l,2),f=e=>{var t=Kze(),r=N(t);n(r),D(t),U(e,t)};G(d,e=>{z(p)&&e(f)}),U(e,t)};G(r,e=>{o()&&e(c)});var l=I(r,2),u=e=>{y$(e,{get files(){return z(g)},set files(e){M(g,e,!0)}})};G(l,e=>{s()&&z(g).length&&e(u)}),D(t),U(e,t)},re=e=>{var t=H();Go(P(t),()=>u()??kr),U(e,t)};G(te,e=>{z(_)?e(ne):e(re,-1)});var ie=I(te,2),ae=e=>{var t=Yze(),n=N(t),r=N(n);Xc(r,{name:`download`});var i=F(I(r,2),!0);D(n),D(t),R(e=>W(i,e),[()=>Y(`drop_files_here`,{values:{count:a()?2:1}})]),U(e,t)};G(ie,e=>{z(f)&&e(ae)}),D(ee),Ds(ee,e=>M(d,e),()=>z(d));var oe=I(ee,2);Ds(_u(oe,{get accept(){return r()},get multiple(){return a()},onSelect:({files:e})=>{S(e)}}),e=>M(h,e,!0),()=>z(h));var se=I(oe,2),ce=e=>{{let t=A(()=>Y(`unsupported_file_type`));nu(e,{get title(){return z(t)},get open(){return z(m)},set open(e){M(m,e,!0)},children:(e,t)=>{n(e)},$$slots:{default:!0}})}};return G(se,e=>{z(_)||e(ce)}),yo(`dragover`,ee,e=>{e.preventDefault(),!i()&&e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`,M(f,!0),M(p,!1))}),yo(`dragleave`,ee,e=>{e.preventDefault(),!i()&&M(f,!1)}),yo(`dragend`,ee,e=>{e.preventDefault(),!i()&&M(f,!1)}),yo(`drop`,ee,async e=>{if(e.preventDefault(),i()||!e.dataTransfer)return;M(f,!1);let t=await hbe(e.dataTransfer,{accept:c()?r():void 0});t.length?S(t):c()&&M(p,!0)}),U(e,T),k(w)}var x$=(e,t=kr)=>{var n=$ze();Bo(n,23,t,(e,t)=>`${e}-${t}`,(e,t)=>{var n=Qze(),r=F(n,!0);R(()=>W(r,z(t))),U(e,n)}),D(n),U(e,n)},Qze=B(`<li class="svelte-1luofoe"> </li>`),$ze=B(`<ul class="filenames svelte-1luofoe"></ul>`),S$=B(`<div class="svelte-1luofoe"> </div> <!>`,1),eBe=B(`<div class="svelte-1luofoe"><!></div> <!>`,1),tBe=B(`<!> <!> <!>`,1),nBe={hash:`svelte-1luofoe`,code:`div.svelte-1luofoe:not(:first-child) {margin-top:8px;}.filenames.svelte-1luofoe {border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-tertiary-background-color);font-size:var(--sui-font-size-default);}ul.svelte-1luofoe {margin:8px 0 0;padding:0;list-style:none;}li.svelte-1luofoe {margin:0;padding:0;}`};function C$(e,t){O(t,!0),K(e,nBe);let n=J(t,`accept`,3,void 0),r=j(!1),i=j([]),a=j([]),o=j([]),s=e=>{let{mismatchedFileNames:t=[]}=e;(e.oversizedFileNames.length||e.invalidFileNames.length||t.length)&&(M(i,e.oversizedFileNames),M(a,e.invalidFileNames),M(o,t),M(r,!0))},c=A(()=>[z(i),z(a),z(o)].filter(e=>e.length).length>1?Y(`assets_dialog.rejected_files.title`):z(o).length?Y(`unsupported_file_type`):z(a).length?Y(`assets_dialog.invalid_file.title`):Y(`assets_dialog.large_file.title`)),l=A(()=>AH(n())),u=e=>qA(Jc.current,{type:`disjunction`}).format(e);var d={report:s};return nu(e,{get title(){return z(c)},get open(){return z(r)},set open(e){M(r,e,!0)},children:(e,r)=>{var s=tBe(),c=P(s),d=e=>{var n=S$(),r=P(n),a=F(r,!0);x$(I(r,2),()=>z(i)),R(e=>W(a,e),[()=>Y(`warning_oversized_files`,{values:{count:z(i).length,size:_$(t.maxSize)}})]),U(e,n)};G(c,e=>{z(i).length&&e(d)});var f=I(c,2),p=e=>{var t=S$(),n=P(t),r=F(n,!0);x$(I(n,2),()=>z(a)),R(e=>W(r,e),[()=>Y(`warning_invalid_files`,{values:{count:z(a).length}})]),U(e,t)};G(f,e=>{z(a).length&&e(p)});var m=I(f,2),h=e=>{var t=eBe(),r=P(t),i=N(r),a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`warning_unsupported_image_files`,{values:{count:z(o).length,types:u(z(l))}})]),U(e,t)},s=e=>{var t=V();R(e=>W(t,e),[()=>Y(`warning_unsupported_files`,{values:{count:z(o).length,types:u(n().split(/,\s*/))}})]),U(e,t)};G(i,e=>{z(l)?e(a):e(s,-1)}),D(r),x$(I(r,2),()=>z(o)),U(e,t)};G(m,e=>{z(o).length&&e(h)}),U(e,s)},$$slots:{default:!0}}),k(d)}var w$=e=>{try{let{language:t,script:n}=new Intl.Locale(e).maximize();return`${t}-${n}`}catch{return}},T$=(e,t)=>{let n=Jc.current.toLowerCase(),[r]=n.split(`-`),i=w$(n);return e.find(e=>e.toLowerCase()===n)??(i?e.find(e=>w$(e)===i):void 0)??e.find(e=>e.split(`-`)[0]===r)??t},E$=async(e,t)=>{let n=t?await fetch(e,t):await fetch(e);if(!n.ok)throw Error(`Failed to fetch ${e}: ${n.status}`);return n.json()},D$=async({maxPages:e,fetchPage:t,parsePage:n})=>vV(async e=>{let r=e??1,{results:i,hasMore:a}=n(await t(r),r);return{results:i,next:a?r+1:void 0}},{maxPages:e}),rBe=`en-US,pt-BR,es-ES,ca-ES,de-DE,it-IT,fr-FR,sv-SE,id-ID,pl-PL,ja-JP,zh-TW,zh-CN,ko-KR,th-TH,nl-NL,hu-HU,vi-VN,cs-CZ,da-DK,fi-FI,uk-UA,el-GR,ro-RO,nb-NO,sk-SK,tr-TR,ru-RU`.split(`,`),O$=`https://api.pexels.com/v1`,k$={per_page:80},iBe=/\/photo\/(?<alt>.+?)-\d+\/$/,aBe=()=>T$(rBe,`en-US`),A$=e=>e.map(({id:e,url:t,alt:n,src:{large2x:r,medium:i},photographer:a})=>({id:String(e),description:t.match(iBe)?.groups?.alt.replace(/-/g,` `)??n,previewURL:i,downloadURL:r,fileName:`pexels-${a.split(/\s+/).join(`-`).toLowerCase()}-${e}.jpg`,kind:`image`,credit:`<a href="${t}">Photo by ${a} on Pexels</a>`})),oBe={serviceType:`stock_assets`,serviceId:`pexels`,serviceLabel:`Pexels`,serviceURL:`https://www.pexels.com/`,showServiceLink:!0,hotlinking:!1,authType:`api_key`,developerURL:`https://www.pexels.com/api/`,apiKeyURL:`https://www.pexels.com/api/new/`,apiKeyPattern:/^[a-zA-Z\d]{56}$/,list:async({apiKey:e})=>{let t={Authorization:e},n=(await E$(`${O$}/curated?${new URLSearchParams(k$)}`,{headers:t})).photos;return A$(n)},search:async(e,{apiKey:t})=>{let n={Authorization:t},r=new URLSearchParams({...k$,query:e,locale:aBe()});return A$(await D$({maxPages:2,fetchPage:e=>(r.set(`page`,String(e)),E$(`${O$}/search?${r}`,{headers:n})),parsePage:({photos:e,next_page:t})=>({results:e,hasMore:!!t})}))}},sBe=`https://picsum.photos/v2/list`,cBe=100,lBe=10,uBe=3,dBe=e=>e.map(({id:e,width:t,height:n})=>{let r=t>=n,[i,a]=r?[1920,1280]:[1280,1920],[o,s]=r?[480,320]:[320,480];return{id:e,description:``,previewURL:`https://picsum.photos/id/${e}/${o}/${s}.webp`,downloadURL:`https://picsum.photos/id/${e}/${i}/${a}.webp`,fileName:`picsum-${e}.webp`,kind:`image`}}),fBe={serviceType:`stock_assets`,serviceId:`picsum`,serviceLabel:`Lorem Picsum`,serviceURL:`https://picsum.photos/`,showServiceLink:!0,hotlinking:!0,authType:`none`,list:async()=>{let e=Array.from({length:lBe},(e,t)=>t+1).sort(()=>Math.random()-.5).slice(0,uBe);return dBe((await Promise.all(e.map(e=>E$(`${sBe}?page=${e}&limit=${cBe}`)))).flat().sort(()=>Math.random()-.5))}},pBe=`cs,da,de,en,es,fr,id,it,hu,nl,no,pl,pt,ro,sk,fi,sv,tr,vi,th,bg,ru,el,ja,ko,zh`.split(`,`),j$=`https://pixabay.com/api`,M$={image_type:`photo`,min_width:1280,safesearch:!0,per_page:150},N$=e=>e.map(({id:e,webformatURL:t,previewURL:n,largeImageURL:r,imageWidth:i,imageHeight:a,pageURL:o,tags:s,user:c})=>({id:String(e),description:s,previewURL:t.replace(`_640.`,i>a?`_180.`:`_340.`),downloadURL:r,fileName:n.split(`/`).pop().replace(`_150.`,`_1280.`),kind:`image`,credit:`<a href="${o}">Photo by ${c} on Pixabay</a>`})),P$=()=>T$(pBe,`en`),mBe={serviceType:`stock_assets`,serviceId:`pixabay`,serviceLabel:`Pixabay`,serviceURL:`https://pixabay.com/`,showServiceLink:!0,hotlinking:!1,authType:`api_key`,developerURL:`https://pixabay.com/service/about/api/`,apiKeyURL:`https://pixabay.com/api/docs/#api_key`,apiKeyPattern:/^\d+-[a-f\d]{25}$/,list:async({apiKey:e})=>{let t=(await E$(`${j$}/?${new URLSearchParams({...M$,key:e,lang:P$(),editors_choice:`true`})}`)).hits;return N$(t)},search:async(e,{apiKey:t})=>{let n=(await E$(`${j$}/?${new URLSearchParams({...M$,key:t,lang:P$(),q:e})}`)).hits;return N$(n)}},hBe=`af,sq,am,ar,hy,as,az,bn,ba,eu,bs,bg,yue,ca,lzh,zh-Hans,zh-Hant,hr,cs,da,prs,dv,nl,en,et,fo,fj,fil,fi,fr,fr-ca,gl,ka,de,el,gu,ht,he,hi,mww,hu,is,id,ikt,iu,iu-Latn,ga,it,ja,kn,kk,km,ko,ku,kmr,ky,lo,lv,lt,mk,mg,ms,ml,mt,mi,mr,mn-Cyrl,mn-Mong,my,ne,nb,or,ps,fa,pl,pt,pt-pt,pa,otq,ro,ru,sm,sr-Cyrl,sr-Latn,sk,sl,so,es,sw,sv,ty,ta,tt,te,th,bo,ti,to,tr,tk,uk,hsb,ur,ug,uz,vi,cy,yua,zu`.split(`,`),F$=`https://api.unsplash.com`,I$=`utm_source=sveltia-cms&utm_medium=referral`,L$={per_page:30},gBe=()=>T$(hBe,`en`),R$=e=>e.map(({id:e,description:t,alt_description:n,urls:{regular:r,thumb:i},user:{username:a,name:o},links:s})=>({id:String(e),description:[t,n].filter(Boolean).join(` — `),previewURL:i,downloadURL:r,fileName:`${o.split(/\s+/).join(`-`).toLowerCase()}-${e}-unsplash.jpg`,kind:`image`,credit:`Photo by <a href="https://unsplash.com/@${a}?${I$}">${o}</a> on <a href="https://unsplash.com/?${I$}">Unsplash</a>`,downloadTrackingURL:s?.download_location})),z$={pexels:oBe,picsum:fBe,pixabay:mBe,unsplash:{serviceType:`stock_assets`,serviceId:`unsplash`,serviceLabel:`Unsplash`,serviceURL:`https://unsplash.com/`,showServiceLink:!0,hotlinking:!0,authType:`api_key`,developerURL:`https://unsplash.com/developers`,apiKeyURL:`https://unsplash.com/oauth/applications`,apiKeyPattern:/^[a-zA-Z\d_-]{40,}$/,list:async({apiKey:e})=>{let t={Authorization:`Client-ID ${e}`};return R$(await E$(`${F$}/photos?${new URLSearchParams(L$)}`,{headers:t}))},search:async(e,{apiKey:t})=>{let n={Authorization:`Client-ID ${t}`},r=new URLSearchParams({...L$,query:e,lang:gBe()});return R$(await D$({maxPages:5,fetchPage:e=>(r.set(`page`,String(e)),E$(`${F$}/search/photos?${r}`,{headers:n})),parsePage:({results:e,total_pages:t},n)=>({results:e,hasMore:n<t})}))},trackDownload:async({downloadTrackingURL:e},{apiKey:t})=>{if(e)try{await E$(e,{headers:{Authorization:`Client-ID ${t}`}})}catch(e){console.error(e)}}}},B$=({fieldConfig:e}={})=>{let t=CH({libraryName:`stock_assets`,fieldConfig:e});if(t===!1)return{providers:[]};let n=Object.keys(z$),{providers:r}=t;return{providers:Array.isArray(r)?r:n}},V$=(e,t)=>{let n=e[1].serviceLabel.toLowerCase(),r=t[1].serviceLabel.toLowerCase();return n.localeCompare(r)},H$=({folder:e,enabled:t},n)=>t&&(!n||rU(e)),_Be=({assetLibraryFolderMap:e,isDefaultLibraryEnabled:t,selectFolder:n})=>{if(!t)return;let r=Object.entries(e).find(([,e])=>H$(e,n))?.[0];return r?`default-${r}`:void 0},vBe=({assetLibraryFolderMap:e,isDefaultLibraryEnabled:t,selectFolder:n,hasPendingFiles:r,cloudServiceEntries:i,externalServiceEntries:a})=>{let o=_Be({assetLibraryFolderMap:e,isDefaultLibraryEnabled:t,selectFolder:n});if(o)return o;let[s]=(r?i[0]:void 0)??a[0]??[``];return s},yBe=({fieldConfig:e,selectFolder:t,isDefaultLibraryEnabled:n})=>{if(t)return[];let{providers:r=[]}=B$({fieldConfig:e});return Object.entries(z$).filter(([e,{hotlinking:t}])=>r.includes(e)&&(t||n)).sort(V$)},bBe=({selectFolder:e,browsingSubfolders:t,folder:n,basePath:r,subfolderPath:i,selectedSubfolderPaths:a})=>!e||!t?[]:(a.length?a.map(e=>iU(e,r)):[i]).map(e=>PLe({folder:n,subfolderPath:e})),xBe=({path:e},t)=>t===void 0?``:WP(iU(e,t)),SBe=({resources:e,targetFolderPath:t})=>e.map(e=>{let{asset:n,replace:r}=e;return n?.unsaved?{file:n.file,folder:ni(n.folder),subfolderPath:xBe(n,t),replace:r}:ni(e)}),U$=({resources:e,resource:t,isSame:n,multiple:r=!1})=>r?[...e.filter(e=>!n(e)),t]:[t],W$=({libraryName:e,enteredURL:t})=>{let n=e===`enter-url`?t.trim():``;return n?[{url:n}]:[]},CBe=({trackDownload:e,resources:t,assets:n,options:r})=>{e&&t.forEach(({url:t})=>{let i=t?n.get(t):void 0;i&&e(i,r).catch(()=>{})})},G$={saved:!1,moved:!1,renamed:!1,deleted:!1,folderCreated:!1,folderRenamed:!1,folderDeleted:!1,deletionPending:!1,discarded:!1,deletionCancelled:!1,alreadyPublished:!1,published:!1,count:1},K$=mk({...G$}),q$=mk({...G$}),J$=e=>{[gH,_H].forEach(t=>{let n=t.current?e(t.current):void 0;n!==void 0&&(t.current=uX(n))})},Y$=(e,{slugificationEnabled:t=!1}={})=>{let n=Sk.current?.slug?.timezone===`local`?void 0:`UTC`;return{template:e,slugificationEnabled:t,randomValues:new Map,dateTimeParts:_z({timeZone:n})}},X$=({nameTemplate:{template:e,randomValues:t,dateTimeParts:n},originalName:r,collection:i,collectionFileName:a,content:o={},slug:s,isIndexFile:c=!1})=>{let{extension:l}=Uk(r),u={replaceSubContext:{collection:i,content:o,currentSlug:s,dateTimeParts:n,randomValues:t,assetFileName:r,identifierField:dz(i?._type===`entry`?i:void 0),basePath:void 0},getFieldArgs:{collectionName:i?.name??``,fileName:a,keyPath:``,valueMap:o,isIndexFile:c}},d=mN(e,(e,t)=>DU(t,u)).trim();return l?`${d}.${l}`:d},Z$=({draft:e,item:{file:t,nameTemplate:n},defaultLocaleSlug:r})=>{if(!n)return t.name;let{collection:i,fileName:a,defaultLocale:o,currentValues:s,isIndexFile:c}=e;return YB(X$({nameTemplate:n,originalName:t.name,collection:i,collectionFileName:a,content:s[o],slug:r,isIndexFile:c}),{slugificationEnabled:n.slugificationEnabled})},wBe=async(e,{convertHEIC:t=!1}={})=>{if(!TH.includes(e.type))return!0;if(await IH(e)===`heic`)return t;try{return(await createImageBitmap(e)).close(),!0}catch{return!1}},TBe=async(e,t)=>{if(!TH.includes(e.type))return!0;if(await IH(e)!==`heic`)try{if(await kLe(await XP(e)))return!0}catch{}return wBe(e,{convertHEIC:t})},Q$=async(e,{slugify_filename:t=!1,transformations:n,max_file_size:r=1/0}={},{nameTemplate:i}={})=>{let a=await TBe(e,XH(n));if(i||t){let{name:n,type:r,lastModified:a}=e,o=i?X$({nameTemplate:Y$(i),originalName:n}):n;o=YB(o,{slugificationEnabled:t}),e=new File([e],o,{type:r,lastModified:a})}if(!a)return{file:e,originalFile:void 0,oversized:!1,invalid:!0};let o=e;if(n)try{e=await zOe(e,n)}catch{return{file:e,originalFile:void 0,oversized:!1,invalid:!0}}return{file:e,originalFile:e===o?void 0:o,oversized:e.size>r,invalid:!1}},$$=e=>({validFiles:e.filter(({oversized:e,invalid:t})=>!e&&!t).map(({file:e})=>e),oversizedFiles:e.filter(({oversized:e,invalid:t})=>e&&!t).map(({file:e})=>e),invalidFiles:e.filter(({invalid:e})=>e).map(({file:e})=>e)}),EBe=LR(4),e1=()=>({processing:!1,validFiles:[],oversizedFiles:[],invalidFiles:[],transformedFileMap:new WeakMap}),t1=pk(e1());_k(()=>{let e=!1,t=vH.current.files,{config:n}=JH();return t1.current=e1(),(async()=>{t.length&&n.transformations&&(t1.current={...e1(),processing:!0});let r=vH.current.originalAssets?.length?void 0:n.filename_template,i=await Promise.all(t.map(t=>EBe(async()=>e?void 0:Q$(t,n,{nameTemplate:r}))));if(e)return;let a=i;t1.current={processing:!1,...$$(a),transformedFileMap:new WeakMap(a.filter(({originalFile:e})=>e!==void 0).map(({file:e,originalFile:t})=>[e,t]))}})(),()=>{e=!0}});var n1=mk({show:!1,status:`info`,message:``}),r1=pk({files:[]}),i1=e=>({...Sk.current?.media_libraries?.all,...e?.media_libraries?.all}),a1=(e,t)=>{n1.current={show:!0,status:`error`,message:e},console.error(t)},o1=(e,t=1)=>{n1.current.show=!1,q$.current={...G$,[e]:!0,count:t}},s1=e=>{let t=aQ.current;oQ.current=e,e&&t&&(mQ.current={...mQ.current,[t.serviceId]:e.length})},c1=e=>{let t=new Set(e.map(({id:e})=>e));s1(oQ.current?.filter(({id:e})=>!t.has(e))),yQ(e=>!t.has(e))},l1=(e,t)=>{let n=n=>n.id===e.id?t:n;s1(oQ.current?.map(n)),_Q.current=_Q.current.map(n),vQ.current?.id===e.id&&(vQ.current=t)},u1=(e,t=[])=>{let n=new Set(e.map(({id:e})=>e));yQ(e=>n.has(e));let r=uQ.current?.path;r!==void 0&&!e.some(({description:e})=>e.startsWith(`${r}/`))&&!t.some(e=>e===r||e.startsWith(`${r}/`))&&(uQ.current=void 0)},d1=0,f1=async({downloadURL:e})=>{let t=await fetch(e);if(!t.ok)throw Error(`The response returned with HTTP status ${t.status}.`);return t.blob()},p1=async e=>{d1+=1;let t=d1;s1(void 0),hQ.current=void 0,gQ.current=!1;try{let n=CQ(e),{assets:r,folders:i,truncated:a=!1}=e.browse?await e.browse(n):{assets:await e.list?.(n)??[],folders:[]};aQ.current===e&&t===d1&&(s1(r),cQ.current=i,gQ.current=a,u1(r,i))}catch(n){aQ.current===e&&t===d1&&(s1([]),cQ.current=[],hQ.current=`search_fetch_failed`,u1([])),console.error(n)}},m1=async(e,t,{replacing:n=!1}={})=>{let r=n?void 0:qH(t.filename_template),{validFiles:i,oversizedFiles:a,invalidFiles:o}=$$(await Promise.all(e.map(e=>Q$(e,t,{nameTemplate:r}))));return{validFiles:i,oversizedFileNames:a.map(({name:e})=>e),invalidFileNames:o.map(({name:e})=>e)}},DBe=async(e,{originalAsset:t}={})=>{let n=aQ.current,{validFiles:r,oversizedFileNames:i,invalidFileNames:a}=await m1(e,i1(),{replacing:!!t});if(n&&r.length){n1.current={show:!0,status:`info`,message:`uploading_files_progress`};try{let e={...CQ(n),dirPath:lQ.current};if(t)n.replace&&(l1(t,await n.replace(t,r[0],e)),o1(`saved`,1));else if(n.upload){let t=await n.upload(r,e);s1(iQ(t,oQ.current??[])),o1(`saved`,t.length)}}catch(e){a1(`uploading_files_failed`,e),await p1(n)}}return{oversizedFileNames:i,invalidFileNames:a}},h1=async e=>{let t=aQ.current;if(!t?.delete||!e.length)return!1;try{await t.delete(e,CQ(t))}catch(e){return a1(`deleting_assets_failed`,e),await p1(t),!1}return c1(e),o1(`deleted`,e.length),!0},OBe=async(e,t)=>{let n=aQ.current;if(n?.rename)try{let r=await n.rename(e,t,CQ(n));return l1(e,r),o1(`renamed`,1),r}catch(e){a1(`renaming_asset_failed`,e);return}},g1=e=>(oQ.current??[]).filter(({description:t})=>t.startsWith(`${e}/`)),kBe=e=>cQ.current.filter(t=>t===e||t.startsWith(`${e}/`)),_1=async(e,t,n)=>e.listFolder?e.listFolder(t,n):{assets:g1(t),folders:kBe(t)},ABe=async e=>{let t=aQ.current;if(!t?.createFolder)return!1;let n=UP([lQ.current,e]);try{await t.createFolder(n,CQ(t))}catch(e){return a1(`creating_folder_failed`,e),!1}return cQ.current=[...cQ.current,n],o1(`folderCreated`),!0},jBe=async({path:e},t)=>{let n=aQ.current;if(!n?.move||!n.createFolder||!n.deleteFolder)return!1;let r=[...e.split(`/`).slice(0,-1),t].join(`/`),i=t=>`${r}${t.slice(e.length)}`,a=CQ(n),o=uQ.current?.path===e;n1.current={show:!0,status:`info`,message:`renaming_folder`};try{let{assets:t,folders:r}=await _1(n,e,a);for(let e of t)await n.move(e,i(e.description),a);for(let e of r)await n.createFolder(i(e),a),await n.deleteFolder(e,a)}catch(e){return a1(`renaming_folder_failed`,e),await p1(n),!1}return await p1(n),o&&(uQ.current={name:t,path:r}),o1(`folderRenamed`),!0},MBe=async({path:e})=>{let t=aQ.current;if(!t?.delete||!t.deleteFolder)return!1;let n=CQ(t),r=[],i=[];n1.current={show:!0,status:`info`,message:`deleting_folder`};try{({assets:r,folders:i}=await _1(t,e,n)),await t.delete(r,n);for(let e of i)await t.deleteFolder(e,n)}catch(e){return a1(`deleting_folder_failed`,e),await p1(t),!1}return c1(r),cQ.current=cQ.current.filter(e=>!i.includes(e)),uQ.current?.path===e&&(uQ.current=void 0),o1(`folderDeleted`),!0},NBe=new WeakMap,v1=e=>PA(NBe,e,()=>new Map),PBe=RegExp(`(?<=[${[`Latin`,`Greek`,`Hebrew`,`Arabic`].map(e=>`\\p{Script=${e}}`).join(``)}]\\p{M}*)\\p{M}|(?<=\\p{Script=Cyrillic}\\p{M}*)[\\p{M}--[\\u0306]]`,`gv`),FBe=/^[\x00-\x7F]*$/,y1=e=>(e=e.trim(),e?FBe.test(e)?e.toLocaleLowerCase():e.normalize(`NFD`).replace(PBe,``).toLocaleLowerCase().normalize(`NFC`):``),b1=(e,t=void 0)=>{if(!t)return y1(e);let n=t.get(e);if(n!==void 0)return n;let r=y1(e);return t.set(e,r),r},x1=({value:e,terms:t,normalizedValueCache:n=void 0})=>b1(e,n).includes(t),S1=e=>[...new Set(y1(e).split(/\s+/).filter(Boolean))],C1=({value:e,tokens:t,normalizedValueCache:n=void 0})=>{let r=b1(e,n);return t.every(e=>r.includes(e))},w1={name:void 0,last_modified:`date`,size:`number`},IBe=Object.keys(w1),LBe=hk(()=>Object.entries(w1).map(([e,t])=>({key:e,label:Y(`sort_keys.${e}`),type:t}))),RBe=(e,t)=>t===`last_modified`?e.lastModified?.getTime()??0:t===`size`?e.size??0:e.fileName.split(`.`)[0],zBe=(e,{key:t,order:n}={})=>!t||!n||!IBe.includes(t)?e:Zz([...e],e=>RBe(e,t),t===`name`,n),BBe=(e,{field:t,pattern:n}={field:``,pattern:``})=>t===`fileType`?e.filter(({kind:e})=>e===n):e,VBe=(e,t)=>{if(t===`domain`)try{return new URL(e.downloadURL).hostname}catch{return}},HBe=(e,t)=>Jz(e,t,VBe),UBe=hk(()=>aQ.current?.serviceId===`linked`?[{label:Y(`domain`),field:`domain`}]:[]),WBe=(e,t)=>{let n=y1(t);return n?e.filter(e=>{let t=v1(e);return x1({value:e.fileName,terms:n,normalizedValueCache:t})||x1({value:e.description,terms:n,normalizedValueCache:t})}):e},T1=({dirPath:e,assets:t,folders:n})=>lU({dirPath:e,paths:[...t.map(({description:e})=>e),...n.map(e=>`${e}/`)]}),E1=({dirPath:e,assets:t})=>t.filter(({description:t})=>WP(t)===e),D1=({dirPath:e,serviceLabel:t})=>e?`/${e}`:t,O1=hk(()=>sQ(aQ.current)&&!SQ.current),k1=hk(()=>O1.current?T1({dirPath:lQ.current,assets:oQ.current??[],folders:cQ.current}):[]),GBe=gk(()=>DQ.current.sort),KBe=gk(()=>DQ.current.filter),qBe=hk(()=>{let e=oQ.current??[];return O1.current&&(e=E1({dirPath:lQ.current,assets:e})),BBe(zBe(e,GBe.current),KBe.current)}),A1=hk(()=>WBe(qBe.current,SQ.current)),JBe=hk(()=>{let e=uQ.current;if(e){let{name:t,path:n}=e,r=oQ.current??[];return{name:t,path:n,folderCount:T1({dirPath:n,assets:r,folders:cQ.current}).length,assetCount:E1({dirPath:n,assets:r}).length}}let t=aQ.current;if(!t)return;let n=O1.current,r=n?lQ.current:``;return{name:r.split(`/`).at(-1)||t.serviceLabel,path:r||void 0,folderCount:n?k1.current.length:void 0,assetCount:A1.current.length}}),j1=hk(()=>HBe(A1.current,DQ.current.group));_k(()=>{let e=new Set(A1.current.map(({id:e})=>e));fo(()=>yQ(t=>e.has(t)))});var M1=B(`<span role="alert"> </span>`),N1=B(`<!> <!>`,1),YBe=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),XBe=B(`<!> <!> <div role="none" class="grid-wrapper svelte-mqll9n"><!> <!></div>`,1),ZBe=B(`<!> <!> <!> <!> <!> <!>`,1),QBe={hash:`svelte-mqll9n`,code:`.grid-wrapper.svelte-mqll9n {overflow-y:auto;height:100%;}`};function $Be(e,t){O(t,!0),K(e,QBe);let n=e=>{var t=H(),n=P(t),r=e=>{_U(e,{get rootLabel(){return z(d)},get path(){return z(oe)},onNavigate:e=>{M(oe,e,!0)}})};G(n,e=>{z(ge)&&e(r)}),U(e,t)},r=e=>{var t=H(),r=P(t),i=e=>{VO(e,{children:(e,t)=>{var n=M1(),r=F(n,!0);R(e=>W(r,e),[()=>Y(z(he)?`searching`:`loading`)]),U(e,n)},$$slots:{default:!0}})},o=e=>{var t=N1(),r=P(t);n(r),VO(I(r,2),{children:(e,t)=>{var n=M1(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`no_files_found`)]),U(e,n)},$$slots:{default:!0}}),U(e,t)},c=e=>{var t=XBe(),r=P(t);n(r);var i=I(r,2),o=e=>{var t=YBe(),n=P(t);Lo(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),jl(n.lastChild,{status:`warning`,dismissible:!1,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`external_assets_truncated`)]),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)};G(i,e=>{z(se)&&e(o)});var c=I(i,2),l=N(c),u=e=>{CU(e,{get subfolders(){return z(ve)},get viewType(){return z(x)},onOpen:({path:e})=>{M(oe,e,!0)}})};G(l,e=>{z(ve).length&&e(u)}),yU(I(l,2),{get viewType(){return z(x)},get gridId(){return s()},get multiple(){return a()},children:(e,t)=>{zu(e,{get items(){return z(_e)},itemKey:`id`,renderItem:(e,t=kr)=>{let n=A(()=>{let{id:e,previewURL:n,description:r,kind:i}=t();return{id:e,previewURL:n,description:r,_kind:i}});{let r=A(()=>ke(t()));vU(e,{get value(){return z(n).id},get ariaLabel(){return z(n).description},get viewType(){return z(x)},get multiple(){return a()},get selected(){return z(r)},onChange:({detail:{selected:e}})=>{Ne(t(),e)},children:(e,t)=>{var r=N1(),i=P(r);u$(i,{get kind(){return z(n)._kind},get src(){return z(n).previewURL},get alt(){return z(n).description},variant:`tile`,crossorigin:`anonymous`});var a=I(i,2),o=e=>{{let t=A(()=>z(S)?{caption:z(n).description}:{path:z(ge)?iU(z(n).description,z(oe)):z(n).description});LV(e,As(()=>z(t)))}};G(a,e=>{(z(x)===`list`||!iG.isSmallScreen&&!z(S))&&e(o)}),U(e,r)},$$slots:{default:!0}})}},$$slots:{renderItem:!0}})},$$slots:{default:!0}}),D(c),U(e,t)};G(r,e=>{z(ie)?!z(_e).length&&!z(ve).length?e(o,1):e(c,-1):e(i)}),U(e,t)},i=J(t,`fieldConfig`,3,void 0),a=J(t,`multiple`,3,!1),o=J(t,`searchTerms`,3,``),s=J(t,`gridId`,3,void 0),c=J(t,`selectedResources`,31,()=>ta([])),l=A(()=>Mr(t.serviceProps.serviceType,`stock_assets`)),u=A(()=>Mr(t.serviceProps.serviceId,``)),d=A(()=>Mr(t.serviceProps.serviceLabel,``)),f=A(()=>Mr(t.serviceProps.hotlinking,!1)),p=A(()=>Mr(t.serviceProps.authType,`api_key`)),m=A(()=>t.serviceProps.init),h=A(()=>t.serviceProps.list),g=A(()=>t.serviceProps.browse),_=A(()=>t.serviceProps.search),v=A(()=>t.serviceProps.upload),y=A(()=>t.serviceProps.createFolder),b=A(()=>t.serviceProps.trackDownload),x=A(()=>z(u)===`picsum`?`grid`:qQ.current?.type),S=A(()=>z(l)===`stock_assets`),C=A(()=>i1(i())),w=A(()=>z(C).max_file_size??1/0),T=j(!0),ee=j(!1),te=j(``),ne=j(``),re=j(``),ie=j(null),ae=j(ta([])),oe=j(``),se=j(!1),ce=j(!1),le=j(!1),ue=j(void 0),de=j(!1),fe=j(!1),pe=j(void 0),me=A(()=>({kind:t.kind,fieldConfig:i(),apiKey:z(te),userName:z(ne),password:z(re)})),he=A(()=>z(_)?o().trim():``),ge=A(()=>!!z(g)&&!z(he)),_e=A(()=>{let e=z(ie)??[];return z(ge)?E1({dirPath:z(oe),assets:e}):e}),ve=A(()=>z(ge)?T1({dirPath:z(oe),assets:z(ie)??[],folders:z(ae)}):[]),ye=A(()=>uU({subfolders:z(ve),fileNames:z(_e).map(({fileName:e})=>e)})),be=A(()=>D1({dirPath:z(oe),serviceLabel:z(d)})),xe=IR(),Se=async e=>{let t=xe.next();M(ie,null),M(ue,void 0),M(se,!1);try{let n,r,i=!1;if(e?n=await z(_)(e,z(me)):z(g)?{assets:n,folders:r,truncated:i=!1}=await z(g)(z(me)):n=await z(h)?.(z(me))??[],!t())return;M(ie,n),M(se,i,!0),r&&M(ae,r,!0)}catch(e){if(!t())return;M(ue,`search_fetch_failed`),console.error(e)}},Ce=async e=>{let{downloadURL:t,fileName:n,credit:r}=e;if(z(f))return{url:t,credit:r};try{let i=await f1(e);return{url:t,credit:r,file:new File([i],n,{type:i.type})}}catch(e){M(ue,`image_fetch_failed`),console.error(e)}},we=async e=>{if(!z(v))return;let t=await m1(e,z(C));if(e=t.validFiles,z(pe)?.report(t),e.length){M(de,!0),M(fe,!1);try{let t=await z(v)(e,{...z(me),dirPath:z(oe)}),n=await Promise.all(t.map(e=>Ce(e)));c(n.filter(e=>!!e).slice(0,a()?void 0:1)),M(ie,iQ(t,z(ie)??[]))}catch(e){M(fe,!0),console.error(e),Se(z(he))}finally{M(de,!1)}}},Te=()=>z(ge)&&!!z(y),Ee=()=>{M(ce,!0)},De=async e=>{let t=z(oe)?`${z(oe)}/${e}`:e;try{await z(y)(t,z(me)),M(ae,[...z(ae),t],!0)}catch(e){M(le,!0),console.error(e)}},Oe=A(()=>new Set(c().map(({url:e})=>e))),ke=e=>z(Oe).has(e.downloadURL),Ae=new Map,je=new Map,Me=()=>{CBe({trackDownload:z(b),resources:c(),assets:je,options:z(me)})},Ne=async(e,t)=>{let{downloadURL:n}=e;if(t&&!a()&&[...Ae.keys()].forEach(e=>{Ae.set(e,!1)}),Ae.set(n,t),t){let t=await Ce(e);t&&Ae.get(n)&&(je.set(n,e),c(U$({resources:c(),resource:t,isSame:e=>e.url===n,multiple:a()})))}else c(c().filter(e=>e.url!==n))},Pe=()=>{let e=CQ(t.serviceProps);M(te,e.apiKey,!0),M(ne,e.userName,!0),M(re,e.password,!0),M(ee,z(p)===`none`||!!z(te)||!!z(re),!0)};js(()=>{(async()=>{typeof z(m)==`function`&&(M(T,!1),M(T,await z(m)(),!0)),z(T)&&(Pe(),M(ie,null))})()}),vk(()=>[z(he),z(ee)],()=>{z(ee)&&Se(z(he))});var Fe={uploadFiles:we,canCreateFolder:Te,showNewFolderDialog:Ee,trackDownloads:Me},Ie=ZBe(),Le=P(Ie),Re=e=>{var t=H(),n=P(t),a=e=>{VO(e,{children:(e,t)=>{var n=M1(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`assets_dialog.error.${z(ue)}`)]),U(e,n)},$$slots:{default:!0}})},o=e=>{{let t=A(()=>i()?.accept);b$(e,{get accept(){return z(t)},multiple:!0,onDrop:({files:e})=>we(e),children:(e,t)=>{r(e)},$$slots:{default:!0}})}},s=e=>{r(e)};G(n,e=>{z(ue)?e(a):z(v)?e(o,1):e(s,-1)}),U(e,t)},ze=e=>{m$(e,{get serviceProps(){return t.serviceProps},onAuth:Pe})},Be=e=>{VO(e,{children:(e,t)=>{var n=M1(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`cloud_storage.invalid`)]),U(e,n)},$$slots:{default:!0}})};G(Le,e=>{z(ee)?e(Re):z(T)?e(ze,1):e(Be,-1)});var Ve=I(Le,2);Xu(Ve,{get show(){return z(de)},duration:0,children:(e,t)=>{el(e,{status:`info`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`uploading_files_progress`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var He=I(Ve,2);Xu(He,{get show(){return z(fe)},set show(e){M(fe,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`uploading_files_failed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var Ue=I(He,2);Ds(C$(Ue,{get maxSize(){return z(w)}}),e=>M(pe,e,!0),()=>z(pe));var We=I(Ue,2);Xu(We,{get show(){return z(le)},set show(e){M(le,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`creating_folder_failed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var Ge=I(We,2),Ke=e=>{{let t=A(()=>Y(`new_folder`)),n=A(()=>Y(`new_folder_create`)),r=A(()=>Y(`new_folder_description`,{values:{folder:z(be)}}));wU(e,{get title(){return z(t)},get okLabel(){return z(n)},get description(){return z(r)},get takenNames(){return z(ye)},onSubmit:e=>{De(e)},get open(){return z(ce)},set open(e){M(ce,e,!0)}})}};return G(Ge,e=>{z(y)&&e(Ke)}),U(e,Ie),k(Fe)}var P1=B(`<div role="none" class="unsaved svelte-1ong0f1"> </div>`),eVe=B(`<!> <!> <!>`,1),tVe=B(`<div role="none" class="grid-wrapper svelte-1ong0f1"><!> <!></div>`),nVe=B(`<span role="none"> </span>`),rVe={hash:`svelte-1ong0f1`,code:".grid-wrapper.svelte-1ong0f1 {overflow-y:auto;height:100%;[role='listbox'] {background-color:transparent;&.grid {.unsaved {position:absolute;inset-block-start:8px;inset-inline-end:8px;z-index:1;}}&.list {.name {display:flex;gap:8px;align-items:center;justify-content:space-between;\n\n /* `Option` pins button descendants to `flex: none`, so a long name can’t shrink */.truncated-text {flex:auto;min-width:0;}}}}}.unsaved.svelte-1ong0f1 {display:flex;justify-content:center;align-items:center;border-color:var(--sui-info-border-color);border-radius:4px;padding:2px 6px;color:var(--sui-info-foreground-color);background-color:var(--sui-info-background-color);font-size:var(--sui-font-size-small);}"};function F1(e,t){O(t,!0),K(e,rVe);let n=J(t,`multiple`,3,!1),r=J(t,`kind`,3,void 0),i=J(t,`assets`,19,()=>[]),a=J(t,`viewType`,3,`grid`),o=J(t,`searchTerms`,3,``),s=J(t,`basePath`,3,void 0),c=J(t,`gridId`,3,void 0),l=J(t,`checkerboard`,3,!1),u=J(t,`emptyMessage`,3,void 0),d=J(t,`selectedResources`,31,()=>ta([])),f=J(t,`subfolders`,19,()=>[]),p=J(t,`onSelect`,3,void 0),m=J(t,`onOpenSubfolder`,3,void 0),h=J(t,`selectedSubfolderPaths`,19,()=>[]),g=J(t,`onSelectSubfolder`,3,void 0),_=A(()=>S1(o())),v=A(()=>i().map(e=>{let{folder:t,name:n,path:r}=e;return{asset:e,relPath:s()&&!t.entryRelative?CE(r.replace(s(),``)):n,key:dX(e)}})),y=A(()=>z(_).length?z(v).filter(e=>C1({value:e.relPath,tokens:z(_),normalizedValueCache:v1(e)})):z(v)),b=A(()=>new Set(d().flatMap(({asset:e})=>e?[dX(e)]:[]))),x=e=>z(b).has(dX(e)),S=(e,t)=>{let r=dX(e),i=e=>!!e.asset&&dX(e.asset)===r;t?(d(U$({resources:d(),resource:{asset:e},isSame:i,multiple:n()})),p()?.({asset:e})):d(d().filter(e=>!i(e)))};var C=H(),w=P(C),T=e=>{var t=tVe(),i=N(t),o=e=>{CU(e,{get subfolders(){return f()},get viewType(){return a()},get multiple(){return n()},get onOpen(){return m()},get selectedPaths(){return h()},get onSelect(){return g()}})};G(i,e=>{f().length&&e(o)});var s=I(i,2),u=e=>{{let t=A(()=>Y(`assets_dialog.available_${r()===`image`?`images`:`files`}`));yU(e,{get multiple(){return n()},get gridId(){return c()},get viewType(){return a()},get ariaLabel(){return z(t)},children:(e,t)=>{zu(e,{get items(){return z(y)},itemKey:`key`,renderItem:(e,t=kr)=>{let r=A(()=>t()),i=A(()=>{let{kind:e,unsaved:t}=z(r).asset;return{assetKind:e,unsaved:t}});{let t=A(()=>x(z(r).asset));vU(e,{get value(){return z(r).key},get ariaLabel(){return z(r).relPath},get viewType(){return a()},get multiple(){return n()},get selected(){return z(t)},onChange:({detail:{selected:e}})=>{S(z(r).asset,e)},children:(e,t)=>{var n=eVe(),o=P(n),s=e=>{var t=P1(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`assets_dialog.unsaved`)]),U(e,t)};G(o,e=>{a()===`grid`&&z(i).unsaved&&e(s)});var c=I(o,2);u$(c,{get kind(){return z(i).assetKind},get asset(){return z(r).asset},get alt(){return z(r).relPath},variant:`tile`,get checkerboard(){return l()}});var u=I(c,2),d=e=>{LV(e,{get path(){return z(r).relPath},children:(e,t)=>{var n=H(),r=P(n),o=e=>{var t=P1(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`assets_dialog.unsaved`)]),U(e,t)};G(r,e=>{a()===`list`&&z(i).unsaved&&e(o)}),U(e,n)},$$slots:{default:!0}})};G(u,e=>{iG.isSmallScreen&&a()!==`list`||e(d)}),U(e,n)},$$slots:{default:!0}})}},$$slots:{renderItem:!0}})},$$slots:{default:!0}})}};G(s,e=>{z(y).length&&e(u)}),D(t),U(e,t)},ee=e=>{VO(e,{children:(e,t)=>{var n=nVe(),r=F(n,!0);R(e=>W(r,e),[()=>u()??Y(`no_files_found`)]),U(e,n)},$$slots:{default:!0}})};G(w,e=>{z(y).length||f().length?e(T):e(ee,-1)}),U(e,C),k()}var iVe=B(`<div role="none" class="wrapper svelte-x4ewel"><!> <div role="none" class="panel svelte-x4ewel"><!></div></div>`),aVe={hash:`svelte-x4ewel`,code:`.wrapper.svelte-x4ewel {display:flex;flex-direction:column;height:100%;}.panel.svelte-x4ewel {flex:auto;overflow:hidden;}`};function oVe(e,t){O(t,!0),K(e,aVe);let n=J(t,`multiple`,3,!1),r=J(t,`kind`,3,void 0),i=J(t,`selectFolder`,3,!1),a=J(t,`uploadDisabled`,3,!1),o=J(t,`accept`,3,void 0),s=J(t,`assets`,19,()=>[]),c=J(t,`searchTerms`,3,``),l=J(t,`basePath`,3,void 0),u=J(t,`folderLabel`,3,``),d=J(t,`subfolderPath`,3,``),f=J(t,`subfolders`,19,()=>[]),p=J(t,`selectedResources`,31,()=>ta([])),m=J(t,`onNavigate`,3,void 0),h=J(t,`onOpenSubfolder`,3,void 0),g=J(t,`selectedSubfolderPaths`,19,()=>[]),_=J(t,`onSelectSubfolder`,3,void 0),v=j(void 0);L(()=>{p().length||fo(()=>{z(v)?.reset()})});{let y=A(()=>i()||a());Ds(b$(e,{get disabled(){return z(y)},get multiple(){return n()},get accept(){return o()},filterDroppedFiles:!1,get onDrop(){return t.onDrop},children:(e,t)=>{var a=iVe(),o=N(a);_U(o,{get rootLabel(){return u()},get path(){return d()},get onNavigate(){return m()}});var v=I(o,2),y=N(v);{let e=A(()=>qQ.current?.type),t=A(()=>i()?Y(`assets_dialog.no_subfolders`):void 0);F1(y,{get multiple(){return n()},get kind(){return r()},get assets(){return s()},get viewType(){return z(e)},get searchTerms(){return c()},get basePath(){return l()},get subfolders(){return f()},gridId:`select-assets-grid`,checkerboard:!0,get emptyMessage(){return z(t)},get onOpenSubfolder(){return h()},get selectedSubfolderPaths(){return g()},get onSelectSubfolder(){return _()},get selectedResources(){return p()},set selectedResources(e){p(e)}})}D(v),D(a),U(e,a)},$$slots:{default:!0}}),e=>M(v,e,!0),()=>z(v))}k()}var sVe=B(`<!> <!>`,1),cVe=B(`<!> <!> <!>`,1);function lVe(e,t){O(t,!0);let n=(e,n)=>{let r=()=>(n?.()).name,i=()=>(n?.()).label,a=()=>(n?.()).icon,o=()=>(n?.()).onclick;{let n=e=>{Xc(e,{get name(){return a()}})},s=A(()=>t.libraryName===r());Tu(e,{get name(){return r()},get label(){return i()},get selected(){return z(s)},get onclick(){return o()},startIcon:n,$$slots:{startIcon:!0}})}},r=A(()=>iG.isSmallScreen?Hu:Cu);var i=H(),a=P(i);{let e=A(()=>Y(`assets_dialog.locations`));Ko(a,()=>z(r),(r,i)=>{i(r,{class:`tabs`,get ariaLabel(){return z(e)},get"aria-controls"(){return t.controlsId},filterThreshold:-1,onChange:e=>{t.onChange(e.detail.name)},children:(e,r)=>{var i=cVe(),a=P(i),o=e=>{{let r=A(()=>Y(`asset_location.repository`));wu(e,{get label(){return z(r)},children:(e,r)=>{var i=H();Bo(P(i),17,()=>Object.entries(t.assetLibraryFolderMap),([e,t])=>e,(e,r)=>{var i=A(()=>Nr(z(r),2));let a=()=>z(i)[0],o=()=>z(i)[1];var s=H(),c=P(s),l=e=>{{let t=A(()=>({name:`default-${a()}`,label:o().folder?.label||Y(`assets_dialog.folder.${a()}`),icon:`folder`}));n(e,()=>z(t))}},u=A(()=>H$(o(),t.selectFolder));G(c,e=>{z(u)&&e(l)}),U(e,s)}),U(e,i)},$$slots:{default:!0}})}};G(a,e=>{t.showRepository&&e(o)});var s=I(a,2),c=e=>{{let r=A(()=>Y(`asset_location.external`));wu(e,{get label(){return z(r)},children:(e,r)=>{var i=sVe(),a=P(i);Bo(a,17,()=>t.cloudServiceEntries,([,{serviceId:e,serviceLabel:t}])=>e,(e,t)=>{var r=A(()=>Nr(z(t),2));let i=()=>z(r)[1].serviceId,a=()=>z(r)[1].serviceLabel;n(e,()=>({name:i(),label:a(),icon:`cloud`,onclick:()=>{i()===`cloudinary`&&OV.current&&(AV.current=!0)}}))});var o=I(a,2),s=e=>{{let t=A(()=>({name:`enter-url`,label:Y(`assets_dialog.enter_url`),icon:`link_2`}));n(e,()=>z(t))}};G(o,e=>{t.showURLInput&&e(s)}),U(e,i)},$$slots:{default:!0}})}};G(s,e=>{(t.showURLInput||t.cloudServiceEntries.length)&&e(c)});var l=I(s,2),u=e=>{{let r=A(()=>Y(`asset_location.stock_photos`));wu(e,{get label(){return z(r)},children:(e,r)=>{var i=H();Bo(P(i),17,()=>t.stockAssetProviderEntries,([e,{serviceLabel:t}])=>e,(e,t)=>{var r=A(()=>Nr(z(t),2));let i=()=>z(r)[0],a=()=>z(r)[1].serviceLabel;n(e,()=>({name:i(),label:a(),icon:`photo_camera_back`}))}),U(e,i)},$$slots:{default:!0}})}};G(l,e=>{t.stockAssetProviderEntries.length&&e(u)}),U(e,i)},$$slots:{default:!0}})})}U(e,i),k()}var I1=e=>{let t=e.folder.entryRelative?void 0:KX(e,{allowSpecial:!0,pathOnly:!0});return t===void 0?{asset:e}:{url:t}},L1=({config:e=xk.current,collection:t,collectionFile:n}={})=>!!(e?.readonly||t?.readonly||n?.readonly),uVe=e=>!!YV.current&&!!e&&!qq(Kq({cmsConfig:xk.current,collection:e})),R1=({collection:e,collectionFile:t}={})=>L1({collection:e,collectionFile:t})||uVe(e),z1=e=>!!e&&R1({collection:e.collection,collectionFile:e.collectionFile}),B1=(e,{collection:t,collectionFile:n,folder:r}={})=>xk.current?.readonly?Y(`readonly_cms`):!(e===`asset_folder`?r?.readonly:L1({collection:t,collectionFile:n}))&&YV.current?Y(`readonly_branch`,{values:{branch:YV.current}}):Y(`readonly_${e}`),V1=({loader:e,notLoadedMessage:t})=>{let n,r,i=pk(!1),a=async()=>(r??=(async()=>{let t;try{t=await e()}catch(e){throw r=void 0,e}return n=t,i.current=!0,t})(),r);return{loaded:i,load:a,preload:()=>{a().catch(()=>{})},get:()=>{if(!n)throw Error(t);return n},reset:()=>{n=void 0,r=void 0,i.current=!1}}},H1=V1({loader:()=>RN(`immutable`,`dist/immutable.es.js`),notLoadedMessage:"Immutable.js is not loaded yet. Call `loadImmutable()` first."}),U1=H1.loaded,W1=H1.load,G1=H1.preload,K1=H1.get;H1.reset;var q1=pk(0),J1=new WeakMap,dVe=async e=>J1.get(e)??!1,fVe=class{#e;constructor(e){this.#e=e,this.path=KX(e,{pathOnly:!0})??``,this.url=e.blobURL??this.path,this.field=void 0,this.fileObj=e.file,J1.set(this,(async()=>{try{let t=await FX(e);if(t&&t!==this.url)return this.url=t,q1.current+=1,!0}catch{}return!1})())}toString(){return this.url}async toBase64(){try{return Gk(await PX(this.#e))}catch(e){throw Error(`Failed to encode asset as base64: ${e.message}`)}}},pVe=class{constructor(e){this.path=e,this.url=e,this.field=void 0,this.fileObj=void 0}toString(){return this.url}async toBase64(){try{let e=await fetch(this.url);if(!e.ok)throw Error(`HTTP ${e.status}`);return Gk(await e.blob())}catch(e){throw Error(`Failed to encode asset as base64: ${e.message}`)}}},mVe=class{#e;constructor(e,t){this.#e=t,this.path=e,this.url=e,this.field=void 0,this.fileObj=t}toString(){return this.url}async toBase64(){return Gk(this.#e)}},Y1=({content:e,otherLocales:t,locales:n,slug:r,path:i,isNew:a,collectionName:o,associatedAssets:s})=>K1().fromJS({data:Vj(e),i18n:Object.fromEntries(t.map(e=>[e,{data:Vj(n[e].content)}])),slug:r,path:i,newRecord:a,collection:o,mediaFiles:s.map(({sha:e,file:t,size:n,blobURL:r,...i})=>({id:e,name:i.name,path:i.path,file:t,size:n,url:r,displayURL:r})),meta:{path:i},isModification:null,label:null,partial:!1,author:``,raw:``,status:``,updatedOn:``}),X1=({entry:e,locale:t,collectionName:n,associatedAssets:r,content:i})=>Y1({content:i??e?.locales?.[t]?.content??{},otherLocales:Object.keys(e?.locales??{}).filter(e=>e!==t),locales:e?.locales??{},slug:e?.slug??``,path:e?.locales?.[t]?.path??``,isNew:!1,collectionName:n,associatedAssets:r}),Z1=({entry:e,collectionName:t,fileName:n,files:r,typedKeyPath:i,componentNames:a,locale:o})=>s=>{let c=r?.[s]?.file;if(c)return new mVe(s,c);let l={value:s,entry:e,collectionName:t,fileName:n,typedKeyPath:i,locale:o},{asset:u,url:d}=(a?_Z({...l,componentNames:a}):mZ(l))??{};if(u)return new fVe(u);if(d)return new pVe(d)},hVe=new WeakMap,gVe=(e,t,n)=>PA(PA(PA(hVe,e,()=>new WeakMap),n,()=>new Map),t,()=>{let r=new Map;return e.forEach(e=>{AB({locale:t,fieldConfig:n,refEntry:e}).forEach(({value:t})=>{r.has(t)||r.set(t,e)})}),r}),_Ve=({locale:e,getFieldArgs:t})=>{let{valueMap:n={}}=t,r={},i=new Map;return Object.entries(n).forEach(([n,a])=>{let o=n.replace(/\.\d+$/,``),s=bM({...t,keyPath:o});if(s?.widget===`relation`){let{collection:t,file:n}=s,c=gVe((()=>{let e=`${t}:${n??``}`,r=i.get(e);if(r)return r;let a=n?[Tj(t,n)].filter(e=>!!e):rz(t);return i.set(e,a),a})(),e,s).get(String(a)),l=fj(t)?._i18n.defaultLocale;r[o]??={},r[o][t]??={},r[o][t][a]=(c?.locales[e]??(l?c?.locales[l]:void 0)??c?.locales._default)?.content}}),K1().fromJS(r)},vVe=({originalEntry:e,currentValues:t})=>({...e,locales:Object.fromEntries(Object.entries(t).map(([t,n])=>[t,{slug:e?.locales[t]?.slug??e?.slug,path:e?.locales[t]?.path??e?.subPath,content:PM(n)}]))}),yVe=RA(()=>pH.current,()=>new WeakMap),Q1=({collectionName:e,fileName:t})=>{let n=cH({collectionName:e,fileName:t});return n?PA(yVe(),n,()=>pH.current.filter(e=>vX(e,n))):[]},$1=({draft:e,locale:t})=>{let{collectionName:n,fileName:r,isIndexFile:i,originalEntry:a,currentValues:o,files:s}=e,c=vVe({originalEntry:a,currentValues:o}),l=c.locales[t].content??{},u={collectionName:n,fileName:r,valueMap:l,isIndexFile:i},d;return{entryMap:X1({entry:c,locale:t,collectionName:n,associatedAssets:Q1({collectionName:n,fileName:r}),content:l}),valueMap:l,getFieldArgs:u,get fieldsMetaData(){return d??=_Ve({locale:t,getFieldArgs:u}),d},getAsset:Z1({entry:c,collectionName:n,fileName:r,files:s,locale:t})}},e0=new WeakMap,t0=e=>{let t=e0.get(e);if(t)return t;let n=K1().fromJS(e);return e0.set(e,n),n},n0=new Map,r0=!1,i0=({draft:e,locale:t})=>{let n=n0.get(e)??new Map,r=n.get(t);if(r)return r;let i=$1({draft:{...e,currentValues:KM(e)},locale:t});return n.set(t,i),n0.set(e,n),r0||(r0=!0,queueMicrotask(()=>{n0.clear(),r0=!1})),i},a0=new Map,o0=new Map,s0=new Map,c0=new Map,l0=(e,t)=>`${e}:${t}`,u0=({locale:e,keyPath:t,instance:n})=>{n&&typeof n==`object`&&a0.set(l0(e,t),n)},d0=({locale:e,keyPath:t,instance:n})=>{let r=l0(e,t);a0.has(r)&&a0.get(r)!==n||(a0.delete(r),o0.delete(r),s0.delete(r),c0.set(r,(c0.get(r)??0)+1))},bVe=()=>{a0.clear(),o0.clear(),s0.clear(),c0.clear()},xVe=e=>{if(e===!1)return{valid:!1};if(typeof e==`object`&&e){let{error:t}=e;if(typeof t==`object`&&t&&typeof t.message==`string`)return{valid:!1,message:t.message}}return{valid:!0}},SVe=async({locale:e,keyPath:t,value:n,fieldConfig:r})=>{let i=l0(e,t),a=a0.get(i);if(typeof a?.isValid!=`function`){o0.set(i,{valid:!0,pending:!1});return}let o=(c0.get(i)??0)+1;c0.set(i,o);let s=o0.get(i);o0.set(i,{valid:s?.valid??!0,message:s?.message,pending:!0});let c=(async()=>{await W1();let e=t0(r),t;try{t=xVe(await a.isValid(n,e))}catch(e){t={valid:!1,message:e instanceof Error?e.message:Y(`validation.unexpected_error`)}}c0.get(i)===o&&o0.set(i,{...t,pending:!1})})();s0.set(i,c);try{await c}finally{s0.get(i)===c&&s0.delete(i)}},CVe=async()=>{for(;s0.size;)await Promise.all(s0.values())},wVe=({locale:e,keyPath:t,validity:n})=>{let r=l0(e,t);if(typeof a0.get(r)?.isValid!=`function`)return;let i=o0.get(r);i&&(n.customError=!i.valid,!i.valid&&i.message?n.customErrorMessage=i.message:delete n.customErrorMessage)},TVe=/(?<hours>[+-]\d{2})(?::?(?<minutes>\d{2}))?(?::?(?<seconds>\d{2}))?(?:\.\d+)?$|Z$/,f0=e=>String(Math.abs(Number(e))).padStart(2,`0`),EVe=new Map,p0=(e,t)=>{if(typeof e!=`string`||!e.trim())return;let{inputTimeZone:n}=IN(t);if(n===`local`||n===`utc`)return;let r=new Date(e);if(Number.isNaN(r.getTime()))return;let i=e.match(TVe);if(!i?.groups)return;let{hours:a,minutes:o=`0`}=i.groups,s=i[0]===`Z`?`+00:00`:`${a.startsWith(`-`)?`-`:`+`}${f0(a)}:${f0(o)}`;return(PA(EVe,n,()=>new Intl.DateTimeFormat(`en-US`,{timeZone:n,timeZoneName:`longOffset`})).formatToParts(r).find(e=>e.type===`timeZoneName`)?.value??``).replace(`GMT`,``)===s?n:void 0},DVe=(e,t)=>{let n=p0(e,t);if(n)return n;let{inputTimeZone:r,singleCustomTimeZone:i}=IN(t);if(i)return i;try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(r===`local`)return e}catch{return r===`local`?``:void 0}},m0=(e,t=new Date)=>{try{let n=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).formatToParts(t).find(e=>e.type===`timeZoneName`)?.value??``,r=e.split(`/`).pop()?.replaceAll(`_`,` `)??e;return`(${n.replace(`GMT`,``)}) ${r}`}catch{return e}};bN.default.extend(xN.default),bN.default.extend(SN.default),bN.default.extend(CN.default),bN.default.extend(GN.default);var OVe=/^(?<date>\d{4}-[01]\d-[0-3]\d)(?:T00:00(?::00)?(?:\.000)?Z)?$/,kVe=/(?:^|T)(?<time>[0-2]\d:[0-5]\d)(?!\d)/,AVe=/(?:^|T)[0-2]\d:[0-5]\d:[0-5]\d/,h0=({date:e,timeZone:t,inputTimeZone:n,dateOnly:r,timeOnly:i,includeUTCSeconds:a=!1,includeSeconds:o=!1})=>{let s=t||(n===`utc`?`UTC`:void 0),{year:c,month:l,day:u,hour:d,minute:f,second:p}=_z({date:e,timeZone:s}),m=`${c}-${l}-${u}`,h=`${d}:${f}${o?`:${p}`:``}`;return r?m:i?h:a&&s===`UTC`?`${m}T${h}${o?``:`:00`}.000Z`:`${m}T${h}`},jVe=({newValue:e,currentValue:t,fieldConfig:n,locale:r})=>{if(e===void 0||e===t)return!1;let i=iP(e,n,r),a=iP(t,n,r);return i!==void 0&&a!==void 0?i.getTime()!==a.getTime():i!==void 0||a!==void 0||e===``},g0=(e,t,{date:n=void 0,includeSeconds:r=!1}={})=>{let{dateOnly:i,timeOnly:a,inputTimeZone:o}=IN(e);return h0({date:n,timeZone:t,inputTimeZone:o,dateOnly:i,timeOnly:a,includeUTCSeconds:!0,includeSeconds:r})},_0=({inputValue:e,currentValue:t,fieldConfig:n,timeZone:r,outputUTC:i,locale:a})=>{let{format:o,dateOnly:s,timeOnly:c,inputTimeZone:l,outputUTC:u}=IN(n),d=i??u,f=!!e&&AVe.test(e),p=f?`HH:mm:ss`:`HH:mm`,m=s?`YYYY-MM-DD`:c?p:`YYYY-MM-DDT${p}`,h=l===`utc`?`UTC`:l===`local`?d?r:void 0:r||l;if(e===``)return``;if(!e)return;if(o){let t=WN(n,a),r=qN(l===`utc`),i=r(e,m);return i.isValid()||(i=r(e)),i.isValid()?(s||(h&&(i=bN.default.tz(i.format(`YYYY-MM-DDTHH:mm:ss`),h)),d&&l!==`utc`&&(i=i.utc())),eP(i,o,t)):``}if(s)return e;let g=t?`:00${t.endsWith(`.000`)?`.000`:``}`:`:00`;if(c){let t=f?e:`${e}${g}`;return l===`utc`?`${t}Z`:t}return l===`utc`?bN.default.utc(e).format():d?(r?bN.default.tz(e,r):(0,bN.default)(e)).utc().format():r&&l!==`local`?bN.default.tz(e,r).format(`YYYY-MM-DDTHH:mm:ssZ`):f?e:`${e}${g}`},v0=(e,{date:t=void 0,includeSeconds:n=!1,locale:r=void 0}={})=>{let{singleCustomTimeZone:i,outputUTC:a}=IN(e);return _0({inputValue:g0(e,i,{date:t,includeSeconds:n}),currentValue:``,fieldConfig:e,timeZone:i,outputUTC:a,locale:r})},y0=({currentValue:e,fieldConfig:t,timeZone:n,locale:r})=>{let{dateOnly:i,timeOnly:a,inputTimeZone:o,format:s}=IN(t),c=p0(e,t)??n,l=s?WN(t,r):void 0;if(!e)return``;let u=s&&(0,bN.default)(e,s,l,!0).isValid()?void 0:i?e.match(OVe)?.groups?.date:a?e.match(kVe)?.groups?.time:void 0;if(u)return u;if(i&&s){let t=$N({value:e,format:s,parseAsUTC:!1,localeKey:l});return t.isValid()?t.format(`YYYY-MM-DD`):``}let d=iP(e,t,r);return d?h0({date:d,timeZone:c,inputTimeZone:o,dateOnly:i,timeOnly:a}):``},b0=({fieldConfig:e,value:t,sourceLocale:n,targetLocale:r})=>{if(e.widget!==`datetime`||e.localize_format!==!0||typeof t!=`string`||!t)return t;let i=e,{format:a}=IN(i),o=WN(i,n),s=WN(i,r);if(!a||o===s)return t;let c=$N({value:t,format:a,parseAsUTC:!0,localeKey:o});return c.isValid()?eP(c,a,s??`en`):t},MVe=({fieldConfig:e,value:t,locale:n})=>{let r=e,{type:i,min:a,max:o,singleCustomTimeZone:s}=IN(r),c=typeof a==`string`&&!!a,l=typeof o==`string`&&!!o,u=!1,d=!1;if(t&&(c||l)){let e=y0({currentValue:t,fieldConfig:r,timeZone:s,locale:n});if(e){let t=document.createElement(`input`);t.type=i,c&&(t.min=a),l&&(t.max=o),t.value=e,{rangeUnderflow:u,rangeOverflow:d}=t.validity}}return{validity:{rangeUnderflow:u,rangeOverflow:d},detail:{hasMin:c,hasMax:l,invalid:u||d}}},NVe=new Intl.DateTimeFormat(`en-GB`,{hour12:!0,timeZone:`UTC`,hour:`2-digit`,minute:`2-digit`}),x0=e=>NVe.format(new Date(`1970-01-01T${e}Z`)).toUpperCase(),PVe=(e,t)=>{if(e===`date`)return t;if(e===`time`)return x0(t);let[n,r]=t.split(`T`);return`${n}, ${x0(r)}`},S0=({direction:e,limitKey:t,limitValue:n,fieldType:r,type:i,canAddMultiValue:a})=>r===`datetime`&&typeof n==`string`?Y(`validation.range_${e}.${i}`,{values:{[t]:PVe(i,n)}}):Y(r===`number`?`validation.range_${e}.number`:a?`validation.range_${e}.add`:`validation.range_${e}.select`,{values:{[t]:n}}),C0=({validity:e,fieldConfig:t})=>{let n=[],{widget:r=`string`}=t,{pattern:i=[]}=t,a=r===`datetime`,o=a?IN(t):{},s=r===`string`?t.type??`text`:a?o.type:r===`number`?`number`:void 0,{min:c,max:l}=a?o:t,u=r===`list`||r===`keyvalue`||Lk.includes(r)&&_M(t);if(e.valueMissing&&n.push(Y(`validation.value_missing`)),e.tooShort){let{minlength:e}=t;n.push(Y(`validation.too_short`,{values:{min:e}}))}if(e.tooLong){let{maxlength:e}=t;n.push(Y(`validation.too_long`,{values:{max:e}}))}return e.rangeUnderflow&&n.push(S0({direction:`underflow`,limitKey:`min`,limitValue:c,fieldType:r,type:s,canAddMultiValue:u})),e.rangeOverflow&&n.push(S0({direction:`overflow`,limitKey:`max`,limitValue:l,fieldType:r,type:s,canAddMultiValue:u})),e.patternMismatch&&n.push(i[1]),e.typeMismatch&&n.push(Y(`validation.type_mismatch.${s}`)),e.duplicateError&&n.push(Y(`validation.value_not_unique`)),e.mapKeyDuplicate&&n.push(Y(`validation.key_not_unique`)),e.mapKeyNumeric&&n.push(Y(`validation.key_numeric`)),e.customError&&n.push(e.customErrorMessage??Y(`validation.invalid_value`)),n},w0=e=>{let t=[];return e?.patternMismatch&&t.push(Y(`edit_path_error.invalid`)),e?.customError&&t.push(Y(`edit_path_error.recursive`)),e?.duplicateError&&t.push(Y(`edit_path_error.duplicate`)),t},FVe=({draft:e,locale:t})=>{let{currentValues:n,extraValues:r}=e,i=n[t]??{},a=r[t]??{};return Object.entries(e.validationMessages[t]??{}).filter(([,e])=>!!e.length).map(([e,t])=>{let[n]=e.match(vZ)??[];return{keyPath:e,messages:t,prefix:n,valueMap:n?a:i}}).filter(({keyPath:e,valueMap:t})=>e in t||Object.keys(t).some(t=>t.startsWith(`${e}.`))).map(({keyPath:n,messages:r,prefix:i,valueMap:o})=>{let s=bM(yM(e,{keyPath:yZ(n),valueMap:o,componentName:i?a[`${i}__sc_component_name`]:void 0}));return{keyPath:n,label:s?pB({config:s,locale:t}):``,messages:r}})},IVe=({fieldConfig:e,locale:t,value:n})=>{let r=e,{value_type:i=`int`,min:a,max:o}=r,s=n===null||typeof n==`string`&&!n.trim()?NaN:Number(n),c=DP(n,r),l=!c&&Number.isFinite(s),u=l&&typeof a==`number`&&s<a;return{validity:{rangeUnderflow:u,rangeOverflow:!u&&l&&typeof o==`number`&&s>o,typeMismatch:c||(i===`int`||i===`float`)&&SM({fieldConfig:e,locale:t})&&n===null}}},T0=({fieldConfig:e,value:t})=>{let n=e,{widget:r=`string`,minlength:i,maxlength:a}=n,o=Number.isInteger(i)&&i<=(a??1/0),s=Number.isInteger(a)&&(i??0)<=a,{type:c=`text`,prefix:l,suffix:u}=n,d=typeof t==`string`?t:String(t??``);r===`string`&&(l&&d.startsWith(l)&&(d=d.slice(l.length)),u&&d.endsWith(u)&&(d=d.slice(0,-u.length)));let f=[...d.trim()].length,p=o&&f<i,m=s&&f>a,h=!1;if(r===`string`&&d){if(c!==`text`){let e=document.createElement(`input`);e.type=c,e.value=d,{typeMismatch:h}=e.validity}c===`email`&&!h&&!d.split(`@`)[1]?.includes(`.`)&&(h=!0)}return{validity:{tooShort:p,tooLong:m,typeMismatch:h},detail:{count:f,hasMin:o,hasMax:s,invalid:p||m||h}}},LVe={datetime:MVe,number:IVe,string:T0,text:T0},E0=({value:e,validation:t,validity:n})=>{if(Array.isArray(t)){let r=XR(t[0]);r&&!r.test(String(e))&&(n.patternMismatch=!0)}},RVe=({value:e,required:t,validation:n,validity:r,selected:i=!1})=>{let a=typeof e==`string`?e.trim():e,o=!i&&(a==null||a===``);return t&&o&&(r.valueMissing=!0),E0({value:a,validation:n,validity:r}),{empty:o}},zVe=e=>{let{keyPath:t}=e,n=t.lastIndexOf(`.`);if(n===-1)return;let r=bM({...e,keyPath:t.slice(0,n)});if(r?.widget!==`code`)return;let{output_code_only:i=!1,keys:a={code:`code`,lang:`lang`}}=r;return!i&&[a.code,a.lang].includes(t.slice(n+1))?r:void 0},BVe=({keyPath:e,value:t,valueMap:n,fieldConfig:r,validities:i,locale:a})=>{let{output_code_only:o=!1,keys:s={code:`code`,lang:`lang`}}=r;return e in i[a]?{skip:!0,keyPath:e,value:t}:{skip:!1,keyPath:e,value:o?t:n[`${e}.${s.code}`]}},VVe=/(.+?)(?:\.[^.]*)?$/,HVe=({keyPath:e,getFieldArgs:t,validity:n,validities:r,locale:i,required:a,min:o,max:s})=>{let c=e=>bM({...t,keyPath:yZ(e)})?.widget===`keyvalue`,l=e.match(VVe)?.[1],u=c(l);if(!u&&c(e)&&(l=e,u=!0),l in r[i]||!u)return{skip:!0,keyPath:e};let d=EM(t.valueMap??{},l).filter(([e,t])=>e.trim()||t);return a&&!d.length?n.valueMissing=!0:typeof o==`number`&&d.length<o?n.rangeUnderflow=!0:typeof s==`number`&&d.length>s&&(n.rangeOverflow=!0),{skip:!1,keyPath:l,empty:!d.length}},D0=({collectionName:e,fileName:t,keyPath:n,itemKeyPath:r=n,valueMap:i,isIndexFile:a=!1,locale:o,summaryTemplate:s,hasSingleSubField:c=!1})=>{let l={collectionName:e,fileName:t,keyPath:``,valueMap:i,isIndexFile:a};if(!s)return c?IB({...l,keyPath:r,locale:o,plainText:!0}):WEe({valueMap:i,locale:o,keyPath:r,keyPathPrefix:`${r}.`,getFieldArgs:l,plainText:!0});let u=(e,t)=>{let i=_N(e);if(c){let e=bM({...l,keyPath:n});if(!(`field`in e)||e.field.name!==i)return``}return IB({...l,keyPath:c?r:`${r}.${i}`,locale:o,plainText:!0,transformations:t?fN(t,e=>u(sP(e).value)):void 0})};return mN(s,(e,t)=>{let{value:n,transformations:r}=sP(t);return u(n,r)})},UVe=({fieldType:e,type:t,typeKey:n,types:r})=>t?`The “${t}” type is not defined for the ${e} field.`:`The type key is not found in the ${e===`list`?`list item`:`object`}. The item must include the “${n}” property with one of the defined types: ${r.map(e=>e.name).join(`, `)}`,O0=({fieldType:e,keyPath:t,...n})=>{console.warn(`${e===`list`?`List item`:`Object field`} ${t}: ${UVe({fieldType:e,...n})}`)},k0=({types:e,fields:t,summary:n,type:r})=>{if(!e)return{typeConfig:void 0,unknownType:!1,subFields:t??[],summaryTemplate:n};let i=r?e.find(({name:e})=>e===r):void 0;return{typeConfig:i,unknownType:!i,subFields:i?.fields??[],summaryTemplate:i?.summary||n}},A0=(e,t)=>t?`${e}<${t}>`:e,j0=({typedKeyPath:e,type:t,subFieldName:n})=>`${A0(e,t)}.${n}`,M0=({fieldConfig:e,value:t,sourceLocale:n,targetLocale:r})=>{let{value_field:i}=e;return typeof t!=`string`||typeof i!=`string`||!i.startsWith(`{{locale}}/`)||!t.startsWith(`${n}/`)?t:`${r}/${t.slice(n.length+1)}`},N0=e=>b0({...e,value:M0(e)}),WVe=[`code`,`datetime`,`file`,`image`,`markdown`,`number`,`richtext`,`string`,`text`],P0=e=>e.i18n===`duplicate_if_empty`&&WVe.includes(e.widget??`string`)&&!_M(e),F0=(e,t)=>{if(e.widget!==`code`)return t;let{output_code_only:n=!1,keys:r={code:`code`}}=e;return n?t:`${t}.${r.code}`},I0=({content:e,fieldConfig:t,keyPath:n})=>Hj(e[F0(t,n)]),GVe=(e,t)=>{let n=t(e);if(n)return P0(n)?{fieldConfig:n,fieldKeyPath:e}:void 0;let r=e.lastIndexOf(`.`);if(r<0)return;let i=e.slice(0,r),a=t(i);return a?.widget===`code`&&P0(a)&&F0(a,i)!==i?{fieldConfig:a,fieldKeyPath:i}:void 0},L0=({fieldConfig:e,targetValue:t,previousValue:n,sourceLocale:r,targetLocale:i})=>Hj(t)||t===N0({fieldConfig:e,value:n,sourceLocale:r,targetLocale:i}),R0=e=>e===!0||e===`translate`||e===`duplicate_if_empty`,z0=e=>R0(e)||e===`duplicate`,B0=e=>e===void 0||e===!1||e===`none`,V0=e=>{let t=`field`in e,n=`fields`in e,r=`types`in e;return{hasSingleSubField:t,hasMultiSubFields:n,hasVariableTypes:r,hasSubFields:t||n||r}},KVe=e=>iF(e).some(e=>aF(e,e=>e.i18n===`duplicate`||P0(e))),H0=e=>e.widget===`list`&&R0(e.i18n)&&KVe(e),U0=(e,t=``)=>e.flatMap(e=>{let n=t?`${t}.${e.name}`:e.name;if(H0(e))return[n];let{fields:r}=e;return e.widget===`object`&&r?U0(r,n):[]}),W0=({fieldConfig:e,itemCount:t})=>e.max===1&&t<=1,qVe=({index:e,...t})=>D0({...t,itemKeyPath:`${t.keyPath}.${e}`}),G0=(e,t)=>{let n=e[t];return E(n)?n.__sc_item_id??t:t},K0=(e,t,{assignIds:n=!1}={})=>{e.forEach((e,r)=>{E(e)&&(n&&(e.__sc_item_id??=crypto.randomUUID()),e.__sc_item_original_key_path??=`${t}.${r}`)})},JVe=/^\d+/,YVe=/^\d+$/,XVe=({keyPath:e,value:t,valueMap:n,validity:r,validities:i,locale:a,required:o,min:s,max:c})=>{if(e in i[a])return{skip:!0};let l=Array.isArray(t)&&t.length?t.length:(()=>{let t=`${e}.`,r=new Set;return Object.keys(n).forEach(e=>{if(e.startsWith(t)){let n=e.slice(t.length).match(JVe)?.[0];n!==void 0&&r.add(n)}}),r.size})();return o&&!l?r.valueMissing=!0:typeof s==`number`&&l<s?r.rangeUnderflow=!0:typeof c==`number`&&l>c&&(r.rangeOverflow=!0),{skip:!1,empty:!l}},ZVe=({keyPath:e,value:t,valueMap:n})=>{if(Array.isArray(t)&&t.length)return t;let r=`${e}.`;return Object.keys(n).flatMap(e=>{let t=e.startsWith(r)?e.slice(r.length):void 0;return t!==void 0&&YVe.test(t)?[[Number(t),n[e]]]:[]}).sort(([e],[t])=>e-t).map(([,e])=>e)},q0=({fieldType:e,value:t,files:n})=>Lk.includes(e)&&typeof t==`string`&&t.startsWith(`blob:`)?n[t]?.file?.name:t,QVe=({keyPath:e,value:t,valueMap:n,fieldConfig:r,files:i,validity:a,validities:o,locale:s,required:c,min:l,max:u})=>{let{skip:d,empty:f}=XVe({keyPath:e,value:t,valueMap:n,validity:a,validities:o,locale:s,required:c,min:l,max:u}),{widget:p=`string`,pattern:m}=r;return!d&&!f&&Array.isArray(m)&&(p===`list`?!V0(r).hasSubFields:Bk.includes(p))&&E0({value:ZVe({keyPath:e,value:t,valueMap:n}).map(e=>q0({fieldType:p,value:e,files:i})).join(`,`),validation:m,validity:a}),{skip:d,keyPath:e,value:t,empty:!!f}},$Ve={object:({keyPath:e,value:t,valueMap:n,validity:r,required:i})=>{let a=t===void 0?!Object.keys(n).some(t=>t.startsWith(`${e}.`)):!t;return i&&a&&(r.valueMissing=!0),{skip:!1,keyPath:e,value:t,empty:a}},keyvalue:({keyPath:e,value:t,getFieldArgs:n,validity:r,validities:i,locale:a,required:o,min:s,max:c})=>{let l=HVe({keyPath:e,getFieldArgs:n,validity:r,validities:i,locale:a,required:o,min:s,max:c});return{skip:l.skip,keyPath:l.keyPath,value:t,empty:!!l.empty}},code:({keyPath:e,value:t,valueMap:n,fieldConfig:r,validities:i,locale:a})=>{let o=BVe({keyPath:e,value:t,valueMap:n,fieldConfig:r,validities:i,locale:a});return{skip:o.skip,keyPath:o.keyPath,value:o.value,empty:!1}}},eHe=(e,t)=>{Object.assign(e,{patternMismatch:!1,tooShort:!1,rangeUnderflow:!1,typeMismatch:!1}),t||(e.valueMissing=!1)},tHe=e=>{let t=QY(e)??e.originalEntry;return t?.workflow?NY(t,e.collection):`draft`},J0=e=>!$Y(e)||!AY(e.collection).allowIncompleteDrafts||tHe(e)!==`draft`,Y0=({slug:e})=>{if(typeof e==`string`)return e;if(E(e)&&typeof e.template==`string`)return e.template},X0=e=>!!e?.includes(`{{fields._slug}}`)||!!e?.includes(`{{fields._slug | localize}}`),nHe=(e=!0)=>typeof e==`boolean`?e?[`create`,`update`]:[]:Array.isArray(e)?e:[],Z0=e=>{let{slug:t,file:n}=e,r=dz(e),i=E(t)?t:{},a=Y0(e),o=typeof n==`string`?[]:nHe(i.editable),s=o.includes(`update`);if(i.auto_increment===!0&&typeof n!=`string`)return{template:``,editorRequired:!1,editorValueIsSlug:!0,editable:{create:o.includes(`create`),update:s},localized:i.i18n===!0,autoIncrement:!0,hint:i.hint,pattern:i.pattern};let c=!!a?.includes(`{{fields._slug | localize}}`),l=X0(a)||o.includes(`create`),u=c||i.i18n===!0,d=a===void 0&&i.editable!==void 0&&o.includes(`create`),f=a??(d?u?`{{fields._slug | localize}}`:`{{fields._slug}}`:`{{${r}}}`),p=X0(f);return{template:f,editorRequired:p,editorValueIsSlug:!p||[`{{fields._slug}}`,`{{fields._slug | localize}}`].includes(f),editable:{create:l,update:s},localized:u,autoIncrement:!1,hint:i.hint,pattern:i.pattern}},Q0=(e,t)=>{let n={...e};return Object.entries(n).forEach(([e,r])=>{typeof r==`string`&&r.startsWith(`blob:`)&&t[r]&&(n[e]=t[r].file.name.replace(/\.[^.]+$/,``))}),n},rHe=new WeakMap,$0=e=>PA(rHe,e,()=>new Map),e2=e=>{let{collection:t,isNew:n,currentPath:r}=e;if(n&&AA(e)&&!OA(t))return CE(r)},t2=({draft:e})=>{let{collection:t,collectionFile:n,currentSlugs:r,currentValues:i,files:a,isIndexFile:o}=e,{_i18n:{defaultLocale:s}}=n??t;return{collection:t,content:{...Q0(i[s],a),_slug:r?.[s]??r?._},locale:s,isIndexFile:o,randomValues:$0(e)}},n2=({draft:e,locale:t})=>{let{currentSlugs:n,slugEditor:r}=e,i=n?.[t]??n?._;return!!r[t]&&!!i?.trim()},r2=({draft:e,locale:t,templateOnly:n=!1})=>{let{collection:r}=e;if(r._type!==`entry`)return``;let{template:i,editorRequired:a}=Z0(r);return!n&&!a&&n2({draft:e,locale:t})?`{{fields._slug}}`:i},i2=({draft:e,locale:t,templateOnly:n=!1})=>{let{collection:r}=e;return r._type!==`entry`||!Z0(r).autoIncrement?!1:n||!n2({draft:e,locale:t})},iHe=({draft:e,pendingEntries:t=e.pendingEntries})=>{let{collectionName:n}=e,r=[...iz(n),...KY(n),...t.filter(e=>e.collectionName===n).map(({entry:e})=>e)].flatMap(({slug:e,locales:t})=>[e,...Object.values(t).map(e=>e.slug)]).reduce((e,t)=>{let n=t.split(`/`).pop();return/^\d+$/.test(n)?Math.max(e,Number(n)):e},0);return String(r+1)},aHe=({draft:e,locale:t,localizingKeyPaths:n,defaultLocaleSlug:r,templateOnly:i=!1})=>{let{isNew:a,collection:o,collectionFile:s,originalLocales:c,currentSlugs:l,currentValues:u,files:d,isIndexFile:f}=e,{_i18n:{defaultLocale:p}}=s??o,m=l?.[t]??l?._;return a||!c[t]?i2({draft:e,locale:t,templateOnly:i})?r.split(`/`).pop():cX(r2({draft:e,locale:t,templateOnly:i}),{collection:o,locale:t,content:{...Q0(u[p],d),...Q0(Object.fromEntries(n.map(e=>[e,u[t]?.[e]]).filter(([,e])=>e!==void 0)),d),_slug:m},isIndexFile:f,randomValues:$0(e)}):m},oHe=[...Yk,...Object.keys(Qk),`slug`],a2=e=>{let{template:t,localized:n}=Z0(e),r=new Set;return[...t.matchAll(/{{(.+?)}}/g)].forEach(([,e])=>{let{value:t,transformations:i}=sP(e),a=_N(t);(i.some(({method:e})=>e===`localize`)||n&&!oHe.includes(a))&&r.add(a)}),[...r]},o2=e=>{let{_i18n:{i18nEnabled:t,structureMap:n}}=e;return t&&!ij(n)&&e._type===`entry`&&(Z0(e).localized||!!a2(e).length)},sHe=({draft:e,defaultLocaleSlug:t,templateOnly:n=!1})=>{let{collection:r,collectionFile:i,currentLocales:a}=e,{_i18n:{defaultLocale:o}}=i??r;if(i||!o2(r))return;let s=a2(r);return Object.fromEntries(Object.entries(a).map(([r])=>[r,r===o?t:aHe({draft:e,locale:r,localizingKeyPaths:s,defaultLocaleSlug:t,templateOnly:n})]))},s2=({draft:e,defaultLocaleSlug:t,localizedSlugs:n,fillSlugOptions:r})=>{if(!n)return;let{collection:i,collectionFile:a}=e,{_i18n:{canonicalSlug:{value:o}}}=a??i;return o===`{{slug}}`?t:cX(o,{...r,currentSlug:t})},c2=({draft:e,templateOnly:t=!1,pendingEntries:n=void 0})=>{let{isNew:r,collection:i,collectionFile:a,fileName:o,currentSlugs:s,isIndexFile:c}=e;if(c)return{defaultLocaleSlug:rA(i)?.name,localizedSlugs:void 0,canonicalSlug:void 0};let{_i18n:{defaultLocale:l}}=a??i,u=t2({draft:e}),d=o??(r?i2({draft:e,locale:l,templateOnly:t})?iHe({draft:e,pendingEntries:n}):cX(r2({draft:e,locale:l,templateOnly:t}),{...u,dirPath:e2(e)}):s?.[l]??s?._),f=sHe({draft:e,defaultLocaleSlug:d,templateOnly:t});return{defaultLocaleSlug:d,localizedSlugs:f,canonicalSlug:s2({draft:e,defaultLocaleSlug:d,localizedSlugs:f,fillSlugOptions:u})}},l2=(e,{inFolder:t=!0}={})=>{let{collectionName:n,originalEntry:r}=e,i=new Set(r?$P(r,{includePrevious:!0}):[]);return[...(t?iz:rz)(n),...KY(n)].filter(e=>!Object.values(e.locales).some(({path:e})=>i.has(e)))},u2=(e,t=Object.keys(e.currentSlugs))=>{let{collection:n,originalSlugs:r}=e,i=l2(e),a=e2(e),o=a?`${a}/`:``,s=e=>{let t=e.startsWith(o)?e.slice(o.length):void 0;return t?.includes(`/`)?void 0:t};return Object.fromEntries(t.map(e=>{let t=r[e]??r._,o=a!==void 0&&(e===`_`||e===n._i18n.defaultLocale);return[e,i.flatMap(t=>e===`_`?Object.values(t.locales).map(({slug:e})=>e):[t.locales[e]?.slug]).flatMap(e=>{if(typeof e!=`string`||e===t)return[];let n=o?s(e):e;return n===void 0?[]:[n]})]}))},d2=()=>Sk.current?.slug?.sanitize_replacement?.includes(` `)??!1,f2=({slug:e,required:t=!0,pattern:n,allowSpaces:r=d2(),takenSlugs:i=[],locale:a})=>{let o=e?.trim()??``;if(!o)return t?`empty`:void 0;if((r?/[/]|[^\S ]/:/[/\s]/).test(e))return`invalid`;if(Array.isArray(n)){let e=XR(n[0]);if(e&&!e.test(o))return`pattern`}if(i.includes(jN(o,{locale:a})))return`duplicate`},p2=({error:e,pattern:t})=>e===`pattern`&&t?.[1]?t[1]:Y(`edit_slug_error.${e}`),cHe=({draft:e,locale:t})=>{let{collection:n,isNew:r,currentLocales:i,currentSlugs:a,originalSlugs:o,slugEditor:s}=e;return n._type!==`entry`||t!==`_`&&!i?.[t]?!1:r?!!s[t]:a[t]!==o[t]&&!OA(n)},lHe=e=>{let{collection:t,isNew:n,currentSlugs:r,slugEditor:i}=e,a={},o=!0,s,{editorRequired:c,editorValueIsSlug:l,pattern:u}=Z0(t),d=!n||l,f=d2();return new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let i=r[t],l=cHe({draft:e,locale:t})?f2({slug:i,required:!n||c,pattern:u,allowSpaces:f,takenSlugs:d&&i?.trim()?(s??=u2(e))[t]:[],locale:t}):void 0,p={valueMissing:l===`empty`,patternMismatch:l===`invalid`,customError:l===`pattern`,duplicateError:l===`duplicate`,valid:!l};l&&(o=!1,p.customErrorMessage=p2({error:l,pattern:u})),a[t]={_slug:p}}),{valid:o,validities:a}},uHe=/\.\d+(?=\.|$)/,m2=({collection:e,isIndexFile:t=!1,keyPath:n,inEditorComponent:r=!1})=>e._type===`entry`&&!t&&!r&&!uHe.test(n),dHe=[`color`,`datetime`,`file`,`image`,`markdown`,`number`,`relation`,`richtext`,`select`,`string`,`text`],h2=(e,t)=>{if(e==null||typeof e==`object`)return;let n=String(e).trim();if(n){if(t===`number`){let e=Number(n);return Number.isFinite(e)?e:void 0}if(t===`color`)return n.toLowerCase();if(!(Lk.includes(t)&&n.startsWith(`blob:`)))return n}},g2=({draft:e,fieldConfig:t,keyPath:n,componentName:r})=>{let{widget:i=`string`}=t;return dHe.includes(i)&&t.unique===!0&&!_M(t)&&m2({collection:e.collection,isIndexFile:e.isIndexFile,keyPath:n,inEditorComponent:!!r})},fHe=({draft:e,locale:t,keyPath:n,value:r,fieldType:i})=>{let a=h2(r,i);if(a===void 0)return!1;let{collection:o}=e;return l2(e,{inFolder:!1}).some(e=>!aA(o,e)&&h2(e.locales[t]?.content[n],i)===a)},pHe={valueMissing:!1,tooShort:!1,tooLong:!1,rangeUnderflow:!1,rangeOverflow:!1,patternMismatch:!1,typeMismatch:!1,customError:!1,duplicateError:!1,mapKeyDuplicate:!1,mapKeyNumeric:!1},_2=e=>{let t={...e};return t.valid=!Object.values(e).some(Boolean),t},v2=e=>{if(e.widget!==`datetime`)return[];let{auto_now:t=!1}=e;return typeof t==`boolean`?t?[`create`,`update`]:[]:Array.isArray(t)?t:[]},y2=e=>v2(e).length>0,mHe=({stages:e,isNew:t,value:n})=>e.includes(`create`)&&(t||Hj(n))||e.includes(`update`)&&!t,b2=e=>{let{isNew:t,collectionName:n,fileName:r,isIndexFile:i,currentValues:a}=e,o=new Date;Object.entries(a).forEach(([e,a])=>{let s=new Map;Object.entries(a).forEach(([c,l])=>{let u=bM({collectionName:n,fileName:r,keyPath:c,valueMap:a,isIndexFile:i});u&&mHe({stages:v2(u),isNew:t,value:l})&&(a[c]=PA(s,u,()=>v0(u,{date:o,includeSeconds:!0,locale:e})))})})},x2=({collectionName:e,keyPath:t,locale:n})=>[...rz(e),...KY(e)].reduce((e,r)=>{let i=Number(r.locales[n]?.content?.[t]);return Number.isFinite(i)&&i>e?i:e},0),S2=(e,t=0)=>{let{collection:n,currentValues:r}=e,i=sz(n);if(!i)return;let{defaultLocale:a}=rj(e),o=x2({collectionName:n.name,keyPath:i,locale:a})+t+1;Object.values(r).forEach(e=>{e[i]=o})},C2=({fieldConfig:e,...t})=>e.widget===`number`&&e.auto_increment===!0&&m2(t),hHe=({fieldConfig:e,collection:t,keyPath:n,offset:r})=>{let{value_type:i=`int`,min:a}=e,o=Math.floor(x2({collectionName:t.name,keyPath:n,locale:t._i18n.defaultLocale})),s=typeof a==`number`&&Number.isFinite(a)?Math.ceil(a):1,c=Math.max(o+1,s)+r;return i.endsWith(`/string`)?String(c):c},w2=(e,t=0)=>{let{isNew:n,collection:r,collectionName:i,isIndexFile:a,currentValues:o,originalValues:s}=e;if(r._type!==`entry`||a)return;let{defaultLocale:c}=r._i18n,l=o[c]??{};Object.keys(l).forEach(e=>{let u=bM({collectionName:i,keyPath:e,valueMap:l,isIndexFile:a});if(!u||!C2({fieldConfig:u,collection:r,isIndexFile:a,keyPath:e})||!(n||Hj(s[c]?.[e])))return;let d=hHe({fieldConfig:u,collection:r,keyPath:e,offset:t});Object.values(o).forEach(t=>{e in t&&(t[e]=d)})})},gHe=/\.\d+(?=\.)/g,_He=/\.\d+(?=\.|$)/g,T2=({validities:e,validationMessages:t,locale:n,keyPath:r,fieldConfig:i})=>{let a=e[n][r];a&&(t[n][r]=C0({validity:a,fieldConfig:i}))},E2=e=>{let{draft:t,locale:n,valueMap:r,componentName:i,validities:a,enforceRequired:o=!0}=e,{collection:s,files:c,isIndexFile:l}=t,{keyPath:u,value:d}=e,f=yM(t,{keyPath:yZ(u),valueMap:r,componentName:i}),p=bM({...f})??TM({...f});if(!p)return;let{widget:m=`string`,i18n:h=!1,pattern:g}=p,_=_M(p)||xM(p)===`custom`&&Array.isArray(d),{min:v=0,max:y=1/0}=fbe.includes(m)?p:{},{i18nEnabled:b,defaultLocale:x}=rj(t);if(!i&&n!==x&&(!b||B0(h)||h===`duplicate`)||!i&&y2(p)||C2({fieldConfig:p,collection:s,isIndexFile:l,keyPath:u,inEditorComponent:!!i}))return;let S=SM({fieldConfig:p,locale:n}),C=lF(f),w={...pHe},T=!1,ee=m===`list`||_?QVe:$Ve[m];if(ee){let e=ee({keyPath:u,value:d,valueMap:r,fieldConfig:p,getFieldArgs:f,files:c,validity:w,validities:a,locale:n,required:S,min:v,max:y});if(e.skip)return;({keyPath:u,value:d,empty:T}=e)}let te=d;if(d=q0({fieldType:m,value:d,files:c}),!([`object`,`list`,`hidden`,`compute`,`keyvalue`].includes(m)||_)){let e=m===`select`&&NB({fieldConfig:p,value:d});({empty:T}=RVe({value:d,required:S,validation:g,validity:w,selected:e}))}let ne=LVe[m];return ne&&Object.assign(w,ne({fieldConfig:p,locale:n,value:d}).validity),!T&&g2({draft:t,fieldConfig:p,keyPath:u,componentName:i})&&(w.duplicateError=fHe({draft:t,locale:n,keyPath:u,value:te,fieldType:m})),!T&&C&&(w.mapKeyDuplicate=nCe({...C,valueMap:r,keyPath:u,value:d}),w.mapKeyNumeric=ZSe(String(d))),wVe({locale:n,keyPath:u,validity:w}),T&&eHe(w,o||!!C),_2(w)},D2=e=>{let{validities:t,locale:n,keyPath:r}=e,i=E2(e),a=!0;return i&&(t[n][r]=i,i.valid||(a=!1)),a},O2=({draft:e,locale:t,keyPath:n,value:r,valueMap:i})=>{let{validities:a,validationMessages:o}=e,s=yM(e,{keyPath:n,valueMap:i}),c=bM(s)?void 0:TM(s),l=c?n.replace(wM,``):n;if(!a?.[t]?.[l])return;let u=E2({draft:e,locale:t,keyPath:n,value:r,valueMap:i,enforceRequired:J0(e),validities:{[t]:{}}});u&&(a[t][l]=u,T2({validities:a,validationMessages:o,locale:t,keyPath:l,fieldConfig:c??bM(s)}))},k2=({draft:e,locale:t,keyPath:n,value:r,valueMap:i})=>{O2({draft:e,locale:t,keyPath:n,value:r,valueMap:i});let a=lF(yM(e,{keyPath:n,valueMap:i}));a&&uF({...a,valueMap:i}).forEach(a=>{a!==n&&(e.validities?.[t]?.[a]?.mapKeyDuplicate||String(i[a])===String(r))&&O2({draft:e,locale:t,keyPath:a,value:i[a],valueMap:i})}),[...n.matchAll(_He)].forEach(({index:r})=>{let a=n.slice(0,r),o=bM(yM(e,{keyPath:a,valueMap:i}));o&&(o.widget===`list`||_M(o))&&O2({draft:e,locale:t,keyPath:a,value:i[a],valueMap:i})})},vHe=({fieldConfig:e,validateArgs:t})=>{let{validities:n,locale:r,keyPath:i}=t,a=n[r][i]?.valid??D2(t),{widget:o=`string`}=e;return o===`list`&&!V0(e).hasSubFields||_M(e)?{valid:a,validateItems:!1}:{valid:a,validateItems:!0}},A2=({getFieldArgs:e},t)=>bM({...e,keyPath:yZ(t)}),j2=(e,{listKeyPath:t,fieldConfig:n,listFieldConfig:r})=>{let{validateArgs:i,validationMessages:a}=e,{validities:o,locale:s}=i,c=vHe({fieldConfig:n,validateArgs:{...i,keyPath:t,value:``}});return t in a[s]||T2({validities:o,validationMessages:a,locale:s,keyPath:t,fieldConfig:r}),c},M2=(e,{keyPath:t,value:n,getParentField:r,viaSubKey:i})=>{let{validateArgs:a,validationMessages:o,getFieldArgs:s}=e,{validities:c,locale:l,valueMap:u}=a,d=r({...s}),f=t.replace(wM,``);if(!d||f in c[l])return!0;let p=i?t:f,m=D2({...a,keyPath:p,value:i?n:u[f]}),h=c[l][p];return i&&h&&(delete c[l][t],c[l][f]=h),T2({validities:c,validationMessages:o,locale:l,keyPath:f,fieldConfig:d}),m},yHe=({draft:e,locale:t,valueMap:n,keyPath:r,value:i,validities:a,validationMessages:o,enforceRequired:s})=>{let[c]=r.match(vZ)??[],l=c?n[`${c}__sc_component_name`]:void 0;if(c&&!l)return!0;let u=!0,d={validateArgs:{draft:e,locale:t,valueMap:n,validities:a,enforceRequired:s,componentName:l},validationMessages:o,getFieldArgs:yM(e,{keyPath:yZ(r),valueMap:n,componentName:l})};[...r.matchAll(gHe)].forEach(({index:e})=>{let t=r.slice(0,e),n=A2(d,t);n?.widget===`list`&&!j2(d,{listKeyPath:t,fieldConfig:n,listFieldConfig:n}).valid&&(u=!1)});let f=mM.test(r)?r.replace(mM,``):void 0,p=f===void 0?void 0:A2(d,f),m=A2(d,r)??(p?.widget===`list`&&!V0(p).hasSubFields?p:void 0);if(!m){let e=M2(d,{keyPath:r,value:i,getParentField:TM,viaSubKey:!0}),t=M2(d,{keyPath:r,value:i,getParentField:zVe,viaSubKey:!1});return e&&t||(u=!1),u}if(xM(m)===`unknown`)return u;if(f!==void 0){let{valid:e,validateItems:t}=j2(d,{listKeyPath:f,fieldConfig:m,listFieldConfig:p});if(e||(u=!1),!t)return u}return D2({...d.validateArgs,keyPath:r,value:i})||(u=!1),T2({validities:a,validationMessages:o,locale:t,keyPath:r,fieldConfig:m}),u},N2=(e,{draft:t,enforceRequired:n=!0})=>{let{currentLocales:r}=t,i={},a={},o=!0;return Object.entries(t[e]).forEach(([e,s])=>{let c=Object.entries(s);r[e]?(i[e]={},a[e]={},c.forEach(([r,c])=>{yHe({draft:t,locale:e,valueMap:s,keyPath:r,value:c,validities:i,validationMessages:a,enforceRequired:n})||(o=!1)})):(i[e]=Object.fromEntries(c.map(([e])=>[e,{valid:!0}])),a[e]=Object.fromEntries(c.map(([e])=>[e,[]])))}),{valid:o,validities:i,validationMessages:a}},bHe=/(?<path>.+?)\.[^.]*$/,P2=({fieldConfig:e,getFieldArgs:t})=>{if(e.i18n!==void 0)return e.i18n;let n=t.keyPath.split(`.`);for(let e=n.length-2;e>=0;--e)if(!/^\d+$/.test(n[e])){let{i18n:r}=bM({...t,keyPath:n.slice(0,e+1).join(`.`)})??{};if(r!==void 0)return r}},F2=e=>P2(e)===`duplicate`,I2=({fieldConfig:e,getFieldArgs:t})=>{let{keyPath:n}=t,r=n.split(`.`),i=r.map((e,n)=>{if(n===0||!uM(e))return;let i=r.slice(0,n).join(`.`),a={...t,keyPath:i},o=bM(a);if(!(o?.widget!==`list`||F2({fieldConfig:o,getFieldArgs:a})))return`${i}.${e}`}).filter(e=>e!==void 0);return i.length?r=>{let a=e=>n in r||e in r||Object.keys(r).some(t=>t.startsWith(`${e}.`));return bM({...t,valueMap:r})===e&&i.every(a)}:()=>!0},xHe=({getFieldArgs:e,content:t})=>{let{keyPath:n}=e;if(!n.includes(`.`))return!0;let r=n.match(bHe)?.groups?.path;return!!bM({...e,keyPath:r})||Object.keys(t).some(e=>e.startsWith(`${r}.`))},L2=({draft:e,getFieldArgs:t,sourceLanguage:n,matchesListItems:r},i)=>{Object.entries(e.currentValues).forEach(([e,a])=>{e!==n&&xHe({getFieldArgs:t,content:a})&&r(a)&&i(a,e)})},SHe=({draft:e,getFieldArgs:t,fieldConfig:n,sourceLanguage:r,value:i})=>{let{keyPath:a}=t;L2({draft:e,getFieldArgs:t,sourceLanguage:r,matchesListItems:I2({fieldConfig:n,getFieldArgs:t})},(e,t)=>{let o=N0({fieldConfig:n,value:i,sourceLocale:r,targetLocale:t});e[a]!==o&&(e[a]=o)})},CHe=({draft:e,getFieldArgs:t,fieldConfig:n,fieldKeyPath:r,sourceLanguage:i,value:a,previousValue:o,deleted:s=!1})=>{let{keyPath:c,valueMap:l}=t,u=F0(n,r),d=c===u?o:l[u];L2({draft:e,getFieldArgs:t,sourceLanguage:i,matchesListItems:I2({fieldConfig:n,getFieldArgs:{...t,keyPath:r}})},(e,t)=>{let r=e[u],o=L0({fieldConfig:n,targetValue:r,previousValue:d,sourceLocale:i,targetLocale:t});if(s){o&&c in e&&delete e[c];return}let l=N0({fieldConfig:n,value:a,sourceLocale:i,targetLocale:t});o&&!(E(a)&&E(e[c]))&&e[c]!==l&&(e[c]=l)})},R2=({draft:e,locale:t,target:n={},getValueMap:r})=>{let{collectionName:i,fileName:a,isIndexFile:o}=e,s={collectionName:i,fileName:a,isIndexFile:o},c=Sj(i,a);if(!c)return;let{collection:l,collectionFile:u}=c,{defaultLocale:d,canonicalSlug:{key:f}}=(u??l)._i18n,p=()=>yxe()&&t===d,m=(e,t)=>p()&&F2({fieldConfig:e,getFieldArgs:t}),h=(e,t)=>{let n=typeof r==`function`?r():e,i=yM(s,{keyPath:t,valueMap:n});return{valueMap:n,getFieldArgs:i,fieldConfig:bM({...i})}},g=({fieldConfig:n,getFieldArgs:r,value:i,previousValue:a,deleted:o})=>{if(!p())return;let{keyPath:s}=r,c=GVe(s,e=>e===s?n:bM({...r,keyPath:e}));c&&CHe({draft:e,getFieldArgs:r,...c,sourceLanguage:t,value:i,previousValue:a,deleted:o})};return UM(n,{onSet:(n,r,i,a)=>{if([f].includes(r))return;let{fieldConfig:o,getFieldArgs:s,valueMap:c}=h(n,r);k2({draft:e,locale:t,keyPath:r,value:i,valueMap:c}),o&&m(o,s)&&SHe({draft:e,getFieldArgs:s,fieldConfig:o,sourceLanguage:t,value:i}),g({fieldConfig:o,getFieldArgs:s,value:i,previousValue:a})},onDelete:(n,r,i)=>{let{fieldConfig:a,getFieldArgs:o,valueMap:s}=h(n,r);if(r!==f&&k2({draft:e,locale:t,keyPath:r,value:void 0,valueMap:s}),a&&m(a,o)){let n=I2({fieldConfig:a,getFieldArgs:o});Object.entries(e.currentValues).forEach(([e,i])=>{e!==t&&r in i&&n(i)&&delete i[r]})}g({fieldConfig:a,getFieldArgs:o,previousValue:i,deleted:!0})}})},z2=({field:e,keyPath:t,keyPathList:n})=>{let{widget:r}=e,i=r===`list`;if(n.push(t),i||r===`object`){let{fields:r}=e,{types:a,typeKey:o=`type`}=e;if(r)r.forEach(e=>{z2({field:e,keyPath:i?`${t}.*.${e.name}`:`${t}.${e.name}`,keyPathList:n})});else if(a)n.push(i?`${t}.*.${o}`:`${t}.${o}`),a.forEach(e=>{e.fields?.forEach(e=>{z2({field:e,keyPath:i?`${t}.*.${e.name}`:`${t}.${e.name}`,keyPathList:n})})});else if(i){let{field:r}=e;r?z2({field:r,keyPath:`${t}.*`,keyPathList:n}):n.push(`${t}.*`)}}else r&&Bk.includes(r)&&_M(e)&&n.push(`${t}.*`)},wHe=e=>{let t=[];return e.forEach(e=>{z2({field:e,keyPath:e.name,keyPathList:t})}),t},B2=({collection:e,fields:t=[]})=>{if(e?._type!==`entry`)return;let{aliases_field:n=`aliases`}=e,r=n===!0?`aliases`:n||void 0;if(r&&!t.some(({name:e})=>e===r))return r},V2=(e,t)=>{let n=`${t}.`;return Object.keys(e).filter(e=>e.startsWith(n)&&/^\d+$/.test(e.slice(n.length))).sort((e,t)=>Number(e.slice(n.length))-Number(t.slice(n.length)))},H2=(e,t)=>{t&&(V2(e,t).forEach(t=>{delete e[t]}),delete e[t])},THe=new Map,EHe=e=>PA(THe,e,()=>RegExp(`^(${WO(e)})(?:\\.|$)`)),U2=({key:e,field:t,locale:n,unsortedMap:r,sortedMap:i,isTomlOutput:a,omitEmptyOptionalFields:o})=>{if(kM.test(e)){delete r[e];return}let s=r[e];if(a&&t?.widget===`datetime`&&!IN(t).format){if(Hj(s))s=void 0;else{let e=new pR(s);e.isValid()&&(s=e)}}if(o&&t&&!SM({fieldConfig:t,locale:n})&&Hj(s)){let t=Object.keys(r).filter(t=>t.startsWith(`${e}.`));t.some(e=>!kM.test(e)&&!Hj(r[e]))?i[e]=s:t.forEach(e=>{delete r[e]})}else i[e]=s;delete r[e]},DHe=[`code`,`hidden`],OHe=e=>DHe.includes(String(e.widget))||xM(e)===`custom`,kHe=({locale:e,defaultLocale:t,getFieldArgs:n},r)=>{if(e===t)return!0;let i=r.split(`.`);return i.every((e,t)=>{if(t<i.length-1&&/^\d+$/.test(e))return!0;let r={...n,keyPath:i.slice(0,t+1).join(`.`)},a=bM(r);return!!a&&z0(P2({fieldConfig:a,getFieldArgs:r}))})},AHe=(e,t,n)=>{let{unsortedMap:r,sortedMap:i,copyArgs:a}=e,o=`${t}.`,s=Object.keys(r).filter(e=>e.startsWith(o)?!e.slice(o.length).trim()&&!r[e]?(delete r[e],!1):!0:!1);s.length?(i[t]={},delete r[t],s.forEach(e=>{U2({...a,key:e,field:n})})):(Object.hasOwn(r,t)||kHe(e,t))&&(r[t]??={},U2({...a,key:t,field:n}))},jHe=({unsortedMap:e,copyArgs:t},n,r)=>{Object.hasOwn(e,n)&&U2({...t,key:n,field:r});let i=`${n}.`;Object.keys(e).filter(e=>e.startsWith(i)).forEach(e=>{U2({...t,key:e})})},MHe=({unsortedMap:e,sortedMap:t},n,r)=>{r?.widget===`object`&&rxe(e,n)&&(t[n]={})},W2=(e,t,n)=>{let r=!t.includes(`*`);if(n?.widget===`keyvalue`&&r)AHe(e,t,n);else if(n&&r&&OHe(n))jHe(e,t,n);else if(Object.hasOwn(e.unsortedMap,t))U2({...e.copyArgs,key:t,field:n});else return!1;return!0},NHe=(e,t,n)=>{let r=EHe(t);[...new Set(Object.keys(e.unsortedMap).map(e=>e.match(r)?.[1]).filter(e=>e!==void 0))].sort((e,t)=>TE(e,t)).forEach(t=>{let r=n??bM({...e.getFieldArgs,keyPath:t});W2(e,t,r)||MHe(e,t,r)})},PHe=({collectionName:e,fileName:t,fields:n,locale:r,defaultLocale:i,valueMap:a,canonicalSlugKey:o,aliasesKey:s,orderKey:c,isIndexFile:l=!1,isTomlOutput:u=!1})=>{let d=vr(a),f={},{omit_empty_optional_fields:p=!1}=Sk.current?.output??{},m={collectionName:e,fileName:t,valueMap:a,isIndexFile:l},h={locale:r,unsortedMap:d,sortedMap:f,isTomlOutput:u,omitEmptyOptionalFields:p},g={locale:r,defaultLocale:i,getFieldArgs:m,unsortedMap:d,sortedMap:f,copyArgs:h};return o&&Object.hasOwn(d,o)&&U2({...h,key:o}),s&&(Object.hasOwn(d,s)&&U2({...h,key:s}),V2(d,s).forEach(e=>{U2({...h,key:e})})),c&&Object.hasOwn(d,c)&&U2({...h,key:c}),wHe(n).forEach(e=>{let t=bM({...m,keyPath:e});W2(g,e,t)||NHe(g,e,t)}),Object.keys(d).sort((e,t)=>TE(e,t)).forEach(e=>{U2({...h,key:e})}),Bj(f)},G2=e=>Array.isArray(e)?e.filter(e=>e!=null).map(G2):Pj(e)?Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>[e,G2(t)])):e,K2=({draft:e,locale:t,valueMap:n,format:r})=>{let{collection:i,collectionName:a,collectionFile:o,fields:s,isIndexFile:c}=e,{_i18n:{defaultLocale:l,canonicalSlug:{key:u}}}=o??i,d=dA.includes(r??$A({collection:i,collectionFile:o,isIndexFile:c}).format),f=cF(PHe({collectionName:a,fileName:o?.name,fields:s,locale:t,defaultLocale:l,valueMap:n,canonicalSlugKey:u,aliasesKey:B2({collection:i,fields:s}),orderKey:sz(i),isIndexFile:c,isTomlOutput:d}),s,!1),p=d?G2(f):f;if(gM(s,`list`)){let e=!!oF(s[0]);if(e||!d)return p[s[0].name]??(e?{}:[])}return gM(s,`keyvalue`)?p[s[0].name]??{}:p},q2=(e,t)=>Object.fromEntries(e.flatMap(e=>{let{name:n,widget:r=`string`,comment:i}=e,a=`${t}${n}`,o=mA(i)?[[a,i]]:[];return r===`object`&&`fields`in e&&Array.isArray(e.fields)&&o.push(...Object.entries(q2(e.fields,`${a}.`))),o})),J2=(e=[],t=``)=>gM(e,`list`)||gM(e,`keyvalue`)?{}:q2(e,t),FHe=({config:e,fields:t})=>{let{_i18n:{i18nEnabled:n,allLocales:r,defaultLocale:i,structureMap:{i18nSingleFileDefaultRoot:a}={}}}=e;return n?Object.assign({},...r.map(e=>J2(t,a&&e===i?``:`${e}.`))):J2(t)},IHe=({config:e,entry:t,draft:n,format:r})=>{let{_i18n:{i18nEnabled:i,defaultLocale:a,structureMap:{i18nSingleFileDefaultRoot:o}={}}}=e;if(!i)return K2({draft:n,locale:`_default`,valueMap:t.locales[a].content,format:r});let s=Object.fromEntries(Object.entries(t.locales).filter(([,e])=>!!e.content).map(([e,t])=>[e,K2({draft:n,locale:e,valueMap:t.content,format:r})]));if(o){let{lang:e,...t}=s[a]??{},n=Object.fromEntries(Object.entries(s).filter(([e])=>e!==a));return{lang:[a,...Object.keys(n)],...t,...n}}return s},LHe=()=>JSON.rawJSON,RHe=e=>function(t,n){let r=this[t],i=r instanceof ZL?Cwe(r):lR(n);return i===void 0?n:e(i)},zHe=(e,t=Sk.current?.output?.json??{})=>{let{indent_style:n=`space`,indent_size:r=n===`tab`?1:2}=t,i=LHe();return JSON.stringify(e,i?RHe(i):void 0,n===`tab`?` `.repeat(r):r).trim()},BHe=e=>Uwe(Dwe()?uR(e):e).trim(),Y2=(e,t,n=``)=>{bF(e)&&e.items.forEach(({key:e,value:r})=>{let i=e,a=`${n}${i.value}`,o=Object.hasOwn(t,a)?t[a]:void 0;o&&(i.commentBefore=o.split(/\\n|\n/).map(e=>` ${e}`).join(`
`)),Y2(r,t,`${a}.`)})},VHe=/^(?:y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)$/,HHe=RegExp(`^[-+]?(?:0b[01_,]+|0[0-7_,]+|0x[\\da-fA-F_,]+|(?:\\d[\\d_,]*)?\\.[\\d_,]*(?:[eE][-+]?\\d+)?|\\d[\\d_,]*|\\d[\\d_]*(?::[0-5]?\\d)+(?:\\.[\\d_]*)?)$`),UHe=e=>VHe.test(e)||HHe.test(e),WHe=(e,t=Sk.current?.output?.yaml??{},n={},r={})=>{let{indent_size:i=2,indent_sequences:a=!0,quote:o=`none`}=t,{quote:s=!1}=n,c={indent:i,indentSeq:a,lineWidth:0,defaultKeyType:`PLAIN`,defaultStringType:s||o===`double`?`QUOTE_DOUBLE`:o===`single`?`QUOTE_SINGLE`:`PLAIN`,singleQuote:!(s||o===`double`)},l=new sL(e,{customTags:[wwe]});return kF(l,{Scalar:(e,t)=>{typeof t.value==`string`&&UHe(t.value)&&(t.type=c.singleQuote?`QUOTE_SINGLE`:`QUOTE_DOUBLE`);let n=lR(t.value);n!==void 0&&(t.value=BigInt(n))}}),Y2(l.contents,r),l.toString(c).trim()},X2={yaml:(e,{yamlQuote:t=!1},n)=>WHe(e,void 0,{quote:t},n),toml:e=>BHe(e),json:e=>zHe(e)},Z2=e=>e===`frontmatter`||lA.includes(e),GHe=({content:e,_file:t,comments:n})=>{let{format:r,fmDelimiters:i,bodyField:{key:a=`body`,inline:o=!1}={}}=t,[s,c]=i??cA[`yaml-frontmatter`],l=``;if(!o&&Object.hasOwn(e,a)){let t=e[a];(typeof t==`string`||t==null)&&(l=t??``,delete e[a])}if(!Object.keys(e).length){let e=l.split(`
`,1)[0].trimEnd();return[s,...Object.values(cA).map(([e])=>e)].includes(e)?`${s}\n\n${c}\n\n${l}\n`:`${l}\n`}let u=Z2(r)?pA(r):void 0;if(!u)throw Error(`Unsupported front matter format: ${r}`);let d=X2[u](e,t,n);return u===`json`&&s===`{`&&c===`}`&&(d=d.slice(1,-1).replace(/^\n/,``).replace(/\n$/,``)),`${s}\n${d}\n${c}\n${!o&&l?`\n${l}\n`:``}`},Q2=({content:e,_file:t,comments:n,valueSources:r})=>{let{format:i}=t;if(i===`raw`)return typeof e.body==`string`?`${e.body}\n`:``;r&&(e=dA.includes(i)?nTe(e,r):eR(e,r));try{return Z2(i)?GHe({content:e,_file:t,comments:n}):`${X2[pA(i)](e,t,n)}\n`}catch(e){throw Error(`The entry could not be formatted due to ${e.name}: ${e.message}`,{cause:e})}},$2=async({content:e,_file:t,comments:n,valueSources:r})=>{let{format:i,configuredFormat:a=i}=t,o=ik.get(a)?.formatter,s=o?a:i,c=o??ik.get(s)?.formatter,l=uA.includes(i);if(!c){if(!l)throw Error(ik.has(i)?`Entries in the custom “${i}” format can’t be saved, as no \`toFile\` method was registered for it with \`CMS.registerCustomFormat()\``:`Entries in the unknown “${i}” format can’t be saved`);return Q2({content:e,_file:t,comments:n,valueSources:r})}let u=await c(e,{serialize:async e=>{if(typeof e!=`object`||!e)throw TypeError("The `serialize` function must be given the entry content");if(!l)throw Error(`Entries in the custom “${i}” format can’t be serialized, as there’s no built-in formatter for it`);return Q2({content:Array.isArray(e)?[...e]:{...e},_file:t,comments:n,valueSources:r})}});if(typeof u!=`string`)throw TypeError(`The \`toFile\` method registered for the custom “${s}” format must return a string`);return`${u.trim()}\n`},KHe=({draft:e,config:t,_file:n,entry:r,locale:i,valueSources:a})=>$2(i===void 0?{content:IHe({config:t,entry:r,draft:e,format:n.format}),_file:n,comments:FHe({config:t,fields:e.fields}),valueSources:a}:{content:K2({draft:e,locale:i,valueMap:r.locales[i].content,format:n.format}),_file:n,comments:J2(e.fields),valueSources:a}),e4=e=>e||Vz(OY.current?.repository,`file-cache`),t4=async({previousPath:e,cacheDB:t})=>{if(e)return(await t?.get(e))?.sha},qHe=({i18nEnabled:e,structureMap:t={}})=>!e||ij(t),n4=async({draft:e,config:t,_file:n,entry:r,cacheDB:i,planChange:a})=>{let o=qHe(t._i18n)?[void 0]:t._i18n.allLocales;return(await Promise.all(o.map(async o=>{let s=a(o);if(!s)return;let{currentPath:c,...l}=s;if(l.action===`delete`)return{...l,previousSha:await t4({cacheDB:i,previousPath:c})};let[u,d]=await Promise.all([t4({cacheDB:i,previousPath:c}),KHe({draft:e,config:t,_file:Twe({_file:n,previousPath:c,path:l.path}),entry:r,locale:o,valueSources:n.arrayFile?void 0:bwe({previousPath:c,path:l.path})})]);return{...l,previousSha:u,data:d}}))).filter(Boolean)},r4=e=>e.slice(e.lastIndexOf(`/`)+1),i4=e=>r4(jA(e)),JHe=e=>TA(e)&&o2(e),YHe=({entries:e,dirPath:t,indexFileNames:n,locale:r})=>{let i=e.find(({subPath:e})=>n.some(n=>e===`${t}/${n}`));if(i){let e=i.locales[r]?.slug;return e&&i4(e)||void 0}let a=e.find(({subPath:e})=>e===t)?.locales[r]?.slug;return a?Uk(a).basename:void 0},a4=e=>{let{name:t}=e;return aX(rz(t),VY.current.filter(({workflow:e})=>e.collectionName===t))},o4=({collection:e,dirPath:t,locale:n,entries:r})=>{let i=CE(t);if(!i||n===e._i18n.defaultLocale||!JHe(e))return i;let a=DA(e),o=a?[a]:SA,s=r??a4(e),c=``;return i.split(`/`).map(e=>(c=c?`${c}/${e}`:e,YHe({entries:s,dirPath:c,indexFileNames:o,locale:n})??e)).join(`/`)},XHe=({basePath:e,path:t,extension:n,locale:r,omitLocale:i,structure:a})=>{if(zA(e))return`${HA({path:e,locale:r,omitLocale:i})}/${t}.${n}`;switch(a){case`multiple_folders`:return i?`${e}/${t}.${n}`:`${e}/${r}/${t}.${n}`;case`multiple_folders_i18n_root`:case`multiple_root_folders`:return i?`${e}/${t}.${n}`:`${r}/${e}/${t}.${n}`;case`multiple_files`:return i?`${e}/${t}.${n}`:`${e}/${t}.${r}.${n}`;default:return`${e}/${t}.${n}`}},s4=({draft:e,slug:t,indexFileName:n,locale:r})=>{let{collection:i,isNew:a,originalEntry:o,currentPath:s}=e,c=CE(s??``),l=r!==i._i18n.defaultLocale&&o2(i);if(n)return UP(a?[o4({collection:i,dirPath:c,locale:r}),t,n]:[o4({collection:i,dirPath:jA(c),locale:r}),l?i4(t)||t:r4(c),n]);let u=o?.locales[r]?.slug??(l?void 0:o?.subPath),d=u?Uk(u).basename:t;return UP([o4({collection:i,dirPath:c,locale:r}),d])},c4=({draft:e,locale:t,slug:n})=>{let{originalEntry:r,originalPath:i,currentPath:a}=e;return r?.locales?.[t]?.slug===n?!AA(e)||CE(i??``)===CE(a):!1},l4=({draft:e,locale:t,slug:n})=>{let{collection:r,collectionFile:i,originalEntry:a,currentValues:o,isIndexFile:s}=e,{_i18n:{defaultLocale:c,structure:l,omitDefaultLocaleFromFilePath:u}}=i??r;if(i){let{_i18n:e,file:n}=i;return JA({_i18n:e,locale:t,path:CE(n)})}if(jk(r))return r._file.fullPath;let d=r,f=OA(d),p=AA(e);if(c4({draft:e,locale:t,slug:n}))return a.locales[t].path;let{basePath:m,subPath:h,extension:g}=$A({collection:d,isIndexFile:s}),_=s?rA(d)?.name:p?s4({draft:e,slug:n,indexFileName:f,locale:t}):h?cX(h,{collection:d,locale:t,content:o[c],currentSlug:n}):n;return s&&_?.endsWith(`.${g}`)&&(_=_.slice(0,-g.length-1)),UP(XHe({basePath:m,path:_,extension:g,locale:t,omitLocale:u&&t===c,structure:l}).split(`/`))},ZHe=/(?<path>.+?)(?:\/[^/]+)?$/,u4=(e,t)=>e.includes(`{{`)?cX(e,t):e,QHe=(e,t)=>{if(!t)return!1;let n=e.slice(e.lastIndexOf(`/`)+1);return n===t||n.startsWith(`${t}.`)},d4=(e,t)=>{if(e._type!==`entry`)return;let{subPath:n}=e._file,r=t.substring(0,t.lastIndexOf(`.`)),i=n?.includes(`/`)?n.split(`/`).at(-1):void 0;if(i&&!i.includes(`{{`)||QHe(r,OA(e)))return r.match(ZHe)?.groups?.path;if(n?.includes(`/`))return r},f4=({collection:e,entryFilePath:t,internalPath:n})=>d4(e,t)??(e._type===`entry`?Uk(t).dirname??n:n),$He=({internalSubPath:e,assetFolderPath:t,fillSlugOptions:n})=>KP(u4(UP([t,e]),n)),eUe=({publicPath:e,fillSlugOptions:t})=>/^\.?$/.test(e)?e:KP(u4(e,t)),tUe=({folder:e,fillSlugOptions:t})=>{let{entryRelative:n,internalPath:r,internalSubPath:i,publicPath:a}=e;if(r===void 0||a===void 0)return{resolvedInternalPath:``,resolvedPublicPath:``};if(!n)return{resolvedInternalPath:cX(r,t),resolvedPublicPath:cX(a,t)};let{collection:o,entryFilePath:s}=t;return{resolvedInternalPath:$He({internalSubPath:i,assetFolderPath:f4({collection:o,entryFilePath:s??``,internalPath:r}),fillSlugOptions:t}),resolvedPublicPath:eUe({publicPath:a,fillSlugOptions:t})}},p4=({draft:e,locale:t,slug:n,defaultLocaleSlug:r,folder:i})=>{let{collection:a,collectionFile:o,isIndexFile:s}=e,{_i18n:{defaultLocale:c}}=o??a;return tUe({folder:i,fillSlugOptions:{...t2({draft:e}),type:`media_folder`,currentSlug:r,entryFilePath:l4({draft:e,locale:t??c,slug:n??r}),isIndexFile:s}})},m4=(e,t)=>e?`${e===`/`?``:e}/${t}`:t,nUe=({draft:e,locale:t,entryFilePath:n,folderPath:r})=>{let{collection:i,isNew:a,originalEntry:o}=e,s=a?void 0:o?.locales[t]?.path;if(!s)return;let c=d4(i,s),l=d4(i,n);if(c&&l&&c!==l&&(r===l||r.startsWith(`${l}/`)))return`${c}${r.slice(l.length)}`},rUe=({draft:e,locale:t,slug:n,defaultLocaleSlug:r,folder:i,subfolderPath:a=``})=>{let{collectionName:o}=e,s=p4({draft:e,locale:t,slug:n,defaultLocaleSlug:r,folder:i});if(a){let{resolvedInternalPath:e,resolvedPublicPath:t}=s;s={...s,resolvedInternalPath:UP([e,a]),resolvedPublicPath:m4(t,a)}}let{resolvedInternalPath:c}=s,l=t??rj(e).defaultLocale,u=i.entryRelative?nUe({draft:e,locale:l,entryFilePath:l4({draft:e,locale:l,slug:n??r}),folderPath:c}):void 0,d=e=>yX(e).map(e=>e.name.normalize());return{assetFolderPaths:s,assetNamesInSameFolder:d(c),assetNamesMovingIn:u?d(u):[],savingAssetProps:{collectionName:o,folder:i}}},iUe=async({file:e,folder:t,subfolderPath:n,replace:r,nameTemplate:i,blobURL:a,draft:o,locale:s,slug:c,defaultLocaleSlug:l,keyPath:u,content:d,changes:f,savingAssets:p,encodingEnabled:m})=>{let h=await XP(e);pNe();let{savingAssetProps:g,assetNamesInSameFolder:_,assetNamesMovingIn:v,assetFolderPaths:{resolvedInternalPath:y,resolvedPublicPath:b}}=rUe({draft:o,locale:s,slug:c,defaultLocaleSlug:l,folder:t,subfolderPath:n}),x=p.filter(e=>WP(e.path)===y),S=x.find(n=>n.sha===h&&(!t.entryRelative||(0,yr.default)(n.folder,t))&&(!r||XB(n.name,e.name))),C=``;if(S)C=S.name;else{let n=Z$({draft:o,item:{file:e,folder:t,replace:r,nameTemplate:i},defaultLocaleSlug:l}),s=x.map(e=>e.name.normalize()),c=r?YB(n):void 0,u=c!==void 0&&!s.some(e=>e.toLowerCase()===c.toLowerCase());C=u?c:YB(n,{assetNamesInSameFolder:[..._,...v,...s]});let d=u?_.find(e=>e.toLowerCase()===C.toLowerCase()):void 0,m=!!d;d&&(C=d);let b=y?`${y}/${C}`:C;JV([b]),f.push({action:m?`update`:`create`,path:b,data:e}),p.push({...g,blobURL:a,name:C,path:b,sha:h,size:e.size,kind:pV(C)})}let w=m4(b,C);m&&(w=zP(w)),d[u]=d[u].replaceAll(a,()=>w)};bN.default.extend(xN.default),bN.default.extend(SN.default),bN.default.extend(CN.default);var aUe=({dateFieldName:e,fields:t,content:n,locale:r})=>{let i=e?t.find(({widget:t,name:n})=>t===`datetime`&&n===e):t.find(({widget:e})=>e===`datetime`),a=i?n[i.name]:void 0;if(!i||!a)return;let o=i,s=iP(a,o,r);if(!KN(s))return;let{format:c,dateOnly:l,utc:u,outputUTC:d,singleCustomTimeZone:f}=IN(o);return _z({date:s,timeZone:u||d||l&&!c?`UTC`:l?void 0:f})},h4=({pathTemplate:e,dateFieldName:t,fields:n,collection:r,locale:i,slug:a,entryFilePath:o,content:s,isIndexFile:c=!1})=>{let l;if(!(Xk.test(e)&&(l=aUe({dateFieldName:t,fields:n,content:s,locale:i}),!l)))try{return cX(e,{type:`preview_path`,collection:r,content:s,locale:i,currentSlug:a,entryFilePath:o,dateTimeParts:l,isIndexFile:c})}catch{return}},g4=({collection:e,collectionFile:t,locale:n,slug:r,path:i,content:a,isIndexFile:o=!1})=>{let{preview_path:s,preview_path_date_field:c,fields:l=[],_i18n:{defaultLocale:u,omitDefaultLocaleFromPreviewPath:d}}=t??e;if(!i||!a||!s)return;let f=o?rA(e):void 0,p=s;return n===u&&d&&(p=BA(p)??p),h4({pathTemplate:p,dateFieldName:c,fields:f?.fields??l,collection:e,locale:n,slug:r,entryFilePath:i,content:a,isIndexFile:o})},oUe=(e,t,n,r,i={})=>{let{show_preview_links:a=!0,_baseURL:o}=Sk.current??{},s=i.baseURL||o,{slug:c,path:l,content:u}=e.locales[t]??{};if(!a||!s)return;let{preview_path:d}=r??n;if(i.fallbackToRoot&&!d)return`${s.replace(/\/$/,``)}/`;let f=g4({collection:n,collectionFile:r,locale:t,slug:c,path:l,content:u,isIndexFile:aA(n,e)});if(f!==void 0)return`${s.replace(/\/$/,``)}/${f.replace(/^\//,``)}`},sUe=(e,t)=>{let n=e.locales[t]?.path;return`${OY.current?.repository?.blobBaseURL}/${n?IP(n):``}?plain=1`},_4=(e,t)=>{let n=e?.workflow?.branch;return!n||n===t?.workflow?.pullRequest.branch?e:e.workflow?.replacedAsset},v4=e=>{if(!e.length)return;let t=new Map(pH.current.map(e=>[e.path,e]));e.forEach(e=>{let n=t.get(e.path);t.set(e.path,{...e,workflow:{branch:e.workflow?.branch,replacedAsset:n?.workflow?n.workflow.replacedAsset:n}})}),pH.current=[...t.values()]},y4=e=>{pH.current=pH.current.flatMap(t=>t.workflow?.branch===e?t.workflow.replacedAsset??[]:t)},cUe=e=>{pH.current=pH.current.map(t=>{if(t.workflow?.branch!==e)return t;let{workflow:n,...r}=t;return r})},lUe=new Map,uUe=e=>e.startsWith(`/`),dUe=async(e,t)=>{let{name:n,fields:r=[],preview_path_date_field:i,_i18n:{defaultLocale:a},_thumbnailFieldNames:o}=e,{locales:s}=t,c=QP(s,a),{content:l,slug:u,path:d}=s[c]??{};if(!l)return;let f=o.some(e=>e.includes(`*`))?Object.keys(l):void 0,p=o.flatMap(n=>{if(uUe(n))return[{value:h4({pathTemplate:n,dateFieldName:i,fields:r,collection:e,locale:c,slug:u,entryFilePath:d,content:l,isIndexFile:aA(e,t)})}];if(n.includes(`*`)){let e=PA(lUe,n,()=>RegExp(`^${xE(n).replaceAll(`\\*`,`.+`)}$`));return f.filter(t=>e.test(t)).map(e=>({value:l[e],keyPath:e}))}return[{value:l[n],keyPath:n}]});for(let{value:e,keyPath:r}of p){let i={value:e,entry:t,collectionName:n,typedKeyPath:r,locale:c},{asset:a}=e&&mZ(i)||{},o=e&&(!a||sV(a))?await gZ({...i,thumbnail:!0}):void 0;if(o)return{src:o,owned:!!a&&o.startsWith(`blob:`)}}},fUe=(e,t,n)=>{let r=!1,i;return dUe(e,t).then(e=>{r?e?.owned&&WX(e.src):(i=e,e&&n(e.src))},()=>{}),()=>{r=!0,i&&(n(void 0),i.owned&&WX(i.src))}},pUe=new WeakMap,mUe=e=>{let t=rz(e);return PA(pUe,t,()=>{let e=new Map;return t.forEach(({id:t,locales:n})=>{Object.values(n).forEach(({path:n})=>{let r=Uk(n).dirname;r!==void 0&&PA(e,r,()=>new Set).add(t)})}),e})},hUe=RA(()=>pH.current,e=>{let t=new Map;return e.forEach(e=>{let n=Uk(e.path).dirname;if(n===void 0)return;let r={asset:e,dirPath:n};for(let e=n;PA(t,e,()=>[]).push(r),e.includes(`/`);e=e.slice(0,e.lastIndexOf(`/`)));}),t}),gUe=e=>hUe().get(e)??[],b4=({locales:e},t)=>Object.values(e).flatMap(({path:e})=>t(e)??[]),x4=(e,t)=>b4(t,t=>d4(e,t)),S4=e=>b4(e,e=>Uk(e).dirname),C4=({entry:e,collectionName:t,fileName:n,relative:r=!1})=>{let{locales:i}=e,a=fj(t);if(!a)return[];let o=aA(a,e),s=EO(Object.entries(i).flatMap(([i,{content:a}])=>Object.entries(a??{}).map(([a,s])=>{if(typeof s==`string`&&(!r||gX(s))){let c=bM({collectionName:t,fileName:n,keyPath:a,isIndexFile:o})?.widget??`string`;if(!Lk.includes(c))return;let l=_X({value:s,entry:e,collectionName:t,fileName:n,locale:i});if(l&&lH(l.path).some(e=>e.collectionName===t&&e.fileName===n&&(!r||e.entryRelative)))return l}})).filter(Boolean));if(r&&cH({collectionName:t,fileName:n})?.entryRelative){let n=new Set(x4(a,e)),r=new Set(s.map(({path:e})=>e)),i=mUe(t);n.forEach(t=>{let n=n=>{let r=n;for(;r.length>t.length;){let t=i.get(r);if(t&&(t.size>1||!t.has(e.id)))return!0;r=r.slice(0,r.lastIndexOf(`/`))}return!1};gUe(t).forEach(({asset:e,dirPath:t})=>{!n(t)&&!r.has(e.path)&&(s.push(e),r.add(e.path))})})}return s},_Ue=({entry:e,collectionName:t,fileName:n})=>[...new Set(C4({entry:e,collectionName:t,fileName:n,relative:!0}).map(t=>_4(t,e)).filter(Boolean))],vUe=(e,t,n)=>{let r=new Map;return t.forEach((t,i)=>{let a=x4(e,t);n[i].forEach(e=>{a.some(t=>e.path.startsWith(`${t}/`))||r.set(e.path,e)})}),[...r.values()]},yUe=(e,t,n)=>{let r=new Set(t.flatMap(S4)),i=UZ(e.map(e=>({asset:e})),{entries:[...new Set([...rz(n),...vj.current.filter(e=>S4(e).some(e=>r.has(e)))])]});return new Map(e.map((e,t)=>[e.path,i[t].map(({id:e})=>e)]))},w4=({entries:e,collectionName:t,fileName:n})=>{let r=cH({collectionName:t,fileName:n})?.entryRelative?fj(t):void 0;if(!r||jk(r))return e.map(()=>[]);let i=e.map(e=>_Ue({entry:e,collectionName:t,fileName:n})),a=vUe(r,e,i);if(!a.length)return i;let o=yUe(a,e,t);return i.map((t,n)=>t.filter(t=>(o.get(t.path)??[]).every(t=>t===e[n].id)))},bUe=({entry:e,collectionName:t,fileName:n})=>w4({entries:[e],collectionName:t,fileName:n})[0],T4=[`preSave`,`postSave`,`prePublish`,`postPublish`,`preUnpublish`,`postUnpublish`],xUe=[`preSave`],E4=async({type:e,entry:t,collection:n,collectionFile:r,isNew:i=!1})=>{let{login:a,name:o}=OW.account,s=a??``,c=o??``,l=n.name,u=r?.name,{_i18n:{defaultLocale:d}}=r??n,f=[...ck].filter(t=>t.name===e);if(!f.length)return;let p;try{({isMap:p}=await W1())}catch(t){console.error(`Skipping the ${e} event hooks: Immutable.js could not be loaded`,t);return}let{slug:m,locales:h}=t,g=Object.keys(h).filter(e=>e!==d),_=C4({entry:t,collectionName:l,fileName:u});for(let n of f){let{content:r,path:a}=ZP(t,{defaultLocale:d})??{},o;try{o=await n.handler({author:{login:s,name:c},entry:Y1({content:r,otherLocales:g,locales:h,slug:m,path:a,isNew:i,collectionName:l,associatedAssets:_})})}catch(t){if(!e.startsWith(`post`))throw t;console.error(`The ${e} event hook failed`,t)}if(xUe.includes(e)&&p(o)){let e=o.toJS();E(e.data)&&E(e.i18n)?(h[d].content=zj(e.data),g.forEach(t=>{E(e.i18n[t]?.data)&&(h[t].content=zj(e.i18n[t].data))})):h[d].content=zj(e)}}},D4=e=>e===void 0?void 0:`/${e.replace(/^\//,``)}`,SUe=({draft:e,locale:t,content:n,slug:r,path:i})=>{let{isNew:a,isIndexFile:o,collection:s,fields:c,originalEntry:l}=e;if(a||o||!l)return;let{preview_path:u}=s,d=B2({collection:s,fields:c});if(!u||!d)return;let{slug:f,path:p,content:m}=l.locales[t]??{};if(f===void 0||f===r)return;let h={collection:s,locale:t},g=D4(g4({...h,slug:f,path:p,content:m})),_=D4(g4({...h,slug:r,path:i,content:n}));if(g===void 0||g===_)return;let v=V2(n,d);if(!v.length&&!Hj(n[d]))return;let y=v.map(e=>n[e]).filter(mA).filter(e=>e!==g&&e!==_);H2(n,d),[...y,g].forEach((e,t)=>{n[`${d}.${t}`]=e})},O4=({collection:{_file:e},path:t,fallback:n})=>e.fullPathRegEx?t.match(e.fullPathRegEx)?.groups?.subPath??n:n,CUe=({draft:e,slugs:{defaultLocaleSlug:t,localizedSlugs:n}})=>{let{collection:r,defaultLocale:i}=e;return!n||!TA(r)?void 0:s2({draft:e,defaultLocaleSlug:O4({collection:r,path:l4({draft:e,locale:i,slug:t}),fallback:t}),localizedSlugs:n,fillSlugOptions:t2({draft:e})})},wUe=async({draft:e,files:t,defaultLocaleSlug:n,changes:r,savingAssets:i,getFieldArgs:a,encodingEnabled:o,globalAssetFolder:s,locale:c,slug:l,content:u,keyPath:d,matches:f})=>{let p=bM({...a,valueMap:u,keyPath:d}),m={draft:e,defaultLocaleSlug:n,changes:r,savingAssets:i,locale:c,slug:l,keyPath:d,content:u,encodingEnabled:Rk.includes(p?.widget??``)||o};await Promise.all(f.map(async([e])=>{let{file:n,folder:r=s,replace:i,subfolderPath:a,nameTemplate:o}=t[e]??{};if(!n)throw Error(`The file referenced in the "${p?.label??d}" field is no longer available. Select the file again.`);if(!r)throw Error(`There is no asset folder to save the file "${n.name}" to`);await iUe({...m,file:n,folder:r,replace:i,subfolderPath:a,nameTemplate:o,blobURL:e})}))},TUe=[`text`,...Rk],EUe=({getFieldArgs:e,content:t,keyPath:n,value:r})=>{let i={...e,valueMap:t},a=bM({...i,keyPath:n}),o=n.split(`.`).slice(0,-1).join(`.`),s=a?a.widget??`string`:o&&bM({...i,keyPath:o})?.widget;return s===`code`?r:TUe.includes(String(s))?r.trimEnd():r.trim()},DUe=async({keyPath:e,value:t,...n})=>{let{content:r}=n;if(t===void 0){delete r[e];return}if(typeof t!=`string`)return;r[e]=EUe({getFieldArgs:n.getFieldArgs,content:r,keyPath:e,value:t});let i=[...t.matchAll(Vk(`g`))];i.length&&await wUe({...n,keyPath:e,matches:i})},OUe=async({path:e,canonicalSlug:t,canonicalSlugKey:n,...r})=>{let{draft:i,locale:a,slug:o,content:s}=r;t!==void 0&&(s[n]=t),SUe({draft:i,locale:a,content:s,slug:o,path:e}),await Promise.all(Object.entries(s).map(([e,t])=>DUe({...r,keyPath:e,value:t})))},kUe=async({draft:e,slugs:t})=>{let{defaultLocaleSlug:n,localizedSlugs:r}=t,i=aH.current,{collection:a,collectionFile:o,currentLocales:s,currentValues:c,files:l}=e,{_i18n:{canonicalSlug:{key:u}}}=o??a,d=[],f=[],{encode_file_path:p=!1}=Sk.current?.output??{},m=yM(e,{keyPath:``,valueMap:{}}),h=CUe({draft:e,slugs:t})??t.canonicalSlug,g={draft:e,files:l,defaultLocaleSlug:n,changes:d,savingAssets:f,getFieldArgs:m,encodingEnabled:p,globalAssetFolder:i};return{localizedEntryMap:Object.fromEntries(await Promise.all(Object.entries(c).map(async([t,i])=>{let a=PM(i),o=r?.[t]??n,c=l4({draft:e,locale:t,slug:o});return s[t]?(await OUe({...g,locale:t,slug:o,path:c,content:a,canonicalSlug:h,canonicalSlugKey:u}),[t,{slug:o,path:c,content:vr(a)}]):[t,{path:c}]}))),changes:d,savingAssets:f}},k4=e=>({...e,locales:Object.fromEntries(Object.entries(e.locales).filter(([,{content:e}])=>e!==void 0))}),A4=e=>{if(e?.arrayIndex===void 0)return{};let{locales:t}=vj.current.find(({id:t})=>t===e.id)??e;return{arrayItem:{index:e.arrayIndex,locales:t}}},AUe=({draft:e,savingEntry:t,recreate:n=!1})=>{let{collection:r,originalEntry:i,collectionFile:a}=e,o=e.isNew||n,{_i18n:{defaultLocale:s}}=a??r,{slug:c,path:l}=t.locales[s],u=o?void 0:i?.locales[s]?.path,d=!o&&!!u&&u!==l;return{action:o?`create`:d?`move`:`update`,slug:c,path:l,previousPath:d?u:void 0,currentPath:u,...jk(r)&&!o?A4(i):{}}},jUe=({draft:e,savingEntry:t,locale:n,recreate:r=!1})=>{let{originalLocales:i,currentLocales:a,originalEntry:o}=e,s=e.isNew||r,{slug:c,path:l}=t.locales[n]??{},u=s?void 0:o?.locales[n]?.path;if(a[n]){let e=!s&&!!i[n]&&!!u&&u!==l;return{action:s||!i[n]?`create`:e?`move`:`update`,slug:c,path:l,previousPath:e?u:void 0,currentPath:u}}if(!s&&i[n])return{action:`delete`,slug:o?.locales[n]?.slug??c,path:u,currentPath:u}},j4=async({draft:e,slugs:t,recreate:n=!1,runPreSave:r=!0})=>{let{id:i,collection:a,collectionFile:o}=e,{defaultLocaleSlug:s}=t,c=o??a,{defaultLocale:l}=c._i18n,{localizedEntryMap:u,changes:d,savingAssets:f}=await kUe({draft:e,slugs:t}),{path:p}=u[l]??Object.values(u).find(({content:e})=>e)??Object.values(u)[0],m=O4({collection:c,path:p,fallback:s}),h=TA(a),g={id:i,slug:h?m:s,subPath:m,...e.isNew||e.originalEntry?.arrayIndex===void 0?{}:{arrayIndex:e.originalEntry.arrayIndex},locales:Object.fromEntries(Object.entries(u).map(([e,t])=>[e,h?{...t,slug:O4({collection:c,path:t.path,fallback:s})}:t]))};return r&&await E4({type:`preSave`,entry:g,collection:a,collectionFile:o,isNew:e.isNew}),d.push(...await n4({draft:e,config:c,_file:$A({collection:a,collectionFile:o,isIndexFile:e.isIndexFile}),entry:g,cacheDB:e4(),planChange:t=>t===void 0?AUe({draft:e,savingEntry:g,recreate:n}):jUe({draft:e,savingEntry:g,locale:t,recreate:n})})),{savingEntry:g,savingAssets:f,changes:d}},MUe=async e=>{let{collectionName:t,entry:n,changes:r}=e,i=fj(t),a={...n,locales:Object.fromEntries(Object.entries(n.locales).map(([e,t])=>[e,{...t}]))};if(await E4({type:`preSave`,entry:a,collection:i,isNew:!0}),!Object.entries(a.locales).some(([e,{content:t}])=>t!==n.locales[e].content))return e;let{defaultLocale:o}=i._i18n,s=new Set(Object.values(n.locales).map(({path:e})=>e)),c=await n4({draft:{collection:i,collectionName:t,fields:i.fields,isIndexFile:!1},config:i,_file:$A({collection:i}),entry:a,cacheDB:e4(),planChange:e=>{let t=a.locales[e??o];return t?{action:`create`,slug:t.slug,path:t.path}:void 0}});return{...e,entry:a,changes:[...r.filter(({path:e})=>!s.has(e)),...c]}},M4=({collection:e,collectionFile:t,isIndexFile:n=!1})=>({collection:e,collectionName:e.name,collectionFile:t,fileName:t?.name,fields:t?.fields??e.fields,isIndexFile:n}),N4=async({collection:e,collectionFile:t,entry:n,draft:r,cacheDB:i})=>{let a=t??e;return n4({draft:r,config:a,_file:$A({collection:e,collectionFile:t,isIndexFile:r.isIndexFile}),entry:n,cacheDB:i,planChange:e=>{if(e===void 0){let{slug:e,path:t}=n.locales[a._i18n.defaultLocale];return{action:`update`,slug:e,path:t,currentPath:t,...A4(n)}}let{slug:t,path:r,content:i}=n.locales[e]??{};return i?{action:`update`,slug:t,path:r,currentPath:r}:void 0}})},P4=e=>L1()||AP(e).some(t=>L1({collection:t})||wj(t,e).some(e=>L1({collection:t,collectionFile:e}))),F4=(e,t=AP(e)[0])=>t?`${pj(t)} › ${jz(t,e)}`:e.slug,I4=/\.\d+$/,L4=({content:e,listKeyPath:t,isStale:n})=>{let r=XO(e,t,{live:!0}),i=r.filter(t=>!n(t,e[t])).map(t=>e[t]);r.forEach(t=>{delete e[t]}),i.length?i.forEach((n,r)=>{e[`${t}.${r}`]=n}):e[t]=[]},R4=({draft:e,entry:t,collection:n,collectionFile:r,locale:i,content:a,fields:o})=>{let s=L1({collection:n,collectionFile:r})||P4(t);return[...o].flatMap(([r,o])=>{let c;if(s)c=[Y(`readonly_reference`)];else{let t=E2({draft:e,locale:i,keyPath:r,value:a[r],valueMap:a,validities:{[i]:{}}});if(!t||t.valid)return[];c=C0({validity:t,fieldConfig:o})}let l=n.name;return[{collectionName:l,collectionLabel:n.label||l,fieldLabel:pB({config:o}),entry:t,summary:jz(n,t),locale:i,keyPath:r,messages:c}]})},z4=e=>{let t=new Set;return e.filter(({entry:e,keyPath:n})=>{let r=`${e.id}\0${n}`;return!t.has(r)&&(t.add(r),!0)})},B4=async({targets:e,cacheDB:t})=>{if(!e.length)return{changes:[],savingEntries:[]};let n=e4(t);return{changes:(await Promise.all(e.map(({entry:e,collection:t,collectionFile:r})=>N4({collection:t,collectionFile:r,entry:e,draft:M4({collection:t,collectionFile:r,isIndexFile:aA(t,e)}),cacheDB:n})))).flat(),savingEntries:e.map(({entry:e})=>e)}},NUe=e=>{let t=[],n=new Set;return e.forEach(e=>{let{url:r,asset:i}=I1(e);if(r===void 0){t.push({asset:i});return}let a=RZ(r);n.has(a)||(n.add(a),t.push({url:a}))}),t},V4=(e,t,n)=>{let r=t+n,i=e.lastIndexOf(`
`,t-1)+1,a=e.indexOf(`
`,r),o=a===-1?e.length:a;if(e.slice(i,t).trim()||e.slice(r,o).trim())return e.slice(0,t)+e.slice(r);let s=e.slice(0,i),c=e.slice(o),l=!s||/\n[ \t]*\n$/.test(s),u=!c||/^\n[ \t]*\n/.test(c);return l&&u?c?s+c.replace(/^\n[ \t]*\n/,``):s.replace(/\n[ \t]*\n$/,`
`):c?s+c.slice(1):s.replace(/\n$/,``)},PUe=[`a`,`div`,`figure`,`p`,`picture`,`span`],H4=e=>[`img`,`source`].includes(e.localName)?!e.hasAttribute(`src`)&&!e.hasAttribute(`srcset`):!e.hasAttribute(`src`)&&!e.querySelector(`:scope > source`),FUe=e=>{let t=e;for(e.localName===`img`&&e.parentElement?.localName===`picture`&&(t=e.parentElement);;){let e=t.parentElement;if(t.remove(),!e||!PUe.includes(e.localName)||e.childElementCount||e.textContent.trim())break;t=e}},IUe=(e,t)=>{let n=xZ(e),r=AZ(n),i=new Set(r.filter(e=>PZ(e,e=>t(e)?null:void 0)));return i.size?(r.reverse().forEach(e=>{if(!i.has(e)||!H4(e))return;let{parentElement:t}=e;e.localName===`source`&&t&&[`audio`,`video`].includes(t.localName)&&i.add(t),FUe(e)}),n.innerHTML):e},LUe=(e,t)=>[...e.matchAll(NZ)].reduceRight((n,r)=>{let{index:i,0:a,1:o,2:s}=r;if(s===void 0)return t(o)?V4(n,i,a.length):n;let c=FZ({value:e,tag:s,index:i,callback:e=>t(e)?null:void 0});return c?[`img`,`source`].includes(c.localName)&&H4(c)?V4(n,i,a.length):n.slice(0,i)+SZ(c)+n.slice(i+a.length):n},e),RUe=({value:e,format:t,urls:n,paths:r=new Set,entry:i,collectionName:a,fileName:o,locale:s})=>{let c=e=>{if(n.has(e))return!0;if(!r.size)return!1;let t=mZ({entry:i,collectionName:a,fileName:o,locale:s,value:e})?.asset?.path;return t!==void 0&&r.has(t)};return t===`html`?IUe(e,c):LUe(e,c)},zUe=({content:e,references:t,urls:n,paths:r=new Set})=>{let i={...e},a=new Map,o=new Map;return t.forEach(({entry:t,collection:s,collectionFile:c,locale:l,keyPath:u,fieldConfig:d})=>{let{widget:f=`string`}=d;if(!Lk.includes(f))i[u]=RUe({value:e[u],format:bZ(d),urls:n,paths:r,entry:t,collectionName:s.name,fileName:c?.name,locale:l}),a.set(u,d);else if(_M(d)){let e=u.replace(I4,``);o.set(e,(o.get(e)??new Set).add(u)),a.set(e,d)}else i[u]=``,a.set(u,d)}),o.forEach((e,t)=>{L4({content:i,listKeyPath:t,isStale:t=>e.has(t)})}),{content:i,fields:a}},BUe=async e=>{let t=NUe(e),n=new Set,r=new Set;t.forEach(({url:e,asset:t})=>{t?r.add(t.path):n.add(e)});let i=await LRe(t),a=[...Map.groupBy(i,({entry:e})=>e.id).values()].map(e=>{let[{entry:t,collection:i,collectionFile:a}]=e,o=M4({collection:i,collectionFile:a,isIndexFile:aA(i,t)}),s=Map.groupBy(e.filter(e=>e.collection===i&&e.collectionFile===a),({locale:e})=>e),c={},l=[];return s.forEach((e,s)=>{let u=t.locales[s],{content:d,fields:f}=zUe({content:u.content,references:e,urls:n,paths:r});c[s]={...u,content:d},l.push(...R4({draft:o,entry:t,collection:i,collectionFile:a,locale:s,content:d,fields:f}))}),{target:{entry:{...t,locales:{...t.locales,...c}},collection:i,collectionFile:a},blockers:l}});return{targets:a.map(({target:e})=>e),blockers:z4(a.flatMap(({blockers:e})=>e))}},U4=void 0,W4=e=>{let t=e.map(({path:e})=>e).join(`
`),{current:n}=vj,{current:r}=pH,{current:i}=Sk;if(U4?.key===t&&U4.entries===n&&U4.assets===r&&U4.config===i)return U4.plan;let a=BUe(e);return U4={key:t,entries:n,assets:r,config:i,plan:a},a.catch(()=>{U4?.plan===a&&(U4=void 0)}),a},G4=`commit_cancelled`,K4=pk(),q4=``,J4=e=>e?.message===G4,Y4=async e=>{try{return{ok:!0,cancelled:!1,result:await e(),error:void 0}}catch(e){let t=J4(e);return t||console.error(e),{ok:!1,cancelled:t,result:void 0,error:e}}},X4=()=>{let{current:e}=Sk,{current:t}=OY;if(!e||!t||!(t.isGit||t.name===`local`&&IG.localGitCommits))return;let{prompt_commit_messages:n}=e.backend;return n===!0||n===`prefix`||n===`suffix`?n:void 0},VUe=async({mode:e,defaultMessage:t})=>(K4.current?.respond(null),new Promise(n=>{let r={mode:e,defaultMessage:t,initialValue:e===!0?t:q4,respond:e=>{K4.current===r&&(K4.current=void 0),n(e)}};K4.current=r})),Z4=async(e,t)=>{let n=X4();if(!n||t.userMessage!==void 0)return t;let r=NW(PU(e),t),i=await VUe({mode:n,defaultMessage:r});if(i===null)throw Error(G4);let a=i.trim();return n===!0?a===r&&(a=``):q4=a,{...t,userMessage:a}},Q4,$4=0,e3=0,t3=Promise.resolve(),HUe=({entriesBefore:e,assetsBefore:t})=>{let n=new Map(e.map(e=>[e.id,e])),r=new Map(t.map(e=>[e.path,e])),i=vj.current,a=pH.current,o=new Set(i.map(({id:e})=>e)),s=new Set(a.map(({path:e})=>e));return{addedEntries:i.filter(({id:e})=>!n.has(e)),modifiedEntries:i.filter(e=>{let t=n.get(e.id);return!!t&&t!==e}),deletedEntries:e.filter(({id:e})=>!o.has(e)),addedAssets:a.filter(({path:e})=>!r.has(e)),modifiedAssets:a.filter(e=>{let t=r.get(e.path);return!!t&&t!==e}),deletedAssets:t.filter(({path:e})=>!s.has(e))}},UUe=e=>Object.values(e).some(e=>e.length>0),n3,WUe=async({fetchDirSHA:e},t,n)=>{let r=AU();if(!r||!e)return!1;try{let[i,a]=await Promise.all([n3?.rootDir===r&&n3.commit===t?n3.sha:e(t,r),e(n,r)]);return n3={rootDir:r,commit:n,sha:a},!!i&&i===a}catch(e){return console.error(`Failed to look up the root directory.`,e),!1}},GUe=async e=>{let{fetchLastCommit:t,fetchFiles:n}=e,r=gK(),i=await t();if(r()||i.hash===mK.current)return;if(await WUe(e,mK.current,i.hash)){if(r())return;await Yje(e.repository,mK.current,i.hash);return}let a=vj.current,o=pH.current;if(await n({lastCommit:i}),r())return;VK.current=mK.current;let s=HUe({entriesBefore:a,assetsBefore:o});return UUe(s)?s:void 0},r3=async({maxAge:e=0}={})=>{let t=OY.current;if(t?.fetchLastCommit&&mK.current&&!e3&&!(e&&!Q4&&Date.now()-$4<e))return Q4||=($4=Date.now(),GUe(t).finally(()=>{Q4=void 0})),Q4},KUe=async e=>{let t=t3,{promise:n,resolve:r}=Promise.withResolvers();t3=n,e3+=1;try{return await t,await Q4?.catch(()=>void 0),await e()}finally{--e3,r(void 0)}},qUe=e=>{let t=kP(e).find(({fileName:e,filePathMap:t})=>!e&&!!t),n=t?fj(t.collectionName):void 0;return jk(n)?n:void 0},JUe=e=>{let t=new Map;return e.forEach(e=>{let{path:n}=e,r=t.get(n);if(r){r.changes.push(e);return}let i=qUe(n);i&&t.set(n,{collection:i,changes:[e]})}),t},YUe=({collection:e,path:t,items:n,changes:r})=>{let i=n.map((e,t)=>({item:e,from:t})),a=new Set,o=({index:r,locales:i})=>{let a=r<n.length?qR({collection:e,item:n[r],index:r,path:t}):void 0;if(r>=n.length||i&&!(0,yr.default)(a?.locales,i))throw SW(`The item at ${r} in ${t} has been changed since it was loaded.`,`save_conflict.array_item_changed`)};return r.forEach(e=>{let{action:t,data:n,arrayItem:r,arrayOrder:s}=e;if(s){s.forEach(o);let e=s.map(({index:e})=>e).sort((e,t)=>e-t),t=s.map(({index:e})=>i[e]);e.forEach((e,n)=>{i[e]=t[n]});return}if(r&&o(r),t===`delete`){r&&a.add(r.index);return}let c=JSON.parse(n);if(r){let e=i.find(({from:e})=>e===r.index);e.item=c}else i.push({item:c})}),i.filter(({from:e})=>e===void 0||!a.has(e))},XUe=({collection:e,path:t,items:n,change:r})=>{let{data:i,arrayItem:a,arrayOrder:o}=r,s=(o?.[0]??a)?.index??n.length,c=qR({collection:e,item:i?JSON.parse(i):n[s],index:s,path:t})?.locales[e._i18n.defaultLocale]?.content;return c&&Ez(c,{identifierField:e.identifier_field,useBody:!1})||void 0},ZUe=async e=>{let t=JUe(e);if(!t.size)return{changes:e,arrayFileUpdates:[]};let n=e4(),r=await Promise.all([...t].map(async([e,{collection:t,changes:r}])=>{let i=KR.get(e);if(i===null)throw SW(`${e} can’t be updated, as it doesn’t contain a valid array.`,`save_conflict.array_file_invalid`,{path:e});let a=YUe({collection:t,path:e,items:i??[],changes:r}),o=await n?.get(e),s=WL.get(e),c=s?xwe(s,a.map(({from:e})=>e)):void 0;return{collection:t,path:e,slots:a,change:{action:i?`update`:`create`,slug:XUe({collection:t,path:e,items:i??[],change:r[0]})??r[0].slug,path:e,previousSha:o?.sha,data:await $2({content:a.map(({item:e})=>e),_file:t._file,valueSources:c})},sourceMap:c}}));return{changes:[...e.filter(({path:e})=>!t.has(e)),...r.map(({change:e})=>e)],arrayFileUpdates:r}},QUe=({arrayFileUpdates:e,savingEntries:t,meta:n})=>{let r=[],i=new Map;return e.forEach(({collection:e,path:a,slots:o,sourceMap:s})=>{let{defaultLocale:c}=e._i18n,l=e=>e.arrayIndex!==void 0&&e.locales[c]?.path===a,u=new Map(vj.current.filter(l).map(e=>[e.arrayIndex,e]));KR.set(a,o.map(({item:e})=>e)),s&&WL.set(a,s);let d=new Map(t.filter(l).map(e=>[e.arrayIndex,e])),f=t.filter(e=>e.arrayIndex===void 0&&e.locales[c]?.path===a),p=0;o.forEach(({item:t,from:o},s)=>{let c=o===void 0?f[p]:d.get(o),l=o===void 0?void 0:u.get(o);o===void 0&&(p+=1);let m=qR({collection:e,item:t,index:s,path:a,meta:n});m&&(m.id=c?.id??l?.id??ml(),r.push(m),c&&i.set(c,m))})}),{entries:r,savedEntries:i}},i3=()=>{let e=OW.account;if(!e)return;let{name:t,email:n,id:r,login:i}=e;if(t&&n)return{name:t,email:n,id:r,login:i}},$Ue=async({changes:e,commit:t})=>{let n=Vz(OY.current?.repository,`file-cache`);if(!n)return;let{files:r,author:i,date:a}=t,o={commitAuthor:i,commitDate:a};await Promise.all(e.map(async e=>{let{action:t,path:i,previousPath:a,data:s}=e;if(t===`delete`){await n.delete(i);return}t===`move`&&await n.delete(a);let c={sha:r[i]?.sha,size:JP(s),text:typeof s==`string`?s:void 0,meta:o};await n.set(i,c)}))},eWe=({changes:e,savedEntries:t,savedAssets:n,arrayFileEntries:r=[]})=>{let i=new Set([...t,...r].map(e=>e.id)),a=new Set(r.flatMap(e=>$P(e)));vj.current=[...vj.current.filter(e=>!i.has(e.id)&&!(e.arrayIndex!==void 0&&Object.values(e.locales).some(({path:e})=>a.has(e)))),...t.filter(e=>!r.includes(e)),...r];let o=new Set(n.map(e=>e.path));e.forEach(e=>{e.action===`move`&&e.previousPath?o.add(e.previousPath):e.action===`delete`&&o.add(e.path)}),pH.current=[...pH.current.filter(e=>!o.has(e.path)),...n]},a3=async({changes:e,savingEntries:t=[],savingAssets:n=[],options:r})=>{let{commitChanges:i,fetchLastCommit:a}=OY.current,o=await Z4(e,r);try{await r3()}catch(e){console.error(`Failed to check the repository for changes.`,e)}let s=!1,c=await KUe(async()=>{let r=mK.current,{changes:c,arrayFileUpdates:l}=await ZUe(e),u={...await i(c,o),author:i3()};IG.devModeEnabled&&(console.debug(`Commit changes:`,c),console.debug(`Commit results:`,u));let{files:d,author:f,date:p}=u,{entries:m,savedEntries:h}=QUe({arrayFileUpdates:l,savingEntries:t,meta:{commitAuthor:f,commitDate:p}}),g=t.map(e=>h.get(e)??{...e,commitAuthor:f,commitDate:p}),_=await Promise.all(n.map(async e=>{let{sha:t,file:n}=d[e.path]??{},r={...e,sha:t,blobURL:void 0,commitAuthor:f,commitDate:p};if(n)try{await AX(r,n)}catch(e){console.error(`Failed to cache the saved asset.`,e)}return r}));try{await $Ue({changes:c,commit:u})}catch(e){console.error(`Failed to update the file cache.`,e)}return eWe({changes:c,savedEntries:g,savedAssets:_,arrayFileEntries:m}),VK.current=u.sha,a&&(u.parentSha===void 0||u.parentSha===r?mK.current=u.sha:s=!0),{commit:u,savedEntries:g,savedAssets:_}});return s&&r3().catch(e=>{console.error(`Failed to check the repository for changes.`,e)}),c},tWe=({assets:e,notify:t=!0})=>{e.some(({path:e})=>gH.current?.path===e)&&(gH.current=void 0),t&&(q$.current={...G$,deleted:!0,count:e.length})},o3=async(e,{extraChanges:t=[],notify:n=!0}={})=>{JV([...e,...t].map(({path:e})=>e));let{targets:r,blockers:i}=await W4(e);if(i.length)throw Error(`Cannot delete assets that entries require`,{cause:i});let{changes:a,savingEntries:o}=await B4({targets:r});await a3({changes:[...e.map(({path:e,sha:t})=>({action:`delete`,path:e,previousSha:t})),...a,...t],savingEntries:o,options:{commitType:`deleteMedia`}}),tWe({assets:e,notify:n})},nWe=({entry:e})=>{let{locales:t}=e,n=Object.entries(t),r=Object.fromEntries(n.map(([e])=>[e,!0])),i=Object.fromEntries(n.map(([e,{slug:t}])=>[e,t])),a=Object.fromEntries(n.map(([e,{content:t}])=>[e,t]));return{createdAt:Date.now(),isNew:!1,canPreview:!0,originalEntry:e,originalLocales:r,currentLocales:structuredClone(r),originalSlugs:i,currentSlugs:structuredClone(i),originalValues:a,currentValues:structuredClone(a),files:{},validities:{},validationMessages:{},expanderStates:{}}},s3=async({draftProps:e,indexFile:t,savingEntries:n,changes:r})=>{let{collection:i,collectionFile:a}=e,{fields:o=[]}=a??i,s={...e,fields:t?.fields??o},{savingEntry:c,changes:l}=await j4({draft:s,slugs:c2({draft:s})});n.push(c),r.push(...l)},rWe=async({entry:e,savingEntries:t,changes:n})=>{let r=nWe({entry:e});await Promise.all(AP(e).map(async i=>{let a=i.name,o=aA(i,e),s=o?rA(i):void 0,c=wj(i,e),l={indexFile:s,savingEntries:t,changes:n},u={...r,collection:i,collectionName:a,isIndexFile:o};c.length?await Promise.all(c.map(e=>s3({...l,draftProps:{...u,collectionFile:e,fileName:e.name}}))):await s3({...l,draftProps:u})}))},iWe=({_globalAssetFolder:e,newPath:t,asset:n})=>{let{publicPath:r}=lH(n.path).find(({collectionName:e})=>e!==void 0)??e??n.folder;return t.replace(n.folder.internalPath??``,r??``)},aWe=(e,t)=>n=>{let[r,i]=[[e,t],[zP(e),zP(t)],[encodeURI(e),encodeURI(t)]].find(([e])=>n===e||n.endsWith(`/${e}`))??[];return r===void 0?void 0:`${n.slice(0,-r.length)}${i}`},oWe=async({_globalAssetFolder:e,movingAssets:t,updatingEntryMap:n})=>{let r=t.map(({asset:e})=>{let t=KX(e);return t?{url:t}:{asset:e}});if(!r.length)return;let i=await WZ(r),a=[],o=new Set;if(t.forEach(({asset:t,path:n},s)=>{if(!i[s].length)return;let c=n.slice(n.lastIndexOf(`/`)+1),l=KX({...t,path:n,name:c},{pathOnly:!0,allowSpecial:!0})??(t.folder.entryRelative&&n.slice(0,-c.length)===t.path.slice(0,-t.name.length)?aWe(t.name,c):iWe({_globalAssetFolder:e,newPath:n,asset:t}));a.push({...r[s],newURL:l}),i[s].forEach(e=>o.add(e))}),!a.length)return;let s=[...o].filter(e=>P4(e));if(s.length)throw Error(Y(`cannot_move_referenced_asset`,{values:{entries:s.map(e=>F4(e)).join(`, `)}}));await WZ(a,{entries:[...o].map(e=>PA(n,e.id,()=>structuredClone(e)))})},sWe=({action:e,movedAssets:t,notify:n=!0})=>{J$(({path:e})=>t.find(t=>t.asset.path===e)?.path),n&&(q$.current={...G$,moved:e===`move`,renamed:e===`rename`,count:t.length})},c3=async(e,t,{extraChanges:n=[],notify:r=!0}={})=>{JV([...t.flatMap(({asset:e,path:t})=>[e.path,t]),...n.flatMap(({path:e,previousPath:t})=>[e,...t?[t]:[]])]);let i=aH.current,a=[],o=[],s=[],c=new Map;await Promise.all(t.map(async({asset:e,path:t})=>{let n=t,r=Uk(n).basename,i=e.file??await PX(e);s.push({...e,path:n,name:r}),a.push({action:`move`,path:n,previousPath:e.path,previousSha:e.sha,data:new File([await i.arrayBuffer()],r,{type:i.type})})})),await oWe({_globalAssetFolder:i,movingAssets:t,updatingEntryMap:c}),await Promise.all([...c.values()].map(e=>rWe({entry:e,savingEntries:o,changes:a}))),await a3({changes:[...a,...n],savingEntries:o,savingAssets:s,options:{commitType:`uploadMedia`}}),sWe({action:e,movedAssets:t,notify:r})},l3=e=>{let t=`${e}/`,n=iH.current.map(({internalPath:e})=>e).filter(n=>n!==void 0&&(n===e||n.startsWith(t))).map(e=>`${e}/`);return e=>e.startsWith(t)&&!n.some(t=>e.startsWith(t))},u3=e=>{let t=l3(e);return mH.current.filter(({path:e})=>t(e))},d3=e=>{let t=l3(e);return SH.current.filter(({path:e})=>t(e))},cWe=async e=>{let t=`${e}/.gitkeep`;JV([t]);let{commit:n}=await a3({changes:[{action:`create`,path:t,data:new File([],`.gitkeep`)}],options:{commitType:`uploadMedia`}}),r={type:`config`,path:t,name:`.gitkeep`,sha:n.files[t]?.sha??``,size:0,text:``};SH.current=[...SH.current,r],q$.current={...G$,folderCreated:!0}},lWe=async({dirPath:e,newDirPath:t})=>{let n=d3(e),r=n=>`${t}${n.slice(e.length)}`;await c3(`move`,u3(e).map(e=>({asset:e,path:r(e.path)})),{extraChanges:n.map(({path:e,sha:t,name:n,text:i})=>({action:`move`,path:r(e),previousPath:e,previousSha:t,data:new File([i??``],n)})),notify:!1}),SH.current=SH.current.map(e=>n.includes(e)?{...e,path:r(e.path)}:e),eU.current?.path===e&&(eU.current={name:Uk(t).basename,path:t}),q$.current={...G$,folderRenamed:!0}},uWe=async e=>{let t=d3(e);await o3(u3(e),{extraChanges:t.map(({path:e,sha:t})=>({action:`delete`,path:e,previousSha:t})),notify:!1}),SH.current=SH.current.filter(e=>!t.includes(e)),eU.current?.path===e&&(eU.current=void 0),q$.current={...G$,folderDeleted:!0}},dWe=B(`<!> <!> <!>`,1);function f3(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=j(!1),i=j(!1),a=async e=>{M(r,!0);let{ok:n,cancelled:a}=await Y4(()=>cWe(UP([t.dirPath,e])));M(r,!1),!n&&!a&&M(i,!0)};var o=dWe(),s=P(o);{let e=A(()=>Y(`new_folder`)),r=A(()=>Y(`new_folder_create`)),i=A(()=>Y(`new_folder_description`,{values:{folder:`/${t.dirPath}`}}));wU(s,{get title(){return z(e)},get okLabel(){return z(r)},get description(){return z(i)},get takenNames(){return t.takenNames},onSubmit:e=>{a(e)},get open(){return n()},set open(e){n(e)}})}var c=I(s,2);Xu(c,{get show(){return z(r)},duration:0,children:(e,t)=>{el(e,{status:`info`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`creating_folder`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Xu(I(c,2),{get show(){return z(i)},set show(e){M(i,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`creating_folder_failed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,o),k()}var p3=e=>e.match(_Ee)?.[1],fWe=e=>!!lB(e)?.length,pWe=(e,t)=>{if(typeof t!=`string`||!t)return;if(t===`_summary`||sB.includes(t)||cB(t))return{};let n=bM({collectionName:e.name,keyPath:t});if(n)return{fieldConfig:n};let{i18nEnabled:r,canonicalSlug:i}=e._i18n;return r&&t===i.key?{}:void 0},mWe=(e,t)=>{let{i18nEnabled:n,canonicalSlug:r}=e._i18n,i=[`_summary`,`_manual`,dz(e)];return n&&i.push(r.key),[{key:`_summary`},...t.filter(e=>!i.includes(e)).map(e=>({key:e}))]},hWe=(e,t)=>{if(t===`_summary`){let{summary:t}=e,n=dz(e);return fB({config:t?void 0:bM({collectionName:e.name,keyPath:n}),option:`label`})||Y(`sort_keys._summary`)}if(cB(t)){let n=p3(t);return n?hEe.includes(n)?Y(`table_column_keys.${n}`):bB({collection:e,key:n}):t}return bB({collection:e,key:t})},m3=(e,t)=>{let n=new Set;return t.flatMap(({key:t,label:r})=>{let i=pWe(e,t);return!i||n.has(t)?[]:(n.add(t),[{key:t,label:r||hWe(e,t),...i}])})},gWe=({collection:e,sortKeys:t})=>{let n=lB(e),r=n?m3(e,n):[];return r.length?r:m3(e,mWe(e,t))},_We=new WeakMap,vWe=({collection:e,entry:t,column:n})=>{let{fieldConfig:r}=n,i=cB(n.key)?p3(n.key):void 0,a=i&&sB.includes(i)?i:n.key;if(a===`_summary`)return{type:`text`,value:jz(e,t,{useTemplate:!0})};if(cB(a))return{type:`text`,value:jz(e,t,{useTemplate:!0,template:a,useIndexFileLabel:!1})};if(a===`slug`)return{type:`text`,value:t.slug};if(a===`commit_author`)return{type:`text`,value:wz(t.commitAuthor)||``};if(a===`commit_date`){let{commitDate:e}=t;return{type:`text`,value:e?gP(e,Jc.current):``}}let{defaultLocale:o}=e._i18n,s=QP(t.locales,o),c=t.locales[s]?.content??{};if(r?.widget===`boolean`)return{type:`boolean`,value:c[a]===!0};let l=()=>({type:`text`,value:IB({collectionName:e.name,valueMap:c,keyPath:a,locale:s,plainText:!0,isIndexFile:aA(e,t)})});if(r?.widget===`relation`){let{current:e}=vj,n=`${a}\0${s}`,r=PA(_We,t,()=>new Map),i=r.get(n);if(i&&i.entries===e)return i.value;let o=l();return r.set(n,{entries:e,value:o}),o}return l()},yWe=({collection:e,column:{key:t},sortKeys:n})=>{if(t===`_summary`&&!n.includes(t)){let t=dz(e);return n.includes(t)?t:void 0}let r=cB(t)?p3(t):t;return r&&n.includes(r)?r:void 0},h3=pk(),g3=pk({}),_3=e=>[...e&&fWe(e)?[`table`]:[],`list`,...e?._thumbnailFieldNames.length?[`grid`]:[]],v3=(e,t)=>e&&t.includes(e)?e:t[0],bWe=({type:e,types:t,isLargeScreen:n,reordering:r=!1})=>{if(r)return`list`;let i=v3(e,t);return i===`table`&&!n?`list`:i},y3={current:void 0},xWe=({sort:e,filter:t,filters:n,group:r})=>JSON.stringify([e,t,n,r]),SWe=async({repository:e})=>{await rB(e,`contents-view`,h3),_k(()=>{let e=g3.current;fo(()=>{let{name:t}=sj.current??{},n=y3.current,r=n&&n.collectionName===t?n.view:e,i=h3.current?.[t??``]??{};t&&!(0,yr.default)(r,i)&&(h3.current={...h3.current,[t]:r})})})},CWe=new Set([`$$slots`,`$$events`,`$$legacy`,`disabled`,`currentView`,`types`]),wWe=B(`<div role="none" class="wrapper svelte-8v3idr"><!></div>`),TWe={hash:`svelte-8v3idr`,code:`.wrapper.svelte-8v3idr {display:contents;.select-button-group button {border-radius:var(--sui-button-medium-border-radius) !important;}}`};function b3(e,t){O(t,!0),K(e,TWe);let n=J(t,`disabled`,3,!1),r=J(t,`currentView`,7),i=J(t,`types`,19,()=>[`list`,`grid`]),a=ks(t,CWe),o={table:`table`,list:`format_list_bulleted`,grid:`grid_view`},s=A(()=>v3(r().current.type,i())),c=A(()=>z(s)===`grid`),l=A(()=>i().includes(`list`)&&i().includes(`grid`)),u=e=>{r().current={...r().current,type:e}};var d=wWe(),f=N(d),p=e=>{var t=H(),r=P(t),c=e=>{{let t=A(()=>Y(`switch_view`));Jl(e,As({get disabled(){return n()},get ariaLabel(){return z(t)}},()=>a,{children:(e,t)=>{var r=H();Bo(P(r),16,i,e=>e,(e,t)=>{{let r=e=>{Xc(e,{get name(){return o[t]}})},i=A(()=>z(s)===t),a=A(()=>Y(`${t}_view`));Yl(e,{get disabled(){return n()},get selected(){return z(i)},variant:`ghost`,iconic:!0,get"aria-label"(){return z(a)},onSelect:()=>{u(t)},startIcon:r,$$slots:{startIcon:!0}})}}),U(e,r)},$$slots:{default:!0}}))}};G(r,e=>{i().length>1&&e(c)}),U(e,t)},m=e=>{{let t=e=>{{let t=A(()=>z(c)?o.list:o.grid);Xc(e,{get name(){return z(t)}})}},r=A(()=>Y(z(c)?`switch_to_list_view`:`switch_to_grid_view`));Al(e,{get disabled(){return n()},variant:`ghost`,iconic:!0,get"aria-label"(){return z(r)},onclick:()=>{u(z(c)?`list`:`grid`)},startIcon:t,$$slots:{startIcon:!0}})}};G(f,e=>{iG.isLargeScreen?e(p):z(l)&&e(m,1)}),D(d),U(e,d),k()}var x3={count:0,name:``,showDialog:!1,resolve:()=>{}},S3=ta({...x3}),C3=async({files:e,listedAssets:t})=>{let n=bX(e,t),r=n.length;if(!r)return!1;let{promise:i,resolve:a}=Promise.withResolvers();Object.assign(S3,{count:r,name:n[0].name,showDialog:!0,resolve:a});let o=await i;return Object.assign(S3,{...x3}),o},EWe=/(?<=.)\/(?=\/|$)/g,w3=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i})=>{let a=cH({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i}),o=t?cH({collectionName:e,fileName:t}):void 0,s=cH({collectionName:e}),c=o??s,l=aH.current,u={field:{folder:a,enabled:a!==void 0},entry:{folder:c,enabled:!!c&&(c.entryRelative||c.hasTemplateTags)},file:{folder:o,enabled:!!o&&!o.entryRelative&&!o.hasTemplateTags},collection:{folder:s,enabled:!!s&&!s.entryRelative&&!s.hasTemplateTags},global:{folder:l,enabled:l!==void 0}};return iH.current.forEach(e=>{e.isAssetCollection&&e.collectionName&&(u[e.collectionName]={folder:e,enabled:!0})}),u},T3=e=>Object.values(e).find(({enabled:e})=>e)?.folder,E3=e=>T3(w3(e)),DWe=({entry:e,folder:t,locale:n})=>{let{collectionName:r,entryRelative:i,internalPath:a,internalSubPath:o}=t??{};if(!i)return a===void 0?void 0:pX({internalPath:a,collectionName:r,entry:e,locale:n})??a.replaceAll(qk,`-`);let s=o||void 0;return e?UP([eF(e,n),s]):s?`${a}/${s}/-`:`${a}/-`},OWe=({draft:e,blobURL:t})=>{let n=e.files[t];if(n)return Z$({draft:e,item:n,defaultLocaleSlug:n.nameTemplate?c2({draft:e}).defaultLocaleSlug:``})},kWe=({draft:e,blobURL:t,fileName:n})=>{let{folder:r,subfolderPath:i}=e.files[t]??{},{entryRelative:a,publicPath:o=``}=r??{},s=UP([i,n]);if(!r||!a&&!gN(o))return m4(o,s);let{defaultLocaleSlug:c}=c2({draft:e}),{resolvedPublicPath:l}=p4({draft:e,defaultLocaleSlug:c,folder:r});return m4(l.replace(EWe,``),s)},AWe=({draft:e,value:t,unsavedFileName:n})=>{if(!t||typeof t!=`string`)return``;if(n)return kWe({draft:e,blobURL:t,fileName:MP(n.normalize())});if(t.startsWith(`blob:`))return``;let r=MP(t);if(wE(r)){let e=new URL(r);if(e.search)return e.search=``,`${e}…`}return r},D3=({path:e,folderPath:t})=>t!==void 0&&(t===``||e===t||`${e}/-`===t||e.startsWith(`${t}/`)),jWe=({asset:e,folder:t,folderPath:n})=>t===void 0?!1:t.entryRelative?D3({path:WP(e.path),folderPath:n}):e.folder?.internalPath===t.internalPath&&!e.folder?.entryRelative&&D3({path:e.path,folderPath:n}),MWe=({savedAssets:e,unsavedAssets:t,slugificationEnabled:n})=>{if(!t.length)return{savedAssets:e,unsavedAssets:t};let r=new Map,i=new Set;e.forEach(({path:e,name:t})=>{PA(r,WP(e),()=>[]).push(t.normalize())});let a=t.map(e=>{let{name:t,path:a,replace:o}=e,s=WP(a),c=r.get(s)??[],l=YB(t,{slugificationEnabled:n,assetNamesInSameFolder:o?[]:c}),u=s?`${s}/${l}`:l;return o?i.add(u):(c.push(l.normalize()),r.set(s,c)),u===a?e:{...e,name:l,path:u}});return{savedAssets:i.size?e.filter(({path:e})=>!i.has(e)):e,unsavedAssets:a}},NWe=({kind:e,accept:t,folder:n,folderPath:r,unsavedAssets:i,uncheckedFiles:a=[],slugificationEnabled:o=!1})=>{let s=e=>jWe({asset:e,folder:n,folderPath:r}),c=MWe({savedAssets:pH.current.filter(s),unsavedAssets:i.filter(s),slugificationEnabled:o});return[...c.unsavedAssets,...c.savedAssets].filter(n=>!!n.file&&a.includes(n.file)||(!e||e===n.kind)&&QH({name:n.name},t)).sort((e,t)=>e.name.localeCompare(t.name)).sort((e,t)=>Number(!!t.unsaved)-Number(!!e.unsaved))},PWe=({sha:e,folder:t,unsavedAssets:n})=>n.some(n=>!!n.file&&n.sha===e&&(0,yr.default)(n.folder,t)),O3=async({draft:e,file:t,folder:n,subfolderPath:r=``,replace:i=!1})=>{let a=await XP(t),o;return await Promise.all(Object.entries(e.files??{}).map(async([e,s])=>{!o&&await XP(s.file)===a&&(!n?.entryRelative||(0,yr.default)(s.folder,n))&&(s.subfolderPath??``)===r&&(!i||s.replace&&XB(s.file.name,t.name))&&(o=e)})),o},k3=async({file:e,name:t=e.name,blobURL:n,folder:r,targetFolderPath:i,subfolderPath:a,replace:o})=>{let{size:s}=e;return{unsaved:!0,replace:!!o,file:e,blobURL:n??await OX(e),name:t,path:UP([i,a,t]),sha:await XP(e),size:s,kind:pV(t),folder:r}},A3=async({draft:e,targetFolderPath:t})=>{let n=Object.entries(e.files),r=n.some(([,{nameTemplate:e}])=>e)?c2({draft:e}).defaultLocaleSlug:``;return Promise.all(n.map(async([n,i])=>{let{file:a,folder:o,replace:s,subfolderPath:c}=i;return k3({file:a,name:Z$({draft:e,item:i,defaultLocaleSlug:r}),blobURL:n,folder:o,targetFolderPath:t,subfolderPath:c,replace:s})}))},FWe=(e,t,n)=>{let r=pH.current;if(!t?.entryRelative)return r;let{originalEntry:i,defaultLocale:a,collection:o}=e,s=((n?i?.locales[n]:void 0)??i?.locales[a])?.path;if(!s)return[];let c=UP([f4({collection:o,entryFilePath:s,internalPath:t.internalPath}),t.internalSubPath]);return r.filter(e=>e.path.startsWith(`${c}/`))},j3=e=>({value:void 0,credit:``,oversizedFileName:void 0,invalidFileName:void 0,mismatchedFileName:e.name}),M3=async({draft:e,resource:t,libraryConfig:n,accept:r,locale:i})=>{let{url:a,folderPath:o,credit:s,replace:c=!1,subfolderPath:l}=t,{asset:u,file:d}=t,f=``;if(d){let{folder:a}=t;if(!a)return{value:void 0,credit:``,oversizedFileName:void 0,invalidFileName:void 0};let o;try{o=await O3({draft:e,file:d,folder:a,subfolderPath:l,replace:c})}catch{return{value:void 0,credit:``,oversizedFileName:void 0,invalidFileName:d.name}}if(o){if(!QH(d,r))return j3(d);f=o}else{let{file:o,oversized:s,invalid:p}=await Q$(d,n??{});if(d=o,p)return{value:void 0,credit:``,oversizedFileName:void 0,invalidFileName:d.name};if(!QH(d,r))return j3(t.file);let m=await XP(d),{name:h}=d,g=[...FWe(e,a,i),...await A3({draft:e})].find(e=>e.sha===m&&(0,yr.default)(e.folder,a)&&(!c||(!e.unsaved||e.replace)&&XB(e.name,h)));if(g)u=g,d=void 0;else if(s)return{value:void 0,credit:``,oversizedFileName:d.name,invalidFileName:void 0};else{f=await OX(d);let t=c?void 0:n?.filename_template;e.files[f]={file:d,folder:a,replace:c,subfolderPath:l,...t?{nameTemplate:Y$(t,{slugificationEnabled:n.slugify_filename})}:{}}}}}return u&&(u.unsaved?u.blobURL?f=u.blobURL:u.file&&(f=await O3({draft:e,file:u.file,folder:u.folder})):f=KX(u,{pathOnly:!0,allowSpecial:!0,entry:e.originalEntry,locale:i})),a&&!d&&!u&&(f=a),o&&(f=o),{value:f,credit:s?_t(s,vA):``,oversizedFileName:void 0,invalidFileName:void 0}},N3=({getDraft:e,getFolder:t,getLocale:n,getKind:r,getAccept:i,getSlugificationEnabled:a,getDroppedAssets:o=()=>[]})=>{let s=j(ta([])),c=A(()=>DWe({entry:e()?.originalEntry,folder:t(),locale:n()})),l=A(()=>NWe({kind:r(),accept:i(),folder:t(),folderPath:z(c),unsavedAssets:z(s),uncheckedFiles:o().map(({file:e})=>e),slugificationEnabled:a()}));return yk(async()=>{let t=e(),n=[...o()];return[...t?await A3({draft:t,targetFolderPath:z(c)}):[],...n]},e=>{M(s,e,!0)}),{get targetFolderPath(){return z(c)},get listedAssets(){return z(l)},get unsavedAssets(){return z(s)},reset:()=>{M(s,[],!0)}}},P3=(e,t=kr,n)=>{let r=Ei(()=>Mr(n?.(),!1));{let n=e=>{Xc(e,{name:`create_new_folder`})},i=A(()=>Y(`new_folder`));Al(e,{variant:`ghost`,iconic:!0,get disabled(){return z(r)},get"aria-label"(){return z(i)},get onclick(){return t()},startIcon:n,$$slots:{startIcon:!0}})}},F3=B(`<!> <!>`,1),I3=B(`<!> <!> <!>`,1),IWe=B(`<div role="status" class="selected-folder svelte-5b1zbe" dir="auto"><!></div>`),LWe=B(`<a class="service-link svelte-5b1zbe"> </a>`),RWe=B(`<div role="none" class="filter-tools svelte-5b1zbe"><!></div>`),zWe=B(`<div role="none"> </div> <!>`,1),BWe=B(`<div role="none" class="wrapper svelte-5b1zbe"><div role="none" class="nav svelte-5b1zbe"><!> <!></div> <div role="none" class="content-pane svelte-5b1zbe" data-focus-scope=""><!> <!> <!></div></div>`),VWe={hash:`svelte-5b1zbe`,code:`.wrapper.svelte-5b1zbe {display:flex;gap:16px;height:60dvh;max-height:800px;--tile-padding: 4px;
@media (width < 768px) {flex-direction:column;overflow:hidden;height:72dvh;
}.nav:where(.svelte-5b1zbe) {flex:none;display:flex;gap:4px;
@media (width < 768px) {flex-direction:column;
}}.listbox {flex:none;background-color:transparent;.option button .icon:not(.check) {display:block;}}.content-pane:where(.svelte-5b1zbe) {overflow:auto;flex:auto;}}.service-link.svelte-5b1zbe,
.selected-folder.svelte-5b1zbe {font-size:var(--sui-font-size-small);}.selected-folder.svelte-5b1zbe {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.filter-tools.svelte-5b1zbe {display:flex;gap:8px;}`};function L3(e,t){let n=Eo();O(t,!0),K(e,VWe);let r=e=>{var n=I3(),r=P(n),i=e=>{var n=F3(),r=P(n),i=e=>{b3(e,{get currentView(){return C},"aria-controls":`select-assets-grid`})};G(r,e=>{qQ.current&&e(i)});var a=I(r,2),o=e=>{{let n=A(()=>!z(oe)),r=A(()=>z(x).some(e=>e.file)),i=A(()=>Y(`assets_dialog.search_for_${t.kind??`file`}`));Vu(e,{dir:`auto`,get flex(){return iG.isSmallScreen},get debounce(){return z(n)},get disabled(){return z(r)},get ariaLabel(){return z(i)},get value(){return z(h)},set value(e){M(h,e,!0)}})}};G(a,e=>{c()||e(o)}),U(e,n)};G(r,e=>{(z(oe)||z(xe)&&z(ae)!==`cloudinary`||z(Se)&&z(ae)!==`picsum`)&&e(i)});var a=I(r,2),o=e=>{P3(e,()=>()=>{M(v,!0)},()=>dH.current||z(me))},s=e=>{P3(e,()=>()=>{z(S)?.showNewFolderDialog()})},l=A(()=>z(xe)&&z(S)?.canCreateFolder());G(a,e=>{z(de)?e(o):z(l)&&e(s,1)});var u=I(a,2),d=e=>{{let t=e=>{Xc(e,{name:`cloud_upload`})},n=A(()=>Y(`upload`));Al(e,{variant:`primary`,get label(){return z(n)},get disabled(){return z(me)},onclick:()=>{z(b)?.open()},startIcon:t,$$slots:{startIcon:!0}})}};G(u,e=>{!c()&&(z(oe)||z(xe)&&z(ae)!==`cloudinary`)&&e(d)}),U(e,n)},i=J(t,`open`,15,!1),a=J(t,`multiple`,3,!1),o=J(t,`accept`,19,()=>t.kind===`image`?OH.join(`,`):void 0),s=J(t,`canEnterURL`,3,!0),c=J(t,`selectFolder`,3,!1),l=J(t,`draft`,3,void 0),u=J(t,`locale`,3,void 0),d=J(t,`onSelect`,3,void 0),f=J(t,`onClose`,3,void 0),p=J(t,`pendingFiles`,31,()=>ta([])),m=j(``),h=j(``),g=j(``),_=j(ta([])),v=j(!1),y=j(ta([])),b=j(void 0),x=j(ta([])),S=j(void 0),C=qQ,w=A(()=>c()?Y(`assets_dialog.title.folder`):t.kind===`image`?Y(`assets_dialog.title.image`):Y(`assets_dialog.title.file`)),T=A(()=>y1(z(h))),ee=A(()=>CH({fieldConfig:t.fieldConfig})!==!1&&Object.values(t.assetLibraryFolderMap).some(e=>H$(e,c()))),te=A(()=>s()&&!c()),ne=A(()=>c()?[]:t.enabledCloudServiceEntries),re=A(()=>yBe({fieldConfig:t.fieldConfig,selectFolder:c(),isDefaultLibraryEnabled:z(ee)})),ie=A(()=>[...z(ne),...z(re)].sort(V$)),ae=A(()=>vBe({assetLibraryFolderMap:t.assetLibraryFolderMap,isDefaultLibraryEnabled:z(ee),selectFolder:c(),hasPendingFiles:fo(()=>!!p().length),cloudServiceEntries:z(ne),externalServiceEntries:z(ie)})),oe=A(()=>z(ae).startsWith(`default-`)),se=A(()=>{if(!z(oe))return;let e=z(ae).replace(`default-`,``),{folder:n}=t.assetLibraryFolderMap[e];return n}),ce=N3({getDraft:()=>l(),getFolder:()=>z(se),getLocale:()=>u(),getKind:()=>t.kind,getAccept:()=>o(),getSlugificationEnabled:()=>JH({fieldConfig:t.fieldConfig}).config.slugify_filename,getDroppedAssets:()=>z(y)}),le=A(()=>ce.targetFolderPath),ue=A(()=>ce.listedAssets),de=A(()=>rU(z(se))&&z(le)!==void 0&&!z(T)),fe=A(()=>UP([z(le),z(g)])),pe=A(()=>z(oe)&&KV(z(fe))),me=A(()=>z(pe)||!!z(se)?.readonly),he=A(()=>z(ue).filter(({path:e})=>WP(e)===z(fe))),ge=A(()=>z(de)?z(he):z(ue)),_e=A(()=>z(de)?pU({dirPath:z(fe),assets:z(ue)}):[]),ve=A(()=>uU({subfolders:z(_e),fileNames:z(ge).map(({name:e})=>e),dirPath:z(de)?z(fe):void 0})),ye=A(()=>z(se)?.label||Y(`assets_dialog.folder.${z(ae).replace(`default-`,``)}`)),be=A(()=>z(re).some(([e,{authType:t}])=>e===z(ae)&&(t===`none`||!!IG.apiKeys?.[z(ae)]))),xe=A(()=>z(ne).map(([e])=>e).includes(z(ae))),Se=A(()=>z(re).map(([e])=>e).includes(z(ae))),Ce=A(()=>bBe({selectFolder:c(),browsingSubfolders:z(de),folder:z(se),basePath:z(le),subfolderPath:z(g),selectedSubfolderPaths:z(_)})),we=({path:e},t)=>{let n=z(_).filter(t=>t!==e);M(_,t?[...a()?n:[],e]:n,!0)},Te=e=>{M(g,e,!0),a()||M(_,[],!0)},Ee=async(e,t)=>{let n=await XP(e),r=z(se);if(PWe({sha:n,folder:r,unsavedAssets:ce.unsavedAssets}))return;let i=await k3({file:e,folder:r,targetFolderPath:z(le),subfolderPath:z(g),replace:t});return z(y).push(i),i},De=async e=>{if(z(me))return;let t=await C3({files:e,listedAssets:z(he)});t!==void 0&&M(x,(await Promise.all(e.map(e=>Ee(e,t)))).filter(e=>!!e).map(e=>({asset:e,replace:t})),!0)},Oe=()=>{M(m,``),M(h,``),M(g,``),M(_,[],!0),z(y).forEach(e=>WX(e.blobURL)),M(y,[],!0),ce.reset(),M(x,[],!0)},ke=()=>{if(c()){if(!z(Ce).length)return;d()?.(z(Ce).map(e=>({folderPath:e})))}else z(x).length&&(z(S)?.trackDownloads(),d()?.(SBe({resources:z(x),targetFolderPath:z(le)})))};L(()=>{zQ.current||i(!1)}),L(()=>{z(S)&&z(xe)&&p().length&&(z(S).uploadFiles(p()),p([]))});var Ae=I3(),je=P(Ae);{let e=e=>{var t=H(),n=P(t),i=e=>{r(e)};G(n,e=>{iG.isSmallScreen||e(i)}),U(e,t)},s=e=>{var t=F3(),n=P(t),r=e=>{var t=IWe(),n=N(t),r=e=>{var t=V();R(e=>W(t,e),[()=>Y(`assets_dialog.selected_folder`,{values:{path:z(Ce)[0]}})]),U(e,t)},i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`assets_dialog.selected_folders`,{values:{count:z(Ce).length}})]),U(e,t)};G(n,e=>{z(Ce).length===1?e(r):e(i,-1)}),D(t),R(()=>t.dir=t.dir),U(e,t)};G(n,e=>{z(Ce).length&&e(r)});var i=I(n,2),a=e=>{let t=A(()=>z$[z(ae)]);var n=H(),r=P(n),i=e=>{var n=LWe(),r=F(n,!0);R(e=>{q(n,`href`,z(t).serviceURL),W(r,e)},[()=>Y(`prefs.media.stock_photos.credit`,{values:{service:z(t).serviceLabel}})]),U(e,n)};G(r,e=>{z(t).showServiceLink&&e(i)}),U(e,n)};G(i,e=>{z(be)&&e(a)}),U(e,t)},l=A(()=>c()?Y(`select`):Y(`insert`)),u=A(()=>c()?!z(Ce).length:!z(x).length);tu(je,{get title(){return z(w)},size:`x-large`,get okLabel(){return z(l)},get okDisabled(){return z(u)},focusInput:!1,onOk:ke,onClose:()=>{Oe(),f()?.()},get open(){return i()},set open(e){i(e)},headerExtra:e,footerExtra:s,children:(e,s)=>{var l=BWe(),u=N(l),d=N(u);lVe(d,{get libraryName(){return z(ae)},get assetLibraryFolderMap(){return t.assetLibraryFolderMap},get showRepository(){return z(ee)},get selectFolder(){return c()},get cloudServiceEntries(){return z(ne)},get showURLInput(){return z(te)},get stockAssetProviderEntries(){return z(re)},get controlsId(){return`${n}-content-pane`},onChange:e=>{M(ae,e),M(g,``),M(_,[],!0),M(x,W$({libraryName:z(ae),enteredURL:z(m)}),!0)}});var f=I(d,2),p=e=>{var t=RWe(),n=N(t);r(n),D(t),U(e,t)};G(f,e=>{iG.isSmallScreen&&e(p)}),D(u);var h=I(u,2),v=N(h),y=e=>{{let n=A(()=>c()?[]:z(ge)),r=A(()=>z(de)?z(fe):z(se).internalPath),i=A(()=>z(de)?z(g):``),s=A(()=>c()?we:void 0);oVe(e,{get accept(){return o()},get multiple(){return a()},get kind(){return t.kind},get selectFolder(){return c()},get uploadDisabled(){return z(me)},get assets(){return z(n)},get searchTerms(){return z(T)},get basePath(){return z(r)},get folderLabel(){return z(ye)},get subfolderPath(){return z(i)},get subfolders(){return z(_e)},onDrop:({files:e})=>{De(e)},get selectedSubfolderPaths(){return z(_)},get onSelectSubfolder(){return z(s)},onNavigate:Te,onOpenSubfolder:({path:e})=>{Te(iU(e,z(le)))},get selectedResources(){return z(x)},set selectedResources(e){M(x,e,!0)}})}};G(v,e=>{z(oe)&&z(se)&&e(y)});var b=I(v,2),C=e=>{VO(e,{children:(e,n)=>{var r=zWe(),i=P(r),a=F(i,!0);fu(I(i,2),{dir:`ltr`,flex:!0,oninput:()=>{M(x,W$({libraryName:z(ae),enteredURL:z(m)}),!0)},get value(){return z(m)},set value(e){M(m,e,!0)}}),R(e=>W(a,e),[()=>t.kind===`image`?Y(`assets_dialog.enter_image_url`):Y(`assets_dialog.enter_file_url`)]),U(e,r)},$$slots:{default:!0}})};G(b,e=>{z(te)&&z(ae)===`enter-url`&&e(C)}),Bo(I(b,2),17,()=>z(ie),([e,t])=>e,(e,n)=>{var r=A(()=>Nr(z(n),2));let o=()=>z(r)[0],s=()=>z(r)[1];var c=H(),l=P(c),u=e=>{{let n=A(()=>z(ae)!==`cloudinary`);IV(e,{get kind(){return t.kind},get fieldConfig(){return t.fieldConfig},get multiple(){return a()},get hidden(){return z(n)},onSelect:e=>{M(x,e,!0),ke(),i(!1)}})}},d=e=>{Ds($Be(e,{get kind(){return t.kind},get fieldConfig(){return t.fieldConfig},get multiple(){return a()},get searchTerms(){return z(T)},get serviceProps(){return s()},gridId:`select-assets-grid`,get selectedResources(){return z(x)},set selectedResources(e){M(x,e,!0)}}),e=>M(S,e,!0),()=>z(S))};G(l,e=>{o()===`cloudinary`?e(u):z(ae)===o()&&e(d,1)}),U(e,c)}),D(h),D(l),R(()=>q(h,`id`,`${n}-content-pane`)),U(e,l)},$$slots:{headerExtra:!0,footerExtra:!0,default:!0}})}var Me=I(je,2),Ne=e=>{f3(e,{get dirPath(){return z(fe)},get takenNames(){return z(ve)},get open(){return z(v)},set open(e){M(v,e,!0)}})};G(Me,e=>{z(de)&&e(Ne)}),Ds(_u(I(Me,2),{get accept(){return o()},get multiple(){return a()},onSelect:({files:e})=>{z(xe)?z(S)?.uploadFiles(e):De(e)}}),e=>M(b,e,!0),()=>z(b)),U(e,Ae),k()}var HWe=B(`<!> <!> <!> <!>`,1);function R3(e,t){O(t,!0);{let t=e=>{var t=HWe(),n=P(t);$l(n,{flex:!0});var r=I(n,2);Al(r,{variant:`primary`,onclick:()=>S3.resolve(!0),children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`replace`)]),U(e,n)},$$slots:{default:!0}});var i=I(r,2);Al(i,{variant:`primary`,onclick:()=>S3.resolve(!1),children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`keep_both`)]),U(e,n)},$$slots:{default:!0}}),Al(I(i,2),{variant:`secondary`,onclick:()=>S3.resolve(void 0),children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`cancel`)]),U(e,n)},$$slots:{default:!0}}),U(e,t)},n=A(()=>Y(`file_name_conflict_resolution`));ru(e,{get title(){return z(n)},onCancel:()=>S3.resolve(void 0),get open(){return S3.showDialog},set open(e){S3.showDialog=e},footer:t,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`file_name_conflict_confirmation_with_name`,{values:{count:S3.count,name:S3.name}})]),U(e,n)},$$slots:{footer:!0,default:!0}})}k()}var z3=({collectionName:e,fileName:t,isIndexFile:n,componentName:r,typedKeyPath:i,fieldConfig:a})=>{let o=w3({collectionName:e,fileName:t,componentName:r,typedKeyPath:i,isIndexFile:n}),{enabled:s,config:c}=JH({fieldConfig:a}),l=Object.entries(fZ).filter(([,{isEnabled:e}])=>e?.(a)??!0);return{folderMap:o,folder:T3(o),enabled:s,libraryConfig:c,cloudServiceEntries:l}},B3=({draft:e,resources:t,folder:n,libraryConfig:r,accept:i,locale:a})=>Promise.all(t.map(t=>(t.file&&!t.folder&&(t.folder=n),M3({draft:e,resource:t,libraryConfig:r,accept:i,locale:a})))),V3=e=>({oversizedFileNames:e.flatMap(({oversizedFileName:e})=>e??[]),invalidFileNames:e.flatMap(({invalidFileName:e})=>e??[]),mismatchedFileNames:e.flatMap(({mismatchedFileName:e})=>e??[])}),H3=(e,t)=>t?e.replaceAll(` `,`%20`):e,UWe=({resources:e,multiple:t,previousValue:n,inEditorComponent:r})=>{let i=e.flatMap(({value:e})=>e??[]),a;return t||(a=i.length?H3(i.at(-1),r):n??``),{values:i,value:a,credit:e.flatMap(({credit:e})=>e||[]).join(`
`),rejected:V3(e)}},U3=({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r})=>{let{collectionName:i,fileName:a,isIndexFile:o}=e;return z3({collectionName:i,fileName:a,isIndexFile:o,componentName:r,typedKeyPath:n,fieldConfig:t})},WWe=async({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r,locale:i,file:a,options:o={}})=>{let s=o.name??(a instanceof File?a.name:``);if(!(a instanceof Blob)||!s)throw TypeError("addFile() expects a File, or a Blob along with the `name` option");let c=a instanceof File&&a.name===s?a:new File([a],s,{type:a.type}),{folder:l,libraryConfig:u}=U3({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r});if(!l)throw Error(`There is no asset folder to upload the file "${s}" to`);let{value:d,oversizedFileName:f,invalidFileName:p}=await M3({draft:e,resource:{file:c,folder:l,replace:!!o.replace},libraryConfig:u,locale:i});if(p)throw Error(`The file "${p}" is corrupt or mislabeled and cannot be used`);if(f){let{max_file_size:e}=u;throw Error(`The file "${f}" exceeds the maximum size of ${e} bytes`)}return d},GWe=({kind:e,accept:t})=>{if(e)return e===`image`?`image`:void 0;let n=(t??``).split(`,`).map(e=>e.trim()).filter(Boolean);return n.length&&n.every(e=>e.startsWith(`image/`))?`image`:void 0},KWe=async({draft:e,typedKeyPath:t,componentName:n,locale:r,resource:i,value:a})=>{if(a.startsWith(`blob:`))return e.files[a]?.file;let{collectionName:o,fileName:s,originalEntry:c}=e,l=i.asset??(i.file?_X({value:a,entry:c,collectionName:o,fileName:s,componentName:n,typedKeyPath:t,locale:r}):void 0);return l?PX(l):void 0},qWe=async({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r,locale:i,inEditorComponent:a=!1,resources:o,accept:s})=>{let{folder:c,libraryConfig:l}=U3({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r}),u=await B3({draft:e,resources:o,folder:c,libraryConfig:l,accept:s,locale:i});return{files:(await Promise.all(u.map(async({value:s,credit:c},l)=>s?{value:H3(s,a),file:await KWe({draft:e,fieldConfig:t,typedKeyPath:n,componentName:r,locale:i,resource:o[l],value:s}),credit:c||void 0}:void 0))).filter(Boolean),...V3(u)}},JWe=B(`<!> <!> <!>`,1);function YWe(e,t){O(t,!0);let n=J(t,`componentName`,3,void 0),r=J(t,`inEditorComponent`,3,!1),i=J(t,`locale`,3,void 0),a=$M(),o=j(!1),s=j({}),c=j(void 0),l,u=A(()=>a.current?U3({draft:a.current,fieldConfig:t.fieldConfig,typedKeyPath:t.typedKeyPath,componentName:n()}):void 0),d=A(()=>GWe(z(s))),f=A(()=>ZH({accept:z(s).accept,image:z(d)===`image`,transformations:z(u)?.libraryConfig.transformations})),p=A(()=>z(u)?.libraryConfig.max_file_size??1/0),m=A(()=>t.fieldConfig),h=async(e={})=>{if(!a.current)throw Error(`pickFile() can only be called while an entry is being edited`);return l||(l=Promise.withResolvers(),M(s,e),M(o,!0)),l.promise},g=async e=>{let o=a.current,{resolve:u,reject:d}=l??{},{multiple:p=!1}=z(s);if(l=void 0,u&&d){if(!o)u(null);else try{let{files:a,...s}=await qWe({draft:o,fieldConfig:t.fieldConfig,typedKeyPath:t.typedKeyPath,componentName:n(),locale:i(),inEditorComponent:r(),resources:e,accept:z(f)});z(c)?.report(s),a.length?u(p?a:a[0]):u(null)}catch(e){d(e)}}},_=()=>{l?.resolve(null),l=void 0};Ms(_);var v={pick:h},y=H(),b=P(y),x=e=>{var t=JWe(),n=P(t);{let e=A(()=>!!z(s).multiple),t=A(()=>z(s).allowURL??!0);L3(n,{get kind(){return z(d)},get accept(){return z(f)},get multiple(){return z(e)},get canEnterURL(){return z(t)},get draft(){return a.current},get locale(){return i()},get fieldConfig(){return z(m)},get assetLibraryFolderMap(){return z(u).folderMap},get enabledCloudServiceEntries(){return z(u).cloudServiceEntries},onSelect:g,onClose:_,get open(){return z(o)},set open(e){M(o,e,!0)}})}var r=I(n,2);R3(r,{}),Ds(C$(I(r,2),{get maxSize(){return z(p)},get accept(){return z(f)}}),e=>M(c,e,!0),()=>z(c)),U(e,t)};return G(b,e=>{z(u)&&e(x)}),U(e,y),k(v)}var W3=(0,gr.createContext)({}),G3=V1({loader:()=>BN(`react-dom`),notLoadedMessage:"react-dom is not loaded yet. Call `loadReactDom()` first."}),K3=G3.loaded,q3=G3.load,J3=G3.preload;G3.get,G3.reset;var Y3=e=>{let t;return{render:n=>{t??=G3.get().createRoot(e),t.render(n)},unmount:()=>{t?.unmount(),t=void 0}}},XWe=(e,t)=>{let n,r=!1;return G3.load().then(()=>{r||(n=Y3(e),n.render(t))},e=>{console.error(e)}),()=>{r=!0,n?.unmount()}},ZWe=({fieldConfig:e,dynamicValue:t})=>{if(t!==void 0)return t===`true`;let{default:n}=e;return typeof n==`boolean`&&n},QWe=e=>({[e.keyPath]:ZWe(e)}),$We=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let{default:r,output_code_only:i=!1,keys:a={code:`code`,lang:`lang`}}=e,o=n===void 0?r:n;if(i)return{[t]:typeof o==`string`?o:``};let s=E(o)?o:void 0,c=s?.[a.code]??o,l=s?.[a.lang]??``;return Wj(t,{[a.code]:typeof c==`string`?c:``,[a.lang]:typeof l==`string`?l:``})},eGe=({fieldConfig:e,dynamicValue:t,locale:n})=>{let r=e,i=r.default,a=t??i;return typeof a==`string`?a===`{{now}}`?v0(r,{locale:n}):a:``},tGe=e=>({[e.keyPath]:eGe(e)}),X3=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let r=e,i=r.default,a=lM(r),o=``;o=n===void 0?a?Array.isArray(i)?i:[]:typeof i==`string`?i:``:a?n.split(/,\s*/):n;let s={};return a&&Array.isArray(o)&&(o=o.map(e=>e.trim()).filter(e=>e!==``),Object.assign(s,Wj(t,o))),!a&&typeof o==`string`&&(s[t]=o.trim()),s},nGe=(e,{locale:t,account:{email:n=``,login:r=``,name:i=``}})=>e===`locale`?t:e===`datetime`?new Date().toJSON().replace(/\d+\.\d+Z$/,`00.000Z`):e===`uuid`?ml():e===`uuid_short`?ml(`short`):e===`uuid_shorter`?ml(`shorter`):e===`author-email`?n:e===`author-login`?r:e===`author-name`?i:``,rGe=({fieldConfig:e,locale:t,dynamicValue:n})=>{let{default:r}=e,i=n??r;if(typeof i!=`string`)return i;let a={locale:t,account:OW.account},o=e=>{let{value:n,transformations:r}=sP(e),i=nGe(n,a),s=fN(r,o);return s.length?cP({value:i,transformations:s,locale:t}):i};return mN(i,(e,t)=>o(t))},Z3=e=>({[e.keyPath]:rGe(e)}),iGe=({fieldConfig:e,locale:t})=>{let{default:n}=e,r=SM({fieldConfig:e,locale:t});return E(n)?n:r?{"":``}:{}},aGe=e=>{let{keyPath:t,dynamicValue:n}=e,r;if(n!==void 0)try{let e=JSON.parse(n);E(e)&&(r=e)}catch{}return r??=iGe(e),Object.fromEntries(Object.entries(r).filter(([,e])=>typeof e==`string`).map(([e,n])=>[`${t}.${Ij(e)}`,n]))},Q3=e=>e.replaceAll(/<(?=[!/?a-z])/gi,`&lt;`),$3=e=>{try{return Q3(Fhe(e))}catch{return Q3(e.replace(/<[^>]*>/g,``))}},e6=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let{default:r=Sk.current?.field_defaults?.richtext?.default}=e,i=n===void 0?r||``:$3(n);return{[t]:i}},t6=({content:e,itemKeyPath:t,fields:n,funcArgs:r})=>{let{locale:i,defaultLocale:a,populateDefault:o}=r,s=Object.keys(e);n.forEach(n=>{let r=`${t}.${n.name}`;s.some(e=>GO(e,r))||o?.({content:e,keyPath:r,fieldConfig:n,locale:i,defaultLocale:a,dynamicValues:{}})})},n6=({fieldConfig:e,locale:t})=>e.max===1&&(`fields`in e||`field`in e)&&SM({fieldConfig:e,locale:t}),oGe=e=>{let{fieldConfig:t,keyPath:n,dynamicValue:r,locale:i,defaultLocale:a,populateDefault:o}=e,{default:s}=t,{field:c}=t,{fields:l}=t,{types:u,typeKey:d=`type`}=t,f;if(r!==void 0){let e=Rk.includes(c?.widget);f=r.split(/,\s*/).map(t=>(e?$3(t):t).trim()).filter(e=>e!==``)}else f=Array.isArray(s)?s:[];if(!(Array.isArray(f)&&f.length)){let r=Wj(n,[]);if(n6({fieldConfig:t,locale:i})){let t=`${n}.0`;c?o?.({content:r,keyPath:t,fieldConfig:c,locale:i,defaultLocale:a,dynamicValues:{}}):t6({content:r,itemKeyPath:t,fields:l,funcArgs:e})}return r}let p=c||l||u?f:f.filter(e=>!E(e)),m=Wj(n,p);return(l||u)&&p.forEach((t,r)=>{if(!E(t))return;let i=l??u.find(({name:e})=>e===t[d])?.fields;i&&t6({content:m,itemKeyPath:`${n}.${r}`,fields:i,funcArgs:e})}),m},sGe=[`int`,`float`,`int/string`,`float/string`],cGe=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let r=e,i=n??r.default;if(i===void 0)return{[t]:SP(r)?``:null};if(!sGe.includes(bP(r)))return{};let a=TP(i);return DP(a,r)?{}:{[t]:OP({inputValue:a,fieldConfig:r})}},lGe=e=>{let{fieldConfig:t,keyPath:n,locale:r,defaultLocale:i,populateDefault:a}=e,{default:o}=t,{fields:s}=t,{types:c,typeKey:l=`type`}=t,u=SM({fieldConfig:t,locale:r}),d={};if(E(o)){Object.entries(zj(o)).forEach(([e,t])=>{d[`${n}.${e}`]=t});let t=Array.isArray(c)?c.find(({name:e})=>e===o[l])?.fields:s;return t&&t6({content:d,itemKeyPath:n,fields:t,funcArgs:e}),d}return!u||Array.isArray(c)?(d[n]=null,d):(s&&s.length>0&&s.forEach(e=>{a?.({content:d,keyPath:[n,e.name].join(`.`),fieldConfig:e,locale:r,defaultLocale:i,dynamicValues:{}})}),d)},r6=({fieldConfig:e,keyPath:t,dynamicValue:n})=>{let r=e,{default:i,multiple:a=!1}=r,o=r.options??[],[s]=o,c=e=>{let t=o.findIndex(t=>String(MB(t))===e);return t>-1?MB(o[t]):e};if(n!==void 0&&!a){let e=n.trim();return{[t]:e?c(e):``}}let l=n===void 0?Array.isArray(i)?i.map(MB):MB(i):n.split(/,\s*/).map(e=>c(e.trim()));return a?Array.isArray(l)&&l.length?Object.fromEntries(l.map((e,n)=>[`${t}.${n}`,e])):{[t]:[]}:{[t]:l===void 0?FB(MB(s)):l}},uGe={boolean:QWe,code:$We,datetime:tGe,file:X3,hidden:Z3,image:X3,keyvalue:aGe,list:oGe,markdown:e6,number:cGe,object:lGe,relation:r6,richtext:e6,select:r6},i6=({content:e,keyPath:t,fieldConfig:n,locale:r,defaultLocale:i,dynamicValues:a})=>{let o=mB({fieldConfig:n,locale:r,defaultLocale:i}),{widget:s=`string`,default:c,i18n:l=!1}=o;if(r!==i&&B0(l))return;if(s===`compute`){e[t]=``;return}let u=Object.hasOwn(a,t)&&!/\.\d+(?:\.|$)/.test(t)&&a[t].trim()||void 0,d=uGe[s];d?Object.assign(e,d({fieldConfig:o,keyPath:t,locale:r,defaultLocale:i,dynamicValue:u,populateDefault:i6})):e[t]=u??c??``},a6=({fields:e,locale:t,defaultLocale:n,dynamicValues:r={}})=>{let i={};return e.forEach(e=>{i6({content:i,keyPath:e.name,fieldConfig:e,locale:t,defaultLocale:n,dynamicValues:r})}),i},dGe=(e,t)=>{let n=e.map(([e])=>e);return e.map(([e],r)=>{let i=t.find(([t])=>t===e);if(i)return i;let a=t[r];return a&&!n.includes(a[0])?[e,a[1]]:[e,``]})},o6=({valueStore:e,defaultLocale:t,keyPath:n})=>{let r=EM(e[t]??{},n);Object.entries(e).forEach(([i,a])=>{if(i===t)return;let o=EM(a,n),s=dGe(r,o);(s.length!==o.length||s.some(([e,t],n)=>{let[r,i]=o[n];return e!==r||t!==i}))&&DM(a,n,s),!s.length&&e[t]?.[n]===null&&a[n]!==null&&(a[n]=null)})},fGe=({valueStore:e,getFieldArgs:t})=>{let n=new Set;return Object.values(e).forEach(e=>{Object.keys(e).forEach(r=>{TM({...t,keyPath:r,valueMap:e})?.i18n===`duplicate_keys`&&n.add(r.replace(wM,``))})}),[...n]},s6=({valueStore:e,defaultLocale:t,getFieldArgs:n})=>{fGe({valueStore:e,getFieldArgs:n}).forEach(n=>{o6({valueStore:e,defaultLocale:t,keyPath:n})})},c6=e=>{let{prefix:t,use_b32_encoding:n}=e,r=n?gl():ml();return t?`${t}${r}`:r},l6=({valueStore:e,locale:t,i18n:n,draft:r,keyPath:i},a)=>{let o=r&&i&&e===r.currentValues?yM(r,{keyPath:i,valueMap:e[t]}):void 0,s=o?bM(o):void 0,c=n===`duplicate`||!!o&&F2({fieldConfig:s??{i18n:n},getFieldArgs:o}),l=c&&o?I2({fieldConfig:s,getFieldArgs:o}):()=>!0;MM(()=>{Object.entries(e??{}).forEach(([e,n])=>{(e===t||c&&l(n))&&a(n,e)})})},pGe=({draft:e,content:t,targetLanguage:n,keyPathPrefix:r})=>{let{currentValues:i}=e,{defaultLocale:a}=rj(e),o=vr(i[a]),s={...vr(t),...o},c=yM(e,{valueMap:s}),l=[];return Object.keys(s).forEach(e=>{let r=bM({...c,keyPath:e});if(!r)return;let{widget:i=`text`}=r,u=r.i18n??(F2({fieldConfig:r,getFieldArgs:{...c,keyPath:e}})?`duplicate`:!1);if(zk.includes(i)&&R0(u)&&u!==`duplicate_if_empty`&&(s[e]=t[e]??``),R0(u)&&(i===`uuid`&&(s[e]=t[e]||c6(r)),i===`compute`&&qB(r.value)&&(s[e]=``)),i===`hidden`&&R0(u)){let{default:t}=r;t===`{{locale}}`&&(s[e]=n)}i===`datetime`&&e in o&&(s[e]=b0({fieldConfig:r,value:s[e],sourceLocale:a,targetLocale:n})),i===`object`&&z0(u)&&o[e]!==null&&delete s[e],(B0(u)||l.some(t=>GO(e,t)))&&(delete s[e],l.push(e))}),fGe({valueStore:{[n]:s},getFieldArgs:c}).forEach(e=>{DM(s,e,EM(o,e).map(([n])=>[n,t[`${e}.${n}`]??``]))}),r===void 0?s:Object.fromEntries(Object.entries(s).filter(([e])=>e.startsWith(`${r}.`)))},mGe=({draft:e,locale:t})=>{let{fields:n,defaultLocale:r,currentLocales:i,currentValues:a,validities:o,validationMessages:s}=e,c=!i[t];if(i[t]=c,c&&!a[t]){let i=a6({fields:n,locale:t,defaultLocale:r});e.originalValues[t]=i,a[t]=R2({draft:e,locale:t,target:pGe({draft:e,content:i,targetLanguage:t})})}else o[t]={},s[t]={}},hGe=({draft:e,valueStoreKey:t,locale:n,keyPath:r,i18n:i,value:a})=>{l6({valueStore:e[t],locale:n,i18n:i,draft:e,keyPath:r},e=>{oxe(e,r,a)})},gGe=({draft:e,valueStoreKey:t,locale:n,keyPath:r,i18n:i,value:a})=>{Array.isArray(a)||E(a)?hGe({draft:e,valueStoreKey:t,locale:n,keyPath:r,i18n:i,value:a}):l6({valueStore:e[t],locale:n,i18n:i,draft:e,keyPath:r},e=>{qO(e,`${r}.`,{live:!0}).forEach(t=>{delete e[t]}),e[r]=a})},u6=e=>e===`extraValues`,_Ge=[Symbol.for(`react.forward_ref`),Symbol.for(`react.memo`)],d6=e=>typeof e==`function`||_Ge.includes(e?.$$typeof),vGe=(e,t=new Set)=>{if(d6(e))return e;if(typeof e==`string`){if(t.has(e)){console.warn(`Custom field type "${e}" references itself through its control.`);return}t.add(e);let n=rk.get(e);if(n?.control)return d6(n.control)?n.control:vGe(n.control,t);if(Pk.includes(e)){console.warn(`Custom field references built-in editor "${e}" which is not a React component.`);return}}},yGe=({fieldId:e,fieldClassName:t,fieldConfig:n,currentValue:r,draft:i,locale:a,onChange:o,addFile:s,pickFile:c,handleRef:l})=>{let u=i?i0({draft:i,locale:a}):void 0;return{value:r,field:t0(n),forID:e??``,classNameWrapper:t??``,entry:u?.entryMap,getAsset:u?.getAsset,onChange:o,addFile:s,pickFile:c,ref:l}},f6=void 0,bGe=()=>{if(f6===void 0){let e=document.createElement(`div`);Oo(fu,{target:e}),f6=e.querySelector(`input`).className}return f6},xGe=B(`<div role="none"></div> <!>`,1);function SGe(e,t){O(t,!0);let n=$M(),{valueStoreKey:r=`currentValues`,parentComponentNames:i=[]}=si(`field-editor`)??{},a=u6(r),o=J(t,`required`,3,!0),s=J(t,`readonly`,3,!1),c=J(t,`invalid`,3,!1),l=j(void 0),u,d=j(void 0),f=j(void 0),p={locale:t.locale,keyPath:t.keyPath},m=A(()=>Mr(t.fieldConfig.i18n,!1)),h=A(()=>vGe(t.control)),g=i.at(-1),_=e=>{let i=n.current;i&&gGe({draft:i,valueStoreKey:r,locale:t.locale,keyPath:t.keyPath,i18n:z(m),value:e})},v=async(e,r)=>{if(!n.current)throw Error(`addFile() can only be called while an entry is being edited`);return WWe({draft:n.current,fieldConfig:t.fieldConfig,typedKeyPath:t.typedKeyPath,componentName:g,locale:t.locale,file:e,options:r})},y=async e=>{if(!z(f))throw Error(`pickFile() can only be called while an entry is being edited`);return z(f).pick(e)},b=e=>{let t=z(d);M(d,e),e?u0({...p,instance:e}):d0({...p,instance:t})},x=()=>{if(!z(l)||!z(h)||!U1.current||!K3.current)return;u??=Y3(z(l));let e=yGe({fieldId:t.fieldId,fieldClassName:bGe(),fieldConfig:t.fieldConfig,currentValue:t.currentValue,draft:n.current,locale:t.locale,onChange:_,addFile:v,pickFile:y,handleRef:b});u.render((0,gr.createElement)(W3.Provider,{value:{locale:t.locale,keyPath:t.keyPath,required:o(),readonly:s(),invalid:c()}},(0,gr.createElement)(z(h),e))),z(l)?.querySelector(`input`)?.setAttribute(`aria-invalid`,String(c()))};js(()=>(Promise.all([W1(),q3()]).catch(e=>{console.error(e)}),()=>{u?.unmount(),d0({...p,instance:z(d)})})),L(()=>{let e={locale:t.locale,keyPath:t.keyPath};fo(()=>{z(d)&&(d0({...p,instance:z(d)}),u0({...e,instance:z(d)}))}),p=e}),L(()=>{GM(n.current,t.locale,r),q1.current,U1.current&&K3.current&&z(l)&&z(h)&&x()}),L(()=>{GM(n.current,t.locale,r),typeof z(d)?.isValid==`function`&&SVe({locale:t.locale,keyPath:t.keyPath,value:t.currentValue,fieldConfig:t.fieldConfig})});var S=xGe(),C=P(S);Ds(C,e=>M(l,e),()=>z(l)),Ds(YWe(I(C,2),{get fieldConfig(){return t.fieldConfig},get typedKeyPath(){return t.typedKeyPath},get componentName(){return g},get inEditorComponent(){return a},get locale(){return t.locale}}),e=>M(f,e,!0),()=>z(f)),U(e,S),k()}var CGe=e=>{let{widget:t}=e??{};return t?rk.get(t)?.summary:void 0},wGe=({locale:e,keyPath:t,fieldConfig:n,currentValue:r,draft:i,preview:a})=>{if(!d6(a)||!i)return;let{entryMap:o,fieldsMetaData:s,getAsset:c}=i0({draft:i,locale:e}),l=t.replace(/\.\d+$/,``);return{value:r,field:t0(n),metadata:s.get(l)??K1().fromJS({}),getAsset:c,entry:o,fieldsMetaData:s}},TGe=B(`<div class="svelte-7ynvbs"></div>`),EGe={hash:`svelte-7ynvbs`,code:`div.svelte-7ynvbs {
/* Allow the React component to use the full width, but let it shrink beside a list item
thumbnail rather than overflow */width:100%;min-width:0;}`};function DGe(e,t){O(t,!0),K(e,EGe);let n=$M(),r=j(void 0),i,a=()=>{if(!z(r)||!U1.current||!K3.current)return;let e=wGe({locale:t.locale,keyPath:t.keyPath,fieldConfig:t.fieldConfig,currentValue:t.currentValue,draft:n.current,preview:t.preview});e&&(i??=Y3(z(r)),i.render((0,gr.createElement)(W3.Provider,{value:{locale:t.locale,keyPath:t.keyPath}},(0,gr.createElement)(t.preview,e))))};js(()=>(Promise.all([W1(),q3()]).catch(e=>{console.error(e)}),()=>{i?.unmount()})),L(()=>{GM(n.current,t.locale),q1.current,U1.current&&K3.current&&z(r)&&a()});var o=TGe();Ds(o,e=>M(r,e),()=>z(r)),U(e,o),k()}var OGe=B(`<p> <!></p>`);function kGe(e,t){O(t,!0);let n=A(()=>IN(t.fieldConfig)),r=A(()=>z(n).utc),i=A(()=>z(n).singleCustomTimeZone),a=A(()=>vP({locale:t.locale,fieldConfig:t.fieldConfig,currentValue:t.currentValue}));var o=H(),s=P(o),c=e=>{var n=OGe(),o=N(n),s=I(o),c=e=>{var n=V();R(e=>W(n,`— ${e??``}`),[()=>m0(z(i),iP(t.currentValue,t.fieldConfig,t.locale))]),U(e,n)},l=e=>{U(e,V(`— UTC`))};G(s,e=>{z(i)?e(c):z(r)&&e(l,1)}),D(n),R((e,t)=>{q(n,`lang`,e),q(n,`dir`,t),W(o,`${z(a)??``} `),n.dir=n.dir},[()=>WA(t.locale),()=>GA(t.locale)]),U(e,n)};G(s,e=>{z(a)&&e(c)}),U(e,o),k()}var AGe=B(`<div role="none" class="timezone svelte-1dnhck7"> </div>`),jGe=B(`<div role="none" class="timezone svelte-1dnhck7">UTC</div>`),MGe=B(`<div role="none" class="svelte-1dnhck7"><!> <!> <!></div> <!>`,1),NGe={hash:`svelte-1dnhck7`,code:`div.svelte-1dnhck7 {display:flex;align-items:center;}.timezone.svelte-1dnhck7 {margin:4px 8px 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);white-space:nowrap;}`};function PGe(e,t){O(t,!0),K(e,NGe);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=j(``),s=j(!1),c=A(()=>IN(t.fieldConfig)),l=A(()=>z(c).type),u=A(()=>z(c).min),d=A(()=>z(c).max),f=A(()=>z(c).step),p=A(()=>z(c).dateOnly),m=A(()=>z(c).utc),h=A(()=>z(c).singleCustomTimeZone),g=A(()=>DVe(n(),t.fieldConfig)),_=``,v=()=>{if(z(s))return;let e=y0({currentValue:n(),fieldConfig:t.fieldConfig,timeZone:z(g),locale:t.locale});e!==void 0&&e!==z(o)&&M(o,e,!0),_=z(o)},y=()=>{if(z(o)===_)return;_=z(o);let e=_0({inputValue:z(o),currentValue:n(),fieldConfig:t.fieldConfig,timeZone:z(g),locale:t.locale});jVe({newValue:e,currentValue:n(),fieldConfig:t.fieldConfig,locale:t.locale})&&n(e)};vk(()=>n(),()=>{v()}),vk(()=>z(o),()=>{y()});let b=()=>{M(s,!0)},x=()=>{M(s,!1),v()};var S=H(),C=P(S),w=e=>{kGe(e,{get locale(){return t.locale},get keyPath(){return t.keyPath},get typedKeyPath(){return t.typedKeyPath},get fieldConfig(){return t.fieldConfig},get currentValue(){return n()}})},T=A(()=>i()&&y2(t.fieldConfig)),ee=e=>{var s=MGe(),c=P(s),_=N(c);bye(_,{get type(){return z(l)},get min(){return z(u)},get max(){return z(d)},get step(){return z(f)},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onfocus:b,onblur:x,get value(){return z(o)},set value(e){M(o,e,!0)}});var v=I(_,2),y=e=>{{let n=A(()=>Y(z(p)?`today`:`now`));Al(e,{variant:`tertiary`,get label(){return z(n)},onclick:()=>{M(o,g0(t.fieldConfig,z(g)),!0)}})}};G(v,e=>{i()||e(y)});var S=I(v,2),C=e=>{{let t=A(()=>Y(`clear`)),r=A(()=>!n());Al(e,{variant:`tertiary`,get label(){return z(t)},get disabled(){return z(r)},onclick:()=>{n(``)}})}};G(S,e=>{!i()&&!r()&&e(C)}),D(c);var w=I(c,2),T=e=>{var r=AGe(),i=F(r,!0);R(e=>W(i,e),[()=>m0(z(h),iP(n(),t.fieldConfig,t.locale))]),U(e,r)},ee=e=>{U(e,jGe())};G(w,e=>{z(h)?e(T):z(m)&&e(ee,1)}),U(e,s)};G(C,e=>{z(T)?e(w):e(ee,-1)}),U(e,S),k()}var FGe=new Set([`$$slots`,`$$events`,`$$legacy`,`open`,`oldExtension`,`newExtension`,`okLabel`,`onOk`,`onCancel`]),IGe=B(`<p class="svelte-8pzyo8"> </p> <p class="svelte-8pzyo8"> </p>`,1),LGe={hash:`svelte-8pzyo8`,code:`p.svelte-8pzyo8 {margin:0 0 8px;}p.svelte-8pzyo8:last-child {margin:0;}`};function RGe(e,t){O(t,!0),K(e,LGe);let n=J(t,`open`,15,!1),r=J(t,`oldExtension`,3,void 0),i=J(t,`newExtension`,3,void 0),a=J(t,`okLabel`,3,``),o=J(t,`onOk`,3,void 0),s=J(t,`onCancel`,3,void 0),c=ks(t,FGe),l=A(()=>r()?i()?`change`:`remove`:`add`);{let t=A(()=>Y(`change_file_extension`));ru(e,As(()=>c,{get title(){return z(t)},get okLabel(){return a()},get onOk(){return o()},get onCancel(){return s()},get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=IGe(),a=P(n),o=F(a,!0),s=F(I(a,2),!0);R((e,t)=>{W(o,e),W(s,t)},[()=>Y(`confirm_file_extension_change.${z(l)}`,{values:{oldExtension:r(),newExtension:i()}}),()=>Y(`file_extension_change_warning`)]),U(e,n)},$$slots:{default:!0}}))}k()}var zGe=B(`<!> <!> <!>`,1),BGe=B(`<div role="textbox" tabindex="0" class="value svelte-15viu92"> </div> <!>`,1),VGe=B(`<div role="none" class="editable-text svelte-15viu92"><!></div>`),HGe={hash:`svelte-15viu92`,code:`.editable-text.svelte-15viu92 {display:flex;align-items:center;gap:4px;}.value.svelte-15viu92 {flex:auto;margin:var(--sui-focus-ring-width);padding:4px;word-break:break-all;&:empty {margin:0;padding:0;}}`};function p6(e,t){O(t,!0),K(e,HGe);let n=J(t,`initialText`,3,void 0),r=J(t,`editing`,15),i=J(t,`text`,15),a=J(t,`inputElement`,15),o=J(t,`canEdit`,3,!0),s=J(t,`editLabel`,3,void 0),c=J(t,`placeholder`,3,void 0),l=J(t,`readonly`,3,!0),u=J(t,`invalid`,3,!1),d=J(t,`required`,3,!1),f=J(t,`applyDisabled`,3,!1),p=J(t,`dir`,3,`auto`),m=J(t,`ariaLabelledby`,3,void 0),h=J(t,`ariaErrormessage`,3,void 0),g=J(t,`getSelectionEnd`,3,void 0),_=J(t,`onApply`,3,void 0),v=j(void 0),y=j(void 0),b=async()=>{let e=n()??t.value;i(e),r(!0),await co(),a()?.focus(),a()?.setSelectionRange(0,g()?.(e)??e.length)},x=async()=>{r(!1),await co(),(z(v)??z(y))?.focus()},S=()=>{_()(i())!==!1&&x()};L(()=>{if(r())return fo(()=>{VQ.current+=1}),()=>{--VQ.current}});var C=VGe(),w=N(C),T=e=>{var n=zGe(),r=P(n);fu(r,{get id(){return t.id},dir:`auto`,flex:!0,get placeholder(){return c()},get invalid(){return u()},get required(){return d()},get"aria-labelledby"(){return m()},get"aria-errormessage"(){return h()},onkeydown:e=>{let{key:t,isComposing:n}=e;n||t!==`Enter`&&t!==`Escape`||(e.preventDefault(),e.stopPropagation(),t===`Escape`?x():S())},get value(){return i()},set value(e){i(e)},get element(){return a()},set element(e){a(e)}});var o=I(r,2);{let e=e=>{Xc(e,{name:`check`})},n=A(()=>Y(`done`));Al(o,{size:`small`,iconic:!0,get disabled(){return f()},get"aria-label"(){return z(n)},get"aria-controls"(){return t.id},onclick:()=>{S()},startIcon:e,$$slots:{startIcon:!0}})}var s=I(o,2);{let e=e=>{Xc(e,{name:`close`})},n=A(()=>Y(`cancel`));Al(s,{size:`small`,iconic:!0,get"aria-label"(){return z(n)},get"aria-controls"(){return t.id},onclick:()=>{x()},startIcon:e,$$slots:{startIcon:!0}})}U(e,n)},ee=e=>{var n=BGe(),r=P(n),i=F(r,!0);Ds(r,e=>M(y,e),()=>z(y));var a=I(r,2),c=e=>{Al(e,{size:`small`,iconic:!0,get"aria-label"(){return s()},get"aria-controls"(){return t.id},onclick:()=>{b()},get element(){return z(v)},set element(e){M(v,e,!0)},startIcon:e=>{Xc(e,{name:`edit`})},$$slots:{startIcon:!0}})};G(a,e=>{o()&&e(c)}),R(()=>{q(r,`id`,t.id),q(r,`dir`,p()),q(r,`aria-readonly`,l()),q(r,`aria-invalid`,u()),q(r,`aria-required`,d()),q(r,`aria-labelledby`,m()),q(r,`aria-errormessage`,h()),W(i,t.value),r.dir=r.dir}),U(e,n)};G(w,e=>{r()?e(T):e(ee,-1)}),D(C),U(e,C),k()}var UGe=({index:e,clientY:t,rect:n})=>t<n.top+n.height/2?e:e+1,m6=(e,t,n)=>{let r=[...e];return r.splice(n,0,...r.splice(t,1)),r},WGe=({dragIndex:e,dropIndex:t})=>{if(e!==void 0&&t!==void 0&&t!==e&&t!==e+1)return t>e?t-1:t},GGe=({key:e,index:t,itemCount:n})=>{if(e===`ArrowUp`||e===`Home`){let n=e===`ArrowUp`?t-1:0;return t>0?n:void 0}if(e===`ArrowDown`||e===`End`){let r=e===`ArrowDown`?t+1:n-1;return t<n-1?r:void 0}},KGe=e=>e>=3,qGe=({position:e,itemCount:t})=>{if(e!==void 0&&Number.isInteger(e))return e>=1&&e<=t?e-1:void 0},JGe=({target:e,listElement:t})=>{if(!t||!(e instanceof Element)||e===t||!t.contains(e))return;let n=e;for(;n.parentElement!==t;)n=n.parentElement;return{element:n,index:[...t.children].indexOf(n)}},YGe=[`move-up`,`move-down`,`reorder`,`move-options`],XGe=({item:e,action:t=`reorder`})=>{[t,...YGe].map(t=>e?.querySelector(`button[data-action="${t}"]`)).find(e=>e&&!e.disabled)?.focus()},ZGe=({listElement:e,index:t,action:n})=>{XGe({item:e?.children[t],action:n})},h6=({index:e,getTarget:t,fallback:n})=>{let r=t(e)??t(e-1);r?r.focus():n?.()},g6=64,QGe=16,_6=void 0,$Ge=e=>{let t=e.parentElement;for(;t;){let{overflowY:e}=globalThis.getComputedStyle(t);if([`auto`,`scroll`].includes(e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}},eKe=({clientY:e,rect:t})=>{let n=e-t.top,r=t.bottom-e;return n<g6?-16*(1-Math.max(n,0)/g6):r<g6?QGe*(1-Math.max(r,0)/g6):0},tKe=()=>{if(!_6)return;let{container:e,speed:t}=_6,{scrollTop:n,scrollHeight:r,clientHeight:i}=e,a=Math.min(Math.max(n+t,0),r-i);!t||a===n?_6.frame=void 0:(e.scrollTop=a,_6.frame=requestAnimationFrame(tKe))},nKe=e=>{let t=_6;t.speed=eKe({clientY:e.clientY,rect:t.container.getBoundingClientRect()}),t.speed&&t.frame===void 0&&(t.frame=requestAnimationFrame(tKe))},rKe=e=>{let t=e?$Ge(e):void 0;t&&(_6={container:t,speed:0,frame:void 0},globalThis.addEventListener(`dragover`,nKe,!0))},iKe=()=>{_6&&=(globalThis.removeEventListener(`dragover`,nKe,!0),void 0)};function aKe(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=j(void 0),i=A(()=>qGe({position:z(r),itemCount:t.itemCount})),a=j(!1);L(()=>{n()&&(M(a,!0),M(r,t.index+1))});let o=()=>z(i)!==void 0&&(t.onMove(z(i)),!0);var s=H(),c=P(s),l=e=>{{let a=e=>{{let i=A(()=>Y(`move_to_position`));PO(e,{flex:!0,autofocus:!0,min:1,get max(){return t.itemCount},required:!0,get ariaLabel(){return z(i)},onkeydown:e=>{e.key===`Enter`&&!e.isComposing&&(e.preventDefault(),o()&&n(!1))},get value(){return z(r)},set value(e){M(r,e,!0)}})}},s=A(()=>Y(`move_to`)),c=A(()=>z(i)===void 0);pu(e,{size:`x-small`,get title(){return z(s)},get okDisabled(){return z(c)},onOk:()=>{o()},get open(){return n()},set open(e){n(e)},input:a,children:(e,n)=>{Qr();var r=V();R(e=>W(r,e),[()=>Y(`move_to_description`,{values:{count:t.itemCount}})]),U(e,r)},$$slots:{input:!0,default:!0}})}};G(c,e=>{z(a)&&e(l)}),U(e,s),k()}var oKe=B(`<!> <!> <!>`,1);function sKe(e,t){O(t,!0);var n=oKe(),r=P(n);{let e=A(()=>Y(`move_to_top`)),n=A(()=>t.index===0);Du(r,{get label(){return z(e)},get disabled(){return z(n)},onclick:()=>t.onMove(0,`move-options`)})}var i=I(r,2);{let e=A(()=>Y(`move_to_bottom`)),n=A(()=>t.index===t.itemCount-1);Du(i,{get label(){return z(e)},get disabled(){return z(n)},onclick:()=>t.onMove(t.itemCount-1,`move-options`)})}var a=I(i,2);{let e=A(()=>Y(`move_to`));Du(a,{get label(){return z(e)},get onclick(){return t.onMoveTo}})}U(e,n),k()}var cKe=B(`<!> <!> <!>`,1),lKe=B(`<!> <!>`,1),uKe={hash:`svelte-1djdbgy`,code:`button.drag-handle:not(:disabled) {cursor:grab;&:active {cursor:grabbing;}}`};function v6(e,t){O(t,!0),K(e,uKe);let n=J(t,`disabled`,3,!1),r=J(t,`size`,3,`small`),i=J(t,`icon`,3,`drag_indicator`),a=J(t,`part`,3,`auto`),o=J(t,`menu`,3,!0),s=J(t,`onGrab`,3,void 0),c=J(t,`onRelease`,3,void 0),l=J(t,`onMove`,3,void 0),u=()=>{globalThis.removeEventListener(`pointerup`,u),globalThis.removeEventListener(`pointercancel`,u),c()?.()},d=A(()=>iG.hasMouse&&a()!==`buttons`),f=j(!1),p=A(()=>a()===`buttons`||a()===`auto`&&!iG.hasMouse),m=A(()=>o()&&a()!==`handle`&&KGe(t.itemCount));var h=cKe(),g=P(h),_=e=>{{let a=e=>{Xc(e,{get name(){return i()}})},o=A(()=>Y(`reorder_item`));Al(e,{get size(){return r()},get disabled(){return n()},iconic:!0,class:`drag-handle`,"data-action":`reorder`,get"aria-label"(){return z(o)},"aria-keyshortcuts":`ArrowUp ArrowDown Home End`,onpointerdown:()=>{s()?.(),globalThis.addEventListener(`pointerup`,u),globalThis.addEventListener(`pointercancel`,u)},onkeydown:e=>{let n=GGe({key:e.key,index:t.index,itemCount:t.itemCount});n!==void 0&&(e.preventDefault(),l()?.(n,`reorder`))},startIcon:a,$$slots:{startIcon:!0}})}};G(g,e=>{z(d)&&e(_)});var v=I(g,2),y=e=>{var i=cKe(),o=P(i);{let e=e=>{Xc(e,{name:`arrow_upward`})},i=A(()=>n()||t.index===0),a=A(()=>Y(`move_up`));Al(o,{get size(){return r()},iconic:!0,get disabled(){return z(i)},"data-action":`move-up`,get"aria-label"(){return z(a)},onclick:()=>l()?.(t.index-1,`move-up`),startIcon:e,$$slots:{startIcon:!0}})}var s=I(o,2),c=e=>{$l(e,{})};G(s,e=>{a()!==`buttons`&&e(c)});var u=I(s,2);{let e=e=>{Xc(e,{name:`arrow_downward`})},i=A(()=>n()||t.index===t.itemCount-1),a=A(()=>Y(`move_down`));Al(u,{get size(){return r()},iconic:!0,get disabled(){return z(i)},"data-action":`move-down`,get"aria-label"(){return z(a)},onclick:()=>l()?.(t.index+1,`move-down`),startIcon:e,$$slots:{startIcon:!0}})}U(e,i)};G(v,e=>{z(p)&&e(y)});var b=I(v,2),x=e=>{var i=lKe(),a=P(i);{let e=e=>{{let n=A(()=>Y(`reorder_options`));Eu(e,{get ariaLabel(){return z(n)},children:(e,n)=>{sKe(e,{get index(){return t.index},get itemCount(){return t.itemCount},onMove:(e,t)=>l()?.(e,t),onMoveTo:()=>{M(f,!0)}})},$$slots:{default:!0}})}},i=A(()=>Y(`reorder_options`));Xl(a,{variant:`ghost`,get size(){return r()},iconic:!0,get disabled(){return n()},popupPosition:`bottom-right`,"data-action":`move-options`,get"aria-label"(){return z(i)},popup:e,$$slots:{popup:!0}})}aKe(I(a,2),{get index(){return t.index},get itemCount(){return t.itemCount},onMove:e=>l()?.(e,`move-options`),get open(){return z(f)},set open(e){M(f,e,!0)}}),U(e,i)};G(b,e=>{z(m)&&e(x)}),U(e,h),k()}var dKe=async({kind:e,...t})=>{let n=e??await _De(t.value);return{kind:n,src:n?await gZ(t):void 0}},fKe=B(`<div role="none" class="reorder-controls svelte-1yfgkx5"><!></div>`),pKe=B(`<span role="none" class="preview no-thumbnail"><!></span>`),mKe=B(`<div role="status" class="note svelte-1yfgkx5"> </div>`),hKe=B(`<div role="none"><!> <!> <div role="none" class="svelte-1yfgkx5"><div role="none" class="path svelte-1yfgkx5"><!></div> <!> <div role="none"><!> <!></div></div></div> <!>`,1),gKe={hash:`svelte-1yfgkx5`,code:`.filled.svelte-1yfgkx5 {display:flex !important;align-items:center;position:relative;gap:12px;margin:var(--sui-focus-ring-width);background-color:var(--sui-primary-background-color); /* for dragging opacity */
/* The dragged item is left as a faint placeholder marking the gap it would drop into. The
pointer already carries the browser’s own drag image of it, so showing it twice at full
strength would just be confusing. */&.dragging {opacity:0.25;}.preview {flex:none;width:120px !important;height:120px !important;border-color:var(--sui-control-border-color) !important;border-radius:var(--sui-control-medium-border-radius);padding:8px !important;&.no-thumbnail {display:flex;align-items:center;justify-content:center;background-color:var(--sui-secondary-background-color);.icon {font-size:64px;}}}.sui.button.tertiary.small {margin:var(--sui-focus-ring-width);}& > div:where(.svelte-1yfgkx5) {flex:auto;overflow:hidden;.note:where(.svelte-1yfgkx5) {margin:4px 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.path:where(.svelte-1yfgkx5) {
@media (width < 768px) {font-size:var(--sui-font-size-small);
}}}&.sortable {gap:0;border-width:1px;border-style:solid;border-color:var(--sui-control-border-color) !important;border-radius:var(--sui-control-medium-border-radius);.preview {margin-inline-end:12px;border-radius:0;border-width:0 1px 0 0;}}}.reorder-controls.svelte-1yfgkx5 {flex:none !important;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;align-self:stretch;width:28px;background-color:var(--sui-secondary-border-color);}`};function _Ke(e,t){O(t,!0),K(e,gKe);let n=$M(),r=J(t,`groupFieldId`,19,()=>t.fieldId),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=J(t,`required`,3,!1),s=J(t,`collectionName`,3,``),c=J(t,`fileName`,3,void 0),l=J(t,`typedKeyPath`,3,void 0),u=J(t,`componentName`,3,void 0),d=J(t,`entry`,3,void 0),f=J(t,`locale`,3,void 0),p=J(t,`index`,3,0),m=J(t,`itemCount`,3,1),h=J(t,`dragging`,3,!1),g=j(void 0),_=j(void 0),v=j(void 0),y=j(void 0),b=j(!1),x=j(``),S=j(void 0),C=j(!1),w=j(!1),T=A(()=>t.fieldConfig.widget),ee=A(()=>z(T)===`image`),te=A(()=>z(T)===`file`&&t.fieldConfig.select_folder===!0),ne=A(()=>!!t.onMove&&!i()),re=A(()=>!!z(_)&&!!t.value?.startsWith(`blob:`)),ie=A(()=>z(re)&&!i()),ae=A(()=>z(_)?OWe({draft:n.current,blobURL:t.value}):void 0),oe=A(()=>z(_)?Uk(z(_).name).extension:void 0),se=A(()=>{let e=z(x).trim();return e?YB(e,{slugificationEnabled:JH({fieldConfig:t.fieldConfig}).config.slugify_filename}):``}),ce=A(()=>Uk(z(se)).extension),le=A(()=>({value:t.value,entry:d(),collectionName:s(),fileName:c(),componentName:u(),typedKeyPath:l(),fieldConfig:t.fieldConfig,locale:f()})),ue=A(()=>AWe({draft:n.current,value:t.value,unsavedFileName:z(ae)})),de=()=>{if(!z(_)||!n.current?.files[t.value])return;let e=new File([z(_)],z(se),{type:z(_).type,lastModified:z(_).lastModified});n.current.files[t.value].file=e,delete n.current.files[t.value].nameTemplate,M(_,e,!0),M(b,!1)},fe=()=>!z(_)||!z(se)||z(se)===z(ae)?!0:HP(z(oe),z(ce))?(de(),!0):(M(C,!0),!1),pe=async e=>{if(M(_,t.value?.startsWith(`blob:`)?n.current?.files[t.value]?.file:void 0,!0),M(g,void 0),M(v,void 0),M(y,void 0),!z(te)&&t.value){if(z(ee)&&/^https?:/.test(t.value))M(v,`image`),M(y,t.value,!0);else if(t.value.startsWith(`blob:`)||M(g,_X({...z(le)}),!0),!z(g)){let t=await dKe({...z(le),thumbnail:!0});e()||(M(v,t.kind,!0),M(y,t.src,!0))}}};vk(()=>t.value,()=>{let e=!1;return pe(()=>e),()=>{e=!0}});var me=hKe(),he=P(me);let ge;var _e=N(he),ve=e=>{var n=fKe(),r=N(n);{let e=A(()=>m()<2);v6(r,{get index(){return p()},get itemCount(){return m()},get disabled(){return z(e)},onGrab:()=>{M(w,!0)},onRelease:()=>{M(w,!1)},get onMove(){return t.onMove}})}D(n),U(e,n)};G(_e,e=>{z(ne)&&e(ve)});var ye=I(_e,2),be=e=>{u$(e,{get kind(){return z(v)},get src(){return z(y)},variant:`tile`,checkerboard:!0})},xe=e=>{u$(e,{get kind(){return z(g).kind},get asset(){return z(g)},variant:`tile`,checkerboard:!0})},Se=e=>{var t=pKe(),n=N(t);{let e=A(()=>z(te)?`folder`:`draft`);Xc(n,{get name(){return z(e)}})}D(t),U(e,t)};G(ye,e=>{z(v)&&z(y)?e(be):z(g)?e(xe,1):e(Se,-1)});var Ce=I(ye,2),we=N(Ce),Te=N(we);{let e=A(()=>Y(`rename`)),n=A(()=>!z(se));p6(Te,{get id(){return`${t.fieldId??``}-value`},get value(){return z(ue)},get initialText(){return z(ae)},get canEdit(){return z(ie)},get editLabel(){return z(e)},get readonly(){return i()},get invalid(){return a()},get required(){return o()},get applyDisabled(){return z(n)},dir:`ltr`,get ariaLabelledby(){return`${r()??``}-label`},get ariaErrormessage(){return`${r()??``}-error`},getSelectionEnd:e=>Uk(e).filename.length,onApply:fe,get editing(){return z(b)},set editing(e){M(b,e,!0)},get text(){return z(x)},set text(e){M(x,e,!0)},get inputElement(){return z(S)},set inputElement(e){M(S,e,!0)}})}D(we);var Ee=I(we,2),De=e=>{var t=mKe(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`file_will_be_saved_as`,{values:{name:z(se)}})]),U(e,t)},Oe=A(()=>z(b)&&z(se)!==z(x).trim());G(Ee,e=>{z(Oe)&&e(De)});var ke=I(Ee,2),Ae=N(ke),je=e=>{{let n=A(()=>Y(`replace`)),r=A(()=>Y(`replace_${z(T)}`));Al(e,{get disabled(){return i()},variant:`tertiary`,size:`small`,get label(){return z(n)},get"aria-label"(){return z(r)},get"aria-controls"(){return`${t.fieldId??``}-value`},onclick:()=>{t.onReplace()}})}};G(Ae,e=>{t.onReplace&&e(je)});var Me=I(Ae,2),Ne=e=>{{let n=A(()=>Y(`remove`)),r=A(()=>Y(`remove_${z(T)}`));Al(e,{get disabled(){return i()},variant:`tertiary`,size:`small`,get label(){return z(n)},get"aria-label"(){return z(r)},get"aria-controls"(){return`${t.fieldId??``}-value`},onclick:()=>{t.onRemove()}})}};G(Me,e=>{t.onRemove&&e(Ne)}),D(ke),D(Ce),D(he);var Pe=I(he,2);{let e=A(()=>Y(`rename`));RGe(Pe,{get oldExtension(){return z(oe)},get newExtension(){return z(ce)},get okLabel(){return z(e)},onOk:()=>{de()},onCancel:()=>{z(S)?.focus()},get open(){return z(C)},set open(e){M(C,e,!0)}})}R(()=>{ge=os(he,1,`filled svelte-1yfgkx5`,null,ge,{sortable:z(ne),dragging:h()}),q(he,`draggable`,z(w))}),yo(`dragstart`,he,e=>{t.onDragStart?.(),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,z(ue)))}),yo(`dragend`,he,()=>{M(w,!1),t.onDragEnd?.()}),U(e,me),k()}var vKe=B(`<div role="none" class="buttons"><!> <!></div>`),yKe=B(`<div role="status"> </div>`),bKe=B(`<!> <!>`,1),xKe=B(`<div role="none"><!> <div role="none" class="label svelte-1jvz1op"><!></div></div> <!>`,1),SKe={hash:`svelte-1jvz1op`,code:`.empty.svelte-1jvz1op {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;height:120px;margin:var(--sui-focus-ring-width);border-width:1px;border-style:solid;border-color:var(--sui-button-tertiary-border-color, var(--sui-button-border-color));border-radius:var(--sui-button-medium-border-radius);color:var(--sui-button-tertiary-foreground-color, var(--sui-highlight-foreground-color));background-color:var(
--sui-button-tertiary-background-color,
var(--sui-button-background-color)
);font-family:var(--sui-control-font-family);font-size:var(--sui-font-size-small);cursor:pointer;transition:all 200ms;&:not(.disabled):hover {background-color:var(
--sui-button-tertiary-background-color-focus,
var(--sui-hover-background-color)
);}&:not(.disabled):active {background-color:var(
--sui-button-tertiary-background-color-active,
var(--sui-active-background-color)
);}.icon {color:var(--sui-secondary-foreground-color);font-size:48px;}&.disabled {pointer-events:none !important;* {opacity:0.5;}}
@media (pointer: coarse) {cursor:default;&:active {
/* Reset the style because the element is non-interactive on touch devices */background-color:var(--sui-button-background-color) !important;}
}&.invalid {border-color:var(--sui-error-border-color);}}.label.svelte-1jvz1op {display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:0 4px;white-space:nowrap;.button {margin-block:0;}}`};function CKe(e,t){O(t,!0),K(e,SKe);let n=e=>{var n=vKe(),r=N(n);{let e=A(()=>Y(`browse`));Al(r,{get label(){return z(e)},variant:`tertiary`,size:`small`,get disabled(){return z(c)},onclick:e=>{e.stopPropagation(),a(!1),i(!0)},get element(){return z(l)},set element(e){M(l,e,!0)}})}var s=I(r,2),u=e=>{{let n=A(()=>Y(t.isImageField?`paste_image`:`paste`));Al(e,{get label(){return z(n)},variant:`tertiary`,size:`small`,get disabled(){return z(c)},onclick:e=>{e.stopPropagation(),d()}})}};G(s,e=>{o()&&e(u)}),D(n),U(e,n)},r=J(t,`selectFolder`,3,!1),i=J(t,`showSelectAssetsDialog`,15,!1),a=J(t,`replaceMode`,15,!1),o=J(t,`onFilePaste`,3,void 0),s=ta({show:!1,message:``}),c=A(()=>t.readonly||t.processing),l=j(void 0),u=()=>{z(l)?.focus()},d=async()=>{if(!z(c)&&o())try{let e=await navigator.clipboard.read(),t,n=e.find(e=>e.types.some(e=>{let n=e.startsWith(`image/`);return n&&(t=e),n}));if(n&&t){let e=await n.getType(t),r=t.split(`/`)[1].replace(`+xml`,``),i=new File([e],`pasted-image-${Date.now()}.${r}`,{type:t});o()(i);return}Object.assign(s,{message:Y(`no_image_in_clipboard`),show:!0})}catch{Object.assign(s,{message:Y(`clipboard_access_denied`),show:!0})}};var f={focus:u},p=xKe(),m=P(p);let h;var g=N(m);{let e=A(()=>r()?`folder`:`cloud_upload`);Xc(g,{get name(){return z(e)}})}var _=I(g,2),v=N(_),y=e=>{var n=yKe(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`processing_files`,{values:{count:t.multiple?2:1}})]),U(e,n)},b=e=>{var r=bKe(),i=P(r),a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`click_to_browse`)]),U(e,t)},o=e=>{var n=V();R(e=>W(n,e),[()=>Y(`drop_image_files_or`,{values:{count:t.multiple?2:1}})]),U(e,n)},s=e=>{var n=V();R(e=>W(n,e),[()=>Y(`drop_files_or`,{values:{count:t.multiple?2:1}})]),U(e,n)};G(i,e=>{t.allowDrop?t.isImageField?e(o,1):e(s,-1):e(a)});var c=I(i,2);n(c),U(e,r)},x=e=>{n(e)};return G(v,e=>{t.processing?e(y):iG.hasMouse?e(b,1):e(x,-1)}),D(_),D(m),Xu(I(m,2),{get show(){return s.show},set show(e){s.show=e},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(()=>W(n,s.message)),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),R(()=>h=os(m,1,`empty svelte-1jvz1op`,null,h,{invalid:t.invalid,processing:t.processing,disabled:z(c)})),bo(`click`,m,()=>{iG.hasMouse&&!z(c)&&(a(!1),i(!0))}),bo(`keydown`,m,e=>{!z(c)&&sl(e,`Accel+V`)&&(e.preventDefault(),d())}),U(e,p),k(f)}xo([`click`,`keydown`]);var y6=(e,t)=>{Object.entries(t).forEach(([t,n])=>{e[t]!==n&&(e[t]=n)}),Object.keys(e).forEach(n=>{n in t||delete e[n]})},wKe=(e,t)=>[Gj(e,t,{live:!0})??[],Object.fromEntries(Object.entries(e).filter(([e])=>!GO(e,t)))],TKe=(e,t,n)=>{let r=`${t}.`,i={},a=new Map;return Object.entries(e).forEach(([e,t])=>{let[,n,o]=e.startsWith(r)?e.slice(r.length).match(/^(\d+)($|[.#].*)/)??[]:[];n===void 0?i[e]=t:a.set(Number(n),[...a.get(Number(n))??[],[o,t]])}),n.forEach((e,t)=>{typeof e==`number`?a.get(e)?.forEach(([e,n])=>{i[`${r}${t}${e}`]=n}):i[`${r}${t}`]=e}),i},EKe=({draft:e,locale:t,valueStoreKey:n=`currentValues`,keyPath:r,manipulate:i})=>{let{defaultLocale:a}=rj(e),[o,s]=wKe(e[n][t],r),c=t===a,l=c?[...Array(o.length).keys()]:[];i({valueList:o,expanderStateList:l}),MM(()=>{y6(e[n][t],{...zj(o,r),...s}),c&&y6(e.expanderStates._,TKe(e.expanderStates._,r,l))})},b6=({draft:e,locale:t,i18n:n,pairedItems:r=!1,fieldConfig:i,valueStoreKey:a=`currentValues`,keyPath:o,manipulate:s})=>{let c=(e,t,n)=>e.map(e=>M0({fieldConfig:i,value:e,sourceLocale:t,targetLocale:n})),{defaultLocale:l}=rj(e);l6({valueStore:e[a],locale:t,i18n:r&&t===l?`duplicate`:n,draft:e,keyPath:o},(n,r)=>{EKe({draft:e,locale:r,valueStoreKey:a,keyPath:o,manipulate:!i||r===t?({valueList:e,expanderStateList:t})=>s({valueList:e,expanderStateList:t,locale:r}):({valueList:e,expanderStateList:n})=>{let i=c(e,r,t);s({valueList:i,expanderStateList:n,locale:t}),e.splice(0,e.length,...c(i,t,r))}})})},DKe=(e,t)=>Gj(e,t,{live:!0})??[],OKe=({draft:e,locale:t,valueStoreKey:n=`currentValues`,keyPath:r,from:i,to:a})=>{let o=e[n][t],s=DKe(o,r);i!==a&&i in s&&a in s&&(s.splice(a,0,...s.splice(i,1)),s.forEach((e,t)=>{o[`${r}.${t}`]=e}))},kKe=({draft:e,locale:t,valueStoreKey:n=`currentValues`,keyPath:r,newValues:i,replaceIndex:a,max:o=1/0})=>{let s=e[n][t];if(a!==void 0){let[e]=i;e!==void 0&&(s[`${r}.${a}`]=e);return}let{length:c}=DKe(s,r);i.slice(0,Math.max(0,o-c)).forEach((e,t)=>{s[`${r}.${c+t}`]=e})},AKe=({draft:e,locale:t,valueStoreKey:n=`currentValues`,keyPath:r,index:i})=>{let a=e[n][t];for(let e=i;;e+=1){let t=`${r}.${e}`,n=`${r}.${e+1}`;if(n in a)a[t]=a[n];else{a[t]=null,delete a[t];break}}},x6=({getItemCount:e,getListElement:t,onMove:n,getItemData:r,settle:i=co,getItemRect:a=e=>e.getBoundingClientRect()})=>{let o=j(void 0),s=j(void 0),c=[],l=A(()=>{let t=e(),n=z(s)?.previewOrder.length===t?z(s).previewOrder:[...Array(t).keys()];return(n.length!==c.length||n.some((e,t)=>e!==c[t]))&&(c=n),c}),u=()=>{iKe(),M(o,void 0),M(s,void 0)},d=async(e,r,a=`reorder`)=>{n(e,r),await i(),ZGe({listElement:t(),index:r,action:a})},f=(e,n,r)=>{M(s,{index:e,previewOrder:[...z(l)]}),rKe(t()),n?.dataTransfer&&(n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setData(`text/plain`,r??``))};return{get grabbedIndex(){return z(o)},get dragIndex(){return z(s)?.index},get displayOrder(){return z(l)},grab:e=>{M(o,e,!0)},release:()=>{M(o,void 0)},move:d,onDragStart:f,onDragOver:e=>{if(!z(s))return;e.stopPropagation(),e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`);let n=JGe({target:e.target,listElement:t()});if(!n)return;let{index:r,previewOrder:i}=z(s),o=i.indexOf(r),c=WGe({dragIndex:o,dropIndex:UGe({index:n.index,clientY:e.clientY,rect:a(n.element)})});c!==void 0&&M(s,{index:r,previewOrder:m6(i,o,c)})},onDrop:e=>{if(!z(s))return;e.stopPropagation(),e.preventDefault();let{index:t,previewOrder:n}=z(s),r=n.indexOf(t);u(),r!==t&&d(t,r)},onDragEnd:u,itemProps:(e,{ownEventsOnly:t=!1}={})=>({draggable:z(o)===e,ondragstart:n=>{t&&n.target!==n.currentTarget||f(e,n,r?.(e))},ondragend:e=>{t&&e.target!==e.currentTarget||u()}})}},jKe=B(`<div role="none"><!></div>`),MKe=B(`<div role="none" class="item-list svelte-17jic1t"></div> <!>`,1),NKe=B(`<div role="none"> </div> <div role="none"><!></div>`,1),PKe=B(`<!> <!> <!> <!> <!>`,1),FKe={hash:`svelte-17jic1t`,code:`.item-list.svelte-17jic1t {display:flex;flex-direction:column;gap:4px;& ~ [role='button'] {margin-top:calc(4px + var(--sui-focus-ring-width));}}`};function IKe(e,t){O(t,!0),K(e,FKe);let n=e=>{{let t=A(()=>z(re)?void 0:e=>{M(h,!1),Oe([{file:e,folder:z(me)}])});Ds(CKe(e,{get allowDrop(){return z(Te)},get invalid(){return p()},get readonly(){return f()},get processing(){return z(b)},get isImageField(){return z(ce)},get multiple(){return z(ge)},get selectFolder(){return z(re)},get onFilePaste(){return z(t)},get showSelectAssetsDialog(){return z(m)},set showSelectAssetsDialog(e){M(m,e,!0)},get replaceMode(){return z(h)},set replaceMode(e){M(h,e,!0)}}),e=>M(w,e,!0),()=>z(w))}},r=e=>{var r=H(),i=P(r),a=e=>{var r=H(),i=P(r),a=e=>{var r=H(),i=P(r),a=e=>{var r=MKe(),i=P(r);Bo(i,29,()=>je.displayOrder,e=>`${u()[e]}|${e}`,(e,n)=>{var r=jKe(),i=N(r);{let e=A(()=>je.dragIndex===z(n));_Ke(i,As(()=>z(xe),{get index(){return z(n)},get itemCount(){return z(_e)},get value(){return u()[z(n)]},get fieldId(){return`${t.fieldId??``}-${z(n)??``}`},get groupFieldId(){return t.fieldId},get dragging(){return z(e)},onReplace:()=>{M(h,!0),M(g,z(n),!0),M(m,!0)},onRemove:()=>Ae(z(n)),onDragStart:()=>je.onDragStart(z(n)),get onDragEnd(){return je.onDragEnd},onMove:(e,t)=>je.move(z(n),e,t)}))}D(r),Zo(r,()=>Bu,()=>({duration:200})),U(e,r)}),D(i),Ds(i,e=>M(C,e),()=>z(C));var a=I(i,2),o=e=>{n(e)};G(a,e=>{u().length<z(ee)&&e(o)}),yo(`dragover`,i,function(...e){je.onDragOver?.apply(this,e)},!0),yo(`drop`,i,function(...e){je.onDrop?.apply(this,e)},!0),U(e,r)},o=A(()=>Array.isArray(u()));G(i,e=>{z(o)&&e(a)}),U(e,r)},o=e=>{{let n=A(()=>z(be)?De:void 0);_Ke(e,As(()=>z(xe),{get value(){return u()},get fieldId(){return t.fieldId},onReplace:()=>{M(h,!0),M(m,!0)},get onRemove(){return z(n)}}))}};G(i,e=>{z(ge)?e(a):typeof u()==`string`&&u()&&e(o,1)}),U(e,r)},o=e=>{n(e)};G(i,e=>{u()?.length&&!z(b)?e(a):e(o,-1)}),U(e,r)},i=$M(),{valueStoreKey:a=`currentValues`,fieldContext:o=void 0,parentComponentNames:s=[]}=si(`field-editor`)??{},c=u6(a),l=s.at(-1),u=J(t,`currentValue`,15),d=J(t,`required`,3,!0),f=J(t,`readonly`,3,!1),p=J(t,`invalid`,3,!1),m=j(!1),h=j(!1),g=j(-1),_=j(!1),v=j(``),y=j(void 0),b=j(!1),x=j(void 0),S=j(ta([])),C=j(void 0),w=j(void 0),T=A(()=>t.fieldConfig.widget),ee=A(()=>Mr(t.fieldConfig.max,1/0)),te=A(()=>t.fieldConfig.accept),ne=A(()=>Mr(t.fieldConfig.choose_url,!0)),re=A(()=>z(T)===`file`&&t.fieldConfig.select_folder===!0),ie=A(()=>i.current?.originalEntry),ae=A(()=>i.current?.collectionName??``),oe=A(()=>i.current?.fileName),se=A(()=>i.current?.isIndexFile??!1),ce=A(()=>z(T)===`image`),le=A(()=>z(ce)?`image`:void 0),ue=A(()=>z3({collectionName:z(ae),fileName:z(oe),isIndexFile:z(se),componentName:l,typedKeyPath:t.typedKeyPath,fieldConfig:t.fieldConfig})),de=A(()=>z(ue).libraryConfig),fe=A(()=>ZH({accept:z(te),image:z(ce),transformations:z(de).transformations})),pe=A(()=>z(ue).folderMap),me=A(()=>z(ue).folder),he=N3({getDraft:()=>i.current,getFolder:()=>z(me),getLocale:()=>t.locale,getKind:()=>z(le),getAccept:()=>z(fe),getSlugificationEnabled:()=>z(de).slugify_filename}),ge=A(()=>lM(t.fieldConfig)),_e=A(()=>Array.isArray(u())?u().length:0),ve=A(()=>z(ge)&&z(_e)>=z(ee)),ye=A(()=>z(de).max_file_size),be=A(()=>!d()&&(!o||![`rich-text-editor-component`,`single-subfield-list-field`].includes(o))),xe=A(()=>({fieldConfig:t.fieldConfig,readonly:f(),invalid:p(),required:d(),collectionName:z(ae),fileName:z(oe),componentName:l,typedKeyPath:t.typedKeyPath,entry:z(ie),locale:t.locale})),Se=A(()=>z(ue).cloudServiceEntries),Ce=A(()=>z(ue).enabled&&!!z(me)),we=A(()=>+!!z(Ce)+z(Se).length),Te=A(()=>z(we)===1&&!z(re)),Ee=()=>{z(y)?.reset(),z(ge)||(u(``),Vi())},De=async()=>{Ee(),await co(),z(w)?.focus()},Oe=async e=>{let n=i.current;if(!n)return;let r=z(ge)?void 0:u();Ee(),M(b,!0);try{let o=await B3({draft:n,resources:e,folder:z(me),libraryConfig:z(de),accept:z(fe),locale:t.locale});if(i.current!==n)return;let{values:s,value:l,credit:d,rejected:f}=UWe({resources:o,multiple:z(ge),previousValue:r,inEditorComponent:c});z(ge)?kKe({draft:n,locale:t.locale,valueStoreKey:a,keyPath:t.keyPath,newValues:s,replaceIndex:z(h)?z(g):void 0,max:z(ee)}):u(l),M(v,d,!0),d&&M(_,!0),z(x)?.report(f)}finally{M(b,!1)}},ke=async({files:e})=>{if(e.length){if(M(h,!1),z(Ce)){let t=await C3({files:e,listedAssets:he.listedAssets});if(t===void 0)return;Oe(e.map(e=>({file:e,folder:z(me),replace:t})))}else M(S,e,!0),M(m,!0)}},Ae=async e=>{let n=i.current;n&&(AKe({draft:n,locale:t.locale,valueStoreKey:a,keyPath:t.keyPath,index:e}),await co(),h6({index:e,getTarget:e=>{let n=z(C)?.querySelectorAll(`button[aria-controls="${t.fieldId}-${e}-value"]`);return n?.[n.length-1]},fallback:()=>{z(w)?.focus()}}))},je=x6({getItemCount:()=>z(_e),getListElement:()=>z(C),onMove:(e,n)=>{let r=i.current;r&&OKe({draft:r,locale:t.locale,valueStoreKey:a,keyPath:t.keyPath,from:e,to:n})},settle:()=>pl(50)});var Me=PKe(),Ne=P(Me),Pe=e=>{{let t=A(()=>f()||je.dragIndex!==void 0||z(ve));Ds(b$(e,{get multiple(){return z(ge)},get disabled(){return z(t)},get accept(){return z(fe)},filterDroppedFiles:!1,onDrop:ke,children:(e,t)=>{r(e)},$$slots:{default:!0}}),e=>M(y,e,!0),()=>z(y))}},Fe=e=>{r(e)};G(Ne,e=>{z(Te)?e(Pe):e(Fe,-1)});var Ie=I(Ne,2);{let e=A(()=>!z(h)&&z(ge));L3(Ie,{get kind(){return z(le)},get multiple(){return z(e)},get accept(){return z(fe)},get canEnterURL(){return z(ne)},get selectFolder(){return z(re)},get draft(){return i.current},get locale(){return t.locale},get fieldConfig(){return t.fieldConfig},get assetLibraryFolderMap(){return z(pe)},get enabledCloudServiceEntries(){return z(Se)},onSelect:Oe,get open(){return z(m)},set open(e){M(m,e,!0)},get pendingFiles(){return z(S)},set pendingFiles(e){M(S,e,!0)}})}var Le=I(Ie,2);R3(Le,{});var Re=I(Le,2);Ds(C$(Re,{get maxSize(){return z(ye)},get accept(){return z(fe)}}),e=>M(x,e,!0),()=>z(x));var ze=I(Re,2);{let e=A(()=>Y(`assets_dialog.photo_credit.title`)),t=A(()=>Y(`copy`));ru(ze,{get title(){return z(e)},get okLabel(){return z(t)},onOk:()=>{navigator.clipboard.writeText(z(v))},get open(){return z(_)},set open(e){M(_,e,!0)},children:(e,t)=>{var n=NKe(),r=P(n),i=F(r,!0),a=I(r,2);pO(N(a),{dir:`auto`,flex:!0,readonly:!0,get value(){return z(v)},onclick:e=>{e.target.focus(),e.target.select()}}),D(a),R(e=>W(i,e),[()=>Y(`assets_dialog.photo_credit.description`)]),U(e,n)},$$slots:{default:!0}})}U(e,Me),k()}var LKe=B(`<p class="svelte-28vcoi"><!></p>`),RKe=B(`<p class="svelte-28vcoi"> </p>`),zKe={hash:`svelte-28vcoi`,code:`
/* Remove the padding to make the image full-width on small screens */
@media (width < 768px) {[role='document'] section > p.svelte-28vcoi:has(img) {margin-inline:calc(var(--entry-preview-padding-inline) * -1);}
}`};function BKe(e,t){O(t,!0),K(e,zKe);let n=$M(),r=J(t,`typedKeyPath`,3,void 0),i=J(t,`locale`,3,void 0),a=j(void 0),o=j(void 0),s=A(()=>t.fieldConfig.widget),c=A(()=>z(s)===`image`),l=A(()=>n.current?.originalEntry),u=A(()=>n.current?.collectionName??``),d=A(()=>n.current?.fileName);yk(()=>(t.value,fo(async()=>t.value?dKe({value:t.value,kind:z(c)?`image`:void 0,entry:z(l),collectionName:z(u),fileName:z(d),fieldConfig:t.fieldConfig,typedKeyPath:r(),locale:i()}):{kind:void 0,src:void 0})),e=>{M(a,e.kind,!0),M(o,e.src,!0)});var f=H(),p=P(f),m=e=>{var t=LKe(),n=N(t);{let e=A(()=>[`audio`,`video`].includes(z(a)));u$(n,{get kind(){return z(a)},get src(){return z(o)},get controls(){return z(e)}})}D(t),U(e,t)},h=e=>{var n=RKe(),r=F(n,!0);R(()=>W(r,t.value)),U(e,n)},g=A(()=>t.value.trim()&&!t.value.startsWith(`blob:`));G(p,e=>{z(a)&&z(o)?e(m):z(g)&&e(h,1)}),U(e,f),k()}function VKe(e,t){O(t,!0);var n=H(),r=P(n),i=e=>{var n=H(),r=P(n),i=e=>{var n=H();Bo(P(n),19,()=>t.currentValue,(e,t)=>`${e}-${t}`,(e,n)=>{BKe(e,{get value(){return z(n)},get fieldConfig(){return t.fieldConfig},get typedKeyPath(){return t.typedKeyPath},get locale(){return t.locale}})}),U(e,n)},a=A(()=>Array.isArray(t.currentValue));G(r,e=>{z(a)&&e(i)}),U(e,n)},a=A(()=>lM(t.fieldConfig)),o=e=>{BKe(e,{get value(){return t.currentValue},get fieldConfig(){return t.fieldConfig},get typedKeyPath(){return t.typedKeyPath},get locale(){return t.locale}})};G(r,e=>{z(a)?e(i):typeof t.currentValue==`string`&&t.currentValue&&e(o,1)}),U(e,n),k()}var HKe=B(`<div role="alert" class="validation svelte-6wra4i"><div role="none" class="svelte-6wra4i"><!> <!></div></div>`),UKe={hash:`svelte-6wra4i`,code:`.validation.svelte-6wra4i {color:var(--sui-error-foreground-color) !important;font-size:var(--sui-font-size-small);div:where(.svelte-6wra4i) {display:flex;align-items:center;gap:4px;margin:4px 0 0;.icon {flex:none;font-size:16px; /* !hardcoded */}}}`};function S6(e,t){K(e,UKe);let n=J(t,`id`,3,void 0),r=J(t,`live`,3,`polite`);var i=HKe(),a=N(i),o=N(a);Xc(o,{name:`error`}),Go(I(o,2),()=>t.children),D(a),D(i),R(()=>{q(i,`id`,n()),q(i,`aria-live`,r())}),U(e,i)}var WKe=B(`<span role="none" class="type-label"> </span> <span role="none" class="type-description svelte-kkc51a"> </span>`,1),GKe={hash:`svelte-kkc51a`,code:`.sui.menuitem.variable-type-described {--sui-menuitem-height: auto;--sui-menuitem-padding: 8px 16px;.content {display:flex;flex-direction:column;gap:2px;}}.type-description.svelte-kkc51a {max-width:320px;white-space:normal;text-align:start;font-size:var(--sui-font-size-small);line-height:var(--sui-line-height-compact);color:var(--sui-tertiary-foreground-color);}button:hover .type-description.svelte-kkc51a {color:inherit;}`};function C6(e,t){let n=Eo();O(t,!0),K(e,GKe);let r=J(t,`disabled`,3,!1),i=J(t,`locale`,3,void 0),a=J(t,`items`,19,()=>[]),o=J(t,`addItem`,3,()=>void 0),s=A(()=>t.fieldConfig.types),c=A(()=>t.fieldConfig.widget===`object`?void 0:t.fieldConfig),l=A(()=>z(c)?fB({config:z(c),option:`label_singular`,locale:i()}):void 0),u=A(()=>z(c)?.max??1/0),d=A(()=>Y(`add_x`,{values:{name:z(l)||pB({config:t.fieldConfig,locale:i()})}})),f=A(()=>a().length>=z(u));var p=H(),m=P(p),h=e=>{},g=e=>{Xl(e,{variant:`tertiary`,size:`small`,get label(){return z(d)},get disabled(){return r()},startIcon:e=>{Xc(e,{name:`add`})},endIcon:e=>{},popup:e=>{{let t=A(()=>Y(`select_list_type`));Eu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var r=H();Bo(P(r),19,()=>z(s),e=>e.name,(e,t,r)=>{let a=A(()=>z(t)),s=A(()=>pB({config:z(t),locale:i()}));var c=H(),l=P(c),u=e=>{let t=A(()=>`${n}-type-${z(r)}-description`);Du(e,{class:`variable-type-described`,get"aria-label"(){return z(s)},get"aria-describedby"(){return z(t)},onclick:()=>o()({type:z(a).name}),children:(e,n)=>{var r=WKe(),i=P(r),o=F(i,!0),c=I(i,2),l=F(c,!0);R(()=>{W(o,z(s)),q(c,`id`,z(t)),W(l,z(a).description)}),U(e,r)},$$slots:{default:!0}})},d=e=>{Du(e,{get label(){return z(s)},onclick:()=>o()({type:z(a).name})})};G(l,e=>{z(a).description?e(u):e(d,-1)}),U(e,c)}),U(e,r)},$$slots:{default:!0}})}},$$slots:{startIcon:!0,endIcon:!0,popup:!0}})},_=A(()=>Array.isArray(z(s))),v=e=>{Al(e,{variant:`tertiary`,size:`small`,get label(){return z(d)},get disabled(){return r()},onclick:()=>o()(),startIcon:e=>{Xc(e,{name:`add`})},$$slots:{startIcon:!0}})};G(m,e=>{z(f)?e(h):z(_)?e(g,1):e(v,-1)}),U(e,p),k()}var KKe=({draft:e,valueStoreKey:t=`currentValues`,keyPath:n,locale:r})=>EM(e[t][r]??{},n),qKe=({pairs:e,edited:t})=>e.map(([e],n,r)=>{if(!e.trim()&&t[n])return`empty`;if(e.trim()&&r.findIndex(t=>t[0]===e)!==n)return`duplicate`}),JKe=e=>e.filter(([e])=>e.trim()),YKe=({rows:e,storedPairs:t})=>!(0,yr.default)(JKe(e),t),XKe=({storedPairs:e,storedValue:t})=>!e.length&&t!==null,ZKe=({rows:e,validations:t,getStoredPairs:n})=>{if(t.some(Boolean))return;let r=JKe(e);return r.length?r.length===e.length?r:void 0:n().some(([e])=>e.trim())?r:void 0},QKe=({draft:e,valueStoreKey:t=`currentValues`,keyPath:n,locale:r,fieldConfig:i,pairs:a})=>{let{i18n:o}=i,s=e[t];l6({valueStore:s,locale:r,i18n:o,draft:e,keyPath:n},e=>{DM(e,n,a),a.length||(e[n]=null)}),o===`duplicate_keys`&&r===e.defaultLocale&&o6({valueStore:s,defaultLocale:r,keyPath:n})},$Ke=(e=[])=>{let t=0,n=()=>(t+=1,t-1),r=j(ta(e)),i=j(ta(e.map(n)));return{get values(){return z(r)},get ids(){return z(i)},insert:(e,t)=>{z(r).splice(e,0,t),z(i).splice(e,0,n())},remove:e=>{z(r).splice(e,1),z(i).splice(e,1)},move:(e,t)=>{M(r,m6(z(r),e,t),!0),M(i,m6(z(i),e,t),!0)},replace:(e,{keepIds:t=!1}={})=>{let a=z(i);M(r,e,!0),M(i,e.map((e,r)=>t&&r<a.length?a[r]:n()),!0)}}},eqe=B(`<th scope="col" class="reorder svelte-u0prcz"></th>`),tqe=B(`<th scope="col" class="action svelte-u0prcz"></th>`),nqe=B(`<td class="reorder svelte-u0prcz"><div role="none" class="svelte-u0prcz"><!></div></td>`),rqe=B(`<td class="action svelte-u0prcz"><!></td>`),iqe=B(`<tr><!><td class="key svelte-u0prcz"><!></td><td class="value svelte-u0prcz"><!></td><!></tr>`),aqe=B(`<table class="svelte-u0prcz"><thead><tr class="svelte-u0prcz"><!><th scope="col" class="key svelte-u0prcz"> </th><th scope="col" class="value svelte-u0prcz"> </th><!></tr></thead><tbody></tbody></table>`),oqe=B(`<!> <!>`,1),sqe=B(`<div role="none" class="toolbar svelte-u0prcz"><!></div>`),cqe=B(`<!> <!> <!>`,1),lqe={hash:`svelte-u0prcz`,code:`.toolbar.svelte-u0prcz {display:flex;align-items:center;margin-block-start:8px;&:first-child {margin-block-start:0;}}table.svelte-u0prcz {
/* Space the cells like the items of a List field. The outer spacing is cancelled out by the
negative margins, which the stretched width makes up for */margin:-4px;border-collapse:separate;border-spacing:4px;width:-moz-available;width:-webkit-fill-available;width:stretch;}th.svelte-u0prcz,
td.svelte-u0prcz {border-width:0;}th.svelte-u0prcz {padding-block:4px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-normal);text-align:start;&.key,
&.value {width:50%;}}td.svelte-u0prcz {padding:0;vertical-align:middle;&.reorder div:where(.svelte-u0prcz) {display:flex;align-items:center;}}tr.svelte-u0prcz {
/* The dragged row is left as a faint placeholder marking the gap it would drop into, like the
items of a List field */&.dragging {opacity:0.25;}}`};function uqe(e,t){O(t,!0),K(e,lqe);let n=$M(),{valueStoreKey:r=`currentValues`}=si(`field-editor`)??{},i=J(t,`readonly`,3,!1),a=A(()=>Mr(t.fieldConfig.i18n,!1)),o=A(()=>t.fieldConfig.key_label),s=A(()=>t.fieldConfig.value_label),c=A(()=>Mr(t.fieldConfig.max,1/0)),l=A(()=>z(o)||Y(`key_value.key`)),u=A(()=>z(s)||Y(`key_value.value`)),d=A(()=>n.current?.defaultLocale),f=A(()=>i()||z(a)===`duplicate_keys`&&t.locale!==z(d)),p=$Ke([]),m=ta([]),h=j(void 0),g=j(ta([])),_=j(ta([])),v=A(()=>p.values.length===1&&!p.values[0][0]&&!p.values[0][1]),y=()=>{!p.values.length&&!z(f)&&(p.insert(p.values.length,[``,``]),z(g).push(!1))},b=()=>{let e=n.current;if(!e)return;let i=KKe({draft:e,valueStoreKey:r,keyPath:t.keyPath,locale:t.locale}),a=e[r][t.locale];if(YKe({rows:p.values,storedPairs:i})&&(p.replace([...i],{keepIds:!0}),M(g,i.map(()=>!1),!0)),y(),XKe({storedPairs:i,storedValue:a[t.keyPath]})){let e=t.keyPath;nN(()=>{a[e]=null})}},x=()=>{p.insert(p.values.length,[``,``]),z(g).push(!1),window.requestAnimationFrame(()=>{m[p.values.length-1].querySelector(`input`).focus()})},S=async e=>{p.remove(e),z(g).splice(e,1),y(),await co();let{rows:t}=z(h);h6({index:e,getTarget:e=>{let n=t[e];return n&&(n.querySelector(`td.action button:enabled`)??n.querySelector(`td.key input`))}})},C=x6({getItemCount:()=>p.values.length,getListElement:()=>z(h),onMove:(e,t)=>{p.move(e,t),M(g,m6(z(g),e,t),!0)},getItemData:e=>p.values[e][0]}),w=()=>{let e=n.current;if(M(_,qKe({pairs:p.values,edited:z(g)}),!0),!e)return;let i=ZKe({rows:p.values,validations:z(_),getStoredPairs:()=>KKe({draft:e,valueStoreKey:r,keyPath:t.keyPath,locale:t.locale})});if(!i)return;let a={draft:e,valueStoreKey:r,fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,pairs:ni(i)};nN(()=>{QKe(a)})},T=gk(()=>{let e=qM(n.current,t.locale,t.keyPath,r);return[EM(e,t.keyPath,{live:!1}),e[t.keyPath]]});vk(()=>[T.current],()=>{b()}),vk(()=>ni(p.values),()=>{w()});var ee=cqe(),te=P(ee),ne=e=>{var n=aqe(),r=N(n),a=N(r),o=N(a),s=e=>{var t=eqe();R(e=>q(t,`aria-label`,e),[()=>Y(`reorder`)]),U(e,t)};G(o,e=>{z(f)||e(s)});var d=I(o),y=F(d,!0),b=I(d),w=F(b,!0),T=I(b),ee=e=>{var t=tqe();R(e=>q(t,`aria-label`,e),[()=>Y(`key_value.action`)]),U(e,t)};G(T,e=>{z(f)||e(ee)}),D(a),D(r);var te=I(r);Bo(te,29,()=>C.displayOrder,e=>p.ids[e],(e,n)=>{var r=iqe();bs(r,e=>({...e,[ms]:{dragging:C.dragIndex===z(n)}}),[()=>C.itemProps(z(n))],void 0,void 0,`svelte-u0prcz`);var a=N(r),o=e=>{var t=nqe(),r=N(t),i=N(r);{let e=A(()=>p.values.length<2);v6(i,{get index(){return z(n)},get itemCount(){return p.values.length},get disabled(){return z(e)},onGrab:()=>C.grab(z(n)),get onRelease(){return C.release},onMove:(e,t)=>C.move(z(n),e,t)})}D(r),D(t),U(e,t)};G(a,e=>{z(f)||e(o)});var s=I(a),d=N(s);{let e=A(()=>!!z(_)[z(n)]),r=A(()=>z(_)[z(n)]?`${t.fieldId}-kv-error`:void 0);fu(d,{dir:`ltr`,get readonly(){return z(f)},flex:!0,get invalid(){return z(e)},get ariaLabel(){return z(l)},get"aria-errormessage"(){return z(r)},oninput:()=>{z(g)[z(n)]=!0},onkeydown:e=>{e.key===`Enter`&&!e.isComposing&&m[z(n)].querySelector(`td.value input`).focus()},get value(){return p.values[z(n)][0]},set value(e){p.values[z(n)][0]=e}})}D(s);var h=I(s),y=N(h);{let e=A(()=>GA(t.locale));fu(y,{get dir(){return z(e)},get readonly(){return i()},flex:!0,get ariaLabel(){return z(u)},onkeydown:e=>{e.key===`Enter`&&!e.isComposing&&(z(n)<p.values.length-1?m[z(n)+1].querySelector(z(f)?`td.value input`:`td.key input`).focus():!z(f)&&p.values.length<z(c)&&x())},get value(){return p.values[z(n)][1]},set value(e){p.values[z(n)][1]=e}})}D(h);var b=I(h),w=e=>{var t=rqe();g$(N(t),{variant:`ghost`,get disabled(){return z(v)},onclick:()=>{S(z(n))}}),D(t),U(e,t)};G(b,e=>{z(f)||e(w)}),D(r),Ds(r,(e,t)=>m[t]=e,e=>m?.[e],()=>[z(n)]),Zo(r,()=>Bu,()=>({duration:200})),U(e,r)}),D(te),Ds(te,e=>M(h,e),()=>z(h)),D(n),R(()=>{W(y,z(l)),W(w,z(u))}),yo(`dragover`,te,function(...e){C.onDragOver?.apply(this,e)},!0),yo(`drop`,te,function(...e){C.onDrop?.apply(this,e)},!0),U(e,n)};G(te,e=>{p.values.length&&e(ne)});var re=I(te,2),ie=e=>{S6(e,{get id(){return`${t.fieldId??``}-kv-error`},children:(e,t)=>{var n=oqe(),r=P(n),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`key_value.empty_key`)]),U(e,t)},a=A(()=>z(_).includes(`empty`));G(r,e=>{z(a)&&e(i)});var o=I(r,2),s=e=>{var t=V();R(e=>W(t,e),[()=>Y(`key_value.duplicate_key`)]),U(e,t)},c=A(()=>z(_).includes(`duplicate`));G(o,e=>{z(c)&&e(s)}),U(e,n)},$$slots:{default:!0}})},ae=A(()=>z(_).some(Boolean));G(re,e=>{z(ae)&&e(ie)});var oe=I(re,2),se=e=>{var n=sqe();C6(N(n),{get disabled(){return z(f)},get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get items(){return p.values},addItem:()=>{x()}}),D(n),U(e,n)};G(oe,e=>{p.values.length<z(c)&&e(se)}),U(e,ee),k()}var dqe=B(`<tr><td class="svelte-11sa460"> </td><td class="svelte-11sa460"> </td></tr>`),fqe=B(`<table class="svelte-11sa460"><thead><tr><th scope="col" class="svelte-11sa460"> </th><th scope="col" class="svelte-11sa460"> </th></tr></thead><tbody></tbody></table>`),pqe={hash:`svelte-11sa460`,code:`table.svelte-11sa460 {width:-moz-available;width:-webkit-fill-available;width:stretch;}th.svelte-11sa460 {padding-block:4px;width:50%;color:var(--sui-tertiary-foreground-color);background-color:var(--sui-tertiary-background-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-normal);text-align:start;}td.svelte-11sa460 {&:empty::after {content:'\\00a0'; /* nbsp */}}`};function mqe(e,t){O(t,!0),K(e,pqe);let n=$M(),r=A(()=>t.fieldConfig.key_label),i=A(()=>t.fieldConfig.value_label),a=A(()=>z(r)||Y(`key_value.key`)),o=A(()=>z(i)||Y(`key_value.value`)),s=A(()=>EM(qM(n.current,t.locale,t.keyPath),t.keyPath,{live:!1}));var c=H(),l=P(c),u=e=>{var t=fqe(),n=N(t),r=N(n),i=N(r),c=F(i,!0),l=F(I(i),!0);D(r),D(n);var u=I(n);Bo(u,23,()=>z(s),([e,t],n)=>`${e}-${n}`,(e,t)=>{var n=A(()=>Nr(z(t),2));let r=()=>z(n)[0],i=()=>z(n)[1];var a=dqe(),o=N(a),s=F(o,!0),c=F(I(o),!0);D(a),R(()=>{W(s,r()),W(c,i())}),U(e,a)}),D(u),D(t),R(()=>{W(c,z(a)),W(l,z(o))}),U(e,t)};G(l,e=>{z(s).length&&e(u)}),U(e,c),k()}var hqe=B(`<!> <!> <!> <!>`,1),w6=B(`<!> <!>`,1),gqe=B(`<!> <!> <!> <!> <!>`,1);function _qe(e,t){O(t,!0);let n=(e,n=kr,i=kr)=>{var a=H(),o=P(a),s=e=>{{let a=e=>{var i=H();Bo(P(i),17,r,e=>e.name,(e,r)=>{{let i=A(()=>pB({config:z(r),locale:t.locale}));Du(e,{get label(){return z(i)},onclick:()=>t.addItem({index:n(),type:z(r).name})})}}),U(e,i)},o=A(()=>Y(`add_item_${i()}`));Du(e,{get label(){return z(o)},get disabled(){return t.isAddDisabled},items:a,$$slots:{items:!0}})}},c=e=>{{let r=A(()=>Y(`add_item_${i()}`));Du(e,{get label(){return z(r)},get disabled(){return t.isAddDisabled},onclick:()=>t.addItem({index:n()})})}};G(o,e=>{r()?e(s):e(c,-1)}),U(e,a)},r=J(t,`variableTypes`,3,void 0),i=A(()=>t.canReorder&&KGe(t.itemCount)),a=j(!1);var o=w6(),s=P(o);{let e=e=>{{let r=A(()=>Y(`list_item_options`));Eu(e,{get ariaLabel(){return z(r)},children:(e,r)=>{var o=gqe(),s=P(o),c=e=>{var r=hqe(),i=P(r),a=e=>{{let n=A(()=>Y(`duplicate`)),r=A(()=>t.isAddDisabled||t.unknownType);Du(e,{get label(){return z(n)},get disabled(){return z(r)},onclick:()=>t.addItem({index:t.index+1,dupIndex:t.index})})}};G(i,e=>{t.allowDuplicate&&e(a)});var o=I(i,2);n(o,()=>t.index,()=>`above`);var s=I(o,2);n(s,()=>t.index+1,()=>`below`),mu(I(s,2),{}),U(e,r)};G(s,e=>{t.allowAdd&&!t.hasMaxItems&&e(c)});var l=I(s,2);{let e=A(()=>Y(`copy`));Du(l,{get label(){return z(e)},get disabled(){return t.unknownType},onclick:()=>t.copyItem(t.index)})}var u=I(l,2),d=e=>{{let n=A(()=>Y(`paste_item_to_replace`));Du(e,{get label(){return z(n)},get disabled(){return t.isAddDisabled},onclick:()=>t.pasteItem(t.index,{replace:!0})})}};G(u,e=>{t.allowAdd&&t.allowRemove&&e(d)});var f=I(u,2),p=e=>{var n=w6(),r=P(n);{let e=A(()=>Y(`paste_item_above`));Du(r,{get label(){return z(e)},get disabled(){return t.isAddDisabled},onclick:()=>t.pasteItem(t.index)})}var i=I(r,2);{let e=A(()=>Y(`paste_item_below`));Du(i,{get label(){return z(e)},get disabled(){return t.isAddDisabled},onclick:()=>t.pasteItem(t.index+1)})}U(e,n)};G(f,e=>{t.allowAdd&&!t.hasMaxItems&&e(p)});var m=I(f,2),h=e=>{var n=w6(),r=P(n);mu(r,{}),sKe(I(r,2),{get index(){return t.index},get itemCount(){return t.itemCount},get onMove(){return t.moveItem},onMoveTo:()=>{M(a,!0)}}),U(e,n)};G(m,e=>{z(i)&&e(h)}),U(e,o)},$$slots:{default:!0}})}},r=A(()=>Y(`list_item_options`));Xl(s,{variant:`ghost`,size:`small`,iconic:!0,popupPosition:`bottom-right`,"data-action":`move-options`,get"aria-label"(){return z(r)},popup:e,$$slots:{popup:!0}})}var c=I(s,2),l=e=>{aKe(e,{get index(){return t.index},get itemCount(){return t.itemCount},onMove:e=>t.moveItem(e,`move-options`),get open(){return z(a)},set open(e){M(a,e,!0)}})};G(c,e=>{z(i)&&e(l)}),U(e,o),k()}function vqe(e,t){O(t,!0);let n=J(t,`expanded`,3,!1);{let t=A(()=>n()?`expand_more`:qc()?`chevron_left`:`chevron_right`);Xc(e,{get name(){return z(t)}})}k()}var yqe=B(`<div role="none" class="label svelte-1qyhxjh"><!> <div role="none" class="summary"> </div></div>`),bqe=B(`<!> <!>`,1),xqe=B(`<div role="none"><!> <div role="none" class="actions svelte-1qyhxjh"><!> <!></div></div>`),Sqe=B(`<div role="none" class="toolbar bottom add svelte-1qyhxjh"><!> <!> <!></div>`),Cqe={hash:`svelte-1qyhxjh`,code:`.toolbar.svelte-1qyhxjh {display:flex;align-items:center;flex-wrap:wrap;gap:0 8px;position:sticky;z-index:10;background-color:var(--sui-primary-background-color);min-height:var(--sui-secondary-toolbar-size);&.top {
/* Below the sticky toolbars of the rich text editors the field is in, if any */top:var(--sui-text-editor-inner-toolbar-top, 0);}&.bottom {bottom:0;}& > div:where(.svelte-1qyhxjh) {display:flex;align-items:center;&.actions {flex-wrap:wrap;margin-block:8px;margin-inline-start:auto;}}&.single > div.actions:where(.svelte-1qyhxjh) {
/* With no item count on the left, the Add button goes where the item would be */margin-inline-start:0;}}`};function wqe(e,t){O(t,!0),K(e,Cqe);let n=e=>{var n=H(),r=P(n),i=e=>{{let n=e=>{Xc(e,{name:`content_paste`})},r=A(()=>Y(`paste_item`));Al(e,{variant:`tertiary`,size:`small`,iconic:!0,get"aria-label"(){return z(r)},get disabled(){return t.isAddDisabled},onclick:()=>t.pasteItem(t.addToTop?0:t.items.length),startIcon:n,$$slots:{startIcon:!0}})}};G(r,e=>{t.hasMaxItems||e(i)}),U(e,n)},r=J(t,`element`,15),i=J(t,`summaryId`,3,void 0);var a=H(),o=P(a),s=e=>{var a=xqe();let o;var s=N(a),c=e=>{var n=yqe(),r=N(n);{let e=e=>{vqe(e,{get expanded(){return t.parentExpanded}})},n=A(()=>!t.items.length),i=A(()=>t.parentExpanded?Y(`collapse`):Y(`expand`));Al(r,{iconic:!0,get disabled(){return z(n)},get"aria-label"(){return z(i)},get"aria-expanded"(){return t.parentExpanded},get"aria-controls"(){return`list-${t.fieldId??``}-item-list`},onclick:()=>{t.updateExpanderStates({[t.parentExpandedKeyPath]:!t.parentExpanded})},startIcon:e,$$slots:{startIcon:!0}})}var a=I(r,2),o=F(a);D(n),R(()=>{q(a,`id`,i()),W(o,`${t.items.length??``}
${((t.items.length===1?t.labelSingular:void 0)||t.label||t.fieldName)??``}`)}),U(e,n)};G(s,e=>{t.singleItem||e(c)});var l=I(s,2),u=N(l),d=e=>{var r=bqe(),i=P(r);C6(i,{get disabled(){return t.isAddDisabled},get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get items(){return t.items},get addItem(){return t.addItem}});var a=I(i,2);n(a),U(e,r)};G(u,e=>{t.allowAdd&&(t.addToTop||!t.items.length||!t.parentExpanded)&&e(d)});var f=I(u,2),p=e=>{var n=H();Bo(P(n),16,()=>[!0,!1],e=>e,(e,n)=>{{let r=A(()=>Y(n?`expand_all`:`collapse_all`)),i=A(()=>t.itemExpanderStates.every(([,e])=>e===n));Al(e,{variant:`tertiary`,size:`small`,get label(){return z(r)},get disabled(){return z(i)},onclick:()=>{t.updateExpanderStates(Object.fromEntries(t.itemExpanderStates.map(([e])=>[e,n])))}})}}),U(e,n)};G(f,e=>{t.parentExpanded&&t.items.length>1&&e(p)}),D(l),D(a),Ds(a,e=>r(e),()=>r()),R(()=>o=os(a,1,`toolbar top svelte-1qyhxjh`,null,o,{single:t.singleItem})),U(e,a)},c=e=>{var r=Sqe(),i=N(r);$l(i,{flex:!0});var a=I(i,2);C6(a,{get disabled(){return t.isAddDisabled},get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get items(){return t.items},get addItem(){return t.addItem}});var o=I(a,2);n(o),D(r),U(e,r)};G(o,e=>{t.position===`top`?e(s):e(c,-1)}),U(e,a),k()}var Tqe=e=>{if(e instanceof Error)return e.message;try{return String(e??``)}catch{return``}},Eqe=B(`<span role="alert"> </span> <div role="none" class="buttons svelte-tpixvt"><!> <!></div>`,1),Dqe=B(`<div role="none" class="field-error svelte-tpixvt"><!> <!></div>`),Oqe={hash:`svelte-tpixvt`,code:`.buttons.svelte-tpixvt {display:flex;flex-wrap:wrap;justify-content:center;gap:8px;}.field-error.svelte-tpixvt {display:flex;flex-direction:column;align-items:flex-start;gap:8px;}`};function T6(e,t){O(t,!0),K(e,Oqe);let n=J(t,`scope`,3,`field`),r=()=>{window.location.reload()};var i=H();Do(P(i),{onerror:e=>{console.error(e)},failed:(e,t=kr,i=kr)=>{let a=A(()=>Y(`${n()}_crashed`,{values:{message:Tqe(t())}}));var o=H(),s=P(o),c=e=>{VO(e,{children:(e,t)=>{var n=Eqe(),o=P(n),s=F(o,!0),c=I(o,2),l=N(c);{let e=A(()=>Y(`try_again`));Al(l,{variant:`secondary`,get label(){return z(e)},get onclick(){return i()}})}var u=I(l,2);{let e=A(()=>Y(`reload_cms`));Al(u,{variant:`primary`,get label(){return z(e)},onclick:r})}D(c),R(()=>W(s,z(a))),U(e,n)},$$slots:{default:!0}})},l=e=>{var t=Dqe(),n=N(t);el(n,{status:`error`,children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(a))),U(e,n)},$$slots:{default:!0}});var r=I(n,2);{let e=A(()=>Y(`try_again`));Al(r,{variant:`tertiary`,size:`small`,get label(){return z(e)},get onclick(){return i()}})}D(t),bo(`click`,t,e=>e.stopPropagation()),bo(`keydown`,t,e=>{e.key===`Enter`&&e.stopPropagation()}),U(e,t)};G(s,e=>{n()===`page`?e(c):e(l,-1)}),U(e,o)}},e=>{var n=H();Go(P(n),()=>t.children),U(e,n)}),U(e,i),k()}xo([`click`,`keydown`]);var E6=e=>Error(`The response from the ${e} API was cut off at the token limit.`),kqe=(e,t)=>({"Content-Type":`application/json`,Authorization:`Bearer ${e}`,...t}),D6=async({endpoint:e,headers:t,body:n,apiLabel:r})=>{let i=await fetch(e,{method:`POST`,headers:t,body:JSON.stringify(n)});if(!i.ok){let e=await i.json().catch(()=>({})),t=e.error?.message||e.message||``;throw Error(`${r} API error: ${i.status} ${i.statusText}${t?` - ${t}`:``}`)}return i.json()},Aqe=async({endpoint:e,headers:t={},apiKey:n,model:r,systemPrompt:i,userMessage:a,temperature:o=.3,maxTokens:s=16e3,reasoning:c=`high`,extraBody:l={}})=>{let u=await D6({endpoint:e,headers:kqe(n,t),apiLabel:`Chat Completions`,body:{model:r,messages:[{role:`system`,content:i},{role:`user`,content:a}],temperature:o,max_tokens:s,stream:!1,reasoning_effort:c,...l}});if(u.choices?.[0]?.finish_reason===`length`)throw E6(`Chat Completions`);if(!u.choices||!Array.isArray(u.choices)||!u.choices[0]?.message?.content)throw Error(`Invalid response format from Chat Completions API.`);return u.choices[0].message.content.trim()},jqe=async({endpoint:e,headers:t={},apiKey:n,model:r,systemPrompt:i,userMessage:a,maxTokens:o=16e3,reasoning:s,extraBody:c={}})=>{let l=await D6({endpoint:e,headers:kqe(n,t),apiLabel:`Responses`,body:{model:r,instructions:i,input:a,store:!1,max_output_tokens:o,...s?{reasoning:{effort:s}}:{},...c}});if(l.status===`incomplete`&&l.incomplete_details?.reason===`max_output_tokens`)throw E6(`Responses`);if(typeof l.output_text==`string`)return l.output_text.trim();let u=(Array.isArray(l.output)?l.output:[]).find(e=>E(e)&&`type`in e&&e.type===`message`&&`content`in e&&Array.isArray(e.content));if(!E(u)||!(`content`in u)||!Array.isArray(u.content))throw Error(`Invalid response format from Responses API.`);let{content:d}=u,f=d.find(e=>E(e)&&`type`in e&&e.type===`output_text`&&`text`in e&&typeof e.text==`string`);if(E(f)&&`text`in f&&typeof f.text==`string`)return f.text.trim();throw Error(`Invalid response format from Responses API.`)},Mqe=async({endpoint:e,headers:t={},apiKey:n,model:r,systemPrompt:i,userMessage:a,maxTokens:o=16e3,reasoning:s,extraBody:c={}})=>{let l={"Content-Type":`application/json`,...t};!t.Authorization&&!t[`x-api-key`]&&(l[`x-api-key`]=n);let u=await D6({endpoint:e,headers:l,apiLabel:`Messages`,body:{model:r,max_tokens:o,system:i,messages:[{role:`user`,content:a}],...s===`none`?{thinking:{type:`disabled`}}:{},...c}});if(u.stop_reason===`refusal`)throw Error(`The request was declined by the Messages API.`);if(u.stop_reason===`max_tokens`)throw E6(`Messages`);let d=Array.isArray(u.content)?u.content.filter(e=>E(e)&&e.type===`text`&&typeof e.text==`string`).map(({text:e})=>e):[];if(!d.length)throw Error(`Invalid response format from Messages API.`);return d.join(``).trim()},Nqe=c({apiKeyPattern:()=>Iqe,apiKeyURL:()=>`https://platform.claude.com/settings/keys`,apiLabel:()=>`Anthropic API`,complete:()=>Lqe,developerURL:()=>`https://docs.claude.com/en/api/overview`}),Pqe=`https://api.anthropic.com/v1/messages`,Fqe={"anthropic-version":`2023-06-01`,"anthropic-dangerous-direct-browser-access":`true`},Iqe=/^sk-ant-[a-z]+\d*-[a-zA-Z0-9-_]{40,}$/,Lqe=async e=>Mqe({...e,endpoint:Pqe,headers:Fqe}),O6=e=>KA(e,{displayLocale:`en`}),Rqe=(e,t)=>{let n=[`- CRITICAL: Leave content EXACTLY unchanged within HTML elements that have translate="no"`,`- CRITICAL: Leave content EXACTLY unchanged within HTML elements that have class="notranslate"`,`- CRITICAL: Leave content EXACTLY unchanged between "notranslate" and "/notranslate" comments`,`- Preserve all markdown formatting (headers, links, bold, italic, code blocks, lists, etc.)`,`- Preserve all HTML tags and attributes exactly as they are`,`- Maintain the original structure and formatting`,`- Do not translate code content within code blocks or inline code`,`- Do not translate URLs, email addresses, or technical identifiers`,`- If you see translate="no", class="notranslate", or notranslate comments, copy that content verbatim without any changes`],r=[`- Do not split translations into separate paragraphs or add extra line breaks`,`- Keep each translation as a single continuous text string in the array`],i=[`- Return your response as a valid JSON array containing the translated texts`,`- The array should contain the translated texts in the same order as provided`,`- VALIDATION: Before responding, double-check that any translate="no", class="notranslate", or notranslate comment content remains EXACTLY the same`];return`You are a professional translator. Translate the given texts from ${e} to ${t}. Your response must be valid JSON that can be parsed directly.
IMPORTANT INSTRUCTIONS:\n${[...n,...r,...i].join(`
`)}\n\nOUTPUT FORMAT:
- Output ONLY valid JSON, nothing else
- Do NOT use markdown code blocks or formatting
- Do NOT add any explanation or commentary
- Your entire response should be parseable by JSON.parse()
- Start your response with [ and end with ]
Required JSON structure:
["translation 1", "translation 2", ...]`},zqe=e=>`Translate these texts and return ONLY valid JSON (no markdown, no code blocks):
${JSON.stringify(e)}\n\nRespond with JSON only:`,Bqe=(e,t,n)=>{let r;try{r=JSON.parse(e)}catch{throw Error(`Failed to parse JSON response from ${n}.`)}if(!Array.isArray(r))throw Error(`Invalid JSON structure in ${n} response.`);if(r.length!==t)throw Error(`Translation count mismatch: expected ${t}, got ${r.length}`);return r},Vqe=async({sourceLanguage:e,targetLanguage:t})=>!!O6(e)&&!!O6(t),Hqe=(e,t)=>{let n=O6(e),r=O6(t);if(!n)throw Error(`Source locale is not supported.`);if(!r)throw Error(`Target locale is not supported.`);return[n,r]},Uqe=(e,t,n,r={})=>async(i,{sourceLanguage:a,targetLanguage:o,apiKey:s})=>{let[c,l]=Hqe(a,o);return Bqe(await e({apiKey:s,model:t,systemPrompt:Rqe(c,l),userMessage:zqe(i),...r}),i.length,n)},k6=({ai:{apiLabel:e,developerURL:t,apiKeyURL:n,apiKeyPattern:r,complete:i},serviceId:a,serviceLabel:o,model:s,extraOptions:c})=>({serviceId:a,serviceLabel:o,apiLabel:e,developerURL:t,apiKeyURL:n,apiKeyPattern:r,markdownSupported:!0,availability:Vqe,translate:Uqe(i,s,e,c)}),Wqe=k6({ai:Nqe,serviceId:`anthropic`,serviceLabel:`Anthropic Claude`,model:`claude-haiku-5-5`,extraOptions:{reasoning:`none`}}),Gqe=c({apiKeyPattern:()=>qqe,apiKeyURL:()=>`https://platform.deepseek.com/api_keys`,apiLabel:()=>`DeepSeek API`,complete:()=>Jqe,developerURL:()=>`https://api-docs.deepseek.com/`}),Kqe=`https://api.deepseek.com/chat/completions`,qqe=/^sk-[a-zA-Z0-9]{32,}$/,Jqe=async e=>Aqe({...e,endpoint:Kqe,extraBody:{thinking:{type:e.reasoning===`none`?`disabled`:`enabled`}}}),Yqe=k6({ai:Gqe,serviceId:`deepseek`,serviceLabel:`DeepSeek`,model:`deepseek-flash`,extraOptions:{reasoning:`none`}}),Xqe=`google`,Zqe=`Google Cloud Translation`,Qqe=`Cloud Translation API`,$qe=`https://console.cloud.google.com/apis/library/translate.googleapis.com`,eJe=`https://console.cloud.google.com/apis/api/translate.googleapis.com/credentials`,tJe=/^AIza[0-9A-Za-z-_]{35}$/,nJe=`ab,ace,ach,af,ak,alz,am,ar,as,awa,ay,az,ba,ban,bbc,be,bem,bew,bg,bho,bik,bm,bn,br,bs,bts,btx,bua,ca,ceb,cgg,chm,ckb,cnh,co,crh,crs,cs,cv,cy,da,de,din,doi,dov,dv,dz,ee,el,en,eo,es,et,eu,fa,ff,fi,fil,fj,fr,fr-CA,fr-FR,fy,ga,gaa,gd,gl,gn,gom,gu,ha,haw,he,hi,hil,hmn,hr,hrx,ht,hu,hy,id,ig,ilo,is,it,iw,ja,jv,jw,ka,kk,km,kn,ko,kri,ktu,ku,ky,la,lb,lg,li,lij,lmo,ln,lo,lt,ltg,luo,lus,lv,mai,mak,mg,mi,min,mk,ml,mn,mni-Mtei,mr,ms,ms-Arab,mt,my,ne,new,nl,no,nr,nso,nus,ny,oc,om,or,pa,pa-Arab,pag,pam,pap,pl,ps,pt,pt-BR,pt-PT,qu,rn,ro,rom,ru,rw,sa,scn,sd,sg,shn,si,sk,sl,sm,sn,so,sq,sr,ss,st,su,sv,sw,szl,ta,te,tet,tg,th,ti,tk,tl,tn,tr,ts,tt,ug,uk,ur,uz,vi,xh,yi,yo,yua,yue,zh,zh-CN,zh-TW,zu`.split(`,`),rJe={nb:`no`},iJe=e=>{try{return new Intl.Locale(e).maximize().script}catch{return}},A6=e=>{let[t,...n]=e.split(/[-_]/),r=t.toLowerCase(),i=n.find(e=>/^[a-z]{4}$/i.test(e)),a=n.find(e=>/^(?:[a-z]{2}|\d{3})$/i.test(e))?.toUpperCase(),o=i?`${i[0].toUpperCase()}${i.slice(1).toLowerCase()}`:a&&iJe(`${r}-${a}`);if(r===`zh`){if(o===`Hant`)return`zh-TW`;if(o===`Hans`)return`zh-CN`}if(!o||nJe.includes(`${r}-${o}`)||o===iJe(r))return[o?`${r}-${o}`:void 0,a?`${r}-${a}`:void 0,rJe[r]??r].find(e=>!!e&&nJe.includes(e))},aJe=async({sourceLanguage:e,targetLanguage:t})=>!!A6(e)&&!!A6(t),oJe=128,sJe=9e4,cJe=e=>{let t=new TextEncoder,n=[],r=[],i=0;return e.forEach(e=>{let a=t.encode(e).length;r.length&&(r.length>=oJe||i+a>sJe)&&(n.push(r),r=[],i=0),r.push(e),i+=a}),r.length&&n.push(r),n},lJe={serviceId:Xqe,serviceLabel:Zqe,apiLabel:Qqe,developerURL:$qe,apiKeyURL:eJe,apiKeyPattern:tJe,markdownSupported:!1,availability:aJe,translate:async(e,{sourceLanguage:t,targetLanguage:n,apiKey:r})=>{if(t=A6(t)??``,n=A6(n)??``,!t)throw Error(`Source locale is not supported.`);if(!n)throw Error(`Target locale is not supported.`);let i=[];for(let a of cJe(e)){let{data:e}=await D6({endpoint:`https://translation.googleapis.com/language/translate/v2`,headers:{"Content-Type":`application/json`,"X-goog-api-key":r},apiLabel:`Google Translate`,body:{q:a,source:t,target:n,format:`html`}});i.push(...e.translations.map(e=>e.translatedText.replace(/&#39;/g,`'`)))}return i}},uJe=c({apiKeyPattern:()=>dJe,apiKeyURL:()=>`https://aistudio.google.com/api-keys`,apiLabel:()=>`Gemini API`,complete:()=>fJe,developerURL:()=>`https://ai.google.dev/gemini-api/docs`}),dJe=/^AIza[a-zA-Z0-9_-]{35}$/,fJe=async({apiKey:e,model:t,systemPrompt:n,userMessage:r,temperature:i=.3,maxTokens:a=16e3,responseFormat:o})=>{let s=await D6({endpoint:`https://generativelanguage.googleapis.com/v1beta/models/${t}:generateContent`,headers:{"Content-Type":`application/json`,"x-goog-api-key":e},apiLabel:`Gemini`,body:{system_instruction:{parts:[{text:n}]},contents:[{parts:[{text:r}]}],generationConfig:{temperature:i,maxOutputTokens:a,...o?{responseMimeType:o}:{}}}}),c=Array.isArray(s.candidates)?s.candidates[0]:void 0;if(c?.finishReason===`MAX_TOKENS`)throw E6(`Gemini`);let l=Array.isArray(c?.content?.parts)?c.content.parts.filter(e=>E(e)&&!e.thought&&typeof e.text==`string`).map(({text:e})=>e):[];if(!l.length)throw Error(`Invalid response format from Gemini API.`);return l.join(``).trim()},pJe=k6({ai:uJe,serviceId:`google-ai`,serviceLabel:`Google Gemini`,model:`gemini-3.5-flash-lite`,extraOptions:{responseFormat:`application/json`}}),mJe=c({apiKeyPattern:()=>gJe,apiKeyURL:()=>`https://console.mistral.ai/home?profile_dialog=api-keys`,apiLabel:()=>`Mistral AI API`,complete:()=>_Je,developerURL:()=>`https://docs.mistral.ai/`}),hJe=`https://api.mistral.ai/v1/chat/completions`,gJe=/^(?!AIza)[a-zA-Z0-9]{32,}$/,_Je=async e=>Aqe({...e,endpoint:hJe}),vJe=k6({ai:mJe,serviceId:`mistral`,serviceLabel:`Mistral`,model:`mistral-small-latest`,extraOptions:{reasoning:`none`}}),yJe=c({apiKeyPattern:()=>xJe,apiKeyURL:()=>`https://platform.openai.com/api-keys`,apiLabel:()=>`OpenAI API`,complete:()=>SJe,developerURL:()=>`https://platform.openai.com/docs/overview`}),bJe=`https://api.openai.com/v1/responses`,xJe=/^sk-(?!ant-)[a-zA-Z0-9-_]{40,}$/,SJe=async e=>jqe({...e,endpoint:bJe}),j6={anthropic:Wqe,deepseek:Yqe,google:lJe,"google-ai":pJe,mistral:vJe,openai:k6({ai:yJe,serviceId:`openai`,serviceLabel:`OpenAI GPT`,model:`gpt-6-luna`,extraOptions:{reasoning:`low`}})},M6=hk(()=>{let{defaultTranslationService:e=`google`}=IG;return j6[e]??lJe}),N6=new $O,CJe=({draft:e,targetLanguage:t,keyPath:n=``})=>[...N6].some(r=>r.draft===e&&r.targetLanguage===t&&r.keyPath===n),wJe=V1({loader:async()=>{let{default:e}=await RN(`turndown`,`lib/turndown.browser.es.js`),t=new e({headingStyle:`atx`,bulletListMarker:`-`,codeBlockStyle:`fenced`});return t.keep([`span`,`div`]),t},notLoadedMessage:"Turndown is not loaded yet. Call `getTurndownService()` first."}).load,TJe={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`},EJe=e=>e.replace(/&(?:#(\d+)|#x([\da-f]+)|(amp|lt|gt|quot|apos));/gi,(e,t,n,r)=>{if(r)return TJe[r.toLowerCase()];let i=t?Number(t):Number.parseInt(n,16);return i<=1114111?String.fromCodePoint(i):e}),DJe=/^(.+)\.\d+$/,OJe=({field:e,getFieldArgs:t})=>{if(e)return e.i18n;let[,n]=t.keyPath.match(DJe)??[],r=n?bM({...t,keyPath:n}):void 0;return r?.widget===`list`&&!V0(r).hasSubFields?r.i18n:void 0},kJe=({draft:e,options:t})=>{let{currentValues:n}=e,{sourceLanguage:r,targetLanguage:i,keyPath:a=``,translate:o=!1}=t,s=n[r],c=yM(e,{valueMap:s});return Object.fromEntries(Object.entries(s).map(([e,t])=>{let r=n[i][e],s=bM({...c,keyPath:e}),l=s?.widget??`string`;return a&&!GO(e,a)||!R0(OJe({field:s,getFieldArgs:{...c,keyPath:e}}))||typeof t!=`string`||!t||![...zk,`list`].includes(l)||l===`list`&&V0(s).hasSubFields||!o&&t===r||!a&&o&&r&&!(s&&P0(s)&&t===r)?null:[e,{value:t,format:Rk.includes(l)?bZ(s):`plain`}]}).filter(e=>!!e))},P6=(e,t,{count:n,sourceLanguage:r})=>{UQ.current={id:Date.now(),show:!0,status:e,message:t,count:n,sourceLanguage:r}},AJe=async({currentValues:e,options:t,copingFieldMap:n,isDraftClosed:r=()=>!1})=>{let{serviceId:i}=M6.current,{sourceLanguage:a,targetLanguage:o,keyPath:s}=t,c=Object.keys(n).length,l=Object.fromEntries(Object.keys(n).map(t=>[t,e[o][t]])),u=IG.apiKeys?.[i];if(!u){let{promise:e,resolve:t}=Promise.withResolvers();HQ.current={show:!0,multiple:c>1,resolve:t},u=await e}if(!u)return;let{markdownSupported:d,translate:f}=M6.current;P6(`info`,`translation.started`,{count:c,sourceLanguage:a});try{let t=await f(Object.entries(n).map(([,{value:e,format:t}])=>d||t===`html`?e:t===`markdown`?mr(e):_A(e)),{apiKey:u,sourceLanguage:a,targetLanguage:o}),i=!d&&Object.values(n).some(({format:e})=>e===`markdown`)?await wJe():void 0;if(r())return;let c=0;Object.entries(n).forEach(([n,{format:r}],a)=>{let u=t[a];(s||e[o][n]===l[n])&&(c+=1,e[o][n]=d||r===`html`?u:r===`markdown`?i.turndown(u):EJe(u))}),P6(`success`,`translation.complete`,{count:c,sourceLanguage:a})}catch(e){r()||P6(`error`,`translation.error`,{count:c,sourceLanguage:a}),console.error(e)}},jJe=({currentValues:e,options:t,copingFieldMap:n})=>{let{sourceLanguage:r,targetLanguage:i}=t,a=Object.keys(n).length;Object.entries(n).forEach(([t,{value:n}])=>{e[i][t]=n}),P6(`success`,`copy.complete`,{count:a,sourceLanguage:r})},MJe=async({draft:e,options:t,entryDraft:n})=>{let{sourceLanguage:r,targetLanguage:i,keyPath:a=``,translate:o=!1}=t;if(o&&CJe({draft:e,targetLanguage:i,keyPath:a}))return;let{currentValues:s}=e,c=kJe({draft:e,options:t}),l=Object.keys(c).length;if(!l)P6(`info`,`${o?`translation`:`copy`}.none`,{count:l,sourceLanguage:r});else if(o){let r={draft:e,targetLanguage:i,keyPath:a},o=()=>!!n&&n.current!==e;N6.add(r);try{await AJe({currentValues:s,options:t,copingFieldMap:c,isDraftClosed:o})}finally{N6.delete(r)}}else jJe({currentValues:s,options:t,copingFieldMap:c})};function F6(e,t){O(t,!0);let n=e=>{var n=H();Bo(P(n),16,()=>t.otherLocales,e=>e,(e,n)=>{let r=A(()=>KA(n)??n),i=A(()=>({sourceLanguage:n,targetLanguage:t.locale}));var o=H();Fo(P(o),()=>c(z(i)),null,(e,t)=>{{let n=A(()=>z(s)?z(r):Y(a()?`translate_from_x`:`copy_from_x`,{values:{locale:z(r)}}));Du(e,{get label(){return z(n)},get disabled(){return z(t)},onclick:()=>{l(z(i))}})}}),U(e,o)}),U(e,n)},r=$M(),i=J(t,`keyPath`,3,``),a=J(t,`translate`,3,!1),o=J(t,`submenu`,3,!1),s=A(()=>o()&&t.otherLocales.length>1),c=async({sourceLanguage:e,targetLanguage:t})=>!r.current?.currentLocales[t]||!r.current.currentLocales[e]||!!i()&&!Object.keys(kJe({draft:r.current,options:{sourceLanguage:e,targetLanguage:t,keyPath:i(),translate:a()}})).length||a()&&!await M6.current?.availability({sourceLanguage:e,targetLanguage:t}),l=e=>{r.current&&MJe({draft:r.current,options:{...e,keyPath:i(),translate:a()},entryDraft:r})};var u=H(),d=P(u),f=e=>{{let t=e=>{n(e)},r=A(()=>Y(a()?`translate_from`:`copy_from`));Du(e,{get label(){return z(r)},items:t,$$slots:{items:!0}})}},p=e=>{n(e)};G(d,e=>{z(s)?e(f):e(p,-1)}),U(e,u),k()}var NJe=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),PJe=B(`<section><!></section>`),FJe={hash:`svelte-wzztxu`,code:`section.svelte-wzztxu {position:relative;padding:var(--field-editor-padding);&:not(:last-child)::after {position:absolute;inset:auto var(--field-editor-padding) 0 var(--field-editor-padding);overflow:hidden;height:1px;background-color:var(--sui-tertiary-background-color);content:'';}& > * {margin-inline:auto !important;max-width:768px;}& > header {display:flex;align-items:center;margin:0 -8px 8px;height:var(--sui-button-small-height);h4 {margin-inline:var(--sui-focus-ring-width) 0;font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);color:var(--sui-secondary-foreground-color);}.required {margin-block:2px 0;margin-inline:2px 0;color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-large);}}
/* The buttons are shown on hover, and kept visible while a keyboard user is in the field, so
the focused one isn’t invisible */
@media (hover: hover) {&:not(:hover, :focus-within) > header button {opacity:0;}
}}`};function I6(e,t){O(t,!0),K(e,FJe);let n=J(t,`children`,3,void 0),r=ks(t,NJe),i=j(void 0);js(()=>()=>{z(i)?.dispatchEvent(new CustomEvent(`Unmount`))});var a=PJe();bs(a,()=>({role:`group`,class:`field`,...r}),void 0,void 0,void 0,`svelte-wzztxu`),Go(N(a),()=>n()??kr),D(a),Ds(a,e=>M(i,e),()=>z(i)),U(e,a),k()}var IJe=[`revert`,`restore`,`clear`],LJe={field:{revert:`revert_changes`,restore:`restore_default`,clear:`clear`},locale:{revert:`revert_changes`,restore:`restore_default`,clear:`clear_all`},entry:{revert:`revert_all_changes`,restore:`restore_default`,clear:`clear_all`}},RJe={revert:`confirm_reverting_changes`,restore:`confirm_restoring_defaults`,clear:`confirm_clearing_fields`},zJe=(e,t)=>Y(LJe[t][e]),BJe=(e,t)=>t&&t!==`_default`?Y(`${RJe[e]}_x_locale`,{values:{locale:KA(t)??t}}):Y(RJe[e]),VJe=B(`<!> <!>`,1);function L6(e,t){O(t,!0);let n=J(t,`separator`,3,!0);var r=VJe(),i=P(r),a=e=>{mu(e,{})};G(i,e=>{n()&&e(a)}),Bo(I(i,2),16,()=>IJe.filter(e=>e in t.available),e=>e,(e,n)=>{{let r=A(()=>zJe(n,t.scope)),i=A(()=>!t.available[n]);Du(e,{get label(){return z(r)},get disabled(){return z(i)},onclick:()=>{t.onSelect(n)}})}}),U(e,r),k()}function HJe(e,t){O(t,!0);let n=$M(),r=J(t,`size`,3,`medium`),i=J(t,`keyPath`,3,``),a=A(()=>!n.current?.currentLocales[t.locale]||eX(n.current?.originalEntry)),o=A(()=>CJe({draft:n.current,targetLanguage:t.locale,keyPath:i()})),s=async({sourceLanguage:e,targetLanguage:t})=>z(a)||!n.current?.currentLocales[e]||!await M6.current?.availability({sourceLanguage:e,targetLanguage:t}),c=e=>{n.current&&MJe({draft:n.current,options:{...e,keyPath:i(),translate:!0},entryDraft:n})};var l=H(),u=P(l),d=e=>{let n=A(()=>{let[e]=t.otherLocales;return{otherLocale:e}}),i=A(()=>Y(`translate_from_x`,{values:{locale:KA(z(n).otherLocale)??z(n).otherLocale}})),a=A(()=>({sourceLanguage:z(n).otherLocale,targetLanguage:t.locale}));var l=H();Fo(P(l),()=>s(z(a)),null,(e,t)=>{{let n=e=>{Xc(e,{name:`translate`})},s=A(()=>z(t)||z(o));Al(e,{variant:`ghost`,get size(){return r()},iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return z(i)},get title(){return z(i)},get disabled(){return z(s)},onclick:()=>{c(z(a))},startIcon:n,$$slots:{startIcon:!0}})}}),U(e,l)},f=e=>{{let n=e=>{Xc(e,{name:`translate`})},o=e=>{{let n=A(()=>Y(`translation_options`));Eu(e,{get ariaLabel(){return z(n)},children:(e,n)=>{F6(e,{get locale(){return t.locale},get otherLocales(){return t.otherLocales},get keyPath(){return i()},translate:!0})},$$slots:{default:!0}})}},s=A(()=>Y(`translate`));Xl(e,{variant:`ghost`,get size(){return r()},iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return z(s)},get disabled(){return z(a)},endIcon:n,popup:o,$$slots:{endIcon:!0,popup:!0}})}};G(u,e=>{t.otherLocales.length===1?e(d):e(f,-1)}),U(e,l),k()}var UJe=[`compute`,`hidden`,`uuid`],R6=e=>{let{content:t,fieldConfig:n,keyPath:r,locale:i,defaultLocale:a,inheritedI18n:o}=e,{mirror:s=!1,restore:c=!1}=e,{widget:l=`string`,i18n:u}=n,d=u??o;if(!(UJe.includes(l)||n.readonly)){if(l===`list`&&V0(n).hasSubFields){let{allow_add:e=!0,allow_remove:t=!0}=n;if(!t||c&&!e)return}if(l===`object`){if(t[r]===null)return;let{fields:o}=n,{types:s,typeKey:l=`type`}=n,{default:u}=mB({fieldConfig:{...n,i18n:d},locale:i,defaultLocale:a}),f=t[`${r}.${l}`];(o??s?.find(({name:e})=>e===f)?.fields??[]).forEach(t=>{let n=c&&E(u)&&Object.hasOwn(u,t.name)?{...t,default:u[t.name],default_localized:void 0}:t;R6({...e,fieldConfig:n,keyPath:`${r}.${t.name}`,inheritedI18n:d})})}else if(s?d===`duplicate`:i===a||R0(u)){if(qj(t,r),!c){if(l===`keyvalue`){t[r]=null;return}if(l===`list`){t[r]=[];return}}i6({content:t,keyPath:r,fieldConfig:{...n,i18n:d,...c?{}:{default:void 0,default_localized:void 0}},locale:i,defaultLocale:a,dynamicValues:{}})}}},WJe=({valueStore:e,locale:t,...n})=>{R6({...n,content:e[t],locale:t}),t===n.defaultLocale&&Object.entries(e).forEach(([e,r])=>{e!==t&&R6({...n,content:r,locale:e,mirror:!0})})},GJe=({valueMap:e,restore:t=!1,...n})=>{let r=IM(e,n.keyPath),i={...r};return R6({...n,content:i,restore:t}),!(0,yr.default)(r,i)},KJe=({draft:e,fieldConfig:t,keyPath:n,locale:r,restore:i=!1})=>{let{currentValues:a,defaultLocale:o}=e,s=yM(e);MM(()=>{WJe({valueStore:a,fieldConfig:t,keyPath:n,locale:r,defaultLocale:o,restore:i,inheritedI18n:P2({fieldConfig:t,getFieldArgs:{...s,keyPath:n,valueMap:a[r]}})}),r===o&&s6({valueStore:a,defaultLocale:o,getFieldArgs:s})})},qJe=({currentValues:e,currentLocales:t},n)=>n?[n]:Object.keys(e).filter(e=>t[e]),JJe=({valueStore:e,fields:t,locales:n,defaultLocale:r,restore:i})=>{n.forEach(n=>{t.forEach(t=>{WJe({valueStore:e,fieldConfig:t,keyPath:t.name,locale:n,defaultLocale:r,restore:i})})})},z6=({draft:e,locale:t,restore:n=!1})=>{let{fields:r,currentValues:i,defaultLocale:a}=e,o=()=>Object.fromEntries(Object.entries(i).map(([e,t])=>[e,PM(t)])),s=o(),c=o();return JJe({valueStore:c,fields:r,locales:qJe(e,t),defaultLocale:a,restore:n}),!(0,yr.default)(s,c)},YJe=({draft:e,locale:t,restore:n=!1})=>{let{fields:r,currentValues:i,defaultLocale:a}=e,o=qJe(e,t);MM(()=>{JJe({valueStore:i,fields:r,locales:o,defaultLocale:a,restore:n}),o.includes(a)&&s6({valueStore:i,defaultLocale:a,getFieldArgs:yM(e)})})},XJe=(e,t)=>{let n=t.split(`.`);for(let t=n.length-1;t>=1;--t)if(uM(n[t])){let r=n.slice(0,t+1).join(`.`),i=e[`${r}.__sc_item_original_key_path`];if(i!==void 0){let e=n.slice(t+1).join(`.`);return{originalKeyPath:e?`${i}.${e}`:i,currentPrefix:r,originalPrefix:i}}}},ZJe=(e,t)=>IM(e,t,{relative:!0,dropEmptyPlaceholders:!0}),QJe=({currentValueMap:e,originalValueMap:t,keyPath:n})=>{let r=XJe(e,n)?.originalKeyPath??n;return!(0,yr.default)(ZJe(e,n),ZJe(t,r))},$Je=({locale:e,isDefaultLocale:t,keyPath:n,getFieldArgs:r,currentValues:i,reset:a=!1,remapPrefix:o})=>{let{valueMap:s={}}=r;Object.entries(s).forEach(([s,c])=>{if(!n||GO(s,n)){let n=bM({...r,keyPath:s})??TM({...r,keyPath:s});if(t||R0(n?.i18n)||n?.i18n===`duplicate_keys`){if(a)delete i[e][s];else{let t=o?`${o.to}${s.slice(o.from.length)}`:s;i[e][t]=c}}}})},eYe=({draft:e,keyPath:t,locale:n,revertAll:r=!1})=>{let{currentValues:i,originalValues:a}=e,{defaultLocale:o}=rj(e),s=r||n===o,c=yM(e,{keyPath:``}),l=t?XJe(i[n],t):void 0,u=l?.originalKeyPath??t,d=l?{from:l.originalPrefix,to:l.currentPrefix}:void 0;$Je({locale:n,isDefaultLocale:s,keyPath:t,getFieldArgs:{...c,valueMap:i[n]},currentValues:i,reset:!0}),$Je({locale:n,isDefaultLocale:s,keyPath:u,getFieldArgs:{...c,valueMap:a[n]},currentValues:i,remapPrefix:d})},tYe=({draft:e,keyPath:t})=>{if(!t)return U0(e.fields);let{currentValues:n}=e,{defaultLocale:r}=rj(e),i=bM(yM(e,{keyPath:t,valueMap:n[r]}));return i?U0([i],t.split(`.`).slice(0,-1).join(`.`)):[]},nYe=({draft:e,locale:t=``,keyPath:n=``})=>{let{currentValues:r,originalLocales:i,originalPath:a,originalSlugs:o}=e,{allLocales:s,defaultLocale:c}=rj(e),l=t?[t]:s,u=!t&&!n;l.forEach(t=>{eYe({draft:e,keyPath:n,locale:t})}),t===c&&tYe({draft:e,keyPath:n}).forEach(t=>{s.forEach(n=>{n!==c&&r[n]&&eYe({draft:e,keyPath:t,locale:n,revertAll:!0})})}),s6({valueStore:r,defaultLocale:c,getFieldArgs:yM(e)}),u&&(e.currentLocales={...i},e.currentPath=a,e.currentSlugs={...o})},rYe=[`richtext`,`markdown`,`string`,`text`,`list`,`object`],iYe=e=>{let{widget:t=`string`}=e,n=t===`string`,r=[`boolean`,`number`,`string`].includes(t),{prefix:i,suffix:a}=n?e:{},{before_input:o,after_input:s}=r?e:{};return{prefix:i,suffix:a,beforeInputLabel:o,afterInputLabel:s,hasExtraLabels:!!(i||a||o||s)}},aYe=({fieldConfig:e,autoSet:t,locked:n,isDuplicated:r,isNew:i,parentReadonly:a=!1})=>{let{widget:o=`string`}=e,{readonly:s}=e,c=o===`compute`,l=s===!0||a;return{hidden:c||t&&i,readonly:(s??(o===`uuid`&&e.read_only!==!1))||l||t||n||r||c,subfieldsReadonly:l}},oYe=({fieldConfig:e,inline:t})=>{let{widget:n=`string`}=e;return t&&[`select`,`relation`].includes(n)?{...e,dropdown_threshold:0}:e},sYe=({draft:e,fieldConfig:t,keyPath:n,locale:r,valueMap:i,inEditorComponent:a=!1})=>{let{i18n:o=!1}=t,{i18nEnabled:s,defaultLocale:c}=rj(e),l=s&&r!==c,u=s&&R0(o),d=e,f=l&&(a?o===`duplicate`:F2({fieldConfig:t,getFieldArgs:{collectionName:d.collectionName,fileName:d.fileName,isIndexFile:d.isIndexFile,keyPath:n,valueMap:i}})),p=l&&o===`duplicate_keys`;return{canTranslate:u,isDuplicated:f,areKeysDuplicated:p,isShown:a||r===c||u||f||p}},B6=e=>{let t=j(ta({restore:!1,clear:!1})),n=j(`revert`),r=j(!1);return{get availability(){return z(t)},get action(){return z(n)},get dialogOpen(){return z(r)},set dialogOpen(e){M(r,e,!0)},update:()=>{M(t,e()??z(t),!0)},select:e=>{M(n,e,!0),M(r,!0)}}},cYe=B(`<div role="none" class="before-input svelte-dkfcyc"></div>`),lYe=B(`<div role="none" class="prefix svelte-dkfcyc"> </div>`),V6=B(`<!> <!>`,1),uYe=B(`<div role="none" class="suffix svelte-dkfcyc"> </div>`),dYe=B(`<div role="none" class="after-input svelte-dkfcyc"></div>`),fYe=B(`<span role="none" class="field inline"><span hidden=""> </span> <!></span>`),pYe=B(`<span class="required" aria-hidden="true">*</span>`),mYe=B(`<!> <!> <!>`,1),hYe=B(`<p class="hint svelte-dkfcyc"></p>`),gYe=B(`<div role="none" class="footer svelte-dkfcyc"><!> <!></div>`),_Ye=B(`<header role="none"><h4 role="none"> </h4> <!> <!> <!> <!></header> <!> <div role="none"><!></div> <!>`,1),vYe={hash:`svelte-dkfcyc`,code:`.field-wrapper.svelte-dkfcyc {&.has-extra-labels {display:flex;align-items:center;justify-content:flex-start;gap:4px;}:is(input[type='text'], textarea) {width:100%;}
/* A native color, date or time input is still styled for a custom field type that renders
one. The built-in editors use Sveltia UI components instead, which have the \`sui\` class and
styles of their own, so they’re left out */input:is([type='color']:not(.sui), [type='number']) {border-width:1px;border-color:var(--sui-primary-border-color);border-radius:var(--sui-control-medium-border-radius);height:var(--sui-button-medium-height);color:inherit;background-color:var(--sui-textbox-background-color);}input:is([type='file'], [type='checkbox']) {color:inherit;}& > div {color:inherit;}input:is([type='date'], [type='datetime-local'], [type='time']):not(.sui) {margin:var(--sui-focus-ring-width);border-width:var(--sui-textbox-border-width, 1px);border-color:var(--sui-primary-border-color);border-radius:var(--sui-control-medium-border-radius);padding:var(--sui-textbox-singleline-padding);width:auto;height:var(--sui-textbox-height);color:var(--sui-textbox-foreground-color);background-color:var(--sui-textbox-background-color);font-family:var(--sui-textbox-font-family);font-size:var(--sui-textbox-font-size);text-transform:uppercase;&:disabled {opacity:0.4;}}input[aria-invalid='true']:is(
[type='color'],
[type='date'],
[type='datetime-local'],
[type='time']
):not(.sui) {border-color:var(--sui-error-border-color);}input:read-only {
/* Make readonly inputs selectable */-webkit-user-select:text;user-select:text;pointer-events:auto;}}.before-input.svelte-dkfcyc,
.after-input.svelte-dkfcyc,
.prefix.svelte-dkfcyc,
.suffix.svelte-dkfcyc {color:var(--sui-secondary-foreground-color);white-space:nowrap;}.hint.svelte-dkfcyc {flex:auto;margin-inline:var(--sui-focus-ring-width) !important;margin-block:var(--sui-focus-ring-width) 0 !important;font-size:var(--sui-font-size-small);line-height:var(--sui-line-height-compact);color:var(--sui-tertiary-foreground-color);}.footer.svelte-dkfcyc {display:flex;gap:16px;justify-content:flex-end;margin-top:4px;}`};function H6(e,t){let n=Eo();O(t,!0),K(e,vYe);let r=e=>{var t=V6(),n=P(t),r=e=>{var t=cYe();Wo(t,()=>xA(z(b)),!0),D(t),U(e,t)};G(n,e=>{z(b)&&e(r)});var i=I(n,2),a=e=>{var t=lYe(),n=F(t,!0);R(()=>W(n,z(v))),U(e,t)};G(i,e=>{z(v)&&e(a)}),U(e,t)},i=e=>{var t=V6(),n=P(t),r=e=>{var t=uYe(),n=F(t,!0);R(()=>W(n,z(y))),U(e,t)};G(n,e=>{z(y)&&e(r)});var i=I(n,2),a=e=>{var t=dYe();Wo(t,()=>xA(z(x)),!0),D(t),U(e,t)};G(i,e=>{z(x)&&e(a)}),U(e,t)},a=si(`field-editor`)??{},o=$M(),s=J(t,`context`,19,()=>a.fieldContext??void 0),c=J(t,`valueStoreKey`,19,()=>a.valueStoreKey??`currentValues`),l=J(t,`inline`,3,!1),u=e=>{if(typeof e==`object`&&e)return;let n=o.current,r=c(),i=t.locale,a=t.keyPath;nN(()=>{n&&(n[r][i][a]=e)})},d=pk(),f=A(()=>u6(c())),p=A(()=>Mr(t.fieldConfig.widget,`string`)),m=A(()=>fB({config:t.fieldConfig,option:`hint`,locale:t.locale})??``),h=A(()=>SM({fieldConfig:t.fieldConfig,locale:t.locale})),g=A(()=>_M(t.fieldConfig)),_=A(()=>iYe(t.fieldConfig)),v=A(()=>z(_).prefix),y=A(()=>z(_).suffix),b=A(()=>z(_).beforeInputLabel),x=A(()=>z(_).afterInputLabel),S=A(()=>z(_).hasExtraLabels),C=A(()=>z(p)===`list`||z(g)),w=A(()=>o.current?.originalValues),T=A(()=>rj(o.current)),ee=A(()=>z(T).i18nEnabled),te=A(()=>z(T).allLocales),ne=A(()=>z(T).defaultLocale),re=A(()=>z(ee)?z(te).filter(e=>e!==t.locale):[]),ie=A(()=>qM(o.current,t.locale,t.keyPath,c())),ae=A(()=>sYe({draft:o.current,fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,valueMap:z(ie),inEditorComponent:z(f)})),oe=A(()=>z(ae).canTranslate),se=A(()=>z(ae).isDuplicated),ce=A(()=>z(ae).areKeysDuplicated),le=A(()=>z(ae).isShown),ue=A(()=>!z(f)&&z(oe)&&z(re).length),de=A(()=>!z(f)&&!z(se)),fe=A(()=>rk.get(z(p))),pe=A(()=>CM({valueMap:z(ie),keyPath:t.keyPath,isList:z(C),isCustomFieldType:!!z(fe)})),me=A(()=>!QJe({currentValueMap:z(ie),originalValueMap:z(w)?.[t.locale]??{},keyPath:t.keyPath})),he=A(()=>o.current?.validities[t.locale][t.keyPath]),ge=A(()=>pB({config:t.fieldConfig,locale:t.locale})),_e=A(()=>eX(o.current?.originalEntry)),ve=A(()=>z1(o.current)),ye=A(()=>z(_e)||z(ve)),be=A(()=>!z(f)&&y2(t.fieldConfig)),xe=A(()=>!!o.current&&C2({fieldConfig:t.fieldConfig,collection:o.current.collection,isIndexFile:o.current.isIndexFile,keyPath:t.keyPath,inEditorComponent:z(f)})),Se=A(()=>z(be)||z(xe)),Ce=A(()=>aYe({fieldConfig:t.fieldConfig,autoSet:z(Se),locked:z(ye),isDuplicated:z(se),isNew:!!o.current?.isNew,parentReadonly:!!a.readonly})),we=A(()=>z(Ce).hidden),Te=A(()=>z(Ce).readonly),Ee=A(()=>z(Ce).subfieldsReadonly);ci(`field-editor`,{fieldContext:s(),parentComponentNames:[...a.parentComponentNames??[],t.componentName].filter(Boolean),extraHint:d,valueStoreKey:c(),get readonly(){return z(Ee)}});let De=A(()=>!z(f)&&!z(Te)&&!z(ce)),Oe=B6(()=>{let e={valueMap:z(ie),fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,defaultLocale:z(ne)};return{restore:GJe({...e,restore:!0}),clear:GJe(e)}}),ke=A(()=>z(he)?.valid===!1),Ae=A(()=>oYe({fieldConfig:t.fieldConfig,inline:l()})),je=A(()=>({locale:t.locale,keyPath:t.keyPath,typedKeyPath:t.typedKeyPath,fieldId:n,fieldLabel:z(ge),fieldConfig:z(Ae),readonly:z(Te),required:z(h),invalid:z(ke)}));var Me=H(),Ne=P(Me),Pe=e=>{let r=A(()=>P8[z(p)]);var i=fYe(),a=N(i),o=F(a,!0);T6(I(a,2),{children:(e,t)=>{var n=H(),i=P(n),a=()=>z(pe),o=e=>u(e);Ko(i,()=>z(r),(e,t)=>{t(e,As(()=>z(je),{get currentValue(){return a()},set currentValue(e){o(e)}}))}),U(e,n)},$$slots:{default:!0}}),D(i),R(()=>{q(i,`data-field-type`,z(p)),q(i,`data-key-path`,t.keyPath),q(i,`data-typed-key-path`,t.typedKeyPath),q(a,`id`,`${n}-label`),W(o,z(ge))}),U(e,i)},Fe=e=>{{let a=A(()=>Y(`x_field`,{values:{field:z(ge)}}));I6(e,{get"aria-label"(){return z(a)},get"data-field-type"(){return z(p)},get"data-key-path"(){return t.keyPath},get"data-typed-key-path"(){return t.typedKeyPath},get hidden(){return z(we)},children:(e,a)=>{var s=_Ye(),c=P(s),l=N(c),f=F(l,!0),g=I(l,2),_=e=>{U(e,pYe())};G(g,e=>{!z(Te)&&z(h)&&e(_)});var v=I(g,2);$l(v,{flex:!0});var y=I(v,2),b=e=>{HJe(e,{size:`small`,get locale(){return t.locale},get otherLocales(){return z(re)},get keyPath(){return t.keyPath}})},x=A(()=>z(ue)&&!z(ve)&&rYe.includes(z(p)));G(y,e=>{z(x)&&e(b)});var C=I(y,2),w=e=>{{let n=e=>{{let n=A(()=>Y(`field_options`));Eu(e,{get ariaLabel(){return z(n)},children:(e,n)=>{var r=V6(),i=P(r),a=e=>{F6(e,{get locale(){return t.locale},get otherLocales(){return z(re)},get keyPath(){return t.keyPath},submenu:!0})};G(i,e=>{z(ue)&&e(a)});var s=I(i,2);{let e=A(()=>!!z(ue)),n=A(()=>({revert:!z(me),...z(De)?Oe.availability:{}}));L6(s,{scope:`field`,get separator(){return z(e)},get available(){return z(n)},onSelect:e=>{let n=o.current;e===`revert`?nYe({draft:n,locale:t.locale,keyPath:t.keyPath}):KJe({draft:n,fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,restore:e===`restore`})}})}U(e,r)},$$slots:{default:!0}})}},r=A(()=>Y(`show_field_options`));Xl(e,{variant:`ghost`,size:`small`,iconic:!0,get disabled(){return z(_e)},popupPosition:`bottom-right`,get"aria-label"(){return z(r)},get onclick(){return Oe.update},get onkeydown(){return Oe.update},popup:n,$$slots:{popup:!0}})}};G(C,e=>{!z(ve)&&(z(ue)||z(de)||z(De))&&e(w)}),D(c);var T=I(c,2),ee=e=>{S6(e,{get id(){return`${n}-error`},children:(e,n)=>{Qr();var r=V();R(e=>W(r,e),[()=>o.current?.validationMessages[t.locale][t.keyPath]?.join(` `)]),U(e,r)},$$slots:{default:!0}})};G(T,e=>{z(he)?.valid===!1&&e(ee)});var te=I(T,2);let ne;T6(N(te),{children:(e,n)=>{var a=H(),o=P(a),s=e=>{var n=mYe(),a=P(n);r(a);var o=I(a,2);{let e=A(()=>({...z(je),fieldConfig:t.fieldConfig}));SGe(o,As(()=>z(e),{get control(){return z(fe).control},get currentValue(){return z(pe)}}))}var s=I(o,2);i(s),U(e,n)},c=e=>{el(e,{status:`warning`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`unsupported_field_type_x`,{values:{name:z(p)}})]),U(e,n)},$$slots:{default:!0}})},l=A(()=>xM(t.fieldConfig)===`unknown`),d=e=>{let t=A(()=>P8[z(p)]);var n=mYe(),a=P(n);r(a);var o=I(a,2),s=()=>z(pe),c=e=>u(e);Ko(o,()=>z(t),(e,t)=>{t(e,As(()=>z(je),{get currentValue(){return s()},set currentValue(e){c(e)}}))});var l=I(o,2);i(l),U(e,n)};G(o,e=>{z(fe)?e(s):z(l)?e(c,1):e(d,-1)}),U(e,a)},$$slots:{default:!0}}),D(te);var ie=I(te,2),ae=e=>{let n=A(()=>d.current);var r=gYe(),i=N(r),a=e=>{var t=hYe();Wo(t,()=>xA(z(m)),!0),D(t),U(e,t)};G(i,e=>{z(m)&&e(a)}),Ko(I(i,2),()=>z(n),(e,n)=>{n(e,{get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get currentValue(){return z(pe)}})}),D(r),U(e,r)};G(ie,e=>{!z(Te)&&(z(m)||d.current)&&e(ae)}),R(()=>{q(l,`id`,`${n}-label`),W(f,z(ge)),ne=os(te,1,`field-wrapper svelte-dkfcyc`,null,ne,{"has-extra-labels":z(S)})}),U(e,s)},$$slots:{default:!0}})}};G(Ne,e=>{o.current&&z(le)&&z(p)!==`hidden`&&l()?e(Pe):o.current&&z(le)&&z(p)!==`hidden`&&e(Fe,1)}),U(e,Me),k()}var yYe=B(`<p class="type-hint svelte-1rz7ywc"></p>`),bYe=B(`<!> <!>`,1),xYe=B(`<div role="none" class="summary svelte-1rz7ywc"><!> <!></div>`),SYe={hash:`svelte-1rz7ywc`,code:`.type-hint.svelte-1rz7ywc {margin:0 !important;padding:12px var(--field-editor-padding) 0;font-size:var(--sui-font-size-small);line-height:var(--sui-line-height-compact);color:var(--sui-tertiary-foreground-color);}.summary.svelte-1rz7ywc {display:flex;align-items:center;gap:8px;padding:8px;}`};function CYe(e,t){O(t,!0),K(e,SYe);let n=J(t,`summaryContent`,3,void 0),r=J(t,`summaryId`,3,void 0),i=J(t,`hint`,3,void 0);var a=H(),o=P(a),s=e=>{el(e,{status:`warning`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`unknown_variable_type`)]),U(e,n)},$$slots:{default:!0}})},c=e=>{var n=bYe(),r=P(n),a=e=>{var t=yYe();Wo(t,()=>xA(i()),!0),D(t),U(e,t)};G(r,e=>{i()&&e(a)}),Bo(I(r,2),17,()=>t.subFields,e=>e.name,(e,n)=>{UO(e,{children:(e,r)=>{{let r=A(()=>t.getSubFieldProps(z(n)));H6(e,As(()=>z(r),{get locale(){return t.locale},get fieldConfig(){return z(n)}}))}},$$slots:{default:!0}})}),U(e,n)},l=e=>{let i=A(()=>n()?``:t.getSummary()),a=A(()=>t.getThumbnail());var o=H(),s=P(o),c=e=>{var t=xYe(),o=N(t),s=e=>{h$(e,{get asset(){return z(a).asset},get src(){return z(a).url},variant:`icon`,cover:!0})};G(o,e=>{z(a)&&e(s)});var c=I(o,2),l=e=>{var t=H();Go(P(t),n),U(e,t)},u=e=>{{let t=A(()=>iG.isSmallScreen?2:1);fl(e,{get lines(){return z(t)},children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(i))),U(e,n)},$$slots:{default:!0}})}};G(c,e=>{n()?e(l):e(u,-1)}),D(t),R(()=>q(t,`id`,r())),U(e,t)};G(s,e=>{(n()||z(i)||z(a))&&e(c)}),U(e,o)};G(o,e=>{t.unknownType?e(s):t.expanded?e(c,1):e(l,-1)}),U(e,a),k()}var wYe=B(`<span role="none" class="position svelte-57h597"> </span>`),TYe=B(`<span role="none" class="type svelte-57h597"> </span>`),EYe=B(`<!> <!>`,1),DYe=B(`<span role="none" class="label svelte-57h597"><!></span>`),OYe=B(`<div role="none" class="header svelte-57h597"><div role="none" class="start svelte-57h597"><!></div> <div role="none" class="center svelte-57h597"><!></div> <div role="none" class="end svelte-57h597"><!></div></div>`),kYe={hash:`svelte-57h597`,code:`.header.svelte-57h597 {display:flex;align-items:center;gap:8px;height:28px;background-color:var(--sui-secondary-border-color);& > div:where(.svelte-57h597) {display:flex;align-items:center;}.start:where(.svelte-57h597) {justify-content:flex-start;width:40%;}.center:where(.svelte-57h597) {justify-content:center;width:20%;}.end:where(.svelte-57h597) {justify-content:flex-end;width:40%;}
/* Make the expander button full-width when there is no other content */&:has(.center:where(.svelte-57h597):empty):has(.end:where(.svelte-57h597):empty) {.start:where(.svelte-57h597) {width:100%;button {justify-content:flex-start;padding:var(--sui-button-small-padding);width:-moz-available;width:-webkit-fill-available;width:stretch;aspect-ratio:auto;}}.center:where(.svelte-57h597),
.end:where(.svelte-57h597) {display:none;}}.label:where(.svelte-57h597) {display:flex;align-items:center;gap:8px;padding:var(--sui-button-small-padding);}.position:where(.svelte-57h597) {min-width:1.5em;font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);font-variant-numeric:tabular-nums;color:var(--sui-secondary-foreground-color);text-align:center;}.type:where(.svelte-57h597) {font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);color:var(--sui-secondary-foreground-color);}}`};function U6(e,t){O(t,!0),K(e,kYe);let n=e=>{var t=EYe(),n=P(t),a=e=>{var t=wYe(),n=F(t,!0);R(()=>W(n,i())),U(e,t)};G(n,e=>{i()!==void 0&&e(a)});var o=I(n,2),s=e=>{var t=TYe(),n=F(t,!0);R(()=>W(n,r())),U(e,t)};G(o,e=>{r()&&e(s)}),U(e,t)},r=J(t,`label`,3,``),i=J(t,`position`,3,void 0),a=J(t,`expanded`,15),o=J(t,`expandable`,3,!0),s=J(t,`centerContent`,3,void 0),c=J(t,`endContent`,3,void 0);var l=OYe(),u=N(l),d=N(u),f=e=>{{let o=e=>{vqe(e,{get expanded(){return a()}})},s=A(()=>!r()&&i()===void 0),c=A(()=>a()?Y(`collapse`):Y(`expand`));Al(e,{size:`small`,get iconic(){return z(s)},get"aria-label"(){return z(c)},get"aria-expanded"(){return a()},get"aria-controls"(){return t.controlId},onclick:()=>{a(!a()),t.toggleExpanded?.()},startIcon:o,children:(e,t)=>{n(e)},$$slots:{startIcon:!0,default:!0}})}},p=e=>{var t=DYe(),r=N(t);n(r),D(t),U(e,t)};G(d,e=>{o()?e(f):e(p,-1)}),D(u);var m=I(u,2);Go(N(m),()=>s()??kr),D(m);var h=I(m,2);Go(N(h),()=>c()??kr),D(h),D(l),U(e,l),k()}var AYe=B(`<span role="none"> </span> <!> <!>`,1);function jYe(e,t){O(t,!0);let n=J(t,`disabled`,3,!1);el(e,{status:`info`,children:(e,r)=>{var i=AYe(),a=P(i),o=F(a,!0),s=I(a,2);$l(s,{flex:!0});var c=I(s,2);{let e=A(()=>Y(`restore`));Al(c,{get id(){return t.id},variant:`secondary`,size:`small`,get label(){return z(e)},get disabled(){return n()},get onclick(){return t.onRestore}})}R(e=>W(o,e),[()=>Y(`item_removed`)]),U(e,i)},$$slots:{default:!0}}),k()}var MYe=new Map,W6=new WeakMap,NYe=e=>{let t=W6.get(e);W6.delete(e),Object.entries(t).forEach(([t,n])=>{e.expanderStates._[t]=n})},PYe=({draft:e,key:t,locale:n,collapsed:r=!1})=>{let i=W6.get(e)?.[t]??e.expanderStates?._[t];if(i!==void 0)return i;if(r===`auto`){let r=e.currentValues?.[n]??{},i=t.replace(/#$/,``),a=PA(MYe,i,()=>RegExp(`^${xE(i)}\\.[^\\.]+$`));return!Object.entries(r).some(([e,t])=>a.test(e)&&!!t)}return!r},G6=(e,t)=>e?.expanderStates?._[t]??!0,K6=({draft:e,stateMap:t})=>{let n=e.expanderStates?._;if(!n)return;let r=W6.get(e),i=Object.entries(t).filter(([e,t])=>(r?.[e]??n[e])!==t);i.length&&(r||(r={},W6.set(e,r),queueMicrotask(()=>NYe(e))),Object.assign(r,Object.fromEntries(i)))},FYe=({collectionName:e,fileName:t,valueMap:n,keyPath:r,isIndexFile:i=!1})=>{let a=new Set,o={collectionName:e,fileName:t,valueMap:n,isIndexFile:i};return r.split(`.`).forEach((e,t,n)=>{let r=n.slice(0,t+1).join(`.`),i=bM({...o,keyPath:r}),s=mM.test(r);if(i?.widget===`object`)s&&a.add(r),a.add(`${r}#`);else if(i?.widget===`list`)a.add(s?r:`${r}#`);else if(t>0){let e=n.slice(0,t).join(`.`),i=bM({...o,keyPath:e});i?.widget===`object`&&`fields`in i&&a.add(`${e}.${i.name}#`),i?.widget===`list`&&(`field`in i||`types`in i)&&a.add(r)}}),[...a]},IYe=({draft:e})=>{let{collectionName:t,fileName:n,currentValues:r,validities:i,isIndexFile:a}=e,o={};Object.entries(i??{}).forEach(([e,i])=>{Object.entries(i).forEach(([i,{valid:s}])=>{s||FYe({collectionName:t,fileName:n,valueMap:r[e],keyPath:i,isIndexFile:a}).forEach(e=>{o[e]=!0})})}),K6({draft:e,stateMap:o})},q6=({locale:e,keyPath:t})=>{window.postMessage({type:`highlight-editor-field`,payload:{locale:e,keyPath:t}},window.location.origin)},LYe=(e,t)=>{let n=t.split(`.`);for(let t=n.length-1;t>=0;--t){let r=n.slice(0,t).join(`.`),i=e.querySelectorAll(r?`.field[data-key-path^="${CSS.escape(`${r}.`)}"]`:`.field[data-key-path]`);if(i.length)return i[i.length-1];let a=r?e.querySelector(`.field[data-key-path="${CSS.escape(r)}"]`):null;if(a)return a}},RYe=async({locale:e,keyPath:t,maxAttempts:n=20,interval:r=100})=>{let i=CSS.escape(t),a=`.field:is([data-key-path="${i}"], [data-validation-key="${i}"])`;await new Promise(e=>{window.requestAnimationFrame(e)});let o=document.querySelector(`.content-editor .pane[data-mode="edit"][data-locale="${CSS.escape(e)}"]`);if(!o)return null;let s;for(let e=0;e<n;e+=1){let e=o.querySelector(a);if(e||!o.isConnected)return e;let n=LYe(o,t);if(!n||n===s)return null;s=n,n.scrollIntoView({block:`center`}),await pl(r)}return o.querySelector(a)},zYe=async({draft:e,locale:t,keyPath:n,isOutdated:r=()=>!1})=>{let{collectionName:i,fileName:a,currentValues:o,isIndexFile:s}=e,c=FYe({collectionName:i,fileName:a,valueMap:o[t]??{},keyPath:n,isIndexFile:s});K6({draft:e,stateMap:Object.fromEntries(c.map(e=>[e,!0]))});let l=await RYe({locale:t,keyPath:n});if(!l||r())return;typeof l.scrollIntoViewIfNeeded==`function`?l.scrollIntoViewIfNeeded():l.scrollIntoView();let u=l.querySelector(`.field-wrapper`);(u?.querySelector(`[contenteditable="true"], [tabindex="0"]`)??u?.querySelector(`input, textarea, button`))?.focus()},BYe=({event:e,locale:t})=>{let n=e.type===`keydown`;if(e.defaultPrevented||n&&e.key!==`Enter`)return;let{target:r}=e,i=(n?r:r.closest?.(`[data-key-path]`))?.getAttribute(`data-key-path`);i&&q6({locale:t,keyPath:i})},VYe=({scrollTop:e,scrollHeight:t,clientHeight:n,targetScrollHeight:r,targetClientHeight:i})=>{let a=t-n;return a<=0?0:Math.max(0,r-i)*(e/a)},HYe=({y:e,top:t,height:n,targetTop:r,targetHeight:i})=>{let a=(e-t)/n;if(!(a<0||a>1))return r+i*a},UYe=(e,t)=>{let n=t.split(`.`);for(let t=n.length;t>0;--t){let r=CSS.escape(n.slice(0,t).join(`.`)),i=e.querySelector(`[data-key-path="${r}"]`);if(i?.getClientRects().length)return i;let a=[...e.querySelectorAll(`[data-lazy-key-path="${r}"]`)].findLast(e=>e.childElementCount&&e.getClientRects().length&&!(i&&e.contains(i)));if(a)return a}},WYe=async({container:e,keyPath:t,scrollTo:n,isOutdated:r=()=>!1,maxAttempts:i=20,interval:a=100})=>{let o;for(let s=0;s<i;s+=1){let i=UYe(e,t);if(i?.dataset.lazyKeyPath===void 0||!n(i)&&i===o)return i;if(o=i,await pl(a),r())return}return UYe(e,t)},GYe=({viewTop:e,viewHeight:t,scrollTop:n,top:r,height:i,always:a=!1})=>{let o=r-e,s=e+t,c=r+i;if(i>t)return!a&&c>e&&r<s?void 0:Math.max(0,n+o);if(!(!a&&r>=e&&c<=s))return Math.max(0,n+o-(t-i)/2)},KYe=e=>e?Number.parseFloat(getComputedStyle(e).top)+e.getBoundingClientRect().height:0,qYe=async({item:e,list:t,isOutdated:n=()=>!1,maxAttempts:r=5,interval:i=100})=>{let a=e.firstElementChild,o=()=>e.getBoundingClientRect().top-t.getBoundingClientRect().top;for(let t=0;t<r;t+=1){e.scrollIntoView();let t=o();if(await pl(i),n()||o()===t||a.getBoundingClientRect().bottom<=window.innerHeight)return}},JYe=async e=>{let t=await PX(e);return new File([t],e.name,{type:t.type})},YYe=({files:e,findExisting:t})=>{let n=new Map;return(r,i,a)=>{let o=n.get(r);return o||(o=(async()=>{let n=await i();if(!n)return;let r=await t?.(n,a);if(r)return r;let o=await OX(n);return e[o]={file:n,folder:a,replace:!1},o})(),n.set(r,o)),o}},XYe=(e,t)=>t?LZ(e,t):[e],ZYe=async({value:e,format:t,rewrite:n})=>{let r=new Map(await Promise.all(XYe(e,t).map(async e=>[e,await n(e)])));return t?NRe(e,r,t):r.get(e)},QYe=(e,t,n)=>{let{fields:r}=e,{types:i,typeKey:a=`type`}=e,o=i?t[a]:void 0;return{fields:rF({value:t,fields:r,types:i,typeKey:a}),typedKeyPath:A0(n,o)}},$Ye=({container:e,key:t,fieldConfig:n,typedKeyPath:r,callback:i})=>{let a=e[t],{widget:o=`string`}=n,s=Rk.includes(o);if(s||Lk.includes(o))(Array.isArray(a)&&!s?a.map((e,t)=>[a,t]):[[e,t]]).forEach(([e,t])=>{let a=e[t];typeof a==`string`&&a&&i({value:a,format:s?bZ(n):void 0,typedKeyPath:r,set:n=>{e[t]=n}})});else if(o===`object`&&E(a))J6({obj:a,...QYe(n,a,r),callback:i});else if(o===`list`&&Array.isArray(a)){let{field:e}=n;a.forEach((t,o)=>{e?$Ye({container:a,key:o,fieldConfig:e,typedKeyPath:`${r}.*.${e.name}`,callback:i}):E(t)&&J6({obj:t,...QYe(n,t,`${r}.*`),callback:i})})}},J6=({obj:e,fields:t,typedKeyPath:n,callback:r})=>{t.forEach(t=>{let{name:i}=t;i in e&&$Ye({container:e,key:i,fieldConfig:t,typedKeyPath:`${n}.${i}`,callback:r})})},eXe=e=>gX(e)&&!/^[a-z][a-z\d+.-]*:/i.test(e),tXe=(e,t)=>{let{field:n}=e,{fields:r}=e,{types:i}=e;return i?nF(i,t):r??[n]},nXe=1,Y6=e=>(Array.isArray(e)?e.forEach(Y6):E(e)&&Object.keys(e).forEach(t=>{ZO(t)?delete e[t]:Y6(e[t])}),e),rXe=({draft:e,valueStoreKey:t=`currentValues`,fieldConfig:n,keyPath:r,typedKeyPath:i,index:a,locale:o,pairedItems:s=!1,componentName:c})=>{let{originalEntry:l,collectionName:u,fileName:d}=e,{hasSingleSubField:f}=V0(n),{field:p}=n,{typeKey:m=`type`}=n,h=s?Object.keys(e[t]):[o],g={format:`sveltia-cms/list-item`,version:nXe,id:crypto.randomUUID(),copiedAt:Date.now(),locale:o,values:{},assets:{}},_=new Map;return h.forEach(o=>{let[s]=wKe(e[t][o],r);if(!(a in s))return;let h=Y6(structuredClone(s[a])),v=f?{[p.name]:h}:h,y={};!f&&`types`in n&&(g.type??=v[m],delete v[m]),J6({obj:v,fields:tXe(n,g.type)??[],typedKeyPath:A0(`${i}.*`,g.type),callback:({value:t,format:n,typedKeyPath:r})=>{XYe(t,n).forEach(t=>{if(t.startsWith(`blob:`)){let n=e.files[t]?.file;n&&_.set(t,n);return}if(!eXe(t)||t in y)return;let n=_X({value:t,entry:l,collectionName:u,fileName:d,componentName:c,typedKeyPath:r,locale:o});n&&(y[t]=n.path)})}}),g.values[o]=v,g.assets[o]=y}),{data:g,files:_}},iXe=e=>{let t;try{t=JSON.parse(e,(e,t)=>e===`__proto__`||ZO(e)?void 0:t)}catch{return}if(!(!E(t)||t.format!==`sveltia-cms/list-item`||t.version!==nXe||typeof t.locale!=`string`||t.copiedAt!==void 0&&typeof t.copiedAt!=`number`||t.type!==void 0&&typeof t.type!=`string`||!E(t.values)||!E(t.values[t.locale])||!Object.values(t.values).every(E)||t.assets!==void 0&&!(E(t.assets)&&Object.values(t.assets).every(E))))return{assets:{},...t}},aXe=e=>typeof e==`string`||typeof e==`number`,oXe=(e,t)=>{let n=TP(e);return Number.isNaN(n)?void 0:OP({inputValue:n,fieldConfig:t})},sXe=(e,t)=>{let{widget:n=`string`}=t;if(e===null)return null;if(n===`boolean`)return typeof e==`boolean`?e:void 0;if(n===`code`)return typeof e==`string`||E(e)?e:void 0;if(n===`keyvalue`)return E(e)?e:void 0;if(!Fk.includes(n)&&!Bk.includes(n))return e;if(aXe(e))return n===`number`?oXe(e,t):Ik.includes(n)||Lk.includes(n)?String(e):e},cXe=(e,t,n)=>{let{widget:r=`string`}=t;if(r===`object`)return E(e)?lXe(e,t,n):void 0;if(r===`list`)return Array.isArray(e)?uXe(e,t,n):void 0;if(_M(t)&&e!==null){let n=(Array.isArray(e)?e:[e]).map(e=>sXe(e,t));return n.includes(void 0)?void 0:n}return sXe(Bk.includes(r)&&Array.isArray(e)&&e.length===1?e[0]:e,t)},X6=(e,t,n)=>{let{locale:r,defaultLocale:i,stats:a}=n,o={},s=0;return t.forEach(t=>{let{name:a}=t;if(a in e){let r=cXe(e[a],t,n);if(r!==void 0){o[a]=r,s+=1;return}}let c=Bj(a6({fields:[t],locale:r,defaultLocale:i}));a in c&&(o[a]=c[a])}),a.dropped+=Object.keys(e).length-s,{value:o,matched:s}},lXe=(e,t,n)=>{let{fields:r,types:i,typeKey:a=`type`}=t;if(!i)return X6(e,r??[],n).value;let{[a]:o,...s}=e,c=nF(i,o);if(c)return{...X6(s,c,n).value,[a]:o}},uXe=(e,t,n)=>{let{field:r,fields:i,types:a}=t;return r?e.flatMap(e=>{let t=cXe(e,r,n);return t===void 0?(n.stats.dropped+=1,[]):[t]}):i||a?e.flatMap(e=>{let r=E(e)?lXe(e,t,n):void 0;return r===void 0?(n.stats.dropped+=1,[]):[r]}):e.flatMap(e=>aXe(e)?[String(e)]:(n.stats.dropped+=1,[]))},dXe=async({draft:e,valueStoreKey:t=`currentValues`,copied:{data:n,files:r},fieldConfig:i,typedKeyPath:a,componentName:o,inEditorComponent:s=!1})=>{let{originalEntry:c,collectionName:l,fileName:u,isIndexFile:d}=e,{hasSingleSubField:f,hasVariableTypes:p}=V0(i),{field:m}=i,h=p?n.type:void 0,g=tXe(i,h);if(!g)return;let _={dropped:0},v=new Set,y={},b=[],x=YYe({files:e.files,findExisting:(t,n)=>O3({draft:e,file:t,folder:n})}),S=(e,t,n)=>x(e,t,n).catch(()=>void 0),C=async({src:t,assetPaths:n,fieldTypedKeyPath:i,locale:a})=>{let s=t.startsWith(`blob:`),f=n[t];if(s&&t in e.files||!s&&!f)return;let p=()=>E3({collectionName:l,fileName:u,componentName:o,typedKeyPath:i,isIndexFile:d});if(s){let e=r.get(t),n=e?p():void 0,i=e&&n?await S(t,async()=>e,n):void 0;return i||v.add(t),i}let m=uX(f);if(!m){v.add(f);return}let h=KX(m,{pathOnly:!0,allowSpecial:!0,entry:c,locale:a});if(h!==void 0)return h===t?void 0:h;let g=p(),_=g?await S(f,()=>JYe(m),g):void 0;return _||v.add(f),_},w=[];if(Object.keys(e[t]).every((t,r)=>{let i=t in n.values?t:n.locale,a=structuredClone(n.values[i]),o={locale:t,defaultLocale:s?t:e.defaultLocale,stats:r?{dropped:0}:_};f&&!(m.name in a)&&Object.keys(a).length===1&&(a={[m.name]:Object.values(a)[0]});let{value:c,matched:l}=X6(a,g,o);return Object.keys(a).length&&!l?!1:(w.push({locale:t,value:c,assetPaths:n.assets[i]??{}}),!0)}))return w.forEach(({locale:t,value:n,assetPaths:r})=>{J6({obj:n,fields:g,typedKeyPath:A0(`${a}.*`,h),callback:({value:n,format:i,typedKeyPath:a,set:o})=>{b.push((async()=>{let s=await ZYe({value:n,format:i,rewrite:e=>C({src:e,assetPaths:r,fieldTypedKeyPath:a,locale:t})});s===void 0?!i&&n.startsWith(`blob:`)&&!(n in e.files)&&o(``):o(s)})())}}),y[t]=f?n[m.name]:n}),await Promise.all(b),{type:h,items:y,droppedCount:_.dropped,missingFileCount:v.size}},Z6,fXe=async e=>{Z6=rXe(e);try{return await navigator.clipboard.writeText(JSON.stringify(Z6.data)),!0}catch{return!1}},pXe=async()=>{let e;try{e=iXe(await navigator.clipboard.readText())}catch{}return e&&e.id!==Z6?.data.id&&!(Z6&&(e.copiedAt??0)<Z6.data.copiedAt)?{data:e,files:new Map}:Z6},Q6=(e,t,n)=>{let{widget:r=`string`}=t;if(r===`uuid`)return typeof e==`string`&&e?PA(n,e,()=>c6(t)):e;if(r===`compute`)return qB(t.value)?``:e;if(r!==`object`&&r!==`list`)return e;let{field:i}=t,{fields:a}=t,{types:o,typeKey:s}=t,c=e=>{E(e)&&mXe(e,rF({value:e,fields:a,types:o,typeKey:s}),n)};return r===`object`?c(e):Array.isArray(e)&&(i?e.forEach((t,r)=>{e[r]=Q6(t,i,n)}):e.forEach(c)),e},mXe=(e,t,n)=>{t.forEach(t=>{let{name:r}=t;r in e&&(e[r]=Q6(e[r],t,n))})},hXe=({draft:e,keyPath:t,itemCount:n,locale:r,collapsed:i,minimizeCollapsed:a=!1})=>({[`${t}#`]:a===`auto`?!n:!a,...Object.fromEntries(Array.from({length:n},(n,a)=>{let o=`${t}.${a}`;return[o,PYe({draft:e,key:o,locale:r,collapsed:i})]}))}),gXe=({valueList:e,keyPath:t,dupIndex:n,sourceItem:r,subFields:i,hasSingleSubField:a,field:o,type:s,types:c,typeKey:l,renewedUuids:u=new Map,locale:d,defaultLocale:f})=>{let p=(()=>{let t=typeof n==`number`&&n in e;if(r!==void 0||t){let s=structuredClone(t?e[n]:r);return a&&o?Q6(s,o,u):(E(s)&&mXe(s,rF({value:s,fields:c?void 0:i,types:c,typeKey:l}),u),s)}let s=Bj(a6({fields:i,locale:d,defaultLocale:f}));return a&&o?s[o.name]:s})();return s&&(p[l]=s),a||(p.__sc_item_id=crypto.randomUUID(),delete p.__sc_item_original_key_path,K0(e,t)),p},$6=(e,t)=>{WQ.current={id:WQ.current.id+1,show:!0,status:e,message:t}},_Xe=({droppedCount:e,missingFileCount:t})=>{if(t)return{status:`warning`,message:Y(`list_item_pasted_without_files`,{values:{count:t}})};if(e)return{status:`info`,message:Y(`list_item_pasted_without_values`,{values:{count:e}})}},vXe=(e,t)=>{let{index:n}=t,r=e.findIndex(e=>e.index>n),i=e.map(e=>e.index>n?{...e,index:e.index-1}:e);return r===-1?[...i,t]:[...i.slice(0,r),t,...i.slice(r)]},yXe=(e,t)=>e.map(e=>e.index>t?{...e,index:e.index+1}:e),bXe=(e,t)=>{let n=e.findIndex(e=>e.id===t);return e.filter((e,t)=>t!==n).map((e,t)=>n!==-1&&t>=n?{...e,index:e.index+1}:e)},xXe=(e,t,n)=>{let r=`${t}.${n}`;return Object.entries(e).filter(([e])=>e.startsWith(r)&&/^[.#]/.test(e.slice(r.length))).map(([e,t])=>[e.slice(r.length),t])},SXe=({getLocale:e,getItemKeys:t})=>{let n=j([]),r=j(void 0),i=A(()=>z(r)?.locale===e()&&(0,yr.default)(z(r).keys,t())?z(n):[]),a=A(()=>Map.groupBy(z(i),({index:e})=>e));return{get shown(){return z(i)},get byIndex(){return z(a)},remember:(t,n)=>{let i=e();n===i&&M(r,{locale:i,keys:t.map((e,n)=>G0(t,n))})},add:e=>{M(n,vXe(z(i),e))},drop:e=>{M(n,bXe(z(i),e))},shift:e=>{M(n,yXe(z(i),e))}}},CXe=({thumbnailFieldName:e,keyPath:t,typedKeyPath:n,hasSingleSubField:r=!1,collectionName:i,fileName:a,componentName:o,valueMap:s,isIndexFile:c=!1,entry:l,files:u,locale:d})=>{if(!e)return;let[f,...p]=_N(e).split(`.`),m={collectionName:i,fileName:a,componentName:o,valueMap:s,isIndexFile:c};if(r&&bM({...m,keyPath:t})?.name!==f)return;let h=r?p:[f,...p],g=[t,...h].filter(Boolean).join(`.`),_=[n,...h].filter(Boolean).join(`.`),v=bM({...m,keyPath:g}),{widget:y=`string`}=v??{};if(!v||!Lk.includes(y))return;let b=v,x=s[lM(b)?`${g}.0`:g];if(typeof x!=`string`||!x)return;let S=mZ({value:x,entry:l,collectionName:i,fileName:a,componentName:o,fieldConfig:b,typedKeyPath:_,locale:d});if(!S)return;let{asset:C,url:w}=S;return C?sV(C)?S:void 0:(w.startsWith(`blob:`)?dV(u?.[w]?.file.type??``):fV(w))===`image`?S:void 0},wXe=({draft:e,typedKeyPath:t,type:n,...r})=>CXe({...r,typedKeyPath:A0(t,n),collectionName:e?.collectionName??``,fileName:e?.fileName,isIndexFile:!!e?.isIndexFile,entry:e?.originalEntry,files:e?.files}),TXe=B(`<div role="none" hidden=""> </div>`),EXe=B(`<!> <!> <!>`,1),DXe=B(`<div><!> <div role="none" class="item-body"><!></div></div>`),OXe=B(`<div role="none" class="item-wrapper svelte-n5zzp2"><!> <!></div>`),kXe=B(`<div role="none" class="removed-item-list svelte-n5zzp2"><!></div>`),AXe=B(`<!> <!> <div role="none"></div> <!> <!>`,1),jXe={hash:`svelte-n5zzp2`,code:`.item-list.svelte-n5zzp2 {display:flex;flex-direction:column;gap:16px;&.collapsed {display:none;}}.item-wrapper.svelte-n5zzp2,
.removed-item-list.svelte-n5zzp2 {display:flex;flex-direction:column;gap:16px;}.removed-item-list.svelte-n5zzp2 {margin-block-start:16px;}.item.svelte-n5zzp2 {flex:none;position:relative;border-width:2px;border-color:var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);background-color:var(--sui-primary-background-color); /* for dragging opacity */&.unknown-type {overflow:hidden;.alert {border-width:0;border-radius:0;}}
/* The dragged item is left as a faint placeholder marking the gap it would drop into. The
pointer already carries the browser’s own drag image of it, so showing it twice at full
strength would just be confusing. */&.dragging {opacity:0.25;}
/* Like the field menus, the buttons at the end of the header (Move Up/Down, options and
remove) are shown on hover, and kept visible while a keyboard user is in the item, so the
focused one isn’t invisible, or while the options menu is open */
@media (hover: hover) {&:not(:hover, :focus-within) > .header > .end button:not([aria-expanded='true']) {opacity:0;}
}}`};function MXe(e,t){let n=Eo();O(t,!0),K(e,jXe);let r=(e,t=kr)=>{var r=H();Bo(P(r),17,()=>je.byIndex.get(t())??[],e=>e.id,(e,t)=>{{let r=A(()=>z(he)||z(Te));jYe(e,{get id(){return`list-${n}-restore-${z(t).id??``}`},get disabled(){return z(r)},onRestore:()=>We(z(t))})}}),U(e,r)},i=$M(),{valueStoreKey:a=`currentValues`,parentComponentNames:o=[]}=si(`field-editor`)??{},s=o.at(-1),c=J(t,`required`,3,!0),l=J(t,`readonly`,3,!1),u=A(()=>t.fieldConfig.name),d=A(()=>t.fieldConfig.i18n),f=A(()=>Mr(t.fieldConfig.allow_add,!0)),p=A(()=>Mr(t.fieldConfig.allow_remove,!0)),m=A(()=>Mr(t.fieldConfig.allow_duplicate,!0)),h=A(()=>Mr(t.fieldConfig.allow_reorder,!0)),g=A(()=>t.fieldConfig.collapsed),_=A(()=>t.fieldConfig.summary),v=A(()=>t.fieldConfig.thumbnail),y=A(()=>Mr(t.fieldConfig.minimize_collapsed,!1)),b=A(()=>Mr(t.fieldConfig.max,1/0)),x=A(()=>Mr(t.fieldConfig.add_to_top,!1)),S=A(()=>fB({config:t.fieldConfig,option:`label`,locale:t.locale})),C=A(()=>fB({config:t.fieldConfig,option:`label_singular`,locale:t.locale})),w=A(()=>t.fieldConfig.field),T=A(()=>t.fieldConfig.fields),ee=A(()=>t.fieldConfig.types),te=A(()=>Mr(t.fieldConfig.typeKey,`type`)),ne=A(()=>V0(t.fieldConfig)),re=A(()=>z(ne).hasSingleSubField),ie=A(()=>z(ne).hasVariableTypes),ae=A(()=>z(ee)??[]),oe=A(()=>z(T)??(z(w)?[z(w)]:[])),se=A(()=>z(re)?CGe(z(w)):void 0),ce=e=>k0({types:z(ie)?z(ae):void 0,fields:z(oe),summary:z(_),type:e}),le=A(()=>!!i.current?.isIndexFile),ue=A(()=>i.current?.collectionName??``),de=A(()=>i.current?.fileName),fe=A(()=>i.current?.defaultLocale),pe=u6(a),me=A(()=>!pe&&H0(t.fieldConfig)),he=A(()=>l()||t.locale!==z(fe)&&(z(d)===`duplicate`||z(me))),ge=A(()=>qM(i.current,t.locale,t.keyPath,a)),_e=A(()=>`${t.keyPath}#`),ve={},ye=A(()=>Kj(ve,z(ge),t.keyPath)??[]),be=A(()=>W0({fieldConfig:t.fieldConfig,itemCount:z(ye).length})),xe=A(()=>z(p)&&!(z(be)&&c()&&!z(ie))),Se=A(()=>z(be)||G6(i.current,z(_e))),Ce=A(()=>z(ye).map((e,n)=>{let r=`${t.keyPath}.${n}`;return[r,G6(i.current,r)]})),we=gk(()=>z(ye).map((e,t)=>G0(z(ye),t))),Te=A(()=>z(ye).length>=z(b)),Ee=A(()=>z(ie)?z(ae).flatMap(({fields:e=[]})=>e):z(oe)),De=A(()=>t.locale===z(fe)||pe||z(Ee).some(({i18n:e})=>R0(e))),Oe=A(()=>z(he)||!z(De)),ke=A(()=>z(h)&&!z(be)),Ae=A(()=>z(he)||z(ye).length<2),je=SXe({getLocale:()=>t.locale,getItemKeys:()=>we.current}),Me=j(void 0),Ne=j(void 0),Pe=j(void 0),Fe,Ie=e=>{i.current&&K6({draft:i.current,stateMap:e})},Le=()=>{let e=i.current;e&&Ie(hXe({draft:e,keyPath:t.keyPath,itemCount:z(ye).length,locale:t.locale,collapsed:z(g),minimizeCollapsed:z(y)}))},Re=e=>{let n=i.current;n&&b6({draft:n,locale:t.locale,i18n:z(d),pairedItems:z(me),valueStoreKey:a,keyPath:t.keyPath,manipulate:e})},ze=e=>z(Me)?.children[e]?.querySelector(`.item`),Be=async({index:e=z(x)?0:z(ye).length,dupIndex:n,type:r,sourceItems:a,replace:o=!1}={})=>{let s=i.current;if(!s)return;let c=new Map;M(Pe,e,!0),o||je.shift(e),Re(({valueList:i,expanderStateList:l,locale:u})=>{let{subFields:d}=ce(r),f=gXe({valueList:i,keyPath:t.keyPath,dupIndex:n,sourceItem:a?.[u],subFields:d,hasSingleSubField:z(re),field:z(w),type:r,types:z(ee),typeKey:z(te),renewedUuids:c,locale:u,defaultLocale:pe?u:s.defaultLocale});i.splice(e,+!!o,f),l.splice(e,+!!o,!0),je.remember(i,u)}),Ie({[z(_e)]:!0}),await pl(50),M(Pe,void 0);let l=ze(e);if(!l)return;let u=KYe(z(Ne));Fe=l,l.style.scrollMarginTop=`${u}px`,l.querySelector(`button`)?.focus({preventScroll:!0}),await qYe({item:l,list:z(Me),isOutdated:()=>l!==Fe})},Ve=async e=>{let n=i.current;n&&(await fXe({draft:n,valueStoreKey:a,fieldConfig:t.fieldConfig,keyPath:t.keyPath,typedKeyPath:t.typedKeyPath,index:e,locale:t.locale,pairedItems:z(me),componentName:s}),$6(`success`,Y(`list_item_copied`)))},He=async(e,{replace:n=!1}={})=>{let r=i.current;if(!r)return;let o=await pXe();if(!o){$6(`info`,Y(`no_list_item_to_paste`));return}let c=await dXe({draft:r,valueStoreKey:a,copied:o,fieldConfig:t.fieldConfig,typedKeyPath:t.typedKeyPath,componentName:s,inEditorComponent:pe});if(i.current!==r)return;if(!c){$6(`error`,Y(`list_item_not_compatible`));return}let{type:l,items:u,droppedCount:d,missingFileCount:f}=c;await Be({index:e,type:l,sourceItems:u,replace:n});let p=_Xe({droppedCount:d,missingFileCount:f});p&&$6(p.status,p.message)},Ue=async e=>{let r=i.current;if(!r)return;let a=crypto.randomUUID(),o={},s={id:a,index:e,values:o,expanded:G6(r,`${t.keyPath}.${e}`),nestedExpanderStates:xXe(r.expanderStates._,t.keyPath,e)};je.add(s),Re(({valueList:n,expanderStateList:r,locale:i})=>{z(re)||K0(n,t.keyPath,{assignIds:!0});let[a]=n.splice(e,1);a!==void 0&&(o[i]=a),r.splice(e,1),je.remember(n,i)}),await pl(50),document.getElementById(`list-${n}-restore-${a}`)?.focus()},We=async({id:e,index:n,values:r,expanded:i,nestedExpanderStates:a})=>{je.drop(e),Re(({valueList:e,expanderStateList:a,locale:o})=>{o in r&&(z(re)||K0(e,t.keyPath),e.splice(n,0,r[o]),a.splice(n,0,i),je.remember(e,o))}),Ie(Object.fromEntries(a.map(([e,r])=>[`${t.keyPath}.${n}${e}`,r]))),await pl(50),ze(n)?.querySelector(`button`)?.focus()},Ge=(e,n)=>{Re(({valueList:r,expanderStateList:i,locale:a})=>{z(re)||K0(r,t.keyPath,{assignIds:!0}),r.splice(n,0,...r.splice(e,1)),i.splice(n,0,...i.splice(e,1)),je.remember(r,a)})},Ke=(e,n)=>qVe({collectionName:z(ue),fileName:z(de),keyPath:t.keyPath,valueMap:z(ge),locale:t.locale,summaryTemplate:n,hasSingleSubField:z(re),index:e,isIndexFile:z(le)}),qe=x6({getItemCount:()=>z(ye).length,getListElement:()=>z(Me),onMove:Ge,getItemData:e=>Ke(e,ce(z(ie)?z(ye)[e][z(te)]:void 0).summaryTemplate),settle:()=>pl(50),getItemRect:e=>e.lastElementChild.getBoundingClientRect()}),Je=e=>(t,n)=>qe.move(e,t,n),Ye=(e,n)=>wXe({draft:i.current,thumbnailFieldName:z(v),keyPath:`${t.keyPath}.${e}`,typedKeyPath:`${t.typedKeyPath}.*`,type:n,hasSingleSubField:z(re),componentName:s,valueMap:z(ge),locale:t.locale}),Xe=()=>{z(ie)&&z(ye).forEach((e,n)=>{let r=e?.[z(te)];ce(r).unknownType&&O0({fieldType:`list`,keyPath:`${t.keyPath}.${n}`,type:r,typeKey:z(te),types:z(ee)})})},Ze=A(()=>({fieldId:n,summaryId:t.summaryId,fieldConfig:t.fieldConfig,locale:t.locale,items:z(ye),fieldName:z(u),label:z(S),labelSingular:z(C),singleItem:z(be),parentExpanded:z(Se),parentExpandedKeyPath:z(_e),itemExpanderStates:z(Ce),allowAdd:z(f),addToTop:z(x),isAddDisabled:z(Oe),hasMaxItems:z(Te),addItem:Be,pasteItem:He,updateExpanderStates:Ie}));js(()=>{Le(),Xe()});var Qe=AXe(),$e=P(Qe),et=e=>{var n=TXe(),r=F(n,!0);R(()=>{q(n,`id`,t.summaryId),W(r,z(C)||z(S)||z(u))}),U(e,n)};G($e,e=>{z(be)&&e(et)});var tt=I($e,2),nt=e=>{wqe(e,As({position:`top`},()=>z(Ze),{get element(){return z(Ne)},set element(e){M(Ne,e,!0)}}))};G(tt,e=>{z(be)&&z(ye).length||e(nt)});var rt=I(tt,2);let it;Bo(rt,31,()=>qe.displayOrder,e=>we.current[e],(e,a,o)=>{let s=A(()=>z(ye)[z(a)]);var c=OXe(),u=N(c);r(u,()=>z(o));var d=I(u,2);{let e=A(()=>z(a)===z(Pe));UO(d,{get eager(){return z(e)},children:(e,r)=>{let c=A(()=>`${t.keyPath}.${z(a)}`),u=A(()=>z(ie)?z(s)[z(te)]:void 0),d=A(()=>ce(z(u))),h=A(()=>G6(i.current,z(c))),g=A(()=>Je(z(a)));var _=DXe();bs(_,(e,t)=>({role:`group`,"aria-label":e,class:`item`,...t,[ms]:{"unknown-type":z(d).unknownType,dragging:qe.dragIndex===z(a)}}),[()=>z(be)?void 0:Y(`list_item_position`,{values:{position:z(o)+1,count:z(ye).length}}),()=>qe.itemProps(z(a),{ownEventsOnly:!0})],void 0,void 0,`svelte-n5zzp2`);var v=N(_);{let e=e=>{var t=H(),n=P(t),r=e=>{v6(e,{get index(){return z(a)},get itemCount(){return z(ye).length},get disabled(){return z(Ae)},icon:`drag_handle`,part:`handle`,onGrab:()=>qe.grab(z(a)),get onRelease(){return qe.release},get onMove(){return z(g)}})};G(n,e=>{z(ke)&&e(r)}),U(e,t)},r=e=>{var n=EXe(),r=P(n),i=e=>{v6(e,{get index(){return z(a)},get itemCount(){return z(ye).length},get disabled(){return z(Ae)},part:`buttons`,menu:!1,get onMove(){return z(g)}})};G(r,e=>{z(ke)&&e(i)});var o=I(r,2);{let e=A(()=>z(ie)?z(ae):void 0),n=A(()=>z(ke)&&!z(he));_qe(o,{get index(){return z(a)},get locale(){return t.locale},get variableTypes(){return z(e)},get unknownType(){return z(d).unknownType},get allowAdd(){return z(f)},get allowRemove(){return z(p)},get allowDuplicate(){return z(m)},get hasMaxItems(){return z(Te)},get isAddDisabled(){return z(Oe)},get itemCount(){return z(ye).length},get canReorder(){return z(n)},get moveItem(){return z(g)},copyItem:Ve,pasteItem:He,addItem:Be})}var s=I(o,2),c=e=>{g$(e,{variant:`ghost`,get disabled(){return z(he)},onclick:()=>Ue(z(a))})};G(s,e=>{z(xe)&&e(c)}),U(e,n)},i=A(()=>z(ie)&&z(d).typeConfig?pB({config:z(d).typeConfig,locale:t.locale}):``),s=A(()=>z(be)?void 0:z(o)+1),l=A(()=>z(d).subFields.length>0);U6(v,{get label(){return z(i)},get position(){return z(s)},get controlId(){return`list-${n}-item-${z(a)??``}-body`},get expanded(){return z(h)},get expandable(){return z(l)},toggleExpanded:()=>Ie({[z(c)]:!z(h)}),centerContent:e,endContent:r,$$slots:{centerContent:!0,endContent:!0}})}var y=I(v,2);{let e=e=>{DGe(e,As({get locale(){return t.locale},get keyPath(){return z(n)},get typedKeyPath(){return`${t.typedKeyPath??``}.*`},get currentValue(){return z(s)}},()=>({fieldConfig:z(w),preview:z(se)})))},n=A(()=>`${t.keyPath}.${z(a)}`),r=A(()=>z(ie)?z(s)[z(te)]:void 0),o=A(()=>ce(z(r))),c=A(()=>G6(i.current,z(n)));var b=N(y);{let i=A(()=>l()||!z(o).typeConfig?void 0:fB({config:z(o).typeConfig,option:`hint`,locale:t.locale})),s=A(()=>z(se)?e:void 0);CYe(b,{get locale(){return t.locale},get subFields(){return z(o).subFields},getSubFieldProps:e=>({keyPath:z(re)?z(n):`${z(n)}.${e.name}`,typedKeyPath:j0({typedKeyPath:`${t.typedKeyPath}.*`,type:z(r),subFieldName:e.name}),context:z(re)?`single-subfield-list-field`:void 0}),get expanded(){return z(c)},get unknownType(){return z(o).unknownType},get hint(){return z(i)},getSummary:()=>Ke(z(a),z(o).summaryTemplate),getThumbnail:()=>Ye(z(a),z(r)),get summaryContent(){return z(s)}})}D(y)}D(_),R(()=>q(y,`id`,`list-${n}-item-${z(a)??``}-body`)),U(e,_)},$$slots:{default:!0}})}D(c),Zo(c,()=>Bu,()=>({duration:200})),U(e,c)}),D(rt),Ds(rt,e=>M(Me,e),()=>z(Me));var at=I(rt,2),eee=e=>{var t=kXe(),n=N(t);r(n,()=>z(ye).length),D(t),U(e,t)},tee=A(()=>je.byIndex.has(z(ye).length)&&(z(Se)||!z(ye).length));G(at,e=>{z(tee)&&e(eee)});var ot=I(at,2),st=e=>{wqe(e,As({position:`bottom`},()=>z(Ze)))};G(ot,e=>{z(f)&&!z(x)&&z(ye).length&&z(Se)&&!z(Te)&&e(st)}),R(()=>{q(rt,`id`,`list-${n}-item-list`),it=os(rt,1,`item-list svelte-n5zzp2`,null,it,{collapsed:!z(Se)})}),yo(`dragover`,rt,function(...e){qe.onDragOver?.apply(this,e)},!0),yo(`drop`,rt,function(...e){qe.onDrop?.apply(this,e)},!0),U(e,Qe),k()}var NXe=B(`<div><!> <!> <!></div>`),PXe=B(`<div role="none" class="toolbar svelte-60yaxc"><!></div>`),FXe=B(`<div role="none" class="item-list svelte-60yaxc"></div> <!>`,1),IXe={hash:`svelte-60yaxc`,code:`.item-list.svelte-60yaxc {display:flex;flex-direction:column;gap:4px;}.toolbar.svelte-60yaxc {display:flex;align-items:center;margin-block-start:8px;}.item.svelte-60yaxc {display:flex;align-items:center;gap:4px;
/* The dragged row is left as a faint placeholder marking the gap it would drop into. The
pointer already carries the browser’s own drag image of it, so showing it twice at full
strength would just be confusing. */&.dragging {opacity:0.25;}}`};function LXe(e,t){O(t,!0),K(e,IXe);let{valueStoreKey:n=`currentValues`}=si(`field-editor`)??{},r=$M(),i=J(t,`required`,3,!0),a=J(t,`readonly`,3,!1),o=J(t,`invalid`,3,!1),s=$Ke([``]),c=j(void 0),l=A(()=>t.fieldConfig.i18n),u=A(()=>Mr(t.fieldConfig.max,1/0)),d=A(()=>!a()),f=A(()=>s.values.length>1),p=A(()=>W0({fieldConfig:t.fieldConfig,itemCount:s.values.length})),m=()=>s.values.map(e=>e.trim()).filter(Boolean),h=()=>{let e=t.currentValue??[];(0,yr.default)(m(),e)||s.replace(e.length?[...e]:[``])},g=()=>{let e=r.current,i=m();e&&((0,yr.default)(i,t.currentValue??[])||hGe({draft:e,valueStoreKey:n,locale:t.locale,keyPath:t.keyPath,i18n:z(l),value:i}))},_=e=>z(c)?.children[e]?.querySelector(`input`),v=async e=>{s.insert(e,``),await co(),_(e)?.focus()},y=async e=>{s.remove(e),await co(),h6({index:e,getTarget:_})},b=x6({getItemCount:()=>s.values.length,getListElement:()=>z(c),onMove:(e,t)=>{s.move(e,t)},getItemData:e=>s.values[e]});vk(()=>t.currentValue,()=>{h()}),vk(()=>ni(s.values),()=>{g()});var x=FXe(),S=P(x);Bo(S,29,()=>b.displayOrder,e=>s.ids[e],(e,n)=>{var r=NXe();bs(r,e=>({role:`none`,class:`item`,...e,[ms]:{dragging:b.dragIndex===z(n)}}),[()=>b.itemProps(z(n))],void 0,void 0,`svelte-60yaxc`);var c=N(r),l=e=>{{let t=A(()=>!z(f));v6(e,{get index(){return z(n)},get itemCount(){return s.values.length},get disabled(){return z(t)},onGrab:()=>b.grab(z(n)),get onRelease(){return b.release},onMove:(e,t)=>b.move(z(n),e,t)})}};G(c,e=>{z(d)&&!z(p)&&e(l)});var m=I(c,2);{let e=A(()=>GA(t.locale)),r=A(()=>i()&&s.values.length===1),c=A(()=>Y(`list_item_value`));fu(m,{get dir(){return z(e)},flex:!0,get readonly(){return a()},get invalid(){return o()},get required(){return z(r)},get ariaLabel(){return z(c)},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onkeydown:e=>{e.key!==`Enter`||e.isComposing||!z(d)||s.values.length>=z(u)||(e.preventDefault(),v(z(n)+1))},get value(){return s.values[z(n)]},set value(e){s.values[z(n)]=e}})}var h=I(m,2),g=e=>{{let t=A(()=>!z(f));g$(e,{variant:`ghost`,get disabled(){return z(t)},onclick:()=>{y(z(n))}})}};G(h,e=>{z(d)&&!z(p)&&e(g)}),D(r),Zo(r,()=>Bu,()=>({duration:200})),U(e,r)}),D(S),Ds(S,e=>M(c,e),()=>z(c));var C=I(S,2),w=e=>{var n=PXe();C6(N(n),{get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},get items(){return s.values},addItem:()=>v(s.values.length)}),D(n),U(e,n)};G(C,e=>{z(d)&&s.values.length<z(u)&&e(w)}),yo(`dragover`,S,function(...e){b.onDragOver?.apply(this,e)},!0),yo(`drop`,S,function(...e){b.onDrop?.apply(this,e)},!0),U(e,x),k()}var RXe=new Set([`$$slots`,`$$events`,`$$legacy`,`fieldConfig`]);function zXe(e,t){let n=Eo();O(t,!0);let r=ks(t,RXe),i=`list-${n}-summary`,a=A(()=>V0(t.fieldConfig)),o=A(()=>z(a).hasSubFields);{let n=A(()=>z(o)?i:void 0);HO(e,{get"aria-labelledby"(){return z(n)},children:(e,n)=>{var a=H(),s=P(a),c=e=>{{let n=A(()=>({...r,fieldConfig:t.fieldConfig,summaryId:i}));MXe(e,As(()=>z(n)))}},l=e=>{{let n=A(()=>({...r,fieldConfig:t.fieldConfig}));LXe(e,As(()=>z(n)))}};G(s,e=>{z(o)?e(c):e(l,-1)}),U(e,a)},$$slots:{default:!0}})}k()}var BXe=B(`<div role="none" class="header svelte-ygwzbn"> </div>`),VXe=B(`<div role="group" class="subsection svelte-ygwzbn"><!> <div role="none" class="items svelte-ygwzbn"><!></div></div>`),HXe={hash:`svelte-ygwzbn`,code:`.subsection.svelte-ygwzbn {margin:16px auto;border:2px solid var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);.title {font-size:inherit;font-weight:var(--sui-font-weight-normal);}}.header.svelte-ygwzbn {display:flex;align-items:center;height:24px;padding-inline:8px;color:var(--sui-secondary-foreground-color);background-color:var(--sui-secondary-border-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);}.items.svelte-ygwzbn {padding:8px 16px;
/* Hide when no subfield is shown, leaving only the empty wrappers marking the subfields */&:not(:has(> :not(:empty))) {display:none;}}`};function UXe(e,t){let n=Eo();K(e,HXe);let r=`${n}-header`;var i=VXe(),a=N(i),o=e=>{var n=BXe(),i=F(n,!0);R(()=>{q(n,`id`,r),W(i,t.label)}),U(e,n)};G(a,e=>{t.label&&e(o)});var s=I(a,2);Go(N(s),()=>t.children??kr),D(s),D(i),R(()=>q(i,`aria-labelledby`,t.label?r:void 0)),U(e,i)}var WXe=B(`<h4 class="svelte-s650n2"> </h4>`),GXe=B(`<section role="group" tabindex="0" class="svelte-s650n2"><!> <!></section>`),KXe={hash:`svelte-s650n2`,code:`[role='document'] section.svelte-s650n2 {overflow:hidden;
/* Don’t set margin here because it makes scroll sync bumpy */padding:12px 0;h4:where(.svelte-s650n2) {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);&:not(:last-child) {margin-bottom:8px;}}& > * {margin-inline:auto;max-width:768px;}p {margin:8px auto 0;-webkit-user-select:text;user-select:text;}img {max-height:800px !important;}.sui.alert {margin-block:16px;}}
@media (width < 768px) {
/* A top-level field, which is wrapped for the Edit Pane to find it before it’s rendered */[role='document'] > [data-lazy-key-path] {& > section.svelte-s650n2:is([data-field-type='file']:where(.svelte-s650n2), [data-field-type='image']:where(.svelte-s650n2)):has(img),
& > section.svelte-s650n2:is([data-field-type='string']:where(.svelte-s650n2)):has(iframe) {overflow:visible;}& > section.svelte-s650n2:is([data-field-type='file']:where(.svelte-s650n2), [data-field-type='image']:where(.svelte-s650n2)) img {width:100%;max-height:none !important;}}
}`};function e8(e,t){O(t,!0),K(e,KXe);let n=$M(),r=J(t,`showLabel`,3,!0),i=A(()=>Mr(t.fieldConfig.widget,`string`)),a=A(()=>Mr(t.fieldConfig.preview,!0)),o=A(()=>pB({config:t.fieldConfig,locale:t.locale})),s=A(()=>_M(t.fieldConfig)),c=A(()=>z(i)===`list`||z(s)),l=A(()=>qM(n.current,t.locale,t.keyPath)),u=A(()=>sYe({draft:n.current,fieldConfig:t.fieldConfig,keyPath:t.keyPath,locale:t.locale,valueMap:z(l)})),d=A(()=>z(u).isShown),f=A(()=>rk.get(z(i))),p=A(()=>CM({valueMap:z(l),keyPath:t.keyPath,isList:z(c),isCustomFieldType:!!z(f)})),m=A(()=>({locale:t.locale,keyPath:t.keyPath,typedKeyPath:t.typedKeyPath,fieldConfig:t.fieldConfig,currentValue:z(p)}));var h=H(),g=P(h),_=e=>{var n=GXe(),a=N(n),s=e=>{var t=WXe(),n=F(t,!0);R(()=>W(n,z(o))),U(e,t)};G(a,e=>{r()&&e(s)}),T6(I(a,2),{children:(e,n)=>{var r=H(),a=P(r),o=e=>{{let n=A(()=>({...z(m),fieldConfig:t.fieldConfig}));DGe(e,As(()=>z(n),{get preview(){return z(f).preview}}))}},s=e=>{let t=A(()=>F8[z(i)]);var n=H();Ko(P(n),()=>z(t),(e,t)=>{t(e,As(()=>z(m)))}),U(e,n)};G(a,e=>{z(f)?.preview?e(o):z(i)in F8&&e(s,1)}),U(e,r)},$$slots:{default:!0}}),D(n),R(()=>{q(n,`data-field-type`,z(i)),q(n,`data-key-path`,t.keyPath),q(n,`data-typed-key-path`,t.typedKeyPath)}),bo(`keydown`,n,e=>{e.key===`Enter`&&(e.stopPropagation(),q6({locale:t.locale,keyPath:t.keyPath}))}),bo(`click`,n,e=>{e.stopPropagation(),q6({locale:t.locale,keyPath:t.keyPath})}),U(e,n)};G(g,e=>{t.fieldConfig&&z(i)!==`hidden`&&z(a)&&z(d)&&e(_)}),U(e,h),k()}xo([`keydown`,`click`]);var qXe=B(`<div role="none"><!></div>`);function JXe(e,t){O(t,!0);let n=$M(),r=A(()=>t.fieldConfig.field),i=A(()=>t.fieldConfig.fields),a=A(()=>t.fieldConfig.types),o=A(()=>Mr(t.fieldConfig.typeKey,`type`)),s=A(()=>V0(t.fieldConfig)),c=A(()=>z(s).hasSingleSubField),l=A(()=>z(s).hasVariableTypes),u=A(()=>z(i)??(z(r)?[z(r)]:[])),d={},f=A(()=>Kj(d,qM(n.current,t.locale,t.keyPath),t.keyPath)??[]),p=A(()=>z(f).map(e=>z(l)?e[z(o)]:void 0));var m=H();Bo(P(m),19,()=>z(p),(e,t)=>G0(z(f),t),(e,n,r)=>{let i=A(()=>`${t.keyPath}.${z(r)}`);var o=qXe();UO(N(o),{children:(e,r)=>{let o=A(()=>k0({types:z(l)?z(a):void 0,fields:z(u),type:z(n)}));var s=H(),d=P(s),f=e=>{},p=e=>{let r=A(()=>z(o).typeConfig?pB({config:z(o).typeConfig,locale:t.locale}):void 0);UXe(e,{get label(){return z(r)},children:(e,r)=>{var a=H();Bo(P(a),17,()=>z(o).subFields,e=>e.name,(e,r)=>{let a=A(()=>z(c)?z(i):`${z(i)}.${z(r).name}`);var o=qXe();UO(N(o),{children:(e,i)=>{{let i=A(()=>j0({typedKeyPath:`${t.typedKeyPath}.*`,type:z(n),subFieldName:z(r).name}));e8(e,{get keyPath(){return z(a)},get typedKeyPath(){return z(i)},get locale(){return t.locale},get fieldConfig(){return z(r)}})}},$$slots:{default:!0}}),D(o),R(()=>q(o,`data-lazy-key-path`,z(a))),U(e,o)}),U(e,a)},$$slots:{default:!0}})};G(d,e=>{z(o).unknownType?e(f):e(p,-1)}),U(e,s)},$$slots:{default:!0}}),D(o),R(()=>q(o,`data-lazy-key-path`,z(i))),U(e,o)}),U(e,m),k()}var YXe=B(`<li> </li>`),XXe=B(`<ul></ul>`);function ZXe(e,t){O(t,!0);var n=H(),r=P(n),i=e=>{var n=XXe();Bo(n,23,()=>t.currentValue,(e,t)=>`${e}-${t}`,(e,t)=>{var n=YXe(),r=F(n,!0);R(()=>W(r,z(t))),U(e,n)}),D(n),R((e,t)=>{q(n,`lang`,e),q(n,`dir`,t),n.dir=n.dir},[()=>WA(t.locale),()=>GA(t.locale)]),U(e,n)},a=A(()=>Array.isArray(t.currentValue)&&t.currentValue.length);G(r,e=>{z(a)&&e(i)}),U(e,n),k()}var QXe=new Set([`$$slots`,`$$events`,`$$legacy`,`fieldConfig`]);function $Xe(e,t){O(t,!0);let n=ks(t,QXe);var r=H(),i=P(r),a=e=>{{let r=A(()=>({...n,fieldConfig:t.fieldConfig}));JXe(e,As(()=>z(r)))}},o=A(()=>V0(t.fieldConfig).hasSubFields),s=e=>{{let r=A(()=>({...n,fieldConfig:t.fieldConfig}));ZXe(e,As(()=>z(r)))}};G(i,e=>{z(o)?e(a):e(s,-1)}),U(e,r),k()}var eZe=new Set([`$$slots`,`$$events`,`$$legacy`,`coordinates`,`class`,`mapElement`,`onReady`]),tZe=B(`<div></div>`),nZe={hash:`svelte-1c5gj1k`,code:`
/* Leaflet default styles copied from \`node_modules/leaflet/dist/leaflet.css\`. Somehow we can’t */
/* import it directly here; Vite emits it as a separate CSS file, which we want to avoid. */
/* Rules for the features we don’t use — popups, tooltips, the Layers and Scale controls, */
/* image/video overlays, div icons, marker shadows, the Canvas renderer and the legacy IE/VML */
/* hacks — have been dropped. */.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-zoom-box,
.leaflet-layer {position:absolute;left:0;top:0;}.leaflet-container {overflow:hidden;-webkit-tap-highlight-color:transparent;background:#ddd;outline-offset:1px;font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5;}.leaflet-tile,
.leaflet-marker-icon {-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none;}.leaflet-tile::selection {background:transparent;}.leaflet-safari .leaflet-tile {image-rendering:-webkit-optimize-contrast;}.leaflet-safari .leaflet-tile-container {width:1600px;height:1600px;-webkit-transform-origin:0 0;transform-origin:0 0;}.leaflet-marker-icon {display:block;}.leaflet-container .leaflet-overlay-pane svg {max-width:none !important;max-height:none !important;}.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container .leaflet-tile {max-width:none !important;max-height:none !important;width:auto;padding:0;}.leaflet-container img.leaflet-tile {mix-blend-mode:plus-lighter;}.leaflet-container.leaflet-touch-zoom {-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y;}.leaflet-container.leaflet-touch-drag {-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom;}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {-ms-touch-action:none;touch-action:none;}.leaflet-container a {-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4);color:#0078a8;}.leaflet-tile {filter:inherit;visibility:hidden;}.leaflet-tile-loaded {visibility:inherit;}.leaflet-zoom-box {width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800;border:2px dotted #38f;background:rgba(255, 255, 255, 0.5);}.leaflet-overlay-pane svg {-moz-user-select:none;user-select:none;}.leaflet-pane {z-index:400;}.leaflet-tile-pane {z-index:200;}.leaflet-overlay-pane {z-index:400;}.leaflet-marker-pane {z-index:600;}.leaflet-map-pane svg {z-index:200;}.leaflet-control {position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto;float:left;clear:both;cursor:auto;}.leaflet-top,
.leaflet-bottom {position:absolute;z-index:1000;pointer-events:none;}.leaflet-top {top:0;}.leaflet-right {right:0;}.leaflet-bottom {bottom:0;}.leaflet-left {left:0;}.leaflet-right .leaflet-control {float:right;margin-right:10px;}.leaflet-top .leaflet-control {margin-top:10px;}.leaflet-bottom .leaflet-control {margin-bottom:10px;}.leaflet-left .leaflet-control {margin-left:10px;}.leaflet-zoom-animated {-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;}svg.leaflet-zoom-animated {will-change:transform;}.leaflet-zoom-anim .leaflet-zoom-animated {-webkit-transition:-webkit-transform 0.25s cubic-bezier(0, 0, 0.25, 1);-moz-transition:-moz-transform 0.25s cubic-bezier(0, 0, 0.25, 1);transition:transform 0.25s cubic-bezier(0, 0, 0.25, 1);}.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {-webkit-transition:none;-moz-transition:none;transition:none;}.leaflet-zoom-anim .leaflet-zoom-hide {visibility:hidden;}.leaflet-interactive {cursor:pointer;}.leaflet-grab {
/* stylelint-disable-next-line declaration-property-value-no-unknown */cursor:-webkit-grab;
/* stylelint-disable-next-line declaration-property-value-no-unknown */cursor:-moz-grab;cursor:grab;}.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {cursor:crosshair;}.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive {cursor:move;
/* stylelint-disable-next-line declaration-property-value-no-unknown */cursor:-webkit-grabbing;
/* stylelint-disable-next-line declaration-property-value-no-unknown */cursor:-moz-grabbing;cursor:grabbing;}.leaflet-marker-icon,
.leaflet-pane > svg path,
.leaflet-tile-container {pointer-events:none;}.leaflet-marker-icon.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive {pointer-events:visiblePainted;pointer-events:auto;}.leaflet-bar {box-shadow:0 1px 5px rgba(0, 0, 0, 0.65);border-radius:4px;}.leaflet-bar a {background-color:#fff;background-position:50% 50%;background-repeat:no-repeat;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black;}.leaflet-bar a:hover,
.leaflet-bar a:focus {background-color:#f4f4f4;}.leaflet-bar a:first-child {border-top-left-radius:4px;border-top-right-radius:4px;}.leaflet-bar a:last-child {border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none;}.leaflet-bar a.leaflet-disabled {cursor:default;background-color:#f4f4f4;color:#bbb;}.leaflet-touch .leaflet-bar a {width:30px;height:30px;line-height:30px;}.leaflet-touch .leaflet-bar a:first-child {border-top-left-radius:2px;border-top-right-radius:2px;}.leaflet-touch .leaflet-bar a:last-child {border-bottom-left-radius:2px;border-bottom-right-radius:2px;}.leaflet-control-zoom-in,
.leaflet-control-zoom-out {font:bold 18px 'Lucida Console',
Monaco,
monospace;text-indent:1px;}.leaflet-touch .leaflet-control-zoom-in,
.leaflet-touch .leaflet-control-zoom-out {font-size:22px;}.leaflet-container .leaflet-control-attribution {background:#fff;background:rgba(255, 255, 255, 0.8);margin:0;}.leaflet-control-attribution {padding:0 5px;color:#333;line-height:1.4;}.leaflet-control-attribution a {text-decoration:none;}.leaflet-control-attribution a:hover,
.leaflet-control-attribution a:focus {text-decoration:underline;}.leaflet-attribution-flag {display:inline !important;vertical-align:baseline !important;width:1em;height:0.6669em;}.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-bar {box-shadow:none;}.leaflet-touch .leaflet-bar {border:2px solid rgba(0, 0, 0, 0.2);background-clip:padding-box;}.map.svelte-1c5gj1k {margin:var(--sui-focus-ring-width);border:1px solid var(--sui-textbox-border-color);border-radius:var(--sui-textbox-border-radius);overflow:hidden;aspect-ratio:1 / 1;background-clip:text;}.leaflet-container {font-family:inherit !important;font-size:var(--sui-font-size-small) !important;}.leaflet-container a {color:var(--sui-primary-accent-color-text) !important;text-decoration:none !important;}.leaflet-bar a {border-color:var(--sui-button-border-color) !important;color:var(--sui-secondary-foreground-color) !important;background-color:var(--sui-button-background-color) !important;}.leaflet-control {color:var(--sui-secondary-foreground-color) !important;background-color:var(--sui-secondary-background-color-translucent) !important;}.leaflet-control-attribution {padding:4px 8px;}
/* Dark theme: https://stackoverflow.com/q/59819792 */:root[data-theme='dark'] .leaflet-layer {filter:invert(100%) hue-rotate(180deg);}`};function rZe(e,t){O(t,!0),K(e,nZe);let n=J(t,`class`,3,``),r=J(t,`mapElement`,15),i=J(t,`onReady`,3,void 0),a=ks(t,eZe),o,s=!1,c=j(void 0),l,u,d=()=>{let{latitude:e,longitude:n}=t.coordinates??{};if(e===u?.latitude&&n===u?.longitude)return;let{leaflet:r,map:i,iconUrl:a}=z(c);if(u=t.coordinates,l?.remove(),l=void 0,t.coordinates){let e=r.icon({iconUrl:a,iconSize:[25,41]});l=r.marker([t.coordinates.latitude,t.coordinates.longitude],{icon:e}).addTo(i),i.setView([t.coordinates.latitude,t.coordinates.longitude],12)}},f=async()=>{if(!r())return;let e=await RN(`leaflet`,`dist/leaflet-src.esm.js`),t=await nSe();if(s)return;let n=e.map(r(),{center:[0,0],zoom:2});e.tileLayer(`https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`,{attribution:`&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors`,referrerPolicy:`strict-origin`}).addTo(n),M(c,{leaflet:e,map:n,iconUrl:t}),d(),r().querySelectorAll(`a[href^="https:"]`).forEach(e=>{e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)}),o=new ResizeObserver(()=>{n?.invalidateSize()}),o.observe(r()),i()?.({leaflet:e,map:n})};L(()=>{z(c),t.coordinates?.latitude,t.coordinates?.longitude,fo(()=>{z(c)&&d()})}),js(()=>(f(),()=>{s=!0,o?.disconnect(),z(c)&&(z(c).map._animatingZoom=!1,z(c).map.remove())}));var p=tZe();bs(p,e=>({role:`application`,class:`map ${n()??``}`,"aria-label":e,...a}),[()=>t.coordinates?Y(`map_lat_lng`,{values:t.coordinates}):void 0],void 0,void 0,`svelte-1c5gj1k`),Ds(p,e=>r(e),()=>r()),U(e,p),k()}var iZe=e=>Array.isArray(e)&&e.length>=2&&e.every(e=>typeof e==`number`&&Number.isFinite(e)),aZe=e=>Array.isArray(e)&&e.every(iZe),oZe=(e,t)=>t===`Point`?iZe(e):t===`LineString`?aZe(e):Array.isArray(e)&&e.every(aZe),sZe=(e,t=`Point`)=>{try{let n=JSON.parse(e);return E(n)&&n.type===t&&oZe(n.coordinates,t)?n:void 0}catch{return}},cZe=(e,t)=>!!sZe(e,t),lZe=(e,t)=>e.map(e=>Array.isArray(e)?e.map(e=>Array.isArray(e)?e.map(e=>pM(e,t)):pM(e,t)):pM(e,t)),uZe=e=>{if(e.type===`Point`)return null;let t=e.type===`Polygon`?e.coordinates.flat(1):e.coordinates;if(!t.every(e=>Array.isArray(e)&&typeof e[0]==`number`&&typeof e[1]==`number`))return null;let n=t.map(e=>e[1]),r=t.map(e=>e[0]);return[[Math.min(...n),Math.min(...r)],[Math.max(...n),Math.max(...r)]]},dZe=({snapshot:e,changeType:t,geometryType:n=`Point`,decimals:r})=>{let i=e.at(-1);if(i&&t===(n===`Point`?`create`:`delete`))return{value:JSON.stringify({type:n,coordinates:lZe(i.geometry.coordinates,r)}),staleIds:e.filter(e=>e.id!==i.id).map(e=>e.id)}},fZe=(e,t)=>{if(t.type===`Point`){let[n,r]=t.coordinates;typeof n==`number`&&typeof r==`number`&&e.setView([r,n],15);return}let n=uZe(t);n&&e.fitBounds(n)},pZe=async({leaflet:e,map:t,geometryType:n=`Point`,decimals:r,onChange:i,isCancelled:a})=>{let{TerraDraw:o,TerraDrawLineStringMode:s,TerraDrawPointMode:c,TerraDrawPolygonMode:l}=await RN(`terra-draw`,`dist/terra-draw.module.js`),{TerraDrawLeafletAdapter:u}=await RN(`terra-draw-leaflet-adapter`,`dist/terra-draw-leaflet-adapter.module.js?module`);if(a())return;let d={Point:c,LineString:s,Polygon:l}[n],f=n.toLowerCase(),p=new o({adapter:new u({lib:e,map:t}),modes:[new d]});p.start(),p.setMode(f),p.on(`change`,(e,t,a)=>{if(a&&`origin`in a)return;let o=dZe({snapshot:p.getSnapshot(),changeType:t,geometryType:n,decimals:r});o&&(i(o.value),o.staleIds.length&&p.removeFeatures(o.staleIds))});let m=(e,t)=>{p.clear(),p.addFeatures([{type:`Feature`,geometry:e,properties:{mode:t}}])};return{showGeometry:e=>{e?(m(e,f),fZe(t,e)):p.clear()},showDefaultView:({center:e,zoom:n})=>{t.setView(e?[e[1],e[0]]:[0,0],n??2)},setLocation:({latitude:e,longitude:i})=>{if(e=pM(e,r),i=pM(i,r),t.setView([e,i],15),n!==`Point`)return;let a={type:`Point`,coordinates:[i,e]};return m(a,`point`),JSON.stringify(a)},stop:()=>{p.stop()}}},mZe=`https://nominatim.openstreetmap.org/search`,hZe=async e=>{let t=e.trim();if(!t)return[];let n=new URLSearchParams({q:t,format:`jsonv2`});try{return await rG(`${mZe}?${n}`)}catch{return[]}},gZe=class extends Error{constructor(){super(`Geolocation is not supported`),this.name=`GeolocationUnsupportedError`}},_Ze=()=>new Promise((e,t)=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(({coords:{latitude:t,longitude:n}})=>{e({latitude:t,longitude:n})},t):t(new gZe)}),vZe=B(`<div role="alert" class="search-result searching svelte-ktr5k7"> </div>`),yZe=B(`<div role="alert" class="search-result no-result svelte-ktr5k7"> </div>`),bZe=B(`<div role="none" class="toolbar svelte-ktr5k7"><!> <!> <!></div> <!> <div class="map-wrapper svelte-ktr5k7"><!></div> <!>`,1),xZe={hash:`svelte-ktr5k7`,code:`.toolbar.svelte-ktr5k7 {display:flex;align-items:center;margin-bottom:var(--sui-spacing-2x);}.search-result.svelte-ktr5k7 {padding:12px;color:var(--sui-secondary-foreground-color);}.map-wrapper.svelte-ktr5k7 {display:contents;.map {aspect-ratio:auto;height:400px;&.invalid {border-color:var(--sui-error-border-color);}}}`};function SZe(e,t){O(t,!0),K(e,xZe);let n=J(t,`currentValue`,15),r=J(t,`readonly`,3,!1),i=J(t,`invalid`,3,!1),a=A(()=>Mr(t.fieldConfig.decimals,7)),o=A(()=>Mr(t.fieldConfig.type,`Point`)),s=A(()=>t.fieldConfig.center),c=A(()=>t.fieldConfig.zoom),l=j(void 0),u=j(void 0),d=j(void 0),f=j(``),p=j(``),m=j(void 0),h=j(!1),g=j(!1),_=j(``),v=!1,y=async({leaflet:e,map:t})=>{let r=await pZe({leaflet:e,map:t,geometryType:z(o),decimals:z(a),onChange:e=>{M(f,e,!0)},isCancelled:()=>v});r&&(M(d,r),n()&&cZe(n(),z(o))||r.showDefaultView({center:z(s),zoom:z(c)}))},b=()=>{if(!z(d))return;let e=sZe(n()??``,z(o)),t=e?n():``;z(f)!==t&&(M(f,t,!0),z(d).showGeometry(e))},x=()=>{if(!z(d))return;let e=z(f);n()!==e&&n(e)},S=e=>{if(!z(d))return;let t=z(d).setLocation(e);t!==void 0&&M(f,t,!0)},C=({lat:e,lon:t})=>{S({latitude:parseFloat(e),longitude:parseFloat(t)})},w=async()=>{let e;try{e=await _Ze()}catch(e){M(g,!0),e instanceof gZe?M(_,Y(`geolocation_unsupported`),!0):(M(_,Y(`geolocation_error_body`),!0),console.error(`Error getting current location:`,e));return}S(e)},T=async()=>{n(``),await co(),z(u).querySelector(`input`).focus()};Ms(()=>{v=!0,z(d)?.stop()}),vk(()=>[z(d),n()],()=>{b()}),vk(()=>z(f),()=>{x()}),yk(()=>{let e=z(p);if(!e.trim())M(h,!1);else return M(h,!0),fo(()=>hZe(e))},e=>{M(m,e,!0),M(h,!1)});var ee=bZe(),te=P(ee),ne=N(te);{let e=A(()=>Y(`find_place`)),t=A(()=>Y(`find_place`));Vu(ne,{debounce:!0,get readonly(){return r()},flex:!0,get placeholder(){return z(e)},get"aria-label"(){return z(t)},get value(){return z(p)},set value(e){M(p,e,!0)}})}var re=I(ne,2);{let e=e=>{Xc(e,{name:`near_me`})},t=A(()=>Y(`use_your_location`)),n=A(()=>Y(`use_your_location`));Al(re,{variant:`tertiary`,iconic:!0,get title(){return z(t)},get"aria-label"(){return z(n)},get disabled(){return r()},onclick:()=>{w()},startIcon:e,$$slots:{startIcon:!0}})}var ie=I(re,2);{let e=A(()=>Y(`clear`)),t=A(()=>r()||!n());Al(ie,{variant:`tertiary`,get label(){return z(e)},get disabled(){return z(t)},onclick:()=>{T()}})}D(te),Ds(te,e=>M(u,e),()=>z(u));var ae=I(te,2),oe=e=>{var t=vZe(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`searching`)]),U(e,t)},se=e=>{var t=H(),n=P(t),r=e=>{var t=H(),n=P(t),r=e=>{{let t=A(()=>Y(`search_results`));Cu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();Bo(P(n),17,()=>z(m),e=>e.place_id,(e,t)=>{Tu(e,{get label(){return z(t).display_name},onSelect:()=>{C(z(t))}})}),U(e,n)},$$slots:{default:!0}})}},i=e=>{var t=yZe(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`no_results`)]),U(e,t)};G(n,e=>{z(m).length?e(r):e(i,-1)}),U(e,t)};G(n,e=>{z(m)&&e(r)}),U(e,t)};G(ae,e=>{z(h)?e(oe):z(p)&&e(se,1)});var ce=I(ae,2),le=N(ce);{let e=A(()=>i()?`invalid`:void 0);rZe(le,{get inert(){return r()},get class(){return z(e)},onReady:y,get mapElement(){return z(l)},set mapElement(e){M(l,e,!0)}})}D(ce);var ue=I(ce,2);{let e=A(()=>Y(`geolocation_error_title`));nu(ue,{get title(){return z(e)},get open(){return z(g)},set open(e){M(g,e,!0)},children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(_))),U(e,n)},$$slots:{default:!0}})}U(e,ee),k()}var CZe=B(`<pre class="svelte-1ox6w30"> </pre>`),wZe={hash:`svelte-1ox6w30`,code:`pre.svelte-1ox6w30 {white-space:pre-wrap;}`};function TZe(e,t){K(e,wZe);var n=H(),r=P(n),i=e=>{var n=CZe(),r=F(n,!0);R(()=>W(r,t.currentValue)),U(e,n)};G(r,e=>{t.currentValue&&e(i)}),U(e,n)}function EZe(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=j(void 0),s=j(``),c=A(()=>t.fieldConfig.min),l=A(()=>t.fieldConfig.max),u=A(()=>Mr(t.fieldConfig.step,1)),d=()=>z(o)===void 0&&z(s).trim()?z(s):z(o),{updateInput:f}=bk(()=>n(),e=>{n(e)},d,e=>{M(o,e,!0)},e=>RSe({currentValue:e,fieldConfig:t.fieldConfig,inputValue:d()}),e=>OP({inputValue:e,fieldConfig:t.fieldConfig}));{let n=A(()=>xP(t.fieldConfig));PO(e,{get min(){return z(c)},get max(){return z(l)},get step(){return z(u)},get fractional(){return z(n)},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},oninput:e=>{M(s,e.target.value,!0)},onblur:()=>{f()},get value(){return z(o)},set value(e){M(o,e,!0)}})}k()}var DZe=B(`<p> </p>`);function OZe(e,t){O(t,!0);let n=A(()=>WA(t.locale)),r=A(()=>Number(t.currentValue)),i=A(()=>Number.isNaN(z(r))?t.currentValue:yP(z(n)).format(z(r)));var a=H(),o=P(a),s=e=>{var r=DZe(),a=F(r,!0);R(e=>{q(r,`lang`,z(n)),q(r,`dir`,e),W(a,z(i)),r.dir=r.dir},[()=>GA(t.locale)]),U(e,r)};G(o,e=>{t.currentValue!==void 0&&t.currentValue!==null&&t.currentValue!==``&&e(s)}),U(e,a),k()}var kZe=({draft:e,valueStoreKey:t=`currentValues`,locale:n,keyPath:r,fieldConfig:i,type:a})=>{let{i18n:o=!1}=i,{types:s,typeKey:c=`type`}=i,{fields:l}=i,u=e[t],d=(a?s?.find(({name:e})=>e===a)?.fields:l)??[],f=t===`extraValues`?n:e.defaultLocale;MM(()=>{a&&l6({valueStore:u,locale:n,i18n:o,draft:e,keyPath:r},e=>{e[`${r}.${c}`]=a});let t=Object.fromEntries(Object.entries(a6({fields:d,locale:n,defaultLocale:f})).map(([e,t])=>[`${r}.${e}`,t])),i=n===f?t:pGe({draft:e,content:t,targetLanguage:n,keyPathPrefix:r});l6({valueStore:u,locale:n,i18n:o,draft:e,keyPath:r},e=>{Object.assign(e,vr({...i,...e})),delete e[r]})})},AZe=({draft:e,valueStoreKey:t=`currentValues`,locale:n,keyPath:r,fieldConfig:i})=>{let{i18n:a=!1}=i,o={};return l6({valueStore:e[t],locale:n,i18n:a,draft:e,keyPath:r},(e,t)=>{let n={};qO(e,`${r}.`,{live:!0}).forEach(t=>{n[t.slice(r.length)]=vr(e[t]),e[t]=null,delete e[t]}),o[t]=n,e[r]=null}),o},jZe=({draft:e,valueStoreKey:t=`currentValues`,keyPath:n,removedValues:r})=>{MM(()=>{Object.entries(r).forEach(([r,i])=>{let a=e[t][r];a&&(Object.entries(i).forEach(([e,t])=>{a[`${n}${e}`]=t}),delete a[n])})})},MZe=B(`<div role="none" class="removed-item svelte-pauyt3"><!></div>`),NZe=B(`<div role="group"><!> <div role="none" class="item-list"><!></div></div>`),PZe=B(`<!> <!> <!> <!>`,1),FZe={hash:`svelte-pauyt3`,code:`.wrapper.svelte-pauyt3 {border-inline-width:2px;border-color:var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);&.expanded,
&:has(.summary) {border-bottom-width:2px;}&.unknown-type {overflow:hidden;.alert {border-width:0;border-radius:0;}}}.removed-item.svelte-pauyt3 {margin-top:8px;}.sui.checkbox + .wrapper.svelte-pauyt3 {& > .group {margin-top:8px;}}`};function IZe(e,t){let n=Eo();O(t,!0),K(e,FZe);let r=$M(),{fieldContext:i,valueStoreKey:a=`currentValues`,parentComponentNames:o=[]}=si(`field-editor`)??{},s=o.at(-1),c=i===`single-subfield-list-field`,l=J(t,`required`,3,!0),u=J(t,`readonly`,3,!1),d=j(void 0),f=j(void 0),p=A(()=>t.fieldConfig.name),m=A(()=>t.fieldConfig.collapsed),h=A(()=>t.fieldConfig.summary),g=A(()=>t.fieldConfig.thumbnail),_=A(()=>t.fieldConfig.fields),v=A(()=>t.fieldConfig.types),y=A(()=>Mr(t.fieldConfig.typeKey,`type`)),b=A(()=>r.current?.isIndexFile??!1),x=A(()=>r.current?.collectionName??``),S=A(()=>r.current?.fileName),C=A(()=>qM(r.current,t.locale,t.keyPath,a)),w=A(()=>({collectionName:z(x),fileName:z(S),valueMap:z(C),isIndexFile:z(b)})),T=A(()=>qO(z(C),`${t.keyPath}.`).some(e=>z(C)[e]!==void 0)),ee=A(()=>`${t.keyPath}#`),te=A(()=>G6(r.current,z(ee))),ne=A(()=>Array.isArray(z(v))),re=A(()=>`${t.keyPath}.${z(y)}`),ie=A(()=>!z(T)&&z(f)?.locale===t.locale),ae=A(()=>z(ne)?z(C)[z(re)]:void 0),oe=A(()=>k0({types:z(ne)?z(v):void 0,fields:z(_),summary:z(h),type:z(ae)})),se=A(()=>z(oe).typeConfig),ce=A(()=>z(oe).unknownType),le=A(()=>z(oe).subFields),ue=A(()=>z(oe).summaryTemplate),de=A(()=>z(se)?pB({config:z(se),locale:t.locale}):z(ae)),fe=()=>{let e=r.current;if(c||!e)return;let n=z(ee);K6({draft:e,stateMap:{[n]:PYe({draft:e,key:n,locale:t.locale,collapsed:z(m)})}})},pe=({type:e}={})=>{let n=r.current;n&&(kZe({draft:n,valueStoreKey:a,locale:t.locale,keyPath:t.keyPath,fieldConfig:t.fieldConfig,type:e}),M(f,void 0))},me=()=>{M(f,{locale:t.locale,values:AZe({draft:r.current,valueStoreKey:a,locale:t.locale,keyPath:t.keyPath,fieldConfig:t.fieldConfig})})},he=()=>{z(d).querySelector(`:scope > .header button`)?.focus()},ge=async()=>{jZe({draft:r.current,valueStoreKey:a,keyPath:t.keyPath,removedValues:z(f).values}),M(f,void 0),await co(),he()},_e=async({type:e})=>{pe({type:e}),await co(),he()},ve=async()=>{me(),await co(),document.getElementById(`object-${n}-restore`)?.focus()},ye=()=>D0({...z(w),keyPath:t.keyPath,locale:t.locale,summaryTemplate:z(ue)}),be=()=>wXe({draft:r.current,thumbnailFieldName:z(g),keyPath:t.keyPath,typedKeyPath:t.typedKeyPath,type:z(ae),componentName:s,valueMap:z(C),locale:t.locale}),xe=A(ye),Se=A(be),Ce=`object-${n}-summary`,we=A(()=>!z(te)&&!z(ce)&&(z(xe)||z(Se))?Ce:void 0);js(()=>{fe(),z(T)&&z(ce)&&O0({fieldType:`object`,keyPath:t.keyPath,type:z(ae),typeKey:z(y),types:z(v)})});var Te=PZe(),Ee=P(Te),De=e=>{{let n=A(()=>Y(`add_x`,{values:{name:t.fieldLabel||z(p)}}));Ql(e,{get label(){return z(n)},get checked(){return z(T)},get disabled(){return u()},onChange:({detail:{checked:e}})=>{e?pe():me()}})}};G(Ee,e=>{!z(ne)&&!l()&&e(De)});var Oe=I(Ee,2),ke=e=>{C6(e,{get disabled(){return u()},get fieldConfig(){return t.fieldConfig},get locale(){return t.locale},addItem:e=>_e(e)})};G(Oe,e=>{z(ne)&&!z(T)&&e(ke)});var Ae=I(Oe,2),je=e=>{var t=MZe();jYe(N(t),{get id(){return`object-${n}-restore`},get disabled(){return u()},onRestore:ge}),D(t),U(e,t)};G(Ae,e=>{z(ie)&&e(je)});var Me=I(Ae,2),Ne=e=>{var i=NZe();let a;var o=N(i),s=e=>{{let t=e=>{var t=H(),n=P(t),r=e=>{g$(e,{get disabled(){return u()},onclick:()=>{ve()}})};G(n,e=>{z(ne)&&e(r)}),U(e,t)},i=A(()=>z(ne)?z(de):``),a=A(()=>z(le).length>0);U6(e,{get label(){return z(i)},get controlId(){return`object-${n}-item-list`},get expanded(){return z(te)},get expandable(){return z(a)},toggleExpanded:()=>K6({draft:r.current,stateMap:{[z(ee)]:!z(te)}}),endContent:t,$$slots:{endContent:!0}})}};G(o,e=>{c||e(s)});var l=I(o,2),f=N(l);{let e=A(()=>u()||!z(se)?void 0:fB({config:z(se),option:`hint`,locale:t.locale}));CYe(f,{get locale(){return t.locale},get subFields(){return z(le)},getSubFieldProps:e=>({keyPath:`${t.keyPath}.${e.name}`,typedKeyPath:j0({typedKeyPath:t.typedKeyPath,type:z(ae),subFieldName:e.name})}),get expanded(){return z(te)},get unknownType(){return z(ce)},get hint(){return z(e)},getSummary:()=>z(xe),getThumbnail:()=>z(Se),get summaryId(){return Ce}})}D(l),D(i),Ds(i,e=>M(d,e),()=>z(d)),R(()=>{a=os(i,1,`wrapper svelte-pauyt3`,null,a,{"unknown-type":z(ce),expanded:z(te)}),q(i,`aria-labelledby`,z(we)),q(l,`id`,`object-${n}-item-list`)}),U(e,i)};G(Me,e=>{(l()&&!z(ne)||z(T))&&e(Ne)}),U(e,Te),k()}var LZe=B(`<div role="none"><!></div>`);function RZe(e,t){O(t,!0);let n=$M(),r=A(()=>t.fieldConfig.fields),i=A(()=>t.fieldConfig.types),a=A(()=>Mr(t.fieldConfig.typeKey,`type`)),o=A(()=>qM(n.current,t.locale,t.keyPath)),s=A(()=>qO(z(o),`${t.keyPath}.`).some(e=>!!z(o)[e])),c=A(()=>Array.isArray(z(i))),l=A(()=>`${t.keyPath}.${z(a)}`),u=A(()=>z(c)?z(o)[z(l)]:void 0),d=A(()=>k0({types:z(i),fields:z(r),type:z(u)})),f=A(()=>z(d).typeConfig),p=A(()=>z(d).unknownType),m=A(()=>z(d).subFields),h=A(()=>z(f)?pB({config:z(f),locale:t.locale}):void 0);var g=H(),_=P(g),v=e=>{var n=H(),r=P(n),i=e=>{},a=e=>{UXe(e,{get label(){return z(h)},children:(e,n)=>{var r=H();Bo(P(r),17,()=>z(m),e=>e.name,(e,n)=>{let r=A(()=>`${t.keyPath}.${z(n).name}`);var i=LZe();UO(N(i),{children:(e,i)=>{{let i=A(()=>j0({typedKeyPath:t.typedKeyPath,type:z(f)?.name,subFieldName:z(n).name}));e8(e,{get keyPath(){return z(r)},get typedKeyPath(){return z(i)},get locale(){return t.locale},get fieldConfig(){return z(n)}})}},$$slots:{default:!0}}),D(i),R(()=>q(i,`data-lazy-key-path`,z(r))),U(e,i)}),U(e,r)},$$slots:{default:!0}})};G(r,e=>{z(p)?e(i):e(a,-1)}),U(e,n)};G(_,e=>{z(s)&&e(v)}),U(e,g),k()}function zZe(e,t){O(t,!0);let n=e=>{var n=H();Bo(P(n),17,()=>z(a),e=>e.path,(e,n)=>{zZe(e,{get node(){return z(n)},get selectedPath(){return t.selectedPath},get onSelectPath(){return t.onSelectPath}})}),U(e,n)},r=A(()=>t.node.path),i=A(()=>t.node.label),a=A(()=>t.node.children),o=A(()=>t.selectedPath===z(r)),s=A(()=>!z(r)||z(o)||t.selectedPath.startsWith(`${z(r)}/`));{let c=e=>{{let t=A(()=>z(r)?`folder`:`bookmark_manager`);Xc(e,{get name(){return z(t)}})}},l=A(()=>z(a).length?n:void 0);RO(e,{get label(){return z(i)},get selected(){return z(o)},get expanded(){return z(s)},get items(){return z(l)},onSelect:()=>{t.onSelectPath(z(r))},startIcon:c,$$slots:{startIcon:!0}})}k()}var t8=e=>e?e.split(`/`).length:0,BZe=(e,t)=>t?e===t?2:0:SA.includes(e)?2:1,VZe=({entries:e,indexFileName:t,subfolders:n})=>{let r=new Map,i=new Map;return e.forEach(e=>{let a=jA(e.subPath);if(!a)return;if(n){let n=BZe(e.subPath.slice(a.length+1),t);n>(i.get(a)??0)?(i.set(a,n),r.set(a,e)):r.has(a)||r.set(a,void 0)}else r.has(a)||r.set(a,void 0);let o=jA(a);for(;o&&!r.has(o);)r.set(o,void 0),o=jA(o)}),r},HZe=({collection:e,path:t,indexEntry:n,summaryTemplate:r,locale:i})=>{let a=t.slice(t.lastIndexOf(`/`)+1);return n&&jz(e,n,{locale:i,useTemplate:!0,template:r})||a},UZe=({collection:e,entries:t,pruneLeaves:n,excludePath:r,maxDepth:i=1/0,locale:a})=>{let o=wA(e);if(!o)return[];let{summary:s,subfolders:c}=o,l=VZe({entries:t,indexFileName:OA(e),subfolders:c}),u=new Map;[...l.keys()].forEach(e=>{let t=jA(e);PA(u,t,()=>[]).push(e)});let d=t=>(u.get(t)??[]).filter(e=>(!n||!c||!!u.get(e)?.length)&&e!==r&&t8(e)<=i).map(t=>({path:t,label:HZe({collection:e,path:t,indexEntry:l.get(t),summaryTemplate:s,locale:a}),children:d(t)})).sort((e,t)=>TE(e.label,t.label));return d(``)},WZe=({collection:e,entries:t})=>UZe({collection:e,entries:t,pruneLeaves:!0}),GZe=({collection:e,entries:t,ownFolderPath:n})=>{let r=wA(e)?.depth??1/0;if(!OA(e))return r-1;if(!n)return r-2;let i=t8(jA(n));return r-Math.max(2,...t.filter(({subPath:e})=>e.startsWith(`${n}/`)).map(({subPath:e})=>t8(e)-i))},KZe=({collection:e,entries:t,excludePath:n,locale:r})=>UZe({collection:e,entries:t,pruneLeaves:!1,excludePath:n,maxDepth:GZe({collection:e,entries:t,ownFolderPath:n}),locale:r}),qZe=({nodes:e,path:t})=>{let n=t.split(`/`).filter(Boolean),r=(e,[t,...n],i)=>{let a=i?`${i}/${t}`:t,o=e.find(e=>e.path===a);if(o)return n.length?e.map(e=>e===o?{...e,children:r(e.children,n,a)}:e):e;let s={path:a,label:t,children:n.length?r([],n,a):[]};return[...e,s].sort((e,t)=>TE(e.label,t.label))};return n.length?r(e,n,``):e},JZe=(e,t)=>e.reduce((e,n)=>e??(n.path===t?n:JZe(n.children,t)),void 0),YZe=({collection:e,subPath:t,isNew:n=!1})=>{if(n||!t||!e||!OA(e))return;let r=jA(t);return r?r.slice(r.lastIndexOf(`/`)+1):void 0},XZe=({collection:e,label:t,entries:n,newFolderPaths:r,excludePath:i,locale:a})=>({path:``,label:t,children:r.reduce((e,t)=>qZe({nodes:e,path:t}),KZe({collection:e,entries:n,excludePath:i,locale:a}))}),ZZe=e=>(e?.children??[]).map(({path:e})=>e.slice(e.lastIndexOf(`/`)+1)),QZe=B(`<span role="none" class="label"> </span>`),$Ze=B(`<header role="none"><h4 role="none"> </h4></header> <!> <div role="none" class="field-wrapper svelte-1cngjyd"><!> <!> <!></div>`,1),eQe=B(`<div role="none" class="new-parent-folder svelte-1cngjyd"><div role="none"><!> <!></div> <p role="none" class="svelte-1cngjyd"> </p></div>`),tQe=B(`<!> <!>`,1),nQe={hash:`svelte-1cngjyd`,code:`.field-wrapper.svelte-1cngjyd {display:flex;align-items:center;
/* Look like the \`<Select>\` trigger, which is a styled div rather than a button */.parent-folder-button {justify-content:flex-start;border-color:var(--sui-control-border-color);border-radius:var(--sui-textbox-border-radius);padding-inline:calc(var(--sui-textbox-height) / 4);flex:auto;min-width:0;height:var(--sui-textbox-height);color:var(--sui-control-foreground-color);background-color:var(--sui-disabled-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);font-weight:var(--sui-font-weight-normal, normal);line-height:var(--sui-control-line-height);&:is(:hover, :focus-visible, [aria-expanded='true']) {color:var(--sui-control-foreground-color);background-color:var(--sui-hover-background-color);}&[aria-invalid='true'] {border-color:var(--sui-error-border-color);}.icon {font-size:var(--sui-font-size-xx-large);opacity:0.5;}.label {flex:auto;overflow:hidden;text-align:start;text-overflow:ellipsis;white-space:nowrap;}}.parent-folder-tree {min-width:240px;max-height:50vh;}
/* Stand beside the picker without stretching, so the folder name gets the room */.new-parent-folder-button {flex:none;height:var(--sui-textbox-height);white-space:nowrap;}}.new-parent-folder.svelte-1cngjyd {display:flex;flex-direction:column;gap:8px;min-width:320px;p:where(.svelte-1cngjyd) {margin:0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}}`};function rQe(e,t){let n=Eo();O(t,!0),K(e,nQe);let r=$M(),i=A(()=>r.current?.collection),a=A(()=>z(i)?EA(z(i)):void 0),o=A(()=>r.current?.validities[t.locale]._path),s=A(()=>z(o)?.valid===!1),c=A(()=>t.locale===z(i)?._i18n.defaultLocale),l=A(()=>z(c)&&!z1(r.current)),u=A(()=>YZe({collection:z(i),subPath:r.current?.originalEntry?.subPath,isNew:r.current?.isNew})),d=A(()=>CE(r.current?.currentPath??``)),f=A(()=>z(u)?jA(z(d)):z(d)),p=A(()=>!!z(i)&&wA(z(i))?.subfolders===!1),m=A(()=>!!z(i)&&z(f).split(`/`).filter(Boolean).length<GZe({collection:z(i),entries:[]})),h=j(!1),g=j(``),_=j(!1),v=j(ta([])),y=A(()=>z(i)?XZe({collection:z(i),label:pj(z(i)),entries:a4(z(i)),newFolderPaths:z(v),excludePath:z(u)?jA(r.current?.originalEntry?.subPath):void 0,locale:t.locale}):{path:``,label:``,children:[]}),b=A(()=>!z(i)||z(c)?z(f):o4({collection:z(i),dirPath:z(f),locale:t.locale})),x=A(()=>JZe([z(y)],z(f))),S=A(()=>z(x)?.label??z(b)),C=j(void 0),w=j(!1),T=A(()=>ZZe(z(x))),ee=A(()=>NN({takenNames:z(T),name:z(g)})),te=A(()=>z(_)&&!!z(ee)),ne=A(()=>!!z(y).children.length),re=e=>{r.current&&(r.current.currentPath=z(u)?UP([e,z(u)]):e),M(w,!1)};var ie=H(),ae=P(ie),oe=e=>{var t=tQe(),r=P(t);I6(r,{"data-validation-key":`_path`,children:(e,t)=>{var r=$Ze(),i=P(r),a=N(i),c=F(a,!0);D(i);var u=I(i,2),d=e=>{S6(e,{get id(){return`${n}-error`},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>w0(z(o)).join(` `)]),U(e,n)},$$slots:{default:!0}})};G(u,e=>{z(s)&&e(d)});var v=I(u,2),x=N(v);{let e=e=>{{let t=A(()=>z(f)?`folder`:`bookmark_manager`);Xc(e,{get name(){return z(t)}})}},t=e=>{Xc(e,{name:`expand_more`})},r=A(()=>!z(ne)||!z(l)),i=A(()=>z(b)||void 0);Al(x,{class:`parent-folder-button`,variant:`tertiary`,get disabled(){return z(r)},"aria-haspopup":`tree`,get"aria-invalid"(){return z(s)},get"aria-labelledby"(){return`${n}-label`},get"aria-errormessage"(){return`${n}-error`},get"aria-description"(){return z(i)},get element(){return z(C)},set element(e){M(C,e,!0)},startIcon:e,endIcon:t,children:(e,t)=>{var n=QZe(),r=F(n,!0);R(()=>W(r,z(S))),U(e,n)},$$slots:{startIcon:!0,endIcon:!0,default:!0}})}var T=I(x,2);Ol(T,{get anchor(){return z(C)},position:`bottom-left`,get open(){return z(w)},set open(e){M(w,e,!0)},children:(e,t)=>{{let t=A(()=>Y(`entry_parent_folder`));BO(e,{get ariaLabel(){return z(t)},class:`parent-folder-tree`,selectionFollowsFocus:!1,children:(e,t)=>{zZe(e,{get node(){return z(y)},get selectedPath(){return z(f)},onSelectPath:re})},$$slots:{default:!0}})}},$$slots:{default:!0}});var ee=I(T,2),te=e=>{{let t=e=>{Xc(e,{name:`create_new_folder`})},n=A(()=>!z(l)||!z(m)),r=A(()=>Y(`new_parent_folder`));Al(e,{variant:`ghost`,iconic:!0,class:`new-parent-folder-button`,get disabled(){return z(n)},get"aria-label"(){return z(r)},onclick:()=>{M(g,``),M(_,!1),M(h,!0)},startIcon:t,$$slots:{startIcon:!0}})}};G(ee,e=>{z(p)&&e(te)}),D(v),R(e=>{q(a,`id`,`${n}-label`),W(c,e)},[()=>Y(`entry_parent_folder`)]),U(e,r)},$$slots:{default:!0}});var i=I(r,2);{let e=A(()=>Y(`new_parent_folder`)),t=A(()=>Y(`new_parent_folder_create`)),r=A(()=>!!z(ee));tu(i,{get title(){return z(e)},get okLabel(){return z(t)},get okDisabled(){return z(r)},onOk:()=>{let e=UP([z(f),MN(z(g))]);M(v,[...z(v),e],!0),re(e)},get open(){return z(h)},set open(e){M(h,e,!0)},children:(e,t)=>{var r=eQe(),i=N(r),a=N(i);{let e=A(()=>Y(`new_parent_folder_name`));fu(a,{dir:`auto`,flex:!0,get ariaLabel(){return z(e)},get"aria-errormessage"(){return`${n}-new-folder-error`},get invalid(){return z(te)},oninput:()=>{M(_,!0)},get value(){return z(g)},set value(e){M(g,e,!0)}})}var o=I(a,2),s=e=>{S6(e,{get id(){return`${n}-new-folder-error`},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`new_parent_folder_error.${z(ee)}`)]),U(e,n)},$$slots:{default:!0}})};G(o,e=>{z(te)&&e(s)}),D(i);var c=F(I(i,2),!0);D(r),R(e=>W(c,e),[()=>Y(`new_parent_folder_description`,{values:{folder:z(S)}})]),U(e,r)},$$slots:{default:!0}})}U(e,t)};G(ae,e=>{r.current&&z(a)&&(z(ne)||z(p))&&e(oe)}),U(e,ie),k()}var iQe=B(`<!> <!>`,1);function aQe(e,t){O(t,!0);let n=$M(),r=A(()=>n.current?.fields??[]),i=A(()=>n.current?.currentPath!==void 0&&!n.current?.isIndexFile);UO(e,{children:(e,n)=>{var a=iQe(),o=P(a),s=e=>{rQe(e,{get locale(){return t.locale}})};G(o,e=>{z(i)&&e(s)}),Bo(I(o,2),17,()=>z(r),e=>e.name,(e,n)=>{UO(e,{children:(e,r)=>{H6(e,{get keyPath(){return z(n).name},get typedKeyPath(){return z(n).name},get locale(){return t.locale},get fieldConfig(){return z(n)}})},$$slots:{default:!0}})}),U(e,a)},$$slots:{default:!0}}),k()}var oQe=0,n8=void 0,r8=void 0,sQe={saved:!1,restored:!1,deleted:!1},i8=mk({show:!1}),a8=mk({...sQe}),o8=async(e,t=``)=>{await n8?.delete([e,t])},s8=async(e,t=``)=>{let n=await n8?.get([e,t]);return n?n.cmsConfigVersion===wk.current?n:(await o8(e,t),null):null},c8=({collection:e,fileName:t,isIndexFile:n,originalEntry:r})=>t??r?.slug??(n?nA(e):``),cQe=({originalEntry:e})=>e?.arrayIndex!==void 0,lQe=async e=>{if(!(IG.useDraftBackup??!0)||!e.interacted||z1(e)||cQe(e))return;let{collectionName:t,currentLocales:n={},currentPath:r,currentSlugs:i={},currentValues:a={},files:o,isNew:s,originalEntry:c,pendingEntries:l=[]}=e,u=c8(e);if(zM(e)){let e={timestamp:new Date,cmsConfigVersion:wk.current,collectionName:t,slug:u,currentLocales:vr(n),currentSlugs:vr(i),...r===void 0?{}:{currentPath:r},currentValues:vr(a),files:Object.fromEntries(Object.entries(o).map(([e,{file:t,folder:n,replace:r,subfolderPath:i,nameTemplate:a}])=>[e,{file:t,folder:n&&vr(n),replace:r,subfolderPath:i,...a?{nameTemplate:{...a,randomValues:new Map(a.randomValues),dateTimeParts:{...a.dateTimeParts}}}:{}}])),pendingEntries:fk(l),...!s&&c?{baseEntry:fk(c)}:{}};await n8?.put(e)}else await s8(t,u)&&await o8(t,u)},uQe=async({currentValues:e,files:t})=>{let n=new Set;return Object.values(e).forEach(e=>{Object.values(e).forEach(e=>{typeof e==`string`&&[...e.matchAll(Vk(`g`))].forEach(([e])=>{let r=t[e]?.file;r&&n.add(r)})})}),new Map(await Promise.all([...n].map(async e=>[e,await OX(e)])))},dQe=({baseEntry:e,draft:t})=>{let{originalEntry:n,originalLocales:r}=t;e&&n&&!(0,yr.default)(e.locales,fk(n.locales))&&(t.originalEntry=e,t.originalLocales=Object.fromEntries(Object.keys(r).map(t=>[t,!!e.locales[t]?.content])))},fQe=async({backup:e,draft:t})=>{let{baseEntry:n,currentLocales:r,currentPath:i,currentSlugs:a,currentValues:o,files:s,pendingEntries:c=[]}=e,l=await uQe(e);MM(()=>{t.currentLocales=r,t.currentSlugs=a,i!==void 0&&(t.currentPath=i),t.pendingEntries=c;let e=sz(t.collection);Object.entries(o).forEach(([n,r])=>{if(e&&e in r){let i=t.originalEntry?.locales[n]?.content?.[e];i===void 0?delete r[e]:r[e]=i}Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&([...n.matchAll(Vk(`g`))].forEach(([e])=>{let r=s[e],{file:i}=r??{};if(!r||!i)return;let a=l.get(i);t.files[a]??=r,n=n.replaceAll(e,a)}),r[e]=n)}),t.currentValues[n]?y6(t.currentValues[n],r):t.currentValues[n]=R2({draft:t,locale:n,target:structuredClone(r)});let i=t.currentValues[n],a=Object.keys(i),o=lP(i);a.forEach(e=>{i[e]===null&&uP(o,e)&&(i[e]={})}),t.originalValues[n]||(t.originalValues[n]={})}),dQe({baseEntry:n,draft:t})})},pQe=async({draft:e})=>{if(!(IG.useDraftBackup??!0)||z1(e)||cQe(e))return;let{collectionName:t}=e,n=c8(e),r=await s8(t,n);if(!r)return;let{timestamp:i}=r,{promise:a,resolve:o}=Promise.withResolvers();i8.current={show:!0,timestamp:i,resolve:o};let s=await a;s!==void 0&&(s?(await fQe({backup:r,draft:e}),e.interacted=!0):await o8(t,n),a8.current={restored:s,deleted:!s,saved:!1})},mQe=async e=>{(IG.useDraftBackup??!0)&&e&&!a8.current.saved&&await s8(e.collectionName,c8(e))&&(a8.current={restored:!1,deleted:!1,saved:!0})},hQe=()=>{a8.current={...sQe}};_k(()=>{let e=wY(OY.current);e?e!==r8&&(r8=e,n8=new DE(e,`draft-backups`,{keyPath:[`collectionName`,`slug`]})):(n8=null,r8=void 0)});var l8=()=>{globalThis.clearTimeout(oQe)},gQe=e=>{l8(),e&&n8&&(oQe=globalThis.setTimeout(()=>{lQe(e)},500))},_Qe=[`code`,`hidden`,`keyvalue`],u8=(e,t)=>{Object.hasOwn(e,t)&&!Uj(e[t])&&delete e[t]},vQe=({field:e,fieldType:t,keyPath:n,content:r,index:i})=>{if(uP(i,n)){let[e]=dP(i,n);if(e!==void 0){let t=r[`${n}.${e}`];qj(r,n),r[n]=t}else return qj(r,n),!1}let a=r[n];if(E(a)||Array.isArray(a))return qj(r,n),!1;if(Ik.includes(t))return typeof a!=`string`&&(r[n]=String(a??``)),!0;if(t===`boolean`){if(typeof a!=`boolean`){let e=typeof a==`string`?a.trim().toLowerCase():a;if(e!==`true`&&e!==`false`)return!1;r[n]=e===`true`}return!0}if(t===`number`){let{value_type:t=`int`}=e;if(t!==`int`&&t!==`float`||typeof a==`number`||a===null)return!0;let i=typeof a==`string`?Number(a.trim()):NaN;if(a===``||Number.isNaN(i))return!1;r[n]=i}return!0},yQe=({keyPath:e,content:t,index:n,hasSubFields:r})=>{if(dP(n,e).length)return u8(t,e),!0;if(uP(n,e))return qj(t,e),!1;let i=t[e];return Array.isArray(i)?!0:!r&&i!=null&&!E(i)?(delete t[e],t[`${e}.0`]=i,!0):(qj(t,e),!1)},bQe=[`number`,`boolean`,`bigint`],xQe=(e,t,n)=>{let r=dP(n,t);(r.length?r:[0]).forEach(n=>{let r=`${t}.${n}`,i=e[r];Object.hasOwn(e,r)&&(i===null||bQe.includes(typeof i))&&(e[r]=String(i??``))})},SQe=({keyPath:e,content:t,index:n})=>uP(n,e)?(u8(t,e),!0):t[e]===null||(qj(t,e),!1),CQe=e=>{let{field:t,keyPath:n,content:r,index:i}=e,{widget:a=`string`}=t;if(_Qe.includes(a)||xM(t)!==`builtin`)return uP(i,n)&&u8(r,n),!0;if(a===`object`)return SQe(e);if(a===`list`){let{hasSubFields:n}=V0(t);return yQe({...e,hasSubFields:n})}return _M(t)?yQe({...e,hasSubFields:!1}):vQe({...e,fieldType:a})},wQe=({content:e,defaultLocaleContent:t,field:n,keyPath:r,locale:i,defaultLocale:a})=>{let o=Object.keys(t).filter(e=>GO(e,r));return o.forEach(r=>{e[r]=N0({fieldConfig:n,value:t[r],sourceLocale:a,targetLocale:i})}),!!o.length},TQe=({defaultLocaleContent:e,variableTypes:t})=>Object.entries(t).every(([t,n])=>e[t]===n),EQe=({field:e,content:t,keyPath:n,variableTypes:r})=>{let{fields:i}=e;if(i)return{fields:i,variableTypes:r};let{types:a,typeKey:o=`type`}=e,s=`${n}.${o}`,c=t[s],l=a?.find(({name:e})=>e===c)?.fields;return{fields:l,variableTypes:l?{...r,[s]:c}:r}},d8=e=>{let{field:t,keyPath:n,content:r,index:i,locale:a,defaultLocale:o,defaultLocaleContent:s}=e,{fillDefaults:c=!0,inheritedI18n:l,variableTypes:u={}}=e,d=t.i18n??l,f=a!==o&&s&&TQe({defaultLocaleContent:s,variableTypes:u})?s:void 0;if(t.widget===`keyvalue`&&t.i18n===`duplicate_keys`&&f){o6({valueStore:{[o]:f,[a]:r},defaultLocale:o,keyPath:n});return}if(c&&f&&P0(t)&&I0({content:r,fieldConfig:t,keyPath:n})&&!I0({content:f,fieldConfig:t,keyPath:n})){wQe({content:r,defaultLocaleContent:f,field:t,keyPath:n,locale:a,defaultLocale:o});return}if(!(Object.hasOwn(r,n)||uP(i,n))||!CQe(e)||t.widget===`list`&&n6({fieldConfig:t,locale:a})&&!dP(i,n).length){if(!c||t.i18n===`duplicate`&&f&&wQe({content:r,defaultLocaleContent:f,field:t,keyPath:n,locale:a,defaultLocale:o}))return;i6({content:r,keyPath:n,fieldConfig:t,locale:a,defaultLocale:o,dynamicValues:{}});return}let{widget:p=`string`}=t;if(Lk.includes(p)&&_M(t)){xQe(r,n,i);return}if(p===`keyvalue`){d===`duplicate`&&f&&_xe({content:r,referenceContent:f,keyPath:n});return}if(p===`object`){if(r[n]===null)return;let i=EQe({field:t,content:r,keyPath:n,variableTypes:u});i.fields?.forEach(t=>{d8({...e,field:t,keyPath:`${n}.${t.name}`,inheritedI18n:d,variableTypes:i.variableTypes})});return}if(p!==`list`)return;let{field:m}=t,{fields:h}=t,{types:g}=t;!m&&!h&&!g?xQe(r,n,i):dP(i,n).forEach(i=>{let a=`${n}.${i}`;if(m){d8({...e,field:m,keyPath:a,inheritedI18n:d});return}u8(r,a);let o=EQe({field:t,content:r,keyPath:a,variableTypes:u});o.fields?.forEach(t=>{d8({...e,field:t,keyPath:`${a}.${t.name}`,inheritedI18n:d,variableTypes:o.variableTypes})})})},f8=({fields:e,content:t,locale:n,defaultLocale:r,defaultLocaleContent:i,fillDefaults:a=!0})=>{let o=lP(t);return e.forEach(e=>{d8({field:e,keyPath:e.name,fillDefaults:a,content:t,index:o,locale:n,defaultLocale:r,defaultLocaleContent:i})}),t},DQe=({fields:e,contentMap:t,defaultLocale:n})=>{let r=t[n];return r&&f8({fields:e,content:r,locale:n,defaultLocale:n}),Object.entries(t).forEach(([t,i])=>{t!==n&&f8({fields:e,content:i,locale:t,defaultLocale:n,defaultLocaleContent:r})}),t},OQe=/^.*\.\d+(?=\.)/,kQe=({contentMap:e,defaultLocale:t,getFieldArgs:n})=>{let r=e[t],i=(e,t)=>{let r=bM({...n,keyPath:t,valueMap:e});return r?.widget===`uuid`?r:void 0};r&&Object.keys(r).forEach(e=>{let t=i(r,e);t&&!r[e]&&(r[e]=c6(t))}),Object.entries(e).forEach(([e,a])=>{e!==t&&(Object.keys(a).forEach(e=>{let t=i(a,e);t&&!a[e]&&R0(t.i18n)&&(a[e]=c6(t))}),r&&Object.entries(r).forEach(([e,t])=>{let o=i(r,e),s=e.match(OQe)?.[0];o&&!a[e]&&F2({fieldConfig:o,getFieldArgs:{...n,keyPath:e,valueMap:r}})&&(!s||Object.keys(a).some(e=>e.startsWith(`${s}.`)))&&(a[e]=t)}))})},AQe=({collection:e,collectionFile:t,originalSlugs:n,isIndexFile:r=!1})=>{let i=e._type===`entry`,{allLocales:a,defaultLocale:o}=(t??e)._i18n;if(!i||r)return Object.fromEntries(a.map(e=>[e,!1]));let{editable:{create:s}}=Z0(e),c=o2(e);return Object.fromEntries(a.map(e=>!s||n._||n[e]?[e,!1]:[e,e===o||c||`readonly`]))},jQe=({slugEditor:e,locale:t,defaultLocale:n})=>Object.entries(e).filter(([e,r])=>e===t||t===n&&r===`readonly`).map(([e])=>e),MQe=({slugEditor:e,defaultLocale:t,initialSlug:n})=>!n?.trim()||e[t]!==!0?{}:Object.fromEntries(jQe({slugEditor:e,locale:t,defaultLocale:t}).map(e=>[e,n])),NQe=({collection:e,originalEntry:t,initialPath:n})=>{if(!EA(e))return;let{subPath:r}=t;return typeof r==`string`?jA(r):CE(n??CA.current)},p8=({collection:e,collectionFile:t,originalEntry:n={},dynamicValues:r,extraValues:i,expanderStates:a,initialPath:o,initialSlug:s,isIndexFile:c=aA(e,n)})=>{let l=e.name,u=t?.name,{id:d,locales:f}=n,p=d===void 0,{fields:m=[],_i18n:h}=t??e,g=c?rA(e):void 0,_=g?.fields??m,v=g?.editor?.preview??t?.editor?.preview??e.editor?.preview??Sk.current?.editor?.preview??!0,y=g?.editor?.second_pane??t?.editor?.second_pane??e.editor?.second_pane??Sk.current?.editor?.second_pane??!0,{allLocales:b,initialLocales:x,defaultLocale:S,canonicalSlug:{key:C}}=h,w=p?x:b.filter(e=>!!f?.[e]?.content),T=Object.fromEntries(b.map(e=>[e,w.includes(e)])),ee=NQe({collection:e,originalEntry:n,initialPath:o}),te=p?{}:C in(f?.[S]?.content??{})?Object.fromEntries(b.map(e=>[e,f?.[e]?.slug])):{_:f?.[S]?.slug??n.slug},ne=Object.fromEntries(w.map(e=>p?[e,a6({fields:_,locale:e,defaultLocale:S,dynamicValues:r})]:[e,structuredClone(f?.[e]?.content)]));p?kQe({contentMap:ne,defaultLocale:S,getFieldArgs:{collectionName:l,fileName:u,isIndexFile:c}}):DQe({fields:_,contentMap:ne,defaultLocale:S});let re=AQe({collection:e,collectionFile:t,originalSlugs:te,isIndexFile:c}),ie=dk({id:p?crypto.randomUUID():d,createdAt:Date.now(),isNew:p,isIndexFile:c,canPreview:v,canShowSecondPane:y,collectionName:l,collection:e,fileName:u,collectionFile:t,fields:_,originalEntry:p?void 0:n,defaultLocale:S,originalLocales:T,currentLocales:structuredClone(T),originalSlugs:te,currentSlugs:{...structuredClone(te),...MQe({slugEditor:re,defaultLocale:S,initialSlug:s})},originalPath:ee,currentPath:ee,originalValues:ne,currentValues:{},files:{},extraValues:Object.fromEntries(b.map(e=>[e,UM(i?.[e]?fk(i[e]):{})])),validities:Object.fromEntries(b.map(e=>[e,{}])),validationMessages:Object.fromEntries(b.map(e=>[e,{}])),expanderStates:a??{_:{}},slugEditor:re,interacted:!1,pendingEntries:[]},AM);return w.forEach(e=>{ie.currentValues[e]=R2({draft:ie,locale:e,target:structuredClone(ne[e])})}),ie},m8=({entryDraft:e,...t})=>{let{originalEntry:n={}}=t;bVe(),NM(e.current);let r=p8(t);return e.current=r,eX(n)||pQe({draft:r}),r},h8=e=>!!e&&e.collection._type===`entry`&&!e.isIndexFile,PQe=e=>{if(!e||e.isNew||!h8(e)||z1(e)||eX(QY(e)))return!1;let{collection:t}=e;return TA(t)&&!OA(t)?!1:Z0(t).editable.update},FQe=e=>!!e?.isNew&&h8(e)&&Object.values(e.slugEditor).includes(!0)&&Z0(e.collection).editorRequired,IQe=(e,{templateOnly:t=!1}={})=>{let{defaultLocaleSlug:n,localizedSlugs:r}=c2({draft:e,templateOnly:t});return r?Object.fromEntries(Object.entries(r).filter(([t])=>!!e.currentLocales[t])):{_:n}},LQe=({draft:e,slugs:t})=>{e.currentSlugs={...e.currentSlugs,...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,jN(t,{locale:e})]))}},RQe=e=>{let{collection:t,isNew:n,defaultLocale:r,currentPath:i,currentLocales:a,currentSlugs:o}=e;if(n||!OA(t))return;let s=CE(i??``);return o2(t)?{[r]:s,...Object.fromEntries(Object.entries(o).filter(([e,t])=>e!==r&&!!a[e]&&!!i4(t)).map(([e,t])=>[e,jA(t)]))}:{[r]:s}},zQe=({draft:e,ownFolderPaths:t})=>{let{defaultLocale:n,originalEntry:r}=e,i=l2(e).filter(e=>e.id!==r?.id);return Object.fromEntries(Object.entries(t).map(([e,t])=>{let r=jA(t);return[e,i.map(t=>e===n?t.subPath:t.locales[e]?.slug).filter(e=>typeof e==`string`).map(e=>jA(e)).filter(e=>jA(e)===r).map(e=>r4(e))]}))},BQe=({draft:e,ownFolderPaths:t,folderNames:n})=>{let{defaultLocale:r}=e,{currentPath:i,currentSlugs:a}=e;Object.entries(n).forEach(([e,n])=>{let o=UP([jA(t[e]),MN(n)]);e===r?i=o:a={...a,[e]:UP([o,Uk(a[e]).basename])}}),e.currentPath=i,e.currentSlugs=a},VQe=B(`<span class="required" aria-hidden="true">*</span>`),HQe=B(`<header role="none"><h4 role="none"> </h4> <!></header>`),UQe=B(`<!> <!> <div role="none" class="field-wrapper"><!></div>`,1);function WQe(e,t){let n=Eo();O(t,!0);let r=$M(),i=J(t,`ariaLabelledby`,3,void 0),a=A(()=>i()??`${n}-label`),o=A(()=>r.current?.slugEditor[t.locale]),s=A(()=>Z0(r.current.collection)),c=A(()=>z(o)===!0&&z(s).editorRequired),l=A(()=>z(o)===`readonly`),u=A(()=>r.current?.validities[t.locale]._slug),d=A(()=>!z(l)&&z(u)?.valid===!1),f=A(()=>z(u).customErrorMessage),p=A(()=>r.current?.currentSlugs[t.locale]??``),m=A(()=>{if(z(s).editorRequired)return``;let e=IQe(r.current,{templateOnly:!0});return e[t.locale]??e._}),h=A(()=>z(p)||z(m)),g=j(!1),_=j(``),v=A(()=>u2(r.current,[t.locale])[t.locale]),y=A(()=>{if(z(g))return f2({slug:z(_),required:!1,pattern:z(s).pattern,takenSlugs:z(v),locale:t.locale})}),b=e=>{let n=r.current;n&&jQe({slugEditor:n.slugEditor,locale:t.locale,defaultLocale:n.defaultLocale}).forEach(t=>{n.currentSlugs[t]=e})},x=e=>!z(y)&&(e!==z(h)&&b(e.trim()),!0);vk(()=>z(p),()=>{z(c)&&z(_)!==z(p)&&M(_,z(p),!0)});var S=H(),C=P(S),w=e=>{I6(e,{children:(e,t)=>{var r=UQe(),o=P(r),u=e=>{var t=HQe(),r=N(t),i=F(r,!0),a=I(r,2),o=e=>{U(e,VQe())};G(a,e=>{z(c)&&e(o)}),D(t),R(e=>{q(r,`id`,`${n}-label`),W(i,e)},[()=>Y(`slug`)]),U(e,t)};G(o,e=>{i()||e(u)});var p=I(o,2),v=e=>{S6(e,{get id(){return`${n}-error`},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>p2({error:z(y),pattern:z(s).pattern})]),U(e,n)},$$slots:{default:!0}})},S=e=>{S6(e,{get id(){return`${n}-error`},children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(f))),U(e,n)},$$slots:{default:!0}})};G(p,e=>{z(y)?e(v):z(d)&&!z(g)&&e(S,1)});var C=I(p,2),w=N(C),T=e=>{fu(e,{dir:`auto`,oninput:()=>{b(z(_))},flex:!0,get required(){return z(c)},get invalid(){return z(d)},get"aria-labelledby"(){return z(a)},get"aria-errormessage"(){return`${n}-error`},get value(){return z(_)},set value(e){M(_,e,!0)}})},ee=e=>{{let t=A(()=>!z(l)),r=A(()=>Y(`edit_slug`)),i=A(()=>!!z(y)||z(d)&&!z(g)),o=A(()=>!!z(y));p6(e,{get id(){return`${n}-value`},get value(){return z(h)},get canEdit(){return z(t)},get editLabel(){return z(r)},get placeholder(){return z(m)},get invalid(){return z(i)},get applyDisabled(){return z(o)},get ariaLabelledby(){return z(a)},get ariaErrormessage(){return`${n}-error`},onApply:x,get editing(){return z(g)},set editing(e){M(g,e,!0)},get text(){return z(_)},set text(e){M(_,e,!0)}})}};G(w,e=>{z(c)?e(T):e(ee,-1)}),D(C),U(e,r)},$$slots:{default:!0}})};G(C,e=>{r.current&&e(w)}),U(e,S),k()}var GQe=B(` <!>`,1);function KQe(e,t){O(t,!0);let n=J(t,`show`,15,!1),r=J(t,`onShowErrors`,3,void 0);Xu(e,{get show(){return n()},set show(e){n(e)},children:(e,i)=>{el(e,{status:`error`,children:(e,i)=>{Qr();var a=GQe(),o=P(a),s=I(o),c=e=>{{let t=A(()=>Y(`show_errors`));Al(e,{variant:`secondary`,size:`small`,get label(){return z(t)},onclick:()=>{n(!1),r()()}})}};G(s,e=>{r()&&e(c)}),R(e=>W(o,`${e??``} `),[()=>Y(`entry_validation_errors`,{values:{count:t.count}})]),U(e,a)},$$slots:{default:!0}})},$$slots:{default:!0}}),k()}var qQe=/(?:^|\/)(?:\.{1,2})(?:\/|$)/,JQe=e=>{let{id:t,collection:n,currentLocales:r}=e,{defaultLocale:i}=n._i18n,a=OA(n);if(!AA(e))return!1;let{defaultLocaleSlug:o,localizedSlugs:s}=c2({draft:e}),c=[...iz(n.name),...KY(n.name)].filter(e=>e.id!==t);return Object.entries(r).filter(([,e])=>e).some(([t])=>{let n=s?.[t]??o;if(c4({draft:e,locale:t,slug:n}))return!1;let r=s4({draft:e,slug:n,indexFileName:a,locale:t});return c.some(e=>t===i?e.subPath===r:e.locales[t]?.slug===r)})},YQe=e=>{let{collection:t,currentLocales:n,originalPath:r,currentPath:i}=e;if(!EA(t))return{valid:!0,validities:{}};let a=CE(i??``),o=qQe.test(a)||a.includes(`\\`),s=!o&&!!r&&a!==r&&!!wA(t)?.subfolders&&MA(r,a),c=!o&&!s&&JQe(e),l=o||s||c,u={};return Object.keys(n).forEach(e=>{u[e]={_path:{patternMismatch:o,customError:s,duplicateError:c,valid:!l}}}),{valid:!l,validities:u}},g8=({draft:e,enforceRequired:t=!0})=>{let{valid:n,validities:r,validationMessages:i}=N2(`currentValues`,{enforceRequired:t,draft:e}),{valid:a,validities:o,validationMessages:s}=N2(`extraValues`,{enforceRequired:t,draft:e}),{valid:c,validities:l}=lHe(e),{valid:u,validities:d}=YQe(e);return{valid:n&&a&&c&&u,validities:Object.fromEntries(Object.keys(r).map(e=>[e,{...r[e],...o[e],...l[e],...d[e]}])),validationMessages:Object.fromEntries(Object.keys(i).map(e=>[e,{...i[e],...s[e]}]))}},XQe=({draft:e,enforceRequired:t=!0})=>{let{valid:n,validities:r,validationMessages:i}=g8({draft:e,enforceRequired:t});return e.validities=r,e.validationMessages=i,n},ZQe=({draft:e,enforceRequired:t=!0})=>XQe({draft:e,enforceRequired:t})?!0:(IYe({draft:e}),!1),_8=async({draft:e,enforceRequired:t=!0,awaitFieldUpdates:n=!0})=>(n&&await oN(),await CVe(),ZQe({draft:e,enforceRequired:t})),QQe=e=>Object.values(e??{}).some(({valid:e})=>!e),$Qe=e=>Object.values(e).flatMap(e=>Object.values(e).filter(({valid:e})=>!e)).length,v8=pk(),y8=(e,t=!1)=>{v8.current={...v8.current,[e]:!(v8.current?.[e]??t)}},b8={},e$e=async({repository:e})=>{b8.entryEditorSettings?.(),b8.selectAssetsView?.(),b8.entryEditorSettings=await rB(e,`entry-view`,v8,{defaults:{showSecondPane:!0,showPreview:!0,syncScrolling:!0,selectAssetsView:{type:`grid`}}}),qQ.current=v8.current?.selectAssetsView,b8.selectAssetsView=_k(()=>{let e=qQ.current;e&&Object.keys(e).length&&fo(()=>{let t=v8.current,n=t?.selectAssetsView??{};(0,yr.default)(e,n)||(v8.current={...t,selectAssetsView:e})})})};_k(()=>{let{current:e}=OY;e&&!fo(()=>v8.current)&&e$e(e)});var t$e=B(`<!> <!>`,1),n$e=B(`<div role="none" class="inner svelte-1ibgz0y"><!> <!></div>`),r$e=B(`<div role="none" class="wrapper svelte-1ibgz0y"><!></div>`),i$e={hash:`svelte-1ibgz0y`,code:`.wrapper.svelte-1ibgz0y {display:contents;.combobox {
@media (width < 1024px) {min-width:128px;--sui-textbox-height: 32px;--sui-button-medium-height: 32px;
}&.error [role='combobox'] {border-color:var(--sui-error-border-color);}}}.inner.svelte-1ibgz0y {display:contents;:is(.error, .error button[data-mode='edit']) {color:var(--sui-error-foreground-color) !important;}}`};function a$e(e,t){O(t,!0),K(e,i$e);let n=$M(),r=J(t,`thisPane`,7),i=J(t,`thatPane`,23,()=>pk(null)),a=J(t,`previewInThisPane`,3,!1),o=A(()=>rj(n.current)),s=A(()=>z(o).i18nEnabled),c=A(()=>z(o).allLocales),l=A(()=>z(s)&&z(c).length>1),u=A(()=>n.current?.validities??{}),d=A(()=>n.current?.canPreview??!0),f=A(()=>iG.isSmallScreen||iG.isMediumScreen?[...z(c)]:z(c).filter(e=>i().current?.mode!==`edit`||i().current.locale!==e)),p=A(()=>a()||i().current?.mode===`edit`&&z(d)&&!!v8.current?.showPreview),m=A(()=>Object.entries(z(u)).some(([e,t])=>z(f).includes(e)&&QQe(t))),h=A(()=>iG.isSmallScreen||iG.isMediumScreen||z(c).length>=5),g=A(()=>z(h)?Hu:Jl),_=A(()=>z(h)?Tu:Yl),v=A(()=>z(h)?void 0:`tertiary`),y=A(()=>z(h)?void 0:`small`),b=A(()=>r().current?.mode===`edit`?r().current.locale:r().current?.mode===`preview`?`preview`:void 0);var x=r$e(),S=N(x);{let e=A(()=>z(m)&&z(h)?`error`:void 0),a=A(()=>Y(z(l)?`switch_locale`:`switch_view`)),o=A(()=>t.id.replace(`-header`,`-body`));Ko(S,()=>z(g),(t,s)=>{s(t,{get value(){return z(b)},get class(){return z(e)},get ariaLabel(){return z(a)},get"aria-controls"(){return z(o)},children:(e,t)=>{var a=n$e(),o=N(a);Bo(o,16,()=>z(f),e=>e,(e,t)=>{let a=A(()=>z(l)?KA(t)??t:Y(`edit`)),o=A(()=>!n.current?.currentLocales[t]),s=A(()=>QQe(z(u)[t]));var c=H(),d=P(c);{let e=e=>{var t=H(),n=P(t),r=e=>{Xc(e,{name:`edit_off`})},i=e=>{Xc(e,{name:`error`})};G(n,e=>{z(o)?e(r):z(s)&&e(i,1)}),U(e,t)},n=A(()=>z(a)),c=A(()=>z(o)?Y(`locale_content_disabled_short`):z(s)?Y(`locale_content_error_short`):``),l=A(()=>r().current?.mode===`edit`&&r().current.locale===t),u=A(()=>z(s)?`error`:``);Ko(d,()=>z(_),(o,s)=>{s(o,{get variant(){return z(v)},get size(){return z(y)},get label(){return z(a)},get value(){return t},get"aria-label"(){return`${z(n)??``} ${z(c)??``}`},get selected(){return z(l)},get class(){return z(u)},"data-mode":`edit`,onSelect:()=>{sN(()=>{r().current={mode:`edit`,locale:t},i().current?.mode===`preview`&&(i().current={mode:`preview`,locale:t})})},startIcon:e,$$slots:{startIcon:!0}})})}U(e,c)});var s=I(o,2),c=e=>{var t=t$e(),n=P(t),a=e=>{mu(e,{})};G(n,e=>{z(h)&&e(a)});var o=I(n,2);{let e=A(()=>Y(`preview`)),t=A(()=>r().current?.mode===`preview`);Ko(o,()=>z(_),(n,a)=>{a(n,{get variant(){return z(v)},get size(){return z(y)},get label(){return z(e)},value:`preview`,get selected(){return z(t)},"data-mode":`preview`,onSelect:()=>{let{locale:e}=i().current??r().current;sN(()=>{r().current={mode:`preview`,locale:e}})}})})}U(e,t)};G(s,e=>{z(p)&&e(c)}),D(a),U(e,a)},$$slots:{default:!0}})})}D(x),U(e,x),k()}var o$e=(e,t,n)=>{let{fields:r}=e;if(r)return r;let{types:i,typeKey:a=`type`}=e;return i?.find(({name:e})=>e===t[`${n}.${a}`])?.fields??[]},s$e=new WeakMap,c$e=e=>aF(e,({widget:e})=>e===`compute`,s$e),x8=e=>{let{field:t,keyPath:n,valueMap:r,getIndex:i,results:a}=e;if(!c$e(t))return;let{widget:o=`string`}=t;if(o===`compute`){a.push({keyPath:n,fieldConfig:t});return}if(o===`object`){if(r[n]===null)return;o$e(t,r,n).forEach(t=>{x8({...e,field:t,keyPath:`${n}.${t.name}`})});return}let s=t,{hasSingleSubField:c}=V0(s);pP(i(),n).forEach(t=>{let i=`${n}.${t}`;c?x8({...e,field:s.field,keyPath:i}):o$e(s,r,i).forEach(t=>{x8({...e,field:t,keyPath:`${i}.${t.name}`})})})},l$e=({fields:e,valueMap:t,getIndex:n,keyPathPrefix:r=``})=>{let i=[];return e.forEach(e=>{x8({field:e,keyPath:`${r}${e.name}`,valueMap:t,getIndex:n,results:i})}),i},u$e=(e,t)=>{let n=[],r=new Set;return Object.keys(e).forEach(i=>{let[a]=i.match(vZ)??[];if(a===void 0||r.has(a))return;r.add(a);let{fields:o}=oM(e[`${a}__sc_component_name`])??{};o&&n.push(...l$e({fields:o,valueMap:e,getIndex:t,keyPathPrefix:a}))}),n},d$e=({fieldConfig:e,locale:t,defaultLocale:n,i18nEnabled:r})=>t===n||r&&z0(e.i18n),f$e=({draft:e,valueStoreKey:t,locale:n,valueMap:r,target:i})=>{let{collectionName:a,fileName:o,fields:s,isIndexFile:c}=e,{i18nEnabled:l,defaultLocale:u}=rj(e),d,f=()=>(d??=fP(r),d),p=t===`extraValues`?u$e(r,f):l$e({fields:s,valueMap:r,getIndex:f}),m=!1,h=r;return p.forEach(({keyPath:s,fieldConfig:d})=>{if(t!==`extraValues`&&!d$e({fieldConfig:d,locale:n,defaultLocale:u,i18nEnabled:l}))return;let f=lDe({fieldConfig:d,keyPath:s,locale:n,valueMap:h,collectionName:a,fileName:o,isIndexFile:c,...t===`extraValues`?{keyPathPrefix:s.match(vZ)[0],entryValueMap:GM(e,n)}:{}});h[s]!==f&&(i[s]=f,h=h===r?{...r}:h,h[s]=f,m=!0)}),m},p$e=e=>{let{currentLocales:t,fields:n}=e,r=!1;return[`currentValues`,`extraValues`].forEach(i=>{(i!==`currentValues`||n.some(c$e))&&Object.entries(e[i]).forEach(([n,a])=>{let o=GM(e,n,i);t[n]&&Object.keys(o).length&&f$e({draft:e,valueStoreKey:i,locale:n,valueMap:o,target:a})&&(r=!0)})}),r},S8=new WeakSet,m$e=e=>{[e.currentValues,e.extraValues].forEach(e=>{Object.values(e).forEach(VM)}),ni(e.currentLocales),!S8.has(e)&&(S8.add(e),nN(()=>{S8.delete(e),p$e(e)}))},h$e=(e,t)=>{L(()=>{let n=t();n&&tN(n,e())}),L(()=>{let t=e().current;t&&m$e(t)})},C8=e=>az(e,[...aX(rz(e),VY.current.filter(({workflow:t})=>t.collectionName===e)),...qY(e)]),g$e=({collectionName:e,fileName:t,isIndexFile:n,currentValues:r,extraValues:i})=>[...Object.values(r).map(r=>({valueMap:r,fieldArgs:{collectionName:e,fileName:t,isIndexFile:n}})),...Object.values(i).map(e=>({valueMap:e}))],_$e=({collectionName:e,entry:t})=>Object.values(t.locales).flatMap(({content:t})=>t?[{valueMap:t,fieldArgs:{collectionName:e}}]:[]),v$e=(e,{collectionName:t,values:n})=>e.some(({valueMap:e,fieldArgs:r})=>Object.entries(e).some(([i,a])=>{if(!n.includes(a))return!1;if(!r)return!0;let o=bM({...r,valueMap:e,keyPath:i});return!o||o.widget===`relation`&&o.collection===t})),y$e=e=>{let t=g$e(e),n=new Set,r=()=>{let r=e.pendingEntries.filter(e=>!n.has(e)&&v$e(t,e));return r.forEach(e=>{n.add(e),t.push(..._$e(e))}),r.length>0};for(;r(););return e.pendingEntries.filter(e=>n.has(e)).map(e=>fk(e))},w8=(e,t)=>e.pendingEntries.filter(e=>e.collectionName===t),T8=e=>e.quickAddHost??{collectionName:e.collectionName,workflow:$Y(e),branch:QY(e)?.workflow.pullRequest.branch},b$e=(e,t)=>{let{branch:n}=T8(e),r=n?ZY(n):void 0;return r?qY(t,[r]):[]},x$e=({fieldConfig:{collection:e,file:t},draft:n})=>{if(t)return;let r=fj(e);if(r?._type!==`entry`||r.create===!1||R1({collection:r}))return;let i=T8(n);if(!(i.workflow?e===i.collectionName:BY(r)))return r},S$e=({collection:e,draft:t})=>{let{name:n,limit:r=1/0}=e,i=new Set(qY(n).map(({id:e})=>e)),a=w8(t,n).filter(({entry:e})=>!i.has(e.id)).length;return C8(n)+a<r},C$e=({draft:e,fieldConfig:{collection:t},refEntries:n})=>{if(!e)return[];let r=new Set(n.map(({id:e})=>e));return[...w8(e,t).map(({entry:e})=>e),...b$e(e,t)].filter(({id:e})=>!r.has(e)&&(r.add(e),!0))},w$e=({draft:e,fieldConfig:t})=>{let n=IEe(t),r=C$e({draft:e,fieldConfig:t,refEntries:n});return r.length?[...n,...r]:n},T$e=({draft:e,parentDraft:t})=>{let n=c2({draft:e,pendingEntries:t.pendingEntries}),{defaultLocaleSlug:r,localizedSlugs:i}=n,a=[...w8(t,e.collectionName).map(({entry:e})=>e),...qY(e.collectionName)].map(({slug:e})=>e);if(BP(r,a)===r)return n;let o=BP(r,[...a,...rz(e.collectionName).map(({slug:e})=>e)]),s=i?{...i,[e.defaultLocale]:o}:void 0;return{defaultLocaleSlug:o,localizedSlugs:s,canonicalSlug:s2({draft:e,defaultLocaleSlug:o,localizedSlugs:s,fillSlugOptions:t2({draft:e})})}},E$e=async({draft:e,parentDraft:t,fieldConfig:n})=>{let{collectionName:r}=e,i=w8(t,r).length;S2(e,i),w2(e,i);let a=await j4({draft:e,slugs:T$e({draft:e,parentDraft:t}),runPreSave:!1}),{changes:o,savingAssets:s}=a,c=k4(a.savingEntry),{pendingEntries:l}=t;return{collectionName:r,entry:c,changes:o,savingAssets:s,values:EO(Object.keys(t.currentValues).flatMap(e=>AB({locale:e,fieldConfig:n,refEntry:c,pendingEntries:l}).map(({value:e})=>e)))}},D$e=({draft:e,parentDraft:t})=>{let n=new Set(t.pendingEntries.map(({entry:e})=>e.id));return y$e(e).filter(({entry:e})=>!n.has(e.id))},O$e=({draft:e,locale:t,keyPath:n,valueStoreKey:r,fieldConfig:i,pendingEntry:a})=>{let{i18n:o,multiple:s,max:c}=i,[l]=AB({locale:t,fieldConfig:i,refEntry:a.entry,pendingEntries:e.pendingEntries}).map(e=>e.value);l!==void 0&&(s?b6({draft:e,locale:t,i18n:o,fieldConfig:i,valueStoreKey:r,keyPath:n,manipulate:({valueList:e})=>{!e.includes(l)&&(typeof c!=`number`||e.length<c)&&e.push(l)}}):e[r][t][n]=l)},k$e=B(`<!> <!> <!>`,1),A$e=B(`<div role="none" class="fields svelte-197lmw7"><!> <!></div>`),j$e=B(`<div role="none" class="wrapper svelte-197lmw7"><p class="hint svelte-197lmw7"> </p> <!></div>`),M$e={hash:`svelte-197lmw7`,code:`.wrapper.svelte-197lmw7 {--field-editor-padding: 16px;display:flex;flex-direction:column;gap:16px;}.hint.svelte-197lmw7 {margin:0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.fields.svelte-197lmw7 {display:flex;flex-direction:column;}`};function N$e(e,t){let n=Eo();O(t,!0),K(e,M$e);let r=J(t,`open`,15,!1),i=$M(),a=QM(new ZM),o=pk(null),s=j(void 0),c=j(!1),l=!1,u=j(!1),d=j(0),f=j(!1),p=A(()=>Jc.current?pj(t.collection,{useSingular:!0}):``),m=A(()=>t.collection._i18n),h=A(()=>z(m).i18nEnabled),g=A(()=>z(m).allLocales),_=A(()=>z(m).defaultLocale),v=A(()=>z(h)&&z(g).length>1),y=()=>{let e=p8({collection:t.collection,initialPath:``});e.pendingEntries=[...i.current?.pendingEntries??[]],e.quickAddHost=i.current?T8(i.current):void 0,a.current=e,o.current={mode:`edit`,locale:z(_)},l=!1},b=()=>{l||NM(a.current),a.current=void 0,o.current=null},x=async()=>{let e=a.current;if(e&&i.current){M(c,!0);try{if(!await _8({draft:e,enforceRequired:!0})){M(d,$Qe(e.validities),!0),M(u,!0);return}let n=await E$e({draft:e,parentDraft:i.current,fieldConfig:t.fieldConfig});if(!r()||a.current!==e)return;i.current.pendingEntries.push(...D$e({draft:e,parentDraft:i.current}),n),t.onAdd(n),l=!0,r(!1)}catch(e){M(f,!0),console.error(e)}finally{M(c,!1)}}};L(()=>{r()&&fo(()=>y())}),h$e(()=>a,()=>z(s));var S=k$e(),C=P(S);{let e=e=>{var t=H(),r=P(t),i=e=>{a$e(e,{get id(){return`${n}-header`},get thisPane(){return o}})};G(r,e=>{z(v)&&a.current&&e(i)}),U(e,t)},t=e=>{var t=k$e(),n=P(t);$l(n,{flex:!0});var i=I(n,2);{let e=A(()=>Y(`add`));Al(i,{variant:`primary`,get label(){return z(e)},get disabled(){return z(c)},onclick:()=>{x()}})}var a=I(i,2);{let e=A(()=>Y(`cancel`));Al(a,{variant:`secondary`,get label(){return z(e)},get disabled(){return z(c)},onclick:()=>{r(!1)}})}U(e,t)},i=A(()=>Y(`create_entry_title`,{values:{name:z(p)}}));tu(C,{get title(){return z(i)},size:`large`,showOk:!1,showCancel:!1,onClose:()=>{b()},get open(){return r()},set open(e){r(e)},headerExtra:e,footer:t,children:(e,t)=>{var r=j$e(),i=N(r),c=F(i,!0),l=I(i,2),u=e=>{let t=A(()=>o.current);var r=A$e(),i=N(r),s=e=>{var n=H();Io(P(n),()=>z(t).locale,e=>{WQe(e,{get locale(){return z(t).locale}})}),U(e,n)},c=A(()=>FQe(a.current)&&a.current.slugEditor[z(t).locale]);G(i,e=>{z(c)&&e(s)}),aQe(I(i,2),{get locale(){return z(t).locale}}),D(r),R(()=>q(r,`id`,`${n}-body`)),U(e,r)};G(l,e=>{a.current&&o.current&&e(u)}),D(r),Ds(r,e=>M(s,e),()=>z(s)),R(e=>W(c,e),[()=>Y(`relation_field.save_together_hint`,{values:{name:z(p)}})]),U(e,r)},$$slots:{headerExtra:!0,footer:!0,default:!0}})}var w=I(C,2);KQe(w,{get count(){return z(d)},get show(){return z(u)},set show(e){M(u,e,!0)}}),Xu(I(w,2),{get show(){return z(f)},set show(e){M(f,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`relation_field.add_failed`,{values:{name:z(p)}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,S),k()}function P$e(e,t){O(t,!0);let n=$M(),{valueStoreKey:r=`currentValues`}=si(`field-editor`)??{},i=J(t,`required`,3,!0),a=J(t,`readonly`,3,!1),o=J(t,`invalid`,3,!1),s=A(()=>t.fieldConfig.i18n),c=A(()=>t.fieldConfig.max),l=A(()=>Mr(t.fieldConfig.dropdown_threshold,5)),u=e=>{let i=n.current;i&&b6({draft:i,locale:t.locale,i18n:z(s),fieldConfig:t.fieldConfig,valueStoreKey:r,keyPath:t.keyPath,manipulate:e})},d=e=>{u(({valueList:t})=>{t.push(e)})},f=e=>{u(({valueList:t})=>{let n=t.indexOf(e);n>-1&&t.splice(n,1)})};var p=H(),m=P(p),h=e=>{Moe(e,As({get disabled(){return a()},get readonly(){return a()},get required(){return i()},get invalid(){return o()},get options(){return t.options}},()=>({values:t.currentValue}),{get max(){return z(c)},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onAddValue:({detail:{value:e}})=>{d(e)},onRemoveValue:({detail:{value:e}})=>{f(e)},onReorder:({detail:{values:e}})=>{u(({valueList:t})=>{t.splice(0,t.length,...e)})}}))},g=e=>{iie(e,{get"aria-labelledby"(){return`${t.fieldId??``}-label`},children:(e,n)=>{var r=H();Bo(P(r),19,()=>t.options,({label:e,value:t},n)=>`${n}-${t}`,(e,n)=>{let r=()=>z(n).label,s=()=>z(n).value;{let n=A(()=>t.currentValue?.includes(s())??!1);Ql(e,{get label(){return r()},get value(){return s()},get readonly(){return a()},get required(){return i()},get invalid(){return o()},get checked(){return z(n)},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onChange:({detail:{checked:e}})=>{e?d(s()):f(s())}})}}),U(e,r)},$$slots:{default:!0}})};G(m,e=>{t.options.length>z(l)?e(h):e(g,-1)}),U(e,p),k()}function F$e(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=A(()=>Mr(t.fieldConfig.dropdown_threshold,5)),s=A(()=>t.options.some(({value:e})=>e===null||e===``)),c=A(()=>!r()&&!z(s)?[{label:Y(`unselected_option`),value:FB(t.options[0]?.value),searchValue:``},...t.options]:t.options);var l=H(),u=P(l),d=e=>{Hu(e,{get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return n()},set value(e){n(e)},children:(e,t)=>{var r=H();Bo(P(r),19,()=>z(c),({label:e,value:t,searchValue:n},r)=>`${r}-${t}`,(e,t)=>{let r=()=>z(t).label,i=()=>z(t).value,a=()=>z(t).searchValue;{let t=A(()=>PB(i())),o=A(()=>i()===n());Tu(e,{get label(){return r()},get value(){return i()},get valueType(){return z(t)},get searchValue(){return a()},get selected(){return z(o)},wrap:!0})}}),U(e,r)},$$slots:{default:!0}})},f=e=>{ju(e,{get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},onChange:({detail:{value:e}})=>{n(e)},children:(e,t)=>{var r=H();Bo(P(r),19,()=>z(c),({label:e,value:t},n)=>`${n}-${t}`,(e,t)=>{let r=()=>z(t).label,i=()=>z(t).value;{let t=A(()=>PB(i())),a=A(()=>i()===n());Mu(e,{get label(){return r()},get value(){return i()},get valueType(){return z(t)},get checked(){return z(a)}})}}),U(e,r)},$$slots:{default:!0}})};G(u,e=>{z(c).length>z(o)?e(d):e(f,-1)}),U(e,l),k()}function I$e(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=A(()=>t.fieldConfig.options),s=A(()=>t.fieldConfig.multiple),c=A(()=>z(s)?P$e:F$e),l=A(()=>z(o).map(e=>E(e)?e:{label:e,value:e}));var u=H();Io(P(u),()=>JSON.stringify(z(l)),e=>{var o=H();Ko(P(o),()=>z(c),(e,o)=>{o(e,{get locale(){return t.locale},get keyPath(){return t.keyPath},get fieldId(){return t.fieldId},get fieldConfig(){return t.fieldConfig},get readonly(){return i()},get required(){return r()},get invalid(){return a()},get options(){return z(l)},get currentValue(){return n()},set currentValue(e){n(e)}})}),U(e,o)}),U(e,u),k()}var L$e=B(`<div role="none" class="actions svelte-1hlgcqp"><!></div> <!>`,1),R$e=B(`<div role="none" class="wrapper svelte-1hlgcqp"><!> <!></div>`),z$e={hash:`svelte-1hlgcqp`,code:`.wrapper.svelte-1hlgcqp {display:flex;flex-direction:column;gap:8px;}.actions.svelte-1hlgcqp {display:flex;}`};function B$e(e,t){O(t,!0),K(e,z$e);let n=$M(),{valueStoreKey:r=`currentValues`}=si(`field-editor`)??{},i=J(t,`currentValue`,15),a=J(t,`required`,3,!0),o=J(t,`readonly`,3,!1),s=J(t,`invalid`,3,!1),c=j(!1),l=A(()=>w$e({draft:n.current,fieldConfig:t.fieldConfig})),u=A(()=>n.current?.[r]?.[t.locale]),d=A(()=>n.current?.currentSlugs[t.locale]??n.current?.currentSlugs._),f=A(()=>({...t.fieldConfig,widget:`select`,options:kB({locale:t.locale,fieldConfig:t.fieldConfig,refEntries:z(l),currentLocaleValues:z(u),currentSlug:z(d),pendingEntries:n.current?.pendingEntries})})),p=A(()=>o()||!n.current?void 0:x$e({fieldConfig:t.fieldConfig,draft:n.current})),m=A(()=>!!z(p)&&!!n.current&&S$e({collection:z(p),draft:n.current})),h=A(()=>z(p)&&Jc.current?pj(z(p),{useSingular:!0}):``);var g=R$e(),_=N(g);I$e(_,{get locale(){return t.locale},get keyPath(){return t.keyPath},get typedKeyPath(){return t.typedKeyPath},get fieldId(){return t.fieldId},get fieldLabel(){return t.fieldLabel},get fieldConfig(){return z(f)},get readonly(){return o()},get required(){return a()},get invalid(){return s()},get currentValue(){return i()},set currentValue(e){i(e)}});var v=I(_,2),y=e=>{var i=L$e(),a=P(i),o=N(a);{let e=e=>{Xc(e,{name:`add`})},t=A(()=>Y(`add_x`,{values:{name:z(h)}})),n=A(()=>!z(m));Al(o,{variant:`tertiary`,size:`small`,get label(){return z(t)},get disabled(){return z(n)},"aria-haspopup":`dialog`,onclick:()=>{M(c,!0)},startIcon:e,$$slots:{startIcon:!0}})}D(a),N$e(I(a,2),{get collection(){return z(p)},get fieldConfig(){return t.fieldConfig},onAdd:e=>{n.current&&O$e({draft:n.current,locale:t.locale,keyPath:t.keyPath,valueStoreKey:r,fieldConfig:t.fieldConfig,pendingEntry:e})},get open(){return z(c)},set open(e){M(c,e,!0)}}),U(e,i)};G(v,e=>{z(p)&&e(y)}),D(g),U(e,g),k()}var V$e=[`slug`,`{{slug}}`,`{{fields.slug}}`],H$e=({fieldConfig:e,currentValue:t,options:n})=>{let{multiple:r=!1,value_field:i=`{{slug}}`}=e;return(r?t??[]:[t]).filter(e=>e!=null&&e!==``).map(e=>String(e)).map(e=>{let t=n.find(t=>t.value===e)?.label;return!t||t===e?e:V$e.includes(i)?t:`${t} (${e})`})},U$e=B(`<p> </p>`);function W$e(e,t){O(t,!0);let n=$M(),r=A(()=>qA(t.locale)),i=A(()=>w$e({draft:n.current,fieldConfig:t.fieldConfig})),a=A(()=>kB({locale:t.locale,fieldConfig:t.fieldConfig,refEntries:z(i),pendingEntries:n.current?.pendingEntries})),o=A(()=>H$e({fieldConfig:t.fieldConfig,currentValue:t.currentValue,options:z(a)}));var s=H(),c=P(s),l=e=>{var n=U$e(),i=F(n,!0);R((e,t,r)=>{q(n,`lang`,e),q(n,`dir`,t),W(i,r),n.dir=n.dir},[()=>WA(t.locale),()=>GA(t.locale),()=>z(r).format(z(o))]),U(e,n)};G(c,e=>{z(o).length&&e(l)}),U(e,s),k()}var G$e=`https://sveltiacms.app/en/docs/troubleshooting#using-proper-naming-conventions`,K$e=`https://sveltiacms.app/en/docs/migration/netlify-decap-cms#features-not-to-be-implemented`,E8=({type:e=`error`,strKey:t,values:n={},extraStrKey:r,context:i={},collectors:a})=>{let{collection:o,collectionFile:s,componentName:c,typedKeyPath:l}=i,{errors:u,warnings:d}=a,f=[];o&&f.push(Y(`config.error_locator.collection`,{values:{collection:o.label_singular||o.label||o.name}})),s&&f.push(Y(`config.error_locator.file`,{values:{file:s.label||s.name}})),c&&f.push(Y(`config.error_locator.component`,{values:{component:c}})),l&&f.push(Y(`config.error_locator.field`,{values:{field:l}}));let p=e===`error`?u:d,m=Jc.current,h=f.length?`${qA(m).format(f)}: `:``,g=Y(`config.${e}.${t}`,{values:n});t===`invalid_field_name`&&(g=yA(g,G$e));let _=r?Y(`config.${r}`,{values:{link:r===`compatibility_link`?K$e:void 0}}):``;p.add(`${h}${g}${_?` ${_}`:``}`)},D8=({UNSUPPORTED_OPTIONS:e,config:t,context:n,collectors:r})=>{e.forEach(({type:e=`error`,prop:i,newProp:a,value:o,strKey:s=`unsupported_deprecated_option`})=>{i in t&&(o===void 0||t[i]===o)&&E8({type:e,strKey:s,values:{prop:i,newProp:a},extraStrKey:`compatibility_link`,context:n,collectors:r})})},q$e=/^[^\s.*:<>]+$/,J$e=e=>q$e.test(e)&&e!==`__proto__`,O8=({name:e,index:t,nameCounts:n,strKeyBase:r,context:i,collectors:a,required:o=!1})=>{if(typeof e!=`string`||!e){if(e===``||o&&e===void 0){let e=String(t+1);E8({strKey:`missing_${r}`,context:i,values:{count:e},collectors:a})}return!1}if(!J$e(e))return E8({strKey:`invalid_${r}`,context:i,values:{name:e},collectors:a}),!1;let s=Object.hasOwn(n,e)?n[e]:0;return s===1?(E8({strKey:`duplicate_${r}`,context:i,values:{name:e},collectors:a}),!1):(n[e]=s+1,!0)},k8=({option:e,pattern:t,context:n,collectors:r})=>{typeof t==`string`&&XR(t)===void 0&&E8({strKey:`invalid_regex`,values:{option:e,pattern:t},context:n,collectors:r})},Y$e=[`boolean`,`color`,`datetime`,`number`,`relation`,`select`,`string`],A8=e=>{if(e.length!==1)return!1;let[t]=e,n=t.widget??`string`;return Y$e.includes(n)&&!t.multiple},X$e=({definition:e,componentName:t,cmsConfig:n,collectors:r})=>{let{mode:i,fields:a}=e;i===`inline`&&!A8(a)&&E8({strKey:`invalid_inline_component_fields`,context:{cmsConfig:n,componentName:t},collectors:r})},Z$e=({template:e,values:t,fields:n,locale:r})=>{if(!e)return null;let i=mN(e,()=>``);if(i===e)return e.trim()||null;if(!t)return null;let a=zj(t),o=e=>{let{value:t,transformations:i}=sP(e),s=_N(t),c=a[s];if(c==null)return``;let l=fN(i,o);return l.length&&(c=cP({fieldConfig:n.find(e=>e.name===s),value:c,transformations:l,locale:r})),String(c)},s=mN(e,(e,t)=>o(t));return s!==i&&s.trim()?s.trim():null},Q$e=({currentValues:e,values:t,fields:n})=>n.some(t=>e?.[t.name]!==void 0)?e:t,$$e=({template:e,currentValues:t,values:n,fields:r,locale:i,label:a,hasThumbnail:o=!1})=>{let s=Q$e({currentValues:t,values:n,fields:r}),c=Z$e({template:e,values:s,fields:r,locale:i});if(c)return c;let l=r.find(e=>e.widget===`string`||e.widget===`text`||!e.widget);if(l&&s){let e=s[l.name];if(typeof e==`string`&&e.trim())return e.trim()}return o?``:a},e1e=({thumbnailFieldName:e,values:t,...n})=>{if(e&&t)return CXe({...n,thumbnailFieldName:e,keyPath:``,typedKeyPath:``,valueMap:zj(t)})},t1e=({draft:e,locale:t,keyPathPrefix:n})=>{let{validities:r,validationMessages:i}=N2(`extraValues`,{draft:e});return Object.keys(e.validities).forEach(t=>{Object.assign(e.validities[t],r[t]),Object.assign(e.validationMessages[t],i[t])}),!Object.entries(r[t]??{}).some(([e,t])=>e.startsWith(n)&&!t.valid)},j8=(e,t)=>{Object.keys(e??{}).forEach(n=>{n.startsWith(t)&&delete e[n]})},n1e=(e,t)=>Object.fromEntries(Object.entries(zj(e)).map(([e,n])=>[`${t}${e}`,n])),r1e=(e,t)=>Vj(Object.fromEntries(qO(e,t).map(n=>[n.slice(t.length),e[n]]))),i1e=({values:e,fields:t,componentName:n,locale:r,defaultLocale:i})=>{let a=e??Bj(a6({fields:t,locale:r,defaultLocale:r}));a.__sc_component_name=n;let o=Bj(f8({fields:t,content:zj(a),locale:r,defaultLocale:i,fillDefaults:!1}));return(0,yr.default)(o,a)?a:o},a1e=B(`<span role="none"> </span>`),o1e=B(`<!> <!> <!> <!>`,1),s1e=B(`<div role="none" class="fields svelte-1l1n28m"><!></div>`),c1e=B(`<span contenteditable="false" tabindex="0"><!> <!></span> <!>`,1),l1e=B(`<span role="group" class="component inline-field svelte-1l1n28m" contenteditable="false" tabindex="0"><!></span>`),u1e=B(`<div role="none" class="item-list"><!></div>`),d1e=B(`<div role="group" contenteditable="false" tabindex="0"><!> <!></div>`),f1e={hash:`svelte-1l1n28m`,code:`.component.svelte-1l1n28m {&.block {display:block;&:not(:first-child) {margin-top:var(--sui-paragraph-margin);}&:not(:last-child) {margin-bottom:var(--sui-paragraph-margin);}}&.inline {display:inline-block;}}.wrapper.svelte-1l1n28m {border-inline-width:2px;border-color:var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);width:100%;color:var(--sui-secondary-foreground-color); /* Reset color within a link */background-color:var(--sui-primary-background-color);white-space:normal;-webkit-user-select:none;user-select:none;&.expanded {border-bottom-width:2px;}&:focus {outline-color:var(--sui-primary-accent-color-translucent);}
/* Make the input fields compact within the built-in image component */&:is([data-component-name='image']:where(.svelte-1l1n28m), [data-component-name='linked-image']:where(.svelte-1l1n28m)) {
@media (768px <= width) {
/* Hide the bottom border */[data-field-type]::after {display:none;}[data-field-type='string'] {display:flex;align-items:center;gap:8px;padding-block:0 16px;h4 {margin-bottom:0 !important;}.field-wrapper {flex:auto;}}
}button {margin:var(--sui-focus-ring-width);}}}.inline-field.svelte-1l1n28m {
/* Make the controls as compact as the text around them allows */--sui-textbox-singleline-min-width: 8em;--sui-combobox-min-width: 6em;display:inline-flex;align-items:center;vertical-align:middle;margin-inline:2px;border-radius:var(--sui-control-medium-border-radius);padding:2px;background-color:var(--sui-secondary-background-color);white-space:normal;-webkit-user-select:none;user-select:none;&:focus {outline:2px solid var(--sui-primary-accent-color-translucent);outline-offset:1px;}.field.inline {display:inline-flex;align-items:center;}
/* Only the control itself, not the text box within a number input */.field.inline > .sui:is(.text-input, .number-input, .combobox) {margin:0;width:auto;}}.placeholder.svelte-1l1n28m {--icon-size: 20px; /* Thumbnail size */align-items:center;gap:0.4em;border:dashed 1px currentColor;border-color:hsl(from currentColor h s l / 0.5);border-radius:2px;padding-inline:0.4em;cursor:pointer;-webkit-user-select:none;user-select:none;&:not(.static):hover {border-color:currentColor;}&:focus {outline:2px solid var(--sui-primary-accent-color-translucent);outline-offset:1px;}&.inline {display:inline-flex;}&.block {display:flex;width:fit-content;}
/* Center the thumbnail on the line rather than sitting it on the baseline */&:has(.preview) {vertical-align:middle;}&.thumbnail-only {padding:2px;}
/* A component without fields can’t be edited */&.static {cursor:default;}}.fields.svelte-1l1n28m {display:flex;flex-direction:column;gap:16px;}`};function p1e(e,t){let n=Eo();O(t,!0),K(e,f1e);let r=(e,n)=>{let r=()=>(n?.()).typedPrefix,i=()=>(n?.()).observe,a=Ei(()=>Mr((n?.()).inline,!1));var o=H();Bo(P(o),17,()=>t.fields,e=>e.name,(e,n)=>{let o=e=>{H6(e,{get locale(){return z(p)},get keyPath(){return`${z(C)??``}${z(n).name??``}`},get typedKeyPath(){return`${r()??``}${z(n).name??``}`},get fieldConfig(){return z(n)},context:`rich-text-editor-component`,get componentName(){return t.componentName},valueStoreKey:te,get inline(){return z(a)}})};var s=H(),c=P(s),l=e=>{UO(e,{children:(e,t)=>{o(e)},$$slots:{default:!0}})},u=e=>{o(e)};G(c,e=>{i()?e(l):e(u,-1)}),U(e,s)}),U(e,o)},i=j(void 0);QM({get current(){return z(i)?.current},set current(e){z(i)&&(z(i).current=e)},get modified(){return z(i)?.modified??!1}});let a=j([]),o=j(!1);ci(`field-editor`,{get parentComponentNames(){return z(a)},get readonly(){return z(o)}});let s=J(t,`mode`,3,`block`),c=J(t,`inline`,3,!1),l=J(t,`collapsed`,3,!1),u=J(t,`values`,7),d=J(t,`onChange`,3,()=>void 0),f=j(void 0),p=j(``),m=j(``),h=j(``),g=j(!l()),_=j(!1),v=j(void 0),y=j(!1),b=A(()=>t.fields.length>0),x=A(()=>s()===`inline`&&A8(t.fields)),S=A(()=>JSON.stringify([...z(a),t.componentName])),C=A(()=>z(m)?`${z(m)}:${n}:`:``),w=A(()=>z(h)?`${z(h)}:${n}:`:``),T=()=>z(f),ee=e=>{let{target:t}=e;t.closest(`[contenteditable]`)===z(f)&&(e.stopPropagation(),!t.matches(`button, input, textarea`)&&e.key!==`Tab`&&e.preventDefault(),t===z(f)&&e.key===`Backspace`&&!z(o)&&d()(new CustomEvent(`remove`)))},te=`extraValues`,ne,re=!1,ie,ae=A(()=>{if(z(i)?.current&&z(p)&&z(m))return r1e(GM(z(i).current,z(p),te),z(C))}),oe=e=>{z(i)&&tN(e,z(i))},se=()=>{z(b)&&(M(v,z(ae)?{...z(ae)}:void 0,!0),M(_,!0))},ce=()=>{let e=z(i)?.current;e&&z(p)&&z(m)&&z(v)&&(j8(e[te][z(p)],z(C)),Object.assign(e[te][z(p)],n1e(z(v),z(C))))},le=()=>{M(_,!1),d()(new CustomEvent(`remove`))},ue=async()=>{await oN();let e=z(i)?.current;e&&t1e({draft:e,locale:z(p),keyPathPrefix:z(C)})&&(M(y,!1),M(_,!1),d()(new CustomEvent(`update`,{detail:z(ae)})),M(v,void 0))},de=()=>{z(y)?(M(_,!1),d()(new CustomEvent(`remove`))):(ce(),M(_,!1),M(v,void 0))},fe=j(void 0),pe=A(()=>{let e=z(i)?.current;if(!e)return;let n=e1e({thumbnailFieldName:t.thumbnail,values:Q$e({currentValues:z(ae),values:u(),fields:t.fields}),componentName:t.componentName,collectionName:e.collectionName,fileName:e.fileName,isIndexFile:e.isIndexFile,entry:e.originalEntry,files:e.files,locale:z(p)});return n&&(n.asset??n.url)!==z(fe)?n:void 0}),me=A(()=>$$e({template:t.summary,currentValues:z(ae),values:u(),fields:t.fields,locale:z(p),label:t.label,hasThumbnail:!!z(pe)}));js(()=>(window.requestAnimationFrame(()=>{M(i,wxe(z(f)),!0),M(a,lxe(z(f))),ie=uxe(z(f),e=>{M(o,e,!0)});let e=z(f)?.closest(`[data-locale]`),t=z(f)?.closest(`[data-key-path]`);M(p,e?.dataset.locale,!0),M(m,t?.dataset.keyPath,!0),s()!==`dialog`&&M(h,t?.dataset.typedKeyPath,!0),M(y,!u()),s()===`dialog`&&z(y)&&se()}),()=>{let e=z(i)?.current;re=!0,ie?.disconnect(),e&&(j8(e[te][z(p)],z(C)),j8(e.validities[z(p)],z(C)))})),vk(()=>[u(),z(p),z(m)],()=>{if(z(i)?.current&&z(p)&&z(m)){let e=i1e({values:u(),fields:t.fields,componentName:t.componentName,locale:z(p),defaultLocale:z(i).current.defaultLocale});if(e!==u()&&u(e),!(0,yr.default)(u(),z(ae))){let e=z(i),t=n1e(u(),z(C));nN(()=>{let n=e.current;n&&(re||Object.assign(n[te][z(p)],t))})}s()===`dialog`&&!z(b)&&z(y)&&(M(y,!1),d()(new CustomEvent(`update`,{detail:u()})))}}),vk(()=>[s(),z(ae)],()=>{s()!==`dialog`&&!(0,yr.default)(ne,z(ae))&&(d()(new CustomEvent(`update`,{detail:z(ae)})),ne=z(ae))});var he={getElement:T},ge=H(),_e=P(ge),ve=e=>{var n=c1e(),i=P(n);let a;var s=N(i),l=e=>{h$(e,{get asset(){return z(pe).asset},get src(){return z(pe).url},variant:`icon`,cover:!0,onError:()=>{let{asset:e,url:t}=z(pe);M(fe,e??t)}})};G(s,e=>{z(pe)&&e(l)});var u=I(s,2),h=e=>{var t=a1e(),n=F(t,!0);R(()=>W(n,z(me))),U(e,t)};G(u,e=>{z(me)&&e(h)}),D(i),Ds(i,e=>M(f,e),()=>z(f));var g=I(i,2),v=e=>{tu(e,{get title(){return t.label},size:`large`,showOk:!1,showCancel:!1,onCancel:()=>{de()},get open(){return z(_)},set open(e){M(_,e,!0)},footer:e=>{var t=o1e(),n=P(t),r=e=>{{let t=A(()=>Y(`remove`));Al(e,{variant:`secondary`,get label(){return z(t)},onclick:()=>{le()}})}};G(n,e=>{z(o)||e(r)});var i=I(n,2);$l(i,{flex:!0});var a=I(i,2),s=e=>{{let t=A(()=>Y(z(y)?`insert`:`update`));Al(e,{variant:`primary`,get label(){return z(t)},onclick:()=>{ue()}})}};G(a,e=>{z(o)||e(s)});var c=I(a,2);{let e=A(()=>Y(`cancel`));Al(c,{variant:`secondary`,get label(){return z(e)},onclick:()=>{de()}})}U(e,t)},children:(e,t)=>{var n=s1e(),i=N(n),a=e=>{r(e,()=>({typedPrefix:z(C),observe:!1}))};G(i,e=>{z(p)&&z(m)&&e(a)}),D(n),es(n,()=>oe),R(()=>{q(n,`data-locale`,z(p)),q(n,`data-component-path`,z(S))}),U(e,n)},$$slots:{footer:!0,default:!0}})};G(g,e=>{z(b)&&e(v)}),R(()=>{q(i,`role`,z(b)?`button`:`img`),a=os(i,1,`component ${c()?`inline`:`block`} placeholder`,`svelte-1l1n28m`,a,{static:!z(b),"thumbnail-only":!!z(pe)&&!z(me)}),q(i,`aria-label`,t.label),q(i,`title`,t.label),q(i,`data-key-path-prefix`,z(C)),q(i,`data-component-name`,t.componentName)}),bo(`click`,i,()=>{se()}),bo(`keydown`,i,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),se()),e.key===`Backspace`&&(e.preventDefault(),z(o)||d()(new CustomEvent(`remove`)))}),U(e,n)},ye=e=>{var n=l1e(),i=N(n),a=e=>{r(e,()=>({typedPrefix:z(w),observe:!1,inline:!0}))};G(i,e=>{z(p)&&z(m)&&e(a)}),D(n),Ds(n,e=>M(f,e),()=>z(f)),es(n,()=>e=>vo(e,`keydown`,ee)),R(()=>{q(n,`aria-label`,t.label),q(n,`title`,t.label),q(n,`data-key-path-prefix`,z(C)),q(n,`data-component-name`,t.componentName),q(n,`data-component-path`,z(S))}),U(e,n)},be=e=>{var i=d1e();let a;var s=N(i);U6(s,{get label(){return t.label},get controlId(){return`object-${n}-item-list`},get expandable(){return z(b)},get expanded(){return z(g)},set expanded(e){M(g,e,!0)},endContent:e=>{var t=H(),n=P(t),r=e=>{g$(e,{onclick:()=>{d()(new CustomEvent(`remove`))}})};G(n,e=>{z(o)||e(r)}),U(e,t)},$$slots:{endContent:!0}});var l=I(s,2),u=e=>{var t=u1e(),i=N(t),a=e=>{r(e,()=>({typedPrefix:z(w),observe:!0}))};G(i,e=>{z(p)&&z(m)&&z(g)&&e(a)}),D(t),R(()=>q(t,`id`,`object-${n}-item-list`)),U(e,t)};G(l,e=>{z(b)&&e(u)}),D(i),Ds(i,e=>M(f,e),()=>z(f)),es(i,()=>e=>vo(e,`keydown`,ee)),R(()=>{a=os(i,1,`component ${c()?`inline`:`block`} wrapper`,`svelte-1l1n28m`,a,{expanded:z(b)&&z(g)}),q(i,`aria-label`,t.label),q(i,`data-key-path-prefix`,z(C)),q(i,`data-component-name`,t.componentName),q(i,`data-component-path`,z(S))}),U(e,i)};return G(_e,e=>{s()===`dialog`?e(ve):z(x)?e(ye,1):e(be,-1)}),U(e,ge),k(he)}xo([`click`,`keydown`]);var m1e=/^([ \t]*)(`{3,}|~{3,})(.*)$/,h1e=/`+/g,g1e=/\n[ \t]*\n/,_1e=RegExp(`^ {0,3}</?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:[ \\t]|/?>|$)`,`i`),v1e=/^ {0,3}(?:<(?!(?:pre|script|style|textarea)[\s/>])[a-z][a-z\d-]*(?:[ \t]+[a-z_:][\w.:-]*(?:[ \t]*=[ \t]*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*[ \t]*\/?>|<\/[a-z][a-z\d-]*[ \t]*>)[ \t]*$/i,y1e=(e,t,n)=>{let r=0;for(;t-r>n&&e[t-r-1]===`\\`;)r+=1;return r%2==1},b1e=e=>{let[,t=``,n=``,r=``]=e.match(m1e)??[];if(!(!n||n[0]==="`"&&r.includes("`")))return{indent:t,char:n[0],length:n.length,info:r}},x1e=(e,{char:t,length:n})=>{let r=e.trim();return r.length>=n&&r===t.repeat(r.length)},S1e=e=>{let t=[],n,r=0,i=0,a=(n,r)=>{let i=e.slice(n,r),a=[...i.matchAll(h1e)],o=0;a.forEach(({0:e,index:r},s)=>{if(r<o||y1e(i,r,o))return;let c=a.find((t,n)=>n>s&&t[0].length===e.length);c&&!g1e.test(i.slice(r,c.index))&&(o=c.index+e.length,t.push([n+r,n+o]))})};return e.split(`
`).forEach(e=>{let o=i+e.length;if(n)x1e(e,n)&&(t.push([n.start,o]),n=void 0,r=o);else{let t=b1e(e);t&&(a(r,i),n={start:i+t.indent.length,char:t.char,length:t.length})}i=o+1}),n?t.push([n.start,e.length]):a(r,e.length),t.sort(([e],[t])=>e-t)},C1e=(e,t)=>t.some(([t,n])=>e>t&&e<n),w1e=(e,{afterParagraph:t=!1}={})=>_1e.test(e)||!t&&v1e.test(e),T1e=(e,t)=>{let n=e.slice(0,Math.max(0,t-1)).split(`
`),r=n.findLastIndex(e=>!e.trim())+1;return n.slice(r).some((e,t)=>w1e(e,{afterParagraph:t>0}))},M8=()=>void 0,E1e=new WeakMap,D1e=({fields:e})=>U1.current?PA(E1e,e,()=>K1().fromJS(e)):void 0,O1e=e=>Array.from(e).reduce((e,t)=>((e^t.charCodeAt(0))>>>0)*16777619>>>0,2166136261).toString(16),k1e=(...e)=>{let{alt:t,src:n,title:r,alt2:i,src2:a,title2:o,link:s}=e.at(-1);if(a!==void 0){let e=/["']/.test(s)?s:s.replaceAll(` `,`%20`);return`[${k1e({alt:i,src:a,title:o})}](${e})`}let c=n.replaceAll(` `,`%20`);return r?`![${t}](${c} "${r}")`:`![${t}](${c})`},A1e=new RegExp(tM,`g`),j1e=[`image`,`linked-image`],M1e=new Map,N1e=10,P1e=e=>typeof e==`string`?[e]:e&&typeof e==`object`?Object.values(e).flatMap(P1e):[],F1e=e=>PA(M1e,`${e.source}|${e.flags}`,()=>e.global?e:new RegExp(e.source,`${e.flags}g`)),I1e=({match:e,index:t,end:n},r)=>r.some(r=>t>=r.start&&n<=r.end&&r.values.some(t=>t.includes(e[0]))),L1e=(e,t,n)=>{let r=[],i=S1e(e);t.forEach((t,a)=>{e.matchAll(F1e(t.pattern)).forEach(e=>{let o={def:t,match:e,index:e.index,end:e.index+e[0].length,order:a};e[0]&&!C1e(e.index,i)&&(!n||I1e(o,n))&&r.push(o)})}),r.sort((e,t)=>e.index-t.index||t.end-e.end||e.order-t.order);let a=0;return r.filter(e=>e.index<a?!1:(a=e.end,!0))},R1e=(e,t)=>({seenHashes:new Map,previewMap:new Map,previousPreviewMap:e,getAsset:t,assetMap:new Map}),z1e=(e,{def:t,fieldProps:n,source:r})=>{let{seenHashes:i,previewMap:a,previousPreviewMap:o,getAsset:s,assetMap:c}=e,{toPreview:l}=t,u=O1e(r),d=i.get(u)??0,f=d===0?u:`${u}-${d}`,p=o?.get(f);if(p==null&&l){let e=[];p=l(n,(t,n)=>{let r=s(t,n);return r&&e.push(r),r},D1e(t)),e.length&&c.set(f,e)}return i.set(u,d+1),a.set(f,p),{key:f,preview:p}},B1e=(e,t)=>{let n=e.indexOf(`
`,t);return n>=0&&e.slice(n+1).split(`
`,1)[0].trim()?n:void 0},V1e=(e,{preview:t,index:n,end:r})=>{let i=e.lastIndexOf(`
`,n-1)+1,a=e.slice(i,n);if(!/^ {0,3}$/.test(a)||t.includes(`
`))return;let[o]=t.split(`
`),s=B1e(e,r),c=a+o+(o===t?e.slice(r,s??e.indexOf(`
`,r)):``),l=i?e.slice(e.lastIndexOf(`
`,i-2)+1,i-1):``;return s!==void 0&&w1e(c,{afterParagraph:!!l.trim()})&&!T1e(e,i)?s:void 0},H1e=(e,{string:t,matches:n})=>{let r=[],i=[],a=0,o=0,s,c=e=>{let n=t.slice(a,e);s!==void 0&&s<e&&(n=`${t.slice(a,s)}\n${t.slice(s,e)}`,s=void 0),r.push(n),o+=n.length};return n.forEach(({def:n,match:l,index:u,end:d})=>{let f=n.fromBlock?.(l)??l.groups??{},{key:p,preview:m}=z1e(e,{def:n,fieldProps:f,source:l[0]});if(c(u),typeof m==`string`)i.push({start:o,end:o+m.length,values:P1e(f)}),r.push(m),o+=m.length,s=V1e(t,{preview:m,index:u,end:d})??s;else{let e=`<span data-component-key="${p}"></span>`;r.push(e),o+=e.length}s!==void 0&&s<d&&(s=B1e(t,d)),a=d}),c(t.length),{string:r.join(``),regions:i}},U1e=(e,t,n,r=M8)=>{let i=t.filter(e=>Xj(e)&&!!e.toPreview),a=R1e(n,r),{previewMap:o,assetMap:s}=a;if(!i.length)return{markdown:e,previewMap:o,assetMap:s};let c=document.createElement(`template`);c.innerHTML=e;let l=e=>{[...e.children].forEach(e=>{let t,n=i.find(n=>(t=e.matches(n.htmlSelector)?n.fromBlockHTML(e):void 0,!!t));if(!n){l(e);return}let{key:r,preview:o}=z1e(a,{def:n,fieldProps:t,source:e.outerHTML});if(typeof o==`string`){let t=document.createElement(`template`);t.innerHTML=o,e.replaceWith(t.content)}else{let t=document.createElement(`span`);t.dataset.componentKey=r,e.replaceWith(t)}})};return l(c.content),{markdown:c.innerHTML,previewMap:o,assetMap:s}},W1e=(e,t,n,r=M8,i=`markdown`)=>{if(i===`html`)return U1e(e??``,t,n,r);let a=R1e(n,r),{previewMap:o,assetMap:s}=a,c=e??``,l=S1e(c),u=t.filter(({id:e})=>!j1e.includes(e)),d=c.replace(A1e,(...e)=>C1e(e.at(-3),l)?e[0]:k1e(...e)),f;for(let e=0;e<N1e&&u.length;e+=1){let e=L1e(d,u,f);if(!e.length)break;let t=H1e(a,{string:d,matches:e});if(d=t.string,f=t.regions,!f.length)break}return{markdown:d,previewMap:o,assetMap:s}},G1e=/^<(?<tagName>[a-z]+)/i,K1e=(e,t)=>{if(e&&typeof e==`object`&&`localName`in e)return e.localName;if(typeof e==`string`)return e.trim().match(G1e)?.groups?.tagName??(typeof t==`string`?t.trim().match(G1e)?.groups?.tagName:void 0)},q1e=(e,t=[])=>{try{return e?.({},...t)}catch{return}},J1e=e=>{let{id:t,label:n,collapsed:r,mode:i,summary:a,thumbnail:o,fields:s,pattern:c,toBlock:l,toPreview:u,htmlSelector:d,fromBlockHTML:f,toBlockHTML:p}=e,m=!Jj(c),h=Xj(e),g=h?Yj(d):[],_=h?void 0:q1e(u,[M8,D1e(e)]),v=h?void 0:q1e(l),y=h?void 0:K1e(_,v),b=e=>e.matches(d)?f(e):void 0;class x extends $g{__props;constructor(e,t){super(t),this.__props=e}static getType(){return t}isInline(){return m}static clone(e){return new x(e.__props,e.__key)}static importJSON(e){return new x().updateFromJSON(e)}exportJSON(){return{...Zj(this.__props??{}),type:t,version:1}}createDOM(e,c){let l=!!c&&!Fv(`sui-import`)&&!Fv(`history-merge`),u,d=null,f,p=!1,h=()=>{p||(p=!0,jo(f))};return f=Oo(p1e,{target:document.createElement(`div`),props:{componentName:t,label:n,collapsed:r,mode:i,inline:m,summary:a,thumbnail:o,fields:s,values:this.__props,onChange:async({type:e,detail:t})=>{await co(),d??=K_(u);let{activeElement:n}=document,r=n,i=r?.matches(`[contenteditable="true"]`)?window.getSelection():null,a=i&&i.rangeCount>0?i.getRangeAt(0).cloneRange():null;d?.update(()=>{if(e===`update`)try{this.getWritable().__props=t}catch{}e===`remove`&&(h(),this.remove())},{discrete:!0,tag:e===`update`?`skip-dom-selection`:void 0,onUpdate:()=>{r&&document.body.contains(r)&&(r.focus({preventScroll:!0}),a&&i&&(i.removeAllRanges(),i.addRange(a)))}})}}}),Vi(),u=f.getElement(),window.requestAnimationFrame(()=>{let e=u.isConnected?u.closest(`[data-lexical-editor]`):null;if(!e){h();return}l&&u.closest(`[role="textbox"][aria-readonly="false"]`)&&u.focus(),u.closest(`.field`)?.addEventListener(`Unmount`,h,{once:!0});let t=new MutationObserver(()=>{u.isConnected||(h(),t.disconnect())});t.observe(e,{childList:!0,subtree:!0})}),u}exportDOM(){if(!p)return{element:this.createDOM()};let e=p(Zj(this.__props??{}));if(e&&typeof e==`object`)return{element:e};let t=document.createElement(`template`);return t.innerHTML=typeof e==`string`?e:``,{element:t.content}}static importDOM(){let e={};return h?(g.forEach(t=>{e[t]=e=>{let t=b(e);return t?{conversion:()=>({node:new x(t),after:()=>[]}),priority:4}:null}}),e):(y&&(e[y]=()=>({conversion:e=>({node:new x(Object.fromEntries(s.map(({name:t})=>[t,e[t]??``])))}),priority:3})),e)}updateDOM(){return!1}}return x},Y1e=({componentDef:e,CustomNode:t})=>{let{id:n,pattern:r,fromBlock:i,toBlock:a}=e,o=new RegExp(r.source,r.flags.replace(`g`,``)),s=e=>i?.(e)??e.groups??{},c=e=>e instanceof t&&e.getType()===n,l=e=>c(e)?a(Zj(e.__props??{})):null;return Jj(r)?{type:`multiline-element`,dependencies:[t],regExpStart:/^./,regExpEnd:{optional:!0,regExp:/.$/},handleImportAfterStartMatch:({lines:e,rootNode:n,startLineIndex:r})=>{let i=e.slice(r).join(`
`),[a]=i.match(o)??[];if(!a||!i.startsWith(a))return null;let c=a.match(o),l=a.replace(/\n$/,``).split(`
`),u=r+l.length-1;return e[u].slice(l.at(-1).length).trim()?null:c?(n.append(new t(s(c))),[!0,u]):[!1,u]},replace:()=>void 0,export:l}:{type:`text-match`,dependencies:[t],importRegExp:o,regExp:o,replace:(e,n)=>{e.replace(new t(s(n)))},export:l}},X1e=new Map,Z1e=e=>{let t=J1e(e);return{node:t,createNode:e=>new t(e),transformer:Y1e({componentDef:e,CustomNode:t})}},Q1e=class{constructor(e){let t=PA(X1e,e.id,()=>Z1e(e));Object.assign(this,{...e,...t})}},$1e=/^data:(?<type>image\/.+?);base64,.+/,e0e=`image.png`,t0e=e=>EH.test(e)||sOe.test(e),n0e=(e,t=``)=>{let{year:n,month:r,day:i,hour:a,minute:o,second:s}=_z();return`${n}${r}${i}-${a}${o}${s}${t}.${e}`},r0e=(e,t)=>{let n=NP(new URL(e).pathname.split(`/`).pop());if(!t0e(n))return;let{filename:r,extension:i}=Uk(n),a=rV.getExtension(t);return HP(i,a)?n:`${r}.${a}`},i0e=e=>new DOMParser().parseFromString(e,`text/html`).querySelector(`img`),a0e=async e=>{let{clipboardData:t}=e,n=t?.items;if(!n)return[];let r=[],i=[...n].findIndex(({kind:e,type:t})=>e===`file`&&OH.includes(t)),a=[...n].findIndex(({kind:e,type:t})=>e===`string`&&t===`text/html`);if(i>-1&&a>-1){let t=n[i].getAsFile();if(!t)return[];n.clear(),e.stopPropagation();let o=``,s=t.name,c=await new Promise(e=>{n[a].getAsString(t=>{e(i0e(t))})});c&&(o=c.alt,/^https?:/.test(c.src)&&(s=r0e(c.src,t.type)??s)),r=[{file:new File([t],s,{type:t.type}),alt:o}]}else r=[...t.files].filter(({type:e})=>OH.includes(e)).map(e=>({file:e}));return r.map(({file:e,alt:t},n)=>{if(e?.name===e0e){let t=r.length>1?`-${n+1}`:``;e=new File([e],n0e(`png`,t),{type:e.type})}return{file:e,alt:t}})},o0e=async e=>{let{dataTransfer:t}=e,n=t?.files;if(n?.length)return[...n].filter(({type:e})=>OH.includes(e)).map(e=>({file:e}));let r=t?.getData(`text/html`),i=r?i0e(r):null;if(!i)return[];let{src:a,alt:o}=i,s=a.match($1e)?.groups?.type??``,c;if(OH.includes(s))try{let e=await(await fetch(a)).blob(),t=s.split(`/`)[1].replace(/\+.*$/,``);c=new File([e],n0e(t),{type:s})}catch{return[]}return[{file:c,src:a,alt:o}]},s0e=e=>{let t=Sk.current?.field_defaults?.richtext??{},{editor_components:n=t.editor_components??[...xRe,...tk.keys()],linked_images:r=t.linked_images??!0}=e;return n.map(e=>e===`image`&&r?`linked-image`:e)},c0e=e=>s0e(e).map(e=>oM(e)).filter(e=>!!e),l0e=[`code-block`,`table`,`hr`],u0e=(e,t)=>[...e,...l0e.filter(e=>t.includes(e))].map(e=>bRe[e]).filter(Boolean),d0e=e=>e?.allow_nested_components??Sk.current?.field_defaults?.richtext?.allow_nested_components??!0,f0e=e=>e.match(/^[^:]+/)?.[0],p0e=({fieldConfig:e,format:t,allowNestedComponents:n,inEditorComponent:r,parentComponentNames:i})=>r&&!n?[]:c0e(e).filter(e=>t!==`html`||Xj(e)).filter(e=>n!==`exclude_self`||!i.includes(e.id)),m0e=(e,t,n)=>Object.keys(e).filter(e=>{let[r]=e.match(vZ)??[];return!!r?.startsWith(`${t}:`)&&!n(r)}),h0e=B(`<div role="none"><!></div>`),g0e={hash:`svelte-duifo7`,code:`.wrapper.svelte-duifo7 {--sui-paragraph-margin: 20px;display:contents;&.minimal {:is([role='textbox'], textarea) {overflow:auto;max-height:240px;}}
@media (width < 768px) {.sui.text-editor {
/* Remove the section padding */margin:0 calc(var(--field-editor-padding) * -1) calc(var(--field-editor-padding) * -1);width:100dvw;}:is(.sui.toolbar, .lexical-root, textarea) {border:0;border-radius:0;}
}}`};function _0e(e,t){O(t,!0),K(e,g0e);let n=$M(),r=Sk.current?.field_defaults?.richtext??{},{parentComponentNames:i,valueStoreKey:a}=si(`field-editor`)??{},o=u6(a),s=i.at(-1),c=J(t,`currentValue`,15),l=J(t,`required`,3,!0),u=J(t,`readonly`,3,!1),d=J(t,`invalid`,3,!1),f=j(void 0),p=j(``),m=0,h=j(!1),g=A(()=>Mr(t.fieldConfig.modes,()=>r.modes??[..._Re],!0)),_=A(()=>Mr(t.fieldConfig.buttons,()=>r.buttons??[...yRe],!0)),v=A(()=>Mr(t.fieldConfig.use_emoji_autocomplete,()=>r.use_emoji_autocomplete??!0,!0)),y=A(()=>Mr(t.fieldConfig.use_markdown_shortcuts,()=>r.use_markdown_shortcuts??!0,!0)),b=A(()=>Mr(t.fieldConfig.minimal,()=>r.minimal??!1,!0)),x=A(()=>bZ(t.fieldConfig)),S=A(()=>z(g).map(e=>vRe[e]).filter(Boolean)),C=A(()=>n.current?.isIndexFile??!1),w=A(()=>n.current?.collectionName??``),T=A(()=>n.current?.fileName),ee=A(()=>qM(n.current,t.locale,t.keyPath,a)),te=A(()=>s0e(t.fieldConfig)),ne=A(()=>u0e(z(_),z(te))),re=A(()=>d0e(o?bM({collectionName:z(w),fileName:z(T),isIndexFile:z(C),valueMap:z(ee),keyPath:f0e(t.keyPath)}):t.fieldConfig)),ie=A(()=>p0e({fieldConfig:t.fieldConfig,format:z(x),allowNestedComponents:z(re),inEditorComponent:o,parentComponentNames:i}).map(e=>new Q1e(e))),ae=A(()=>z(ie).find(({id:e})=>e===`image`||e===`linked-image`)),oe=A(()=>T3(w3({collectionName:z(w),fileName:z(T),componentName:s,typedKeyPath:t.typedKeyPath,isIndexFile:z(C)}))),se=async({target:e,images:r})=>{let i=e?.closest(`div`),a=K_(i);if(!n.current||!z(ae)||!i?.matches(`.lexical-root`)||!a)return;let o=z(ae).fields?.find(({name:e})=>e===`src`),{config:s}=JH({fieldConfig:o}),c=n.current,l=z(oe);for(let{file:e,src:n,alt:i=``}of r){let r=n;if(e){let{value:n}=await M3({draft:c,resource:{file:e,folder:l},libraryConfig:s,locale:t.locale});r=n}if(!r)continue;let o=r;a.update(()=>{pg([z(ae).createNode({src:o,alt:i}),j_()])})}},ce=async e=>{if(u())return;let{target:t}=e,n=await a0e(e);n.length&&await se({target:t,images:n})},le=async e=>{if(u())return;let{target:t}=e,n=await o0e(e);n.length&&await se({target:t,images:n})},ue=()=>{let e=n.current;e&&!o&&(window.clearTimeout(m),m=window.setTimeout(()=>{m0e(e.extraValues[t.locale],t.keyPath,e=>!!z(f)?.querySelector(`[data-key-path-prefix="${e}"]`)).forEach(n=>{delete e.extraValues[t.locale][n]})},500))};bk(()=>c(),e=>{c(e)},()=>z(p),e=>{M(p,e,!0)},e=>typeof e==`string`?e:``),vk(()=>c(),()=>{ue()}),L(()=>()=>{window.clearTimeout(m)}),L(()=>{if(!z(h))return;let{promise:e,resolve:t}=Promise.withResolvers();return aN(e),async()=>{await co(),t()}});var de=h0e();let fe;Fo(N(de),pl,null,e=>{var n=H();Io(P(n),()=>JSON.stringify(t.fieldConfig),e=>{{let n=A(()=>WA(t.locale)),r=A(()=>GA(t.locale));fye(e,{get lang(){return z(n)},get dir(){return z(r)},get format(){return z(x)},get modes(){return z(S)},get buttons(){return z(ne)},get components(){return z(ie)},get useEmojiAutocomplete(){return z(v)},get useMarkdownShortcuts(){return z(y)},flex:!0,get readonly(){return u()},get required(){return l()},get invalid(){return d()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},autoResize:!0,onpastecapture:e=>{ce(e)},ondrop:e=>{le(e)},get value(){return z(p)},set value(e){M(p,e,!0)},get pending(){return z(h)},set pending(e){M(h,e,!0)}})}}),U(e,n)}),D(de),Ds(de,e=>M(f,e),()=>z(f)),R(()=>fe=os(de,1,`wrapper svelte-duifo7`,null,fe,{minimal:z(b)})),U(e,de),k()}function v0e(){return{useNewRenderer:!0,renderer:{heading(...e){return dr.Renderer.prototype.heading.call(this,...e).replace(/^<(h\d)/,`<$1 dir="auto"`)},list(...e){return dr.Renderer.prototype.list.call(this,...e).replace(/^<(ol|ul)/,`<$1 dir="auto"`)},paragraph(...e){return dr.Renderer.prototype.paragraph.call(this,...e).replace(/^<p/,`<p dir="auto"`)}}}}var y0e=!1,b0e=({text:e,lang:t})=>(t?age(e,t):void 0)??!1,x0e=()=>{y0e||(y0e=!0,fr(v0e(),{renderer:{code:b0e}}))},S0e=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),C0e=e=>{let t=b1e(e);return t&&/^ {0,3}$/.test(t.indent)?t:void 0},w0e=/^<([a-zA-Z][a-zA-Z0-9]*)(?:[\s>])/,T0e=[{start:/^ {0,3}<(?:pre|script|style|textarea)(?:[\s>]|$)/i,end:/<\/(?:pre|script|style|textarea)>/i},{start:/^ {0,3}<!--/,end:/-->/},{start:/^ {0,3}<\?/,end:/\?>/},{start:/^ {0,3}<![a-z]/i,end:/>/},{start:/^ {0,3}<!\[CDATA\[/,end:/\]\]>/}],E0e=/^ {0,3}(?:[-+*]|\d{1,9}[.)])(?:[ \t]|$)/,D0e=new Map,O0e=e=>{let t=document.createElement(`template`);return t.innerHTML=e,[...t.content.childNodes].map(e=>e.nodeType===Node.ELEMENT_NODE?e.outerHTML:e.nodeType===Node.TEXT_NODE?_A(e.data):``).filter(Boolean)},k0e=e=>{let t=T0e.find(({start:t})=>t.test(e));return t&&!t.end.test(e.replace(t.start,``))?t.end:void 0},A0e=e=>{if(!e)return[];let t=e.split(`
`),n=[],r=[],i=null,a=null,o,s=!1,c=e=>{let n=t.find((t,n)=>n>e&&t.trim())??``;return/^[ \t]/.test(n)||E0e.test(n)};return t.forEach((e,t)=>{if(i)r.push(e),e.length-e.trimStart().length<=3&&x1e(e,i)&&(i=null);else if(o)r.push(e),o.test(e)&&(o=void 0);else if(a){r.push(e);let{openRe:t,closeRe:n}=a;a.depth+=[...e.matchAll(t)].length-[...e.matchAll(n)].length,a.depth<=0&&(a=null)}else{let l=C0e(e);if(o=l?void 0:k0e(e),l)r.push(e),i={char:l.char,length:l.length};else if(o)r.push(e);else{let i=w0e.exec(e);if(i){let t=i[1].toLowerCase();if(r.push(e),!S0e.has(t)){let{openRe:n,closeRe:r}=PA(D0e,t,()=>({openRe:RegExp(`<${t}(?:[\\s>])`,`gi`),closeRe:RegExp(`<\\/${t}>`,`gi`)})),i=[...e.matchAll(n)].length-[...e.matchAll(r)].length;i>0&&(a={tag:t,depth:i,openRe:n,closeRe:r})}}else e===``?s&&c(t)?r.push(e):r.length&&(n.push(r.splice(0).join(`
`)),s=!1):(r.push(e),s||=E0e.test(e))}}}),r.length&&n.push(r.join(`
`)),n},j0e=e=>{let t=[],n=e=>{e.forEach(e=>{e.type===`def`?t.push(e.raw.trim()):e.type===`list`?e.items.forEach(e=>{n(e.tokens)}):e.type===`blockquote`&&n(e.tokens)})};return e.filter(e=>e.includes(`]:`)).forEach(e=>n(hr(e))),t.join(`
`)},M0e=e=>{let t=j0e(e);return t?e.map(e=>`${t}\n\n${e}`):e},N0e=(e,{isHTML:t})=>t?O0e(e):M0e(A0e(e)),P0e=(e,t)=>{let n=new Map,r=new Map;return{list:e.map(e=>{let i=n.get(e)??0,a=`${i}\n${e}`,o=t.get(a)??{key:a,block:e};return n.set(e,i+1),r.set(a,o),o}),items:r}},F0e=e=>e.split(`
`).map(e=>/^[ \t]*([^\s`]+)/.exec(C0e(e)?.info??``)?.[1]).filter(e=>e!==void 0).filter((e,t,n)=>n.indexOf(e)===t).sort(),I0e=[`href`,`src`,`action`,`formaction`,`data`,`from`,`to`,`values`],L0e=RegExp(`(?:${I0e.join(`|`)})\\s*=`,`i`),R0e=/^[\u0000-\u0020]+|[\t\n\r]/g,z0e=e=>/^javascript:/i.test(e.replaceAll(R0e,``)),B0e=e=>{if(!L0e.test(e))return e;let t=document.createElement(`template`),n=!1;return t.innerHTML=e,t.content.querySelectorAll(`*`).forEach(e=>{[...e.attributes].forEach(({localName:t,name:r,value:i})=>{I0e.includes(t)&&i.split(`;`).some(z0e)&&(e.removeAttribute(r),n=!0)})}),n?t.innerHTML:e},V0e={ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|blob):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i,ADD_TAGS:[`iframe`],ADD_ATTR:[`allow`,`allowfullscreen`,`referrerpolicy`,`sandbox`],FORBID_TAGS:[`style`,`form`,`input`,`button`,`textarea`,`select`,`option`]},H0e=[`color`,`background-color`,`font-style`,`font-weight`,`text-decoration`,`text-decoration-line`,`text-decoration-style`,`text-decoration-color`,`text-decoration-thickness`,`text-align`,`width`,`height`,`max-width`,`max-height`],U0e=e=>{let{style:t}=e;Array.from(t).filter(e=>!H0e.includes(e)).forEach(e=>{t.removeProperty(e)}),t.length||e.removeAttribute(`style`)},W0e=[`allow-forms`,`allow-orientation-lock`,`allow-pointer-lock`,`allow-popups`,`allow-presentation`,`allow-same-origin`,`allow-scripts`,`allow-storage-access-by-user-activation`],G0e=[`accelerometer`,`autoplay`,`clipboard-write`,`encrypted-media`,`fullscreen`,`gyroscope`,`picture-in-picture`,`web-share`],K0e=e=>{let t=e.getAttribute(`allow`);if(t===null)return;let n=t.split(`;`).map(e=>e.trim()).filter(e=>G0e.includes(e.split(/\s+/)[0].toLowerCase()));n.length?e.setAttribute(`allow`,n.join(`; `)):e.removeAttribute(`allow`)},q0e=e=>{let t=e.getAttribute(`src`)?.trim()||``;if(!t.startsWith(`https://`))return!1;try{let e=new URL(t),n=typeof window<`u`&&window.location?window.location.origin:``;if(n&&e.origin===n)return!1}catch{return!1}let n=e.getAttribute(`sandbox`)||``,r=new Set(n.toLowerCase().split(/\s+/).filter(e=>W0e.includes(e)));return r.add(`allow-scripts`),r.add(`allow-same-origin`),e.setAttribute(`sandbox`,Array.from(r).join(` `)),K0e(e),!0},J0e=(e,t={})=>{let n=_t(e,{...V0e,...t,RETURN_DOM:!0});return Array.from(n.querySelectorAll(`iframe`)).forEach(e=>{q0e(e)||e.remove()}),n.querySelectorAll(`[style]`).forEach(e=>{U0e(e)}),n.innerHTML};x0e();var Y0e=B(`<div role="none" data-rich-text-preview="" class="svelte-14tuh7g"><!></div>`),X0e={hash:`svelte-14tuh7g`,code:`[role='document'] div.svelte-14tuh7g {:is(h1, h2, h3, h4, h5, h6, p, ul, ol) {margin:1em 0 0;}:is(video, img) {max-width:100%;max-height:100%;}:is(a:has(img)) {display:inline-block;img {pointer-events:none;}}pre.shiki {background-color:var(--sui-code-background-color) !important;}}div.svelte-14tuh7g {
/* Make the preview the containing block of any positioned element in the content, so an element
with \`position: fixed\` from an inline style can’t cover the rest of the app */translate:0;[data-component-key] {display:contents;}}`};function N8(e,t){O(t,!0),K(e,X0e);let n=$M(),r=Sk.current?.field_defaults?.richtext??{},i=new ek,a=new $O,o=new Map,s=new Map,c=new Map,l=j(void 0),u=j(!1),d=j(0),f=j(0),p=``,m=A(()=>n?.current?.originalEntry),h=A(()=>n?.current?.collectionName??``),g=A(()=>n?.current?.fileName),_=A(()=>Mr(t.fieldConfig.sanitize_preview,()=>r.sanitize_preview??!0,!0)),v=A(()=>bZ(t.fieldConfig)),y=A(()=>z(v)===`html`),b=A(()=>c0e(t.fieldConfig)),x=A(()=>z(b).map(({id:e})=>e)),S=A(()=>Z1({entry:z(m),collectionName:z(h),fileName:z(g),files:n?.current?.files,typedKeyPath:t.typedKeyPath,componentNames:z(x),locale:t.locale})),C=A(()=>{if(typeof t.currentValue!=`string`||!t.currentValue.trim())return``;z(f);let{markdown:e,previewMap:n,assetMap:r}=W1e(t.currentValue,z(b),o,z(S),z(v));return o=n,s=r,e}),w=A(()=>{let{list:e,items:t}=P0e(N0e(z(C),{isHTML:z(y)}),c);return c=t,e}),T=async e=>{let t=F0e(e).join(`,`);t&&t!==p&&(p=t,await Promise.all(t.split(`,`).map(e=>iO(e))),M(d,z(d)+1))},ee=e=>e.closest(`[data-rich-text-preview]`)===z(l),te=(e,t)=>{let n=Y3(e);i.set(e,n),n.render(t)},ne=e=>{console.error(e)},re=e=>{if(!ee(e))return;let t=e.dataset.componentKey,n=t?o.get(t):void 0;n instanceof Element?(e.replaceChildren(n),a.add(n)):(0,gr.isValidElement)(n)?K3.current?te(e,n):q3().then(()=>{e.isConnected&&!i.has(e)&&te(e,n)}).catch(ne):e.remove()},ie=e=>{[e,...e.querySelectorAll(`span[data-component-key]`)].forEach(e=>{let t=i.get(e);t&&(t.unmount(),i.delete(e))})},ae=(e=!1)=>{a.forEach(t=>{(e||!z(l)?.contains(t))&&(a.delete(t),t.dispatchEvent(new CustomEvent(`Unmount`)))})},oe=e=>{e.forEach((e,t)=>{let n=o.get(t);Promise.all(e.map(dVe)).then(async e=>{e.includes(!0)&&o.get(t)===n&&(o.delete(t),M(f,z(f)+1),await co(),z(l)?.querySelectorAll(`[data-component-key="${t}"]`).forEach(e=>{i.get(e)?.unmount(),i.delete(e),re(e)}),ae())})})},se=async e=>{ee(e)&&(e.dataset.processed=`true`,await ORe(e,e=>gRe({value:e,entry:z(m),collectionName:z(h),fileName:z(g),typedKeyPath:t.typedKeyPath,componentNames:z(x),locale:t.locale})))},ce=e=>{let t=[];e.forEach(({removedNodes:e,addedNodes:n})=>{e.forEach(e=>{e.nodeType===Node.ELEMENT_NODE&&t.push(e)}),n.forEach(e=>{if(e.nodeType!==Node.ELEMENT_NODE)return;let t=e;t.matches(`span[data-component-key]`)?re(t):t.querySelectorAll(`span[data-component-key]`).forEach(e=>{re(e)}),t.matches(kZ)&&se(t),t.querySelectorAll(kZ).forEach(e=>{se(e)})})}),t.forEach(e=>{ie(e)}),ae()},le=e=>{z(d);let t=z(y)?e:mr(e,{breaks:!0});return ERe(z(_)?J0e(t):B0e(t))};L(()=>{z(C)&&!z(y)&&T(z(C))}),L(()=>{z(C),oe(s)}),js(()=>{let e=new MutationObserver(ce);return e.observe(z(l),{childList:!0,subtree:!0}),M(u,!0),()=>{e.disconnect(),i.forEach(e=>e.unmount()),i.clear(),ae(!0)}});var ue=Y0e(),de=N(ue),fe=e=>{var t=H();Bo(P(t),17,()=>z(w),({key:e,block:t})=>e,(e,t)=>{let n=()=>z(t).block;var r=H();Wo(P(r),()=>le(n())),U(e,r)}),U(e,t)};G(de,e=>{z(u)&&z(C)&&e(fe)}),D(ue),Ds(ue,e=>M(l,e),()=>z(l)),U(e,ue),k()}var Z0e=B(`<p> </p>`);function Q0e(e,t){O(t,!0);let n=A(()=>qA(t.locale)),r=A(()=>HEe({fieldConfig:t.fieldConfig,currentValue:t.currentValue}));var i=H(),a=P(i),o=e=>{var i=Z0e(),a=F(i,!0);R((e,t,n)=>{q(i,`lang`,e),q(i,`dir`,t),W(a,n),i.dir=i.dir},[()=>WA(t.locale),()=>GA(t.locale),()=>z(n).format(z(r))]),U(e,i)};G(a,e=>{z(r).length&&e(o)}),U(e,i),k()}var $0e=B(`<div class="wrapper svelte-19vklom"><!> <span role="none"> </span> <!></div>`),e2e={hash:`svelte-19vklom`,code:`.wrapper.svelte-19vklom {flex:none;color:var(--sui-tertiary-foreground-color) !important;font-size:var(--sui-font-size-small);line-height:var(--sui-line-height-compact);text-align:end;}.count.svelte-19vklom {&.invalid {color:var(--sui-error-foreground-color);}&:not(.invalid) {color:var(--sui-success-foreground-color);}}`};function t2e(e,t){O(t,!0),K(e,e2e);let n=A(()=>t.fieldConfig.minlength),r=A(()=>t.fieldConfig.maxlength),i=A(()=>T0({fieldConfig:t.fieldConfig,locale:t.locale,value:t.currentValue}).detail),a=A(()=>z(i).count),o=A(()=>z(i).hasMin),s=A(()=>z(i).hasMax),c=A(()=>z(i).invalid);var l=H(),u=P(l),d=e=>{var t=$0e(),i=N(t),l=e=>{var t=V();R(()=>W(t,`${z(n)??``} / `)),U(e,t)};G(i,e=>{z(o)&&e(l)});var u=I(i,2);let d;var f=F(u,!0),p=I(u,2),m=e=>{var t=V();R(()=>W(t,` /
${z(r)??``}`)),U(e,t)};G(p,e=>{z(s)&&e(m)}),D(t),R(e=>{q(t,`aria-label`,e),d=os(u,1,`count svelte-19vklom`,null,d,{invalid:z(c)}),W(f,z(a))},[()=>Y(z(o)&&z(s)?`character_counter.min_max`:z(o)?`character_counter.min`:`character_counter.max`,{values:{count:z(a),min:z(n),max:z(r)}})]),U(e,t)};G(u,e=>{(z(o)||z(s))&&e(d)}),U(e,l),k()}var n2e=e=>{let{extraHint:t}=si(`field-editor`)??{};L(()=>{t&&(t.current=e)})},r2e=({currentValue:e,fieldConfig:t})=>{let{prefix:n=``,suffix:r=``}=t,i=typeof e==`string`?e:String(e??``);return n&&i.startsWith(n)&&(i=i.slice(n.length)),r&&i.endsWith(r)&&(i=i.slice(0,-r.length)),i},i2e=({inputValue:e,fieldConfig:t})=>{let{prefix:n=``,suffix:r=``}=t;return e.trim()&&(n||r)?`${n}${e}${r}`:e};function a2e(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=j(``),s=A(()=>Mr(t.fieldConfig.type,`text`)),c=A(()=>Mr(t.fieldConfig.use_emoji_autocomplete,z(s)===`text`));bk(()=>n(),e=>{n(e)},()=>z(o),e=>{M(o,e,!0)},e=>r2e({currentValue:e,fieldConfig:t.fieldConfig}),e=>i2e({inputValue:e,fieldConfig:t.fieldConfig})),n2e(t2e);{let n=A(()=>WA(t.locale)),l=A(()=>GA(t.locale));fu(e,{get lang(){return z(n)},get dir(){return z(l)},get type(){return z(s)},get inputmode(){return z(s)},flex:!0,get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get useEmojiAutocomplete(){return z(c)},get value(){return z(o)},set value(e){M(o,e,!0)}})}k()}var o2e=e=>{if(!wE(e))return!1;let{origin:t,pathname:n,searchParams:r}=new URL(e);return!!((t===`https://www.youtube.com`||t===`https://www.youtube-nocookie.com`)&&(n===`/watch`&&r.has(`v`)||n===`/playlist`&&r.has(`list`)||n.startsWith(`/embed/`))||t===`https://youtu.be`&&n)},s2e=e=>{let t=`https://www.youtube-nocookie.com`,{pathname:n,search:r,searchParams:i}=new URL(e);if(n===`/watch`){let e=new URLSearchParams(i),n=`${t}/embed/${e.get(`v`)}`;return e.get(`list`)&&(e.delete(`v`),e.set(`listType`,`playlist`),n+=`?${e}`),n}return n===`/playlist`?`${t}/embed/videoseries${r}`:n.startsWith(`/embed/`)?`${t}${n}${r}`:`${t}/embed${n}${r}`},c2e=B(`<iframe frameborder="0" allow="autoplay; encrypted-media; picture-in-picture; clipboard-write" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" sandbox="allow-same-origin allow-scripts allow-popups" class="svelte-spbxln"></iframe>`),l2e=B(`<a> </a>`),u2e=B(`<div role="none"><!></div>`),d2e={hash:`svelte-spbxln`,code:`iframe.svelte-spbxln {display:block;margin:0 auto;width:100%;height:auto;aspect-ratio:16 / 9;}`};function f2e(e,t){O(t,!0),K(e,d2e);let n=j(!0),r=A(()=>s2e(t.url)),i=({blockedURI:e,violatedDirective:t})=>{e===new URL(z(r)).origin&&t===`frame-src`&&(M(n,!1),window.removeEventListener(`securitypolicyviolation`,i))};js(()=>(window.addEventListener(`securitypolicyviolation`,i),()=>{window.removeEventListener(`securitypolicyviolation`,i)}));var a=u2e(),o=N(a),s=e=>{UO(e,{children:(e,t)=>{var n=c2e();R((e,t)=>{q(n,`src`,e),q(n,`title`,t)},[()=>PP(z(r)),()=>Y(`youtube_video_player`)]),U(e,n)},$$slots:{default:!0}})},c=e=>{var n=l2e(),r=F(n,!0);R(e=>{q(n,`href`,e),W(r,t.url)},[()=>PP(t.url)]),U(e,n)};G(o,e=>{z(n)?e(s):e(c,-1)}),D(a),U(e,a),k()}var p2e=/^(?:https|mailto|tel):/,m2e=({fieldConfig:e,value:t})=>{let{type:n=`text`}=e;return n===`url`||wE(t)?o2e(t)?`youtube`:p2e.test(t)?`link`:`text`:n===`email`?`email`:`text`},h2e=B(`<a> </a>`),g2e=B(`<p><!></p>`),_2e={hash:`svelte-euqs6c`,code:`.title.svelte-euqs6c {font-size:var(--sui-font-size-xxx-large);font-weight:var(--sui-font-weight-bold);}
/* Remove the padding to make the iframe full-width on small screens */
@media (width < 768px) {[role='document'] section > p.svelte-euqs6c:has(iframe) {margin-inline:calc(var(--entry-preview-padding-inline) * -1);}
}`};function v2e(e,t){O(t,!0),K(e,_2e);let n=A(()=>t.fieldConfig.name),r=A(()=>typeof t.currentValue==`string`&&t.currentValue.trim()?t.currentValue:``),i=A(()=>z(r)?m2e({fieldConfig:t.fieldConfig,value:z(r)}):`text`);var a=H(),o=P(a),s=e=>{var a=g2e();let o;var s=N(a),c=e=>{f2e(e,{get url(){return z(r)}})},l=e=>{var t=h2e(),n=F(t,!0);R(e=>{q(t,`href`,e),W(n,z(r))},[()=>PP(z(r))]),U(e,t)},u=e=>{var t=h2e(),n=F(t,!0);R(e=>{q(t,`href`,e),W(n,z(r))},[()=>PP(`mailto:${z(r)}`)]),U(e,t)},d=e=>{var t=V();R(()=>W(t,z(r))),U(e,t)};G(s,e=>{z(i)===`youtube`?e(c):z(i)===`link`?e(l,1):z(i)===`email`?e(u,2):e(d,-1)}),D(a),R((e,t)=>{q(a,`lang`,e),q(a,`dir`,t),o=os(a,1,`svelte-euqs6c`,null,o,{title:z(n)===`title`}),a.dir=a.dir},[()=>WA(t.locale),()=>GA(t.locale)]),U(e,a)};G(o,e=>{z(r)&&e(s)}),U(e,a),k()}function y2e(e,t){O(t,!0);let n=J(t,`currentValue`,15),r=J(t,`required`,3,!0),i=J(t,`readonly`,3,!1),a=J(t,`invalid`,3,!1),o=j(``),s=A(()=>Mr(t.fieldConfig.use_emoji_autocomplete,!0));bk(()=>n(),e=>{n(e)},()=>z(o),e=>{M(o,e,!0)},e=>typeof e==`string`?e:``),n2e(t2e);{let n=A(()=>WA(t.locale)),c=A(()=>GA(t.locale));pO(e,{get lang(){return z(n)},get dir(){return z(c)},flex:!0,get readonly(){return i()},get required(){return r()},get invalid(){return a()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},autoResize:!0,get useEmojiAutocomplete(){return z(s)},get value(){return z(o)},set value(e){M(o,e,!0)}})}k()}var b2e=B(`<p class="svelte-q17c48"> </p>`),x2e={hash:`svelte-q17c48`,code:`p.svelte-q17c48 {white-space:pre-wrap;}`};function S2e(e,t){O(t,!0),K(e,x2e);var n=H(),r=P(n),i=e=>{var n=b2e(),r=F(n,!0);R((e,i)=>{q(n,`lang`,e),q(n,`dir`,i),W(r,t.currentValue),n.dir=n.dir},[()=>WA(t.locale),()=>GA(t.locale)]),U(e,n)},a=A(()=>typeof t.currentValue==`string`&&t.currentValue.trim());G(r,e=>{z(a)&&e(i)}),U(e,n),k()}function C2e(e,t){O(t,!0);let n=$M(),{valueStoreKey:r=`currentValues`}=si(`field-editor`)??{},i=u6(r),a=J(t,`currentValue`,15),o=J(t,`required`,3,!0),s=J(t,`readonly`,3,!0),c=J(t,`invalid`,3,!1),l=A(()=>n.current?.defaultLocale);vk(()=>t.locale,()=>{!a()&&(t.locale===z(l)||i||R0(t.fieldConfig?.i18n))&&a(c6(t.fieldConfig))}),js(()=>{`read_only`in t.fieldConfig&&eA(`uuid_read_only`)}),fu(e,{dir:`ltr`,flex:!0,get readonly(){return s()},get required(){return o()},get invalid(){return c()},get"aria-labelledby"(){return`${t.fieldId??``}-label`},get"aria-errormessage"(){return`${t.fieldId??``}-error`},get value(){return a()},set value(e){a(e)}}),k()}var w2e=B(`<p class="svelte-1phz9g8"> </p>`),T2e={hash:`svelte-1phz9g8`,code:`p.svelte-1phz9g8 {font-family:var(--sui-font-family-monospace);}`};function E2e(e,t){O(t,!0),K(e,T2e);var n=H(),r=P(n),i=e=>{var n=w2e(),r=F(n,!0);R(()=>W(r,t.currentValue)),U(e,n)},a=A(()=>typeof t.currentValue==`string`&&t.currentValue.trim());G(r,e=>{z(a)&&e(i)}),U(e,n),k()}var P8={boolean:tbe,code:Txe,color:Ixe,compute:Bxe,datetime:PGe,file:IKe,image:IKe,keyvalue:uqe,list:zXe,map:SZe,markdown:_0e,number:EZe,object:IZe,relation:B$e,richtext:_0e,select:I$e,string:a2e,text:y2e,uuid:C2e},F8={boolean:rbe,code:Dxe,color:zxe,compute:dDe,datetime:kGe,file:VKe,image:VKe,keyvalue:mqe,list:$Xe,map:TZe,markdown:N8,number:OZe,object:RZe,relation:W$e,richtext:N8,select:Q0e,string:v2e,text:S2e,uuid:E2e},D2e=({initialProps:e,transforms:t={},onValueChange:n})=>{let r=ta({...e}),i={};return Object.keys(e).forEach(e=>{let a=t[e];Object.defineProperty(i,e,{enumerable:!0,get:a?()=>a(r[e]):()=>r[e],set:e===`currentValue`?n:void 0})}),{values:r,props:i}},O2e=(e,t)=>{Object.entries(t).forEach(([t,n])=>{(0,yr.default)(e[t],n)||(e[t]=n)})},k2e=[`boolean`,`color`,`datetime`,`map`,`number`,`select`,`string`,`text`,`uuid`],A2e=new Map,j2e=new WeakMap,M2e=e=>typeof e.toJS==`function`?e.toJS():typeof e.get==`function`?new Proxy({},{get:(t,n)=>typeof n==`string`?e.get(n):void 0,has:(t,n)=>typeof n==`string`&&e.get(n)!==void 0}):E(e)?e:{},I8=e=>{if(e===null||typeof e!=`object`&&typeof e!=`function`)return{};let t=j2e.get(e);if(t)return t;let n=M2e(e);return j2e.set(e,n),n},N2e=(e,t)=>{let{value:n,field:r,forID:i,locale:a,keyPath:o,required:s,readonly:c,invalid:l}=e,u=I8(r),{name:d,required:f}=u,p=a??t.locale??``;return{locale:p,keyPath:o??t.keyPath??d??``,typedKeyPath:``,fieldId:i??``,fieldLabel:pB({config:u,locale:p}),fieldConfig:r,currentValue:n,required:s??t.required??f,readonly:c??t.readonly,invalid:l??t.invalid}},P2e=({value:e,field:t,locale:n,keyPath:r},i)=>({locale:n??i.locale??``,keyPath:r??i.keyPath??I8(t).name??``,typedKeyPath:``,fieldConfig:t,currentValue:e}),F2e=({SvelteComponent:e,buildProps:t})=>n=>{let r=(0,gr.useContext)(W3),i=(0,gr.useRef)(n),a=(0,gr.useRef)(void 0);i.current=n,a.current?O2e(a.current.values,t(n,r)):a.current=D2e({initialProps:t(n,r),transforms:{fieldConfig:I8},onValueChange:e=>{let{values:t}=a.current;(0,yr.default)(t.currentValue,e)||(t.currentValue=e,i.current.onChange?.(e))}});let o=(0,gr.useCallback)(t=>{if(!t)return;let{props:n}=a.current,r=Oo(e,{target:t,props:n});return()=>{jo(r)}},[]);return(0,gr.createElement)(`div`,{ref:o})},I2e=e=>({control:F2e({SvelteComponent:P8[e],buildProps:N2e}),preview:F2e({SvelteComponent:F8[e],buildProps:P2e})}),L2e=e=>{if(!k2e.includes(e)){Pk.includes(e)&&console.warn(`The built-in "${e}" field type cannot be reused in a custom field type, because its editor works only within the entry editor. Reusable field types are: ${k2e.join(`, `)}.`);return}let t=A2e.get(e);if(t)return t;let n=I2e(e);return A2e.set(e,n),n},R2e=(e,t=new Set)=>{let n=rk.get(e);if(!n)return L2e(e);let{control:r,preview:i,summary:a,schema:o}=n;return typeof r==`string`?(t.add(e),{control:t.has(r)?void 0:R2e(r,t)?.control,preview:i,summary:a,schema:o}):{control:r,preview:i,summary:a,schema:o}},L8=(e,t)=>{if(!e)throw TypeError(t)},R8=(e,t,n,r)=>{L8(e,`The \`${n}\` option for \`CMS.${t}()\` must be ${r}`)},z8=(e,t,n)=>{L8(e,`The \`definition.${t}\` must be ${n}`)},z2e=({name:e,reserved:t,subject:n,builtin:r,custom:i})=>{if(t.includes(e))throw Error(`The ${n} name "${e}" is reserved for a ${r}. Choose a different name for your ${i}.`)},B2e=e=>URL.parse(e,window.location.href),B8=e=>(R8(mA(e),`getFieldType`,`name`,`a non-empty string`),R2e(e)),V2e=(e,t,n)=>{let r=yj(new Set([...$P(e),...t]));if(!r)return e;let i=!!t.length&&!!e.slug;return{...r,...e,locales:{...Object.fromEntries(Object.entries(r.locales).filter(([,{path:e}])=>!n.has(e))),...e.locales},slug:i?e.slug:r.slug,subPath:i?e.subPath:r.subPath}},H2e=async(e,t)=>{let n=e=>{let t=fj(e);return t?._type===`entry`&&t.create!==!1&&!R1({collection:t})},r=e.filter(({path:e,folder:r,text:i})=>r.collectionName!==t&&r.fileName===void 0&&i!==void 0&&n(r.collectionName)&&!yj([e]));return(await Promise.all([...Map.groupBy(r,({folder:e})=>e.collectionName)].map(async([e,t])=>(await JR(t)).entries.map(t=>({collectionName:e,entry:t}))))).flat()},U2e=async e=>{let t=zq(e.branch);if(!t||t.legacy&&e.files.some(({path:e,previousPath:t})=>!NU(e)||t!==void 0&&!NU(t)))return{entries:[],assets:[]};let{collectionName:n}=t,{entryFiles:r,assetFiles:i}=YW(e.files.filter(({deleted:e})=>!e).map(({path:e,sha:t,size:n,text:r})=>jK(e,{sha:t,size:n,text:r}))),a=e.files.flatMap(({path:e,deleted:t,previousPath:n})=>n?[n]:t?[e]:[]),o=a.length?YW(a.map(e=>jK(e))).entryFiles.filter(({folder:e})=>e.collectionName===n):[],s=o.map(({path:e})=>e),c=new Set(e.files.filter(({deleted:e})=>e).map(({path:e})=>e)),l=i.map(t=>({...AK(t),workflow:{branch:e.branch}})),u=r.filter(({folder:e,text:t})=>e.collectionName===n&&t!==void 0);if(!u.length){let t=new Set(s);return{entries:(s.length?vj.current.filter(e=>Object.values(e.locales).some(({path:e})=>t.has(e))):[]).map(t=>{let r=Object.entries(t.locales).filter(([,{path:e}])=>!c.has(e));return r.length?{...t,locales:Object.fromEntries(r),workflow:{pullRequest:e,status:e.status,collectionName:n,fileName:o[0].folder.fileName,previousPaths:s}}:{...t,workflow:{pullRequest:e,status:`pending_deletion`,collectionName:n,fileName:void 0,previousPaths:s}}}),assets:l}}let{entries:d}=await JR(u),{fileName:f}=u[0].folder,p=await H2e(r,n);return{entries:d.map(t=>({...V2e(t,s,c),workflow:{pullRequest:e,status:e.status,collectionName:n,fileName:f,previousPaths:s,...p.length?{companions:p}:{}}})),assets:l}},W2e=async e=>{let t=await Promise.all(e.map(U2e));return{entries:t.flatMap(({entries:e})=>e),assets:t.flatMap(({assets:e})=>e)}},V8={time:0,head:``},H8,G2e=e=>{V8={time:Date.now(),head:e}},K2e=()=>{let{backend:e}=Sk.current??{};return!(e&&`open_authoring`in e&&e.open_authoring)||eH.current},q2e=()=>{let e=OY.current?.workflow;return zY.current&&e&&K2e()?e:void 0},J2e=()=>{let e=q2e();if(!e)return;HY.current=!0;let t=e.fetchPullRequests();return t.catch(()=>{}),t},Y2e=async(e=J2e())=>{if(!e)return;let t=mK.current,n=gK();try{let{entries:r,assets:i}=await W2e(await e);n()||(VY.current=r,v4(i),G2e(t))}catch(e){console.error(e)}finally{n()||(HY.current=!1,UY.current=!0)}},U8=e=>Map.groupBy(e,({workflow:e})=>e.pullRequest.branch),X2e=(e=[],t=[])=>e.length===t.length&&e.every((e,n)=>e===t[n]),Z2e=(e,t=[])=>{let n=new Map(t.map(({entry:e})=>[$P(e)[0],e.id]));return e?.map(e=>{let t=n.get($P(e.entry)[0]);return t?{...e,entry:{...e.entry,id:t}}:e})},Q2e=(e,t)=>{let n=e.map((e,n)=>{let r=t[n];if(!r)return e;let{workflow:i}=e,a={...e,id:r.id,...i.companions?{workflow:{...i,companions:Z2e(i.companions,r.workflow.companions)}}:{}};return(0,yr.default)(a,r)?r:a});return X2e(n,t)?t:n},W8=e=>e?.[0]?.workflow.pullRequest.headSHA,$2e=async(e,t,n,r)=>{let i=new Set;return await yW([...t.keys()].filter(e=>{let i=W8(t.get(e));return r.has(e)&&!!i&&i!==W8(n.get(e))}),async n=>{try{await e.fetchBranchHead(n)===W8(t.get(n))&&i.add(n)}catch(e){console.error(`Failed to check the workflow branch for changes.`,e)}}),i},e4e=async e=>{let t=gK(),n=mK.current,r=U8(VY.current),i=await e.fetchPullRequests();if(t())return!1;let a=new Set(i.map(({branch:e})=>e));if([...r.keys()].some(e=>!a.has(e))){try{await r3()}catch(e){console.error(`Failed to check the repository for changes.`,e)}if(t())return!1}let{entries:o,assets:s}=await W2e(i);if(t())return!1;let c=U8(o),l=await $2e(e,r,c,a);if(t())return!1;let u=U8(VY.current),d=new Set(WY.current),f=new Set,p=e=>{let t=u.get(e)??[];if(d.has(e)||l.has(e)||!X2e(t,r.get(e)))return t;let n=Q2e(c.get(e)??[],t);return n!==t&&f.add(e),n},m=[...new Set([...u.keys(),...c.keys()])].flatMap(p);return G2e(n),f.size?(VY.current=m,f.forEach(y4),v4(s.filter(({workflow:e})=>f.has(e?.branch))),!0):!1},G8=async({fresh:e=!1}={})=>{let t=q2e();return!t||!UY.current?!1:(e&&H8&&await H8.catch(()=>void 0),H8||=e4e(t).finally(()=>{H8=void 0}),H8)},t4e=async({maxAge:e=3e5}={})=>!H8&&mK.current===V8.head&&Date.now()-V8.time<e?!1:G8(),K8=0,n4e=0,r4e=()=>document.visibilityState===`visible`,i4e=async({maxAge:e=0,workflowMaxAge:t=3e5}={})=>{try{await r3({maxAge:e})}catch(e){console.error(`Failed to check the repository for changes.`,e)}try{await t4e({maxAge:t})}catch(e){console.error(`Failed to check the unpublished entries for changes.`,e)}},a4e=()=>{r4e()&&i4e()},q8=()=>{r4e()&&Date.now()-n4e>=1e4&&i4e({maxAge:1e4,workflowMaxAge:3e4})},o4e=()=>{K8||(n4e=Date.now(),K8=window.setInterval(a4e,6e4),document.addEventListener(`visibilitychange`,q8),window.addEventListener(`focus`,q8))},s4e=()=>{K8&&=(window.clearInterval(K8),document.removeEventListener(`visibilitychange`,q8),window.removeEventListener(`focus`,q8),0)},J8=pk({}),c4e=100,Y8=new Map,l4e=()=>{if(Y8.size<=c4e)return;let e=Date.now()-3e4,t=new Set([...Y8.entries()].filter(([,{time:t}])=>t<e).map(([e])=>e));[...Y8.keys()].forEach(e=>{Y8.size-t.size>c4e&&t.add(e)}),t.forEach(e=>Y8.delete(e)),J8.current=Object.fromEntries(Object.entries(J8.current).filter(([e])=>!t.has(e)))},u4e=async e=>{let t;try{t=await rG(e,{method:`GET`},{responseType:`raw`})}catch{return`unknown`}return t.ok?`ready`:t.status===404?`pending`:`unknown`},d4e=async e=>{let t=Y8.get(e);if(t&&Date.now()-t.time<3e4)return t.promise;let n=!1;try{n=new URL(e).origin===window.location.origin}catch{n=!1}let r=n?u4e(e):Promise.resolve(`unknown`);Y8.set(e,{time:Date.now(),promise:r}),l4e();let i=await r;return J8.current=J8.current[e]===i?J8.current:{...J8.current,[e]:i},i},f4e=()=>{Y8.clear(),J8.current={}},p4e=()=>{let{current:e}=Sk,{current:t}=OY;if(!e||!t?.isGit)return{};let{skip_ci:n,automatic_deployments:r}=e.backend;return{skipCI:n,autoDeploy:r}},X8=hk(()=>{let{skipCI:e,autoDeploy:t}=p4e();return typeof e==`boolean`||typeof t==`boolean`}),Z8=hk(()=>{let{skipCI:e,autoDeploy:t}=p4e();return e===!0||t===!1}),Q8=(e,t)=>{IG.devModeEnabled&&console.info(`deployPreview: ${e}`,(typeof t==`function`?t():t)??``)},$8=0,e5=0,m4e=()=>{$8+=1},t5=()=>{let e=OY.current?.repository?.branch??``,t=[],n=new Set,r=VK.current;return r&&(t.push({sha:r,branch:e,kind:`production`}),n.add(r)),VY.current.forEach(({workflow:{pullRequest:e}})=>{let{number:r,headSHA:i,branch:a}=e;r!==void 0&&i&&!n.has(i)&&(t.push({sha:i,branch:a,kind:`preview`}),n.add(i))}),t},n5=hk(()=>t5()),r5=()=>{let{show_preview_links:e=!0}=Sk.current??{};return(e||X8.current)&&!!OY.current?.fetchDeployments},h4e=e=>!!e&&e.state!==`checking`&&Date.now()-e.checkedTime<3e4,g4e=e=>{let t=BK.current,n=Object.fromEntries(e.filter(({sha:e})=>!t[e]).map(({sha:e})=>[e,{state:`checking`,checkedTime:0}]));Object.keys(n).length&&(BK.current={...t,...n})},_4e=()=>{g4e(t5())},i5=async({force:e=!1,pendingOnly:t=!1}={})=>{if(!r5()){Q8(`not looking anything up: the backend can’t report deployments, or preview links are off`);return}let n=OY.current?.fetchDeployments,r=BK.current,i=t5().filter(({sha:n})=>{if(e)return!0;let i=r[n]?.state;return t?i!==`ready`&&i!==`error`:!h4e(r[n])});if(!i.length){Q8(`nothing to look up`,()=>({tracked:t5(),known:r}));return}Q8(`looking up`,i);let a=$8;e5+=1;let o=e5;g4e(i);let s;try{s=await n(i)}catch(e){console.error(`Failed to fetch the deployment info.`,e),s=Object.fromEntries(i.map(({sha:e})=>[e,{state:`unknown`,checkedTime:Date.now()}]))}a===$8?o===e5?(Q8(`resolved`,s),BK.current={...BK.current,...s}):Q8(`discarding a result that a later lookup has superseded`,s):Q8(`discarding a result that arrived after the lookup was cancelled`,s)},v4e=async()=>{let e=OY.current?.fetchBranchHeadSHA;if(e)try{let t=await e()??``;Q8(`tracking the branch head`,t),VK.current=t}catch(e){console.error(`Failed to fetch the branch head commit.`,e)}},y4e=async({head:e}={})=>{try{e&&OY.current?.fetchBranchHeadSHA?(Q8(`tracking the branch head`,e),VK.current=e):await v4e(),await i5()}catch(e){console.error(`Failed to look up the deployment info.`,e)}},b4e=e=>new TextEncoder().encode(JSON.stringify(e)).toBase64({alphabet:`base64url`,omitPadding:!0}),x4e=e=>{let t=Uint8Array.fromBase64(e.replaceAll(`+`,`-`).replaceAll(`/`,`_`),{alphabet:`base64url`}),n;try{n=new TextDecoder(`utf-8`,{fatal:!0}).decode(t)}catch{n=Array.from(t,e=>String.fromCharCode(e)).join(``)}return JSON.parse(n)},a5=pk([]),S4e=e=>{let t=e?BK.current[e]?.state:void 0;return t===`ready`||t===`unknown`},C4e=hk(()=>S4e(VK.current)),w4e=hk(()=>{if(C4e.current)return[];let e=a5.current,t=e.findLastIndex(({sha:e})=>S4e(e));return t===-1?e:e.slice(t+1)}),T4e=e=>{let t=VK.current;if(!r5()||!t)return;let{workflow:n}=e,{branch:r}=n.pullRequest;a5.current=[...w4e.current.filter(e=>e.entry.workflow.pullRequest.branch!==r),{entry:{...e,workflow:{...n,pullRequest:{...n.pullRequest,updatedDate:new Date}}},sha:t}]},E4e=()=>{a5.current=[]};_k(()=>{UK.current&&E4e()});var D4e=/^\/signin\/(?<encodedData>.+)/,o5=ta({signInError:{message:``,context:`authentication`},unauthenticated:!0,signingIn:!1,magicLinkConfirmation:void 0}),O4e=async()=>{await Promise.all([kE.set(`sveltia-cms.user`,{}),...DW.map(e=>kE.delete(e))]),OW.account=void 0,o5.unauthenticated=!0},k4e=()=>{IG.apiKeys={},delete IG.logins,delete IG.deployHookURL,delete IG.deployHookAuthHeader},A4e=async e=>{(typeof e?.cause?.status==`number`||e?.message===`Not a collaborator of the repository`)&&await O4e()},j4e=()=>{o5.signInError={message:``,context:`authentication`}},s5=(e,t=`authentication`)=>{let n=e.cause?.message||Y(`unexpected_error`);e.name===`NotFoundError`&&(n=Y(`sign_in_error.not_project_root`)),e.name===`AbortError`&&(n=Y(DY.current===`local`?`sign_in_error.picker_dismissed`:`sign_in_error.authentication_aborted`)),o5.signInError={message:n,context:t},console.error(e.name,e.message,e.cause)},M4e=()=>{let{path:e}=$Q(),{encodedData:t}=e.match(D4e)?.groups??{};if(!t)return{_user:void 0,copiedPrefs:void 0};o$(``,{replaceState:!0});let n,r;try{let e=x4e(t);E(e)&&typeof e.token==`string`&&(n={token:e.token},E(e.prefs)&&(r=e.prefs))}catch{}return{_user:n,copiedPrefs:r}},N4e=async()=>{let e=await[`sveltia-cms.user`,...DW].reduce(async(e,t)=>await e||kE.get(t),Promise.resolve(void 0));return E(e)&&typeof e.backendName==`string`?e:void 0},P4e=e=>kY(e?.backendName===`local`||e?.backendName===`proxy`?`local`:Sk.current.backend.name),F4e=async e=>{let t=P4e(void 0);if(!t)return;let n;o5.signingIn=!0;try{n=await t.signIn({token:e,auto:!0})}catch{}if(o5.signingIn=!1,!n)return;let r=await new Promise(e=>{o5.magicLinkConfirmation={account:n,resolve:e}});return o5.magicLinkConfirmation=void 0,r?n:void 0},I4e=e=>{`deployHookURL`in e&&delete IG.deployHookAuthHeader,Object.assign(IG,e)},L4e=async e=>{let t=gK(),n=!e.repository||e.repository.branch?J2e():void 0;await e.fetchFiles(),!t()&&(await Y2e(n),!t()&&(y4e({head:mK.current}),o4e()))},R4e=async()=>{j4e();let{_user:e,copiedPrefs:t}=M4e(),n=e?await F4e(e.token):void 0,r=!!n;n??=await N4e();let i=P4e(n);if(n){if(!r&&i){OW.account=n;let{token:e,refreshToken:t}=n;o5.signingIn=!0;try{n=await i.signIn({token:e,refreshToken:t,auto:!0})}catch{n=void 0,OW.account=void 0}}if(o5.signingIn=!1,o5.unauthenticated=!n,n&&i){OW.account=n,r&&t&&I4e(t);try{await L4e(i)}catch(e){[401,403,404].includes(e.cause?.status)?o5.unauthenticated=!0:s5(e,`dataFetch`),await A4e(e)}}}},c5=async(e,t)=>{j4e();let n=kY(e);if(!n)return;let r;OW.account=void 0,o5.signingIn=!0;try{r=await n.signIn({token:t,auto:!1})}catch(e){o5.signingIn=!1,o5.unauthenticated=!0,t&&e.cause?.status===401?s5(Error(`Invalid token`,{cause:{message:Y(`sign_in_error.invalid_token`)}})):s5(e);return}if(o5.signingIn=!1,o5.unauthenticated=!r,r){OW.account=r;try{await L4e(n)}catch(e){s5(e,`dataFetch`),await A4e(e)}}},z4e=async()=>{s4e(),hK.current+=1;try{await OY.current?.signOut()}catch(e){console.error(e)}await O4e(),k4e(),kY(void 0),hj.current=!1,KR.clear(),mK.current=``,YV.current=void 0,XV.current=void 0,VY.current=[],UY.current=!1,WY.current=[],rH.current?.respond(!1),QV.current=void 0,eH.current=!1,E4e(),iMe(),f4e();let e=Sk.current?.logout_redirect_url;e&&(window.location.href=e)},B4e=(e,t)=>{let{name:n}=e,r=n===`test-repo`,{auth_methods:i}=e,{base_url:a,app_id:o}=e;return{serviceLabel:n===`gitea`&&a===`https://codeberg.org`?`Codeberg`:t,tokenOptionHidden:!r&&i?.includes(`token`)===!1,oauthOptionHidden:!r&&i?.includes(`oauth`)===!1,oauthOptionDisabled:n===`gitea`&&!o}},V4e=B(`<div role="alert" class="message svelte-1ff54ya"> </div> <!>`,1),H4e=B(`<div role="alert" class="svelte-1ff54ya"><!></div>`),U4e=B(`<div role="none"><!></div>`),W4e=B(`<!> <!> <!>`,1),G4e=B(`<div role="alert" class="error iconic svelte-1ff54ya"><!> </div>`),K4e=B(` <!> <!>`,1),q4e=B(`<div role="none" class="buttons svelte-1ff54ya"><!> <!></div> <!> <!>`,1),J4e={hash:`svelte-1ff54ya`,code:`.buttons.svelte-1ff54ya {display:flex;flex-direction:column;align-items:center;gap:12px;.button {width:320px;}}[role='alert'].svelte-1ff54ya {&.iconic {display:flex;align-items:center;gap:8px;}&.error {color:var(--sui-error-foreground-color);}}`};function Y4e(e,t){O(t,!0),K(e,J4e);let n=j(!1),r=j(``),i=A(()=>Sk.current?.backend),a=A(()=>z(i).name),o=A(()=>EY[z(a)]),s=A(()=>z(a)===`test-repo`),c=A(()=>CY(z(a))),l=A(()=>z(i).repo?.split(`/`).pop()),u=A(()=>iG.isLocalHost&&!z(s)),d=A(()=>z(r).trim()),f=A(()=>z(a)===`github`&&Yq(Sk.current)),p=A(()=>B4e(z(i),z(o)?.label)),m=A(()=>z(p).serviceLabel),h=A(()=>z(p).tokenOptionHidden),g=A(()=>z(p).oauthOptionHidden),_=A(()=>z(p).oauthOptionDisabled),v=A(()=>{let{login:e,name:t}=o5.magicLinkConfirmation?.account??{};return e||t||``});js(()=>{!o5.signInError.message&&!o5.signingIn&&R4e()});var y=q4e(),b=P(y),x=N(b),S=e=>{var t=V4e(),n=P(t),r=F(n,!0),i=I(n,2),a=e=>{{let t=A(()=>Y(`cancel`));Al(e,{variant:`secondary`,get label(){return z(t)},get onclick(){return xG.current}})}};G(i,e=>{xG.current&&e(a)}),R(e=>W(r,e),[()=>Y(`signing_in`)]),U(e,t)},C=e=>{var t=W4e(),r=P(t),i=e=>{var t=W4e(),n=P(t);{let e=A(()=>Y(`work_with_local_repo`)),t=A(()=>!iG.isLocalBackendSupported);Al(n,{variant:`primary`,get label(){return z(e)},get disabled(){return z(t)},onclick:async()=>{await c5(`local`)}})}var r=I(n,2),i=e=>{var t=H4e(),n=N(t),r=e=>{var t=H();Wo(P(t),()=>yA(Y(`local_workflow.disabled`),`https://sveltiacms.app/en/docs/workflows/local#enabling-file-system-access-api-in-brave`)),U(e,t)},i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`local_workflow.unsupported_browser`)]),U(e,t)};G(n,e=>{iG.isBrave?e(r):e(i,-1)}),D(t),U(e,t)},a=e=>{var t=U4e(),n=N(t),r=e=>{var t=V();R(e=>W(t,e),[()=>Y(`work_with_local_repo_description`,{values:{repo:z(l)}})]),U(e,t)},i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`work_with_local_repo_description_no_repo`)]),U(e,t)};G(n,e=>{z(l)?e(r):e(i,-1)}),D(t),U(e,t)};G(r,e=>{iG.isLocalBackendSupported?o5.signInError.message||e(a,1):e(i)}),$l(I(r,2),{}),U(e,t)};G(r,e=>{z(u)&&e(i)});var o=I(r,2),d=e=>{{let t=A(()=>z(u)?`secondary`:`primary`),n=A(()=>z(c)?Y(`start_demo`):z(s)?Y(`work_with_test_repo`):Y(`sign_in_with_x`,{values:{service:z(m)}}));Al(e,{get variant(){return z(t)},get label(){return z(n)},get disabled(){return z(_)},onclick:async()=>{await c5(z(a))}})}};G(o,e=>{z(g)||e(d)});var f=I(o,2),p=e=>{{let t=A(()=>Y(`sign_in_using_access_token`,{values:{service:z(m)}}));Al(e,{variant:`secondary`,get label(){return z(t)},onclick:()=>{M(n,!0)}})}};G(f,e=>{!z(s)&&!z(h)&&e(p)}),U(e,t)};G(x,e=>{o5.signingIn?e(S):z(o)&&e(C,1)});var w=I(x,2),T=e=>{var t=G4e(),n=N(t);Xc(n,{name:`error`});var r=I(n);D(t),R(()=>W(r,` ${o5.signInError.message??``}`)),U(e,t)};G(w,e=>{o5.signInError.message&&o5.signInError.context===`authentication`&&e(T)}),D(b);var ee=I(b,2);{let e=A(()=>Y(`sign_in_using_access_token`)),t=A(()=>({spellcheck:!1,ariaLabel:Y(`personal_access_token`)})),i=A(()=>Y(`sign_in`)),s=A(()=>!z(d));pu(ee,{get title(){return z(e)},get textboxAttrs(){return z(t)},get okLabel(){return z(i)},get okDisabled(){return z(s)},onOk:()=>{c5(z(a),z(d))},onkeydown:e=>{!e.isComposing&&e.key===`Enter`&&z(d)&&(e.preventDefault(),M(n,!1),c5(z(a),z(d)))},get open(){return z(n)},set open(e){M(n,e,!0)},get value(){return z(r)},set value(e){M(r,e,!0)},children:(e,t)=>{Qr();var n=K4e(),r=P(n),i=I(r),a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`sign_in_using_access_token_workflow_note`)]),U(e,t)};G(i,e=>{z(f)&&e(a)});var s=I(i,2),c=e=>{var t=H();Wo(P(t),()=>yA(Y(`sign_in_using_access_token_link`,{values:{service:z(m)}}),z(o).repository.tokenPageURL)),U(e,t)};G(s,e=>{z(o)?.repository?.tokenPageURL&&e(c)}),R(e=>W(r,`${e??``} `),[()=>Y(`sign_in_using_access_token_description`)]),U(e,n)},$$slots:{default:!0}})}var te=I(ee,2);{let e=A(()=>!!o5.magicLinkConfirmation),t=A(()=>Y(`sign_in_with_link`)),n=A(()=>Y(`sign_in`));ru(te,{get open(){return z(e)},get title(){return z(t)},get okLabel(){return z(n)},onOk:()=>{o5.magicLinkConfirmation?.resolve(!0)},onClose:()=>{o5.magicLinkConfirmation?.resolve(!1)},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`sign_in_with_link_confirmation`,{values:{account:z(v),service:z(m)}})]),U(e,n)},$$slots:{default:!0}})}U(e,y),k()}var X4e=/^data:(image\/[a-zA-Z0-9.+-]+);base64,/,Z4e=`data:image/svg+xml;base64,${btoa(`<svg viewBox="0 0 800 800" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="400" x2="400" y1="0" y2="800"><stop offset="0" stop-color="#f0980b"/><stop offset="1" stop-color="#ff1d00"/></linearGradient><clipPath id="b"><rect height="800" rx="80" width="800"/></clipPath><rect fill="url(#a)" height="800" rx="80" width="800"/><g style="clip-path:url(#b);fill:none;stroke:#fff;stroke-linecap:round;stroke-linejoin:round;stroke-width:180"><path d="m320-80-200 320 200 320-200 320"/><path d="m400 240 200 320 200-320"/></g></svg>`)}`,l5=hk(()=>Sk.current?.app_title||`Sveltia CMS`),u5=hk(()=>Sk.current?.logo?.src||Sk.current?.logo_url||Z4e),Q4e=hk(()=>{let e=u5.current,t=e.match(X4e);return t?t[1]:rV.getType(e)??void 0}),$4e=async(e,t)=>`data:image/webp;base64,${await Gk(await KH(e,t))}`,d5=pk();_k(()=>{let e=!1,t=u5.current;return(async()=>{let n;try{let e=await fetch(t);if(!e.ok)throw Error(`Failed to fetch logo`);let r=await e.blob(),[i,a]=await Promise.all([$4e(r,{...GH,width:192,height:192}),$4e(r,GH)]);n={small:i,large:a}}catch{n=void 0}e||(d5.current=n)})(),()=>{e=!0}});var e3e=hk(()=>{let e=l5.current,t=d5.current;if(!t)return;let{origin:n,pathname:r}=window.location,i={name:e,short_name:e,start_url:`${n}${r}`,display:`standalone`,icons:[{src:t.small,sizes:`192x192`,type:`image/webp`},{src:t.large,sizes:`512x512`,type:`image/webp`}]},a=new Blob([JSON.stringify(i)],{type:`application/manifest+json`});return URL.createObjectURL(a)}),f5=pk([{name:`Uint8Array Base64/hex conversion`,test:()=>typeof Uint8Array.fromBase64==`function`&&typeof Uint8Array.prototype.toHex==`function`},{name:`Iterator helpers`,test:()=>typeof globalThis.Iterator==`function`&&typeof globalThis.Iterator.prototype.map==`function`}].filter(({test:e})=>!e()).map(({name:e})=>e)),t3e=(e,t=kr)=>{var n=H();Wo(P(n),()=>bA(t(),{allowedTags:[`a`,`code`]})),U(e,n)},n3e=B(`<img alt="" class="logo svelte-7ua6x9"/> <h1 class="svelte-7ua6x9"> </h1>`,1),p5=B(`<div role="alert" class="message"> </div>`),r3e=B(`<li><!></li>`),i3e=B(`<div role="alert" class="message"><div role="none"> </div> <ul class="error svelte-7ua6x9"></ul></div>`),a3e=B(`<div role="alert"><div role="none" class="message"> </div> <div role="none" class="error svelte-7ua6x9"><!></div></div>`),o3e=B(`<!> <!>`,1),s3e=B(`<div role="alert" class="message"> </div> <!>`,1),c3e=B(`<div role="none" class="powered-by svelte-7ua6x9"> </div>`),l3e=B(`<div role="none" class="container svelte-7ua6x9"><div role="none" class="inner svelte-7ua6x9"><!> <!></div></div> <!>`,1),u3e={hash:`svelte-7ua6x9`,code:`.container.svelte-7ua6x9 {position:absolute;inset:0;z-index:101;flex:auto;display:flex;justify-content:center;align-items:center;gap:16px;padding:32px;.inner:where(.svelte-7ua6x9) {display:flex;flex-direction:column;align-items:center;gap:32px;min-width:240px;max-width:800px;min-height:240px;}.logo:where(.svelte-7ua6x9) {width:auto;height:160px;
@media (width < 768px) {height:120px;
}}h1:where(.svelte-7ua6x9) {font-size:48px;}.logo:where(.svelte-7ua6x9) ~ h1:where(.svelte-7ua6x9) {font-size:var(--sui-font-size-xxx-large);}.error:where(.svelte-7ua6x9) {border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-tertiary-background-color);font-size:var(--sui-font-size-default);text-align:center;-webkit-user-select:text;user-select:text;cursor:text;}
/* \`<SignIn>\` also has \`.message\` */.message {margin:0 0 16px;font-size:var(--sui-font-size-large);font-weight:var(--sui-font-weight-normal);text-align:center;ul {margin:12px 0 0;padding:0;max-height:160px;overflow-y:auto;list-style:none;}li {margin:12px;padding:0;}}}.powered-by.svelte-7ua6x9 {position:absolute;inset:auto 24px 24px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-small);text-align:center;}`};function d3e(e,t){O(t,!0),K(e,u3e);let n=A(()=>!!f5.current.length),r=A(()=>!!o5.signInError.message&&o5.signInError.context===`dataFetch`);L(()=>{Ek.current&&(XQ.current=Y(`welcome_message`,{values:{name:l5.current}}))});var i=l3e(),a=P(i),o=N(a),s=N(o),c=e=>{var t=n3e(),n=P(t),r=F(I(n,2),!0);R(()=>{q(n,`src`,u5.current),W(r,l5.current)}),U(e,t)};G(s,e=>{(Ek.current||z(n))&&e(c)});var l=I(s,2),u=e=>{var t=p5(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`unsupported_browser_error`)]),U(e,t)},d=e=>{var t=i3e(),n=N(t),r=F(n,!0),i=I(n,2);Bo(i,20,()=>Tk.current,e=>e,(e,t)=>{var n=r3e();t3e(N(n),()=>t),D(n),U(e,n)}),D(i),D(t),R(e=>W(r,e),[()=>Y(`config.errors`,{values:{count:Tk.current.length}})]),U(e,t)},f=e=>{var t=p5(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`prefs.error.${FG.current.type}`)]),U(e,t)},p=e=>{var t=p5(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`loading_cms_config`)]),U(e,t)},m=A(()=>!Sk.current||!Object.keys(IG).length),h=e=>{var t=o3e(),n=P(t),i=e=>{var t=a3e(),n=N(t),r=F(n,!0),i=I(n,2);t3e(N(i),()=>o5.signInError.message),D(i),D(t),R(e=>W(r,e),[()=>Y(`loading_site_data_error`)]),U(e,t)};G(n,e=>{z(r)&&e(i)}),Y4e(I(n,2),{}),U(e,t)},g=e=>{var t=p5(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`authorizing`)]),U(e,t)},_=e=>{var t=s3e(),n=P(t),r=F(n,!0),i=I(n,2),a=e=>{Vae(e,{get now(){return gj.current}})};G(i,e=>{gj.current!==void 0&&e(a)}),R(e=>W(r,e),[()=>Y(`loading_site_data`)]),U(e,t)};G(l,e=>{z(n)?e(u):Tk.current.length?e(d,1):FG.current?e(f,2):z(m)?e(p,3):z(r)||!bG.current&&(!OW.account||o5.unauthenticated)?e(h,4):bG.current?e(g,5):hj.current||e(_,6)}),D(o),D(a);var v=I(a,2),y=e=>{var t=c3e(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`powered_by`,{values:{name:`Sveltia CMS`}})]),U(e,t)};G(v,e=>{Ek.current&&l5.current!==`Sveltia CMS`&&e(y)}),U(e,i),k()}var f3e=B(`<div role="none" class="preview svelte-di72gm"> </div>`),p3e=B(`<!> <!>`,1),m3e={hash:`svelte-di72gm`,code:`.preview.svelte-di72gm {margin:8px 0 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);overflow-wrap:anywhere;}`};function h3e(e,t){let n=Eo();O(t,!0),K(e,m3e);let r=A(()=>K4.current),i=A(()=>!!z(r)),a=!1,o=A(()=>z(r).mode),s=A(()=>z(r).defaultMessage),c=A(()=>z(r).initialValue),l=A(()=>{let e=z(c).trim();return e?z(o)===`prefix`?`${e} ${z(s)}`:`${z(s)} ${e}`:z(s)});{let t=e=>{var t=p3e(),r=P(t);{let e=A(()=>Y(z(o)===!0?`commit_message.message`:`commit_message.addition`)),t=A(()=>z(o)===!0?void 0:`${n}-preview`);fu(r,{dir:`auto`,flex:!0,autofocus:!0,get ariaLabel(){return z(e)},get"aria-describedby"(){return z(t)},onkeydown:e=>{e.key===`Enter`&&!e.isComposing&&(e.preventDefault(),a=!0,M(i,!1))},get value(){return z(c)},set value(e){M(c,e)}})}var s=I(r,2),u=e=>{var t=f3e(),r=F(t,!0);R(e=>{q(t,`id`,`${n}-preview`),W(r,e)},[()=>Y(`commit_message.preview`,{values:{message:z(l)}})]),U(e,t)};G(s,e=>{z(o)!==!0&&e(u)}),U(e,t)},s=A(()=>Y(`commit_message.title`));pu(e,{get title(){return z(s)},onOk:()=>{z(r)?.respond(z(c))},onClose:()=>{z(r)?.respond(a?z(c):null),a=!1},get open(){return z(i)},set open(e){M(i,e)},input:t,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(z(o)===!0?`commit_message.description_replace`:`commit_message.description_addition`)]),U(e,n)},$$slots:{input:!0,default:!0}})}k()}var g3e=B(` <!>`,1),_3e=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function v3e(e,t){O(t,!0);let n=0,r=j(`none`),i=async()=>{OY.current?.checkStatus&&M(r,await OY.current.checkStatus(),!0)},a=()=>{window.clearInterval(n),i(),n=window.setInterval(()=>{i()},3e5)},o=()=>{window.clearInterval(n),M(r,`none`)},s=()=>{OY.current?.checkStatus&&!OY.current.repository?.isSelfHosted?a():o()};js(()=>()=>{o()}),L(()=>{OY.current,Sk.current,s()});var c=H(),l=P(c),u=e=>{var t=_3e(),n=P(t);{let e=A(()=>z(r)===`major`?`error`:`warning`);Lo(n,()=>({"--sui-infobar-message-justify-content":`center`})),jl(n.lastChild,{get status(){return z(e)},children:(e,t)=>{Qr();var n=g3e(),i=P(n),a=I(i);{let e=A(()=>Y(`details`));Al(a,{variant:`link`,get label(){return z(e)},onclick:()=>{FV(OY.current?.statusDashboardURL)}})}R(e=>W(i,`${e??``} `),[()=>Y(`backend_status.${z(r)}_incident`,{values:{service:OY.current?.label}})]),U(e,n)},$$slots:{default:!0}}),D(n)}U(e,t)},d=A(()=>[`minor`,`major`].includes(z(r)));G(l,e=>{z(d)&&e(u)}),U(e,c),k()}var y3e=`https://unpkg.com/@sveltia/cms/package.json`,b3e=`https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js`,x3e=async()=>{try{let e=await fetch(y3e);if(!e.ok)return;let{version:t}=await e.json();return typeof t==`string`&&t?t:void 0}catch{return}},S3e=async()=>{let e=await x3e();return!e||e===lk?!1:document.querySelector(`script[src="${b3e}"]`)?!0:(console.warn(`[Sveltia CMS] A new version (${e}) is available. Update the pinned version in your script tag or package.json to upgrade.`),!1)},C3e=B(` <!>`,1),w3e=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function T3e(e,t){O(t,!0);let n=0,r=0,i=j(!1),a=async()=>{await S3e()&&(r=window.setTimeout(()=>{M(i,!0)},6e5))},o=()=>{window.location.reload()};js(()=>(a(),n=window.setInterval(()=>{a()},36e5),()=>{window.clearInterval(n),window.clearTimeout(r)}));var s=H(),c=P(s),l=e=>{var t=w3e(),n=P(t);Lo(n,()=>({"--sui-infobar-message-justify-content":`center`})),jl(n.lastChild,{children:(e,t)=>{Qr();var n=C3e(),r=P(n),i=I(r);{let e=A(()=>Y(`update_now`));Al(i,{variant:`link`,get label(){return z(e)},onclick:o})}R(e=>W(r,`${e??``} `),[()=>Y(`update_available`)]),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)};G(c,e=>{z(i)&&e(l)}),U(e,s),k()}var E3e={create:`New`,select:`Select`,select_all:`Select All`,select_item:`Select {$name}`,upload:`Upload`,copy:`Copy`,download:`Download`,duplicate:`Duplicate`,delete:`Delete`,reorder:`Reorder`,cancel:`Cancel`,done:`Done`,save:`Save`,saving:`Saving…`,publish:`Publish`,publishing:`Publishing…`,rename:`Rename`,update:`Update`,replace:`Replace`,add:`Add`,remove:`Remove`,clear:`Clear`,expand:`Expand`,expand_all:`Expand All`,collapse:`Collapse`,collapse_all:`Collapse All`,insert:`Insert`,restore:`Restore`,discard:`Discard`,searching:`Searching…`,no_results:`No results found.`,global:`Global`,primary:`Primary`,secondary:`Secondary`,collection:`Collection`,folder:`Folder`,folders:`Folders`,more_folders:`More Folders`,api_key:`API Key`,details:`Details`,back:`Back`,automatic:`Automatic`,loading:`Loading…`,later:`Later`,slug:`Slug`,singleton:`Singleton`,singletons:`Singletons`,clipboard_error:`Couldn’t copy to clipboard.`,welcome_message:`Welcome to {$name}`,powered_by:`Powered by {$name}`,unsupported_browser_error:`Your browser is not supported. Please update it to the latest version or use another browser.`,loading_cms_config:`Loading CMS Configuration…`,loading_site_data:`Loading Site Data…`,loading_site_data_error:`There was an error while loading site data.`,sign_in_with_x:`Sign In with {$service}`,sign_in_using_access_token:`Sign In Using Access Token`,sign_in_using_access_token_description:`Enter your token below. It must have read/write access to the repository content.`,sign_in_using_access_token_workflow_note:`Since Editorial Workflow is enabled, it must also have read/write access to pull requests.`,sign_in_using_access_token_link:`You can generate a token on the <a>{$service} user settings page</a>.`,personal_access_token:`Personal Access Token`,authorizing:`Authorizing…`,signing_in:`Signing in…`,work_with_local_repo:`Work with Local Repository`,work_with_local_repo_description:`Once prompted, select the root directory of the “{$repo}” repository.`,work_with_local_repo_description_no_repo:`Once prompted, select the root directory of your Git repository.`,work_with_test_repo:`Work with Test Repository`,start_demo:`Start Demo`,sign_in_error:{not_project_root:`The selected folder is not a repository root directory. Please try again.`,picker_dismissed:`A repository root directory could not be selected. Please try again.`,authentication_aborted:`Authentication aborted. Please try again.`,invalid_token:`The provided token is invalid. Please check and try again.`,UNSUPPORTED_BACKEND:`Your Git backend is not supported by the authenticator.`,UNSUPPORTED_DOMAIN:`Your domain is not allowed to use the authenticator.`,MISCONFIGURED_CLIENT:`OAuth app client ID or secret is not configured.`,AUTH_CODE_REQUEST_FAILED:`Failed to receive an authorization code. Please try again later.`,CSRF_DETECTED:`Potential CSRF attack detected. Authentication flow aborted.`,TOKEN_REQUEST_FAILED:`Failed to request an access token. Please try again later.`,TOKEN_REFRESH_FAILED:`Failed to refresh the access token. Please try again later.`,MALFORMED_RESPONSE:`Server responded with malformed data. Please try again later.`},backend_unsupported_version:`The {$name} backend requires {$name} {$version} or later.`,repository_no_access:`You don’t have access to the “{$repo}” repository.`,repository_no_write_access:`You don’t have write access to the “{$repo}” repository.`,repository_not_found:`The “{$repo}” repository doesn’t exist.`,repository_empty:`The “{$repo}” repository has no branches.`,branch_not_found:`The “{$repo}” repository doesn’t have the “{$branch}” branch.`,root_dir_not_found:`The root directory “{$dir}” doesn’t exist in the “{$repo}” repository.`,unexpected_error:`Unexpected Error`,page_crashed:`Something went wrong, and this page can’t be displayed. {$message}`,field_crashed:`Something went wrong, and this field can’t be displayed. {$message}`,try_again:`Try Again`,reload_cms:`Reload CMS`,entry_parse_errors:`.input {$count :integer} .match $count one {{There was an error while parsing an entry file. Check the browser console for details.}} * {{There were errors while parsing entry files. Check the browser console for details.}}`,username:`Username`,password:`Password`,sign_in:`Sign In`,sign_in_with_mobile:`Sign In with Mobile`,sign_in_with_mobile_instruction:`Scan the QR code below with your phone or tablet for passwordless sign-in. Your settings will be automatically copied.`,sign_in_with_link:`Sign In with Link`,sign_in_with_link_confirmation:`This link signs you in as {$account} on {$service} and copies the settings from the device it was created on. Continue only if you created the link yourself.`,signed_in_as_x:`Signed In as {$name}`,working_with_local_repo:`Working with Local Repository`,working_with_test_repo:`Working with Test Repository`,working_in_demo_mode:`Demo Mode`,demo_welcome:{title:`Welcome to Sveltia CMS Demo`,description:`Feel free to explore the CMS and edit the sample content. Your changes are only saved in this browser. Nothing is published online, and no one else can see them.`,reset_hint:`To start over with the original content, select Erase All Data under Settings > Data Management.`,button_label:`Get Started`},sign_out:`Sign Out`,install_as_app:`Install as App`,contents:`Contents`,assets:`Assets`,editorial_workflow:`Editorial Workflow`,drafts:`Drafts`,cms_config:`CMS Configuration`,menu:`Menu`,custom_pages:`Pages`,mobile_promo_title:`Sveltia CMS is now available on mobile!`,mobile_promo_button:`Give it a try`,new_language_available:`Sveltia CMS is now available in {$locale}!`,change_language:`Change Language`,live_reload_warning:`Your development server reloads this page whenever a file changes, which can interrupt saving and leave your files broken. Serve the CMS from a static HTML file instead. <a>Learn more</a>`,switching_language:`Switching to {$locale}…`,locale_load_failed:`Couldn’t load the {$locale} translation. Please try again later.`,local_git_not_committed:`Your changes have been saved but not committed to Git. {$reason} To only save the files, turn off Git commits under Settings > Developer.`,local_git_skip_reasons:{unsupported_repository:`Your repository uses a Git feature the CMS doesn’t support, such as a linked worktree, SHA-256 object names, the reftable format, a sparse index, or an index in version 3 or 4, which the feature.manyFiles option and git add -N use.`,missing_identity:`Your name and email address aren’t set in the repository’s Git configuration, and the CMS can’t read your global one. Set them in the repository with git config --local user.name "Your Name" and git config --local user.email "you@example.com".`,locked:`Another Git process is using the repository. If none is running, delete the .git/index.lock file.`,operation_in_progress:{merge:`A merge is in progress. Finish it with git commit, or cancel it with git merge --abort.`,rebase:`A rebase is in progress. Finish it with git rebase --continue, or cancel it with git rebase --abort. If you’ve moved on, git rebase --quit drops it without changing your files.`,cherry_pick:`A cherry-pick is in progress. Finish it with git cherry-pick --continue, or cancel it with git cherry-pick --abort.`,revert:`A revert is in progress. Finish it with git revert --continue, or cancel it with git revert --abort.`,am:`Applying patches with git am is in progress. Finish it with git am --continue, or cancel it with git am --abort.`,conflict:`Some files have conflicts. Resolve them and stage the results first.`},detached_head:`No branch is checked out.`,staged_changes:`You have other changes staged for commit. Commit or unstage them first.`,lfs:`{$path} is tracked with Git LFS, which the CMS can’t commit to.`,error:`An unexpected error occurred. {$message}`},visit_live_site:`Visit Live Site`,switch_page:`Switch Page`,search_placeholder_contents:`Search for contents…`,search_placeholder_assets:`Search for assets…`,search_placeholder_all:`Search for contents and assets…`,create_entry_or_assets:`Create Entry or Assets`,publish_changes:`Publish Changes`,publishing_changes:`Publishing Changes…`,publishing_changes_failed:`Couldn’t publish changes. Please try again.`,show_notifications:`Show Notifications`,notifications:`Notifications`,show_account_menu:`Show Account Menu`,account:`Account`,live_site:`Live Site`,git_repository:`Git Repository`,settings:`Settings`,show_help_menu:`Show Help Menu`,help:`Help`,keyboard_shortcuts:`Keyboard Shortcuts`,documentation:`Documentation`,release_notes:`Release Notes`,announcements:`Announcements`,version_x:`Version {$version}`,report_issue:`Report Issue`,share_feedback:`Share Feedback`,get_help:`Get Help`,donate:`Donate`,join_discord:`Join Us on Discord`,bluesky:`Follow Us on Bluesky`,update_available:`The latest version of Sveltia CMS is available.`,update_now:`Update Now`,backend_status:{minor_incident:`{$service} is experiencing a minor incident. Your workflow may be affected.`,major_incident:`{$service} is experiencing a major incident. You may want to wait until the situation has improved.`},content_library:`Content Library`,asset_library:`Asset Library`,collections:`Collections`,entries:`Entries`,files:`Files`,asset_location:{repository:`Your Site`,external:`External Locations`,stock_photos:`Stock Photos`},collection_assets:`Collection Assets`,entry_list:`Entry List`,file_list:`File List`,asset_list:`Asset List`,x_collection:`{$collection} Collection`,x_asset_folder:`{$folder} Asset Folder`,viewing_collection_list:`You’re now viewing the collection list.`,viewing_asset_folder_list:`You’re now viewing the asset folder list.`,viewing_x_collection:`.input {$count :integer} .match $count 0 {{You’re now viewing the “{$collection}” collection, which has no entries yet.}} one {{You’re now viewing the “{$collection}” collection, which has one entry.}} * {{You’re now viewing the “{$collection}” collection, which has {$count} entries.}}`,viewing_x_asset_folder:`.input {$count :integer} .match $count 0 {{You’re now viewing the “{$folder}” asset folder, which has no assets yet.}} one {{You’re now viewing the “{$folder}” asset folder, which has one asset.}} * {{You’re now viewing the “{$folder}” asset folder, which has {$count} assets.}}`,viewing_x_external_location:`You’re now viewing the assets on {$service}.`,singleton_selected_announcement:`Press Enter to edit the “{$file}” file.`,page_not_found:`Page not found.`,collection_not_found:`Collection not found.`,asset_folder_not_found:`Asset folder not found.`,file_not_found:`File not found.`,x_of_x_selected:`{$selected} of {$total} selected`,switch_view:`Switch View`,table_view:`Table View`,list_view:`List View`,grid_view:`Grid View`,switch_to_list_view:`Switch to List View`,switch_to_grid_view:`Switch to Grid View`,sort:`Sort`,sorting_options:`Sorting Options`,table_column_keys:{dirname:`Folder`,filename:`File Name`,extension:`Extension`,locales:`Languages`},sort_keys:{none:`None`,name:`Name`,slug:`Slug`,commit_author:`Updated by`,commit_date:`Updated on`,last_modified:`Modified on`,size:`Size`,_summary:`Summary`,_manual:`Manual`},ascending:`{$label}, A to Z`,ascending_date:`{$label}, old to new`,descending:`{$label}, Z to A`,descending_date:`{$label}, new to old`,ascending_number:`{$label}, small to large`,descending_number:`{$label}, large to small`,filter:`Filter`,filtering_options:`Filtering Options`,group:`Group`,grouping_options:`Grouping Options`,type:`Type`,all:`All`,domain:`Domain`,image:`Image`,video:`Video`,audio:`Audio`,document:`Document`,other:`Other`,show_assets:`Show Assets`,hide_assets:`Hide Assets`,show_info:`Show Info`,hide_info:`Hide Info`,all_assets:`All Assets`,global_assets:`Global Assets`,linked_files:`Linked Files`,file_unavailable:`Unavailable`,file_unavailable_description:`This file couldn’t be loaded. It may have been moved or deleted.`,loading_entries:`.input {$count :integer} .match $count one {{Loading entry…}} * {{Loading entries…}}`,entry_not_found:`Entry not found.`,creating_entries_disabled_by_admin:`Creating new entries in this collection is disabled by the administrator.`,creating_entries_disabled_by_quota:`.input {$quota :integer} .match $quota one {{You cannot add new entries to this collection because it has reached its limit of {$quota} entry.}} * {{You cannot add new entries to this collection because it has reached its limit of {$quota} entries.}}`,creating_entries_nearing_quota:`.input {$quota :integer} .input {$remaining :integer} .match $quota $remaining one one {{This collection is nearing its limit of {$quota} entry. You can only create {$remaining} more entry.}} one * {{This collection is nearing its limit of {$quota} entry. You can only create {$remaining} more entries.}} * one {{This collection is nearing its limit of {$quota} entries. You can only create {$remaining} more entry.}} * * {{This collection is nearing its limit of {$quota} entries. You can only create {$remaining} more entries.}}`,readonly_cms:`The CMS is in read-only mode. You can view content and assets but cannot make any changes.`,readonly_collection:`This collection is read-only. You can view its content but cannot make any changes.`,readonly_entry:`This entry is read-only. You can view it but cannot make any changes.`,readonly_asset_folder:`This folder is read-only. You can view its assets but cannot make any changes.`,readonly_branch:`You don’t have permission to push to the “{$branch}” branch. You can view this content but cannot make any changes.`,readonly_reference:`The entry is read-only, so the reference can’t be removed.`,cannot_rename_referenced_entry:`This entry can’t be renamed, because the following read-only entries refer to it by its current name: {$entries}.`,cannot_move_referenced_asset:`This asset can’t be moved or renamed, because the following read-only entries use it: {$entries}.`,back_to_collection:`Back to Collection`,collection_list:`Collection List`,back_to_collection_list:`Back to Collection List`,asset_folder_list:`Asset Folder List`,back_to_asset_folder_list:`Back to Asset Folder List`,back_to_parent_folder:`Back to Parent Folder`,search_results:`Search Results`,search_results_for_x:`Search Results for “{$terms}”`,viewing_entry_search_results:`.input {$count :integer} .match $count 0 {{You’re now viewing search results for “{$terms}”. We couldn’t find any entries.}} one {{You’re now viewing search results for “{$terms}”. We’ve found one entry.}} * {{You’re now viewing search results for “{$terms}”. We’ve found {$count} entries.}}`,viewing_asset_search_results:`.input {$count :integer} .match $count 0 {{You’re now viewing search results for “{$terms}”. We couldn’t find any assets.}} one {{You’re now viewing search results for “{$terms}”. We’ve found one asset.}} * {{You’re now viewing search results for “{$terms}”. We’ve found {$count} assets.}}`,x_entries:`.input {$count :integer} .match $count 0 {{No entries}} one {{{$count} entry}} * {{{$count} entries}}`,x_assets:`.input {$count :integer} .match $count 0 {{No assets}} one {{{$count} asset}} * {{{$count} assets}}`,no_files_found:`No files found.`,no_entries_found:`No entries found.`,upload_assets:`Upload New Assets`,new_folder:`New Folder`,new_folder_name:`Folder Name`,new_folder_create:`Create`,new_folder_description:`The new folder will be created in “{$folder}”.`,new_folder_error:{empty:`The folder name cannot be empty.`,invalid:`The folder name cannot contain slashes or start with a dot.`,reserved:`The files in a folder with this name are read-only, as the CMS itself is usually served from it.`,duplicate:`A folder or file with this name already exists here.`},creating_folder:`Creating the folder…`,creating_folder_failed:`Couldn’t create the folder.`,folder_options:`Folder Options`,show_folder_options:`Show Folder Options`,rename_folder:`Rename Folder`,delete_folder:`Delete Folder`,enter_new_name_for_folder:`.input {$count :integer} .match $count 0 {{Enter a new name below.}} one {{Enter a new name below. The asset in the folder will be moved along, and any entry using it will be updated.}} * {{Enter a new name below. The {$count} assets in the folder will be moved along, and any entries using them will be updated.}}`,enter_new_name_for_external_folder:`.input {$count :integer} .match $count 0 {{Enter a new name below.}} one {{Enter a new name below. The file in the folder will be moved along, and its URL will change, so update any entry using it.}} * {{Enter a new name below. The {$count} files in the folder will be moved along, and their URLs will change, so update any entries using them.}}`,renaming_external_folder_breaks_links:`.input {$count :integer} .match $count one {{An entry links to a file in this folder. The entry won’t be updated, so the link will break once the folder is renamed.}} * {{{$count} entries link to files in this folder. The entries won’t be updated, so the links will break once the folder is renamed.}}`,confirm_deleting_folder:`.input {$count :integer} .match $count 0 {{Are you sure you want to delete the empty “{$name}” folder?}} one {{Are you sure you want to delete the “{$name}” folder and the asset in it?}} * {{Are you sure you want to delete the “{$name}” folder and the {$count} assets in it?}}`,renaming_folder:`Renaming the folder…`,renaming_folder_failed:`Couldn’t rename the folder.`,deleting_folder:`Deleting the folder…`,deleting_folder_failed:`Couldn’t delete the folder.`,external_assets_truncated:`There are too many files on the service to list them all, so some of them are left out.`,edit_options:`Edit Options`,show_edit_options:`Show Edit Options`,copy_options:`Copy Options`,edit_asset:`Edit Asset`,edit_x:`Edit {$name}`,wrap_long_lines:`Wrap Long Lines`,rename_asset:`Rename Asset`,rename_x:`Rename {$name}`,enter_new_name_for_asset:`.input {$count :integer} .match $count 0 {{Enter a new name below.}} one {{Enter a new name below. An entry using the asset will also be updated.}} * {{Enter a new name below. {$count} entries using the asset will also be updated.}}`,renaming_external_asset_breaks_links:`.input {$count :integer} .match $count one {{An entry links to this file. The entry won’t be updated, so the link will break once the file is renamed.}} * {{{$count} entries link to this file. The entries won’t be updated, so the links will break once the file is renamed.}}`,enter_new_name_for_asset_error:{empty:`File name cannot be empty.`,character:`File name cannot contain special characters.`,duplicate:`This file name is used for another asset.`,leading_dot:`File name cannot start with a dot.`,folder_duplicate:`A folder with this name already exists here.`},file_will_be_saved_as:`The file will be saved as “{$name}”.`,change_file_extension:`Change File Extension`,confirm_file_extension_change:{change:`Are you sure you want to change the extension from “.{$oldExtension}” to “.{$newExtension}”?`,add:`Are you sure you want to add the extension “.{$newExtension}”?`,remove:`Are you sure you want to remove the extension “.{$oldExtension}”?`},file_extension_change_warning:`The file may not be displayed or handled correctly if the extension doesn’t match the actual file format.`,replace_asset:`Replace Asset`,replace_x:`Replace {$name}`,replace_file:`Replace File`,replace_image:`Replace Image`,remove_file:`Remove File`,remove_image:`Remove Image`,click_to_browse:`Click to browse…`,tap_to_browse:`Tap to browse…`,drop_files_or_click_to_browse:`.input {$count :integer} .match $count one {{Drop a file here or click to browse…}} * {{Drop files here or click to browse…}}`,drop_files_or:`.input {$count :integer} .match $count one {{Drop a file here or}} * {{Drop files here or}}`,drop_image_files_or:`.input {$count :integer} .match $count one {{Drop an image file here or}} * {{Drop image files here or}}`,browse:`Browse`,paste:`Paste`,paste_image:`Paste Image`,no_image_in_clipboard:`No image found in clipboard.`,clipboard_access_denied:`Clipboard access denied.`,drop_files_here:`.input {$count :integer} .match $count one {{Drop a file here}} * {{Drop files here}}`,unsupported_file_type:`Unsupported File Type`,dropped_file_type_mismatch:`The dropped file is not one of the following types: {$types}. Please try again.`,dropped_image_type_mismatch:`The dropped file is not supported. Only an image of the following types is accepted: {$types}. Please try again.`,choose_files:`.input {$count :integer} .match $count one {{Choose File}} * {{Choose Files}}`,delete_assets:`.input {$count :integer} .match $count one {{Delete Asset}} * {{Delete Assets}}`,delete_selected_assets:`.input {$count :integer} .match $count one {{Delete Selected Asset}} * {{Delete Selected Assets}}`,confirm_deleting_this_asset:`Are you sure you want to delete this asset?`,confirm_deleting_selected_assets:`.input {$count :integer} .match $count one {{Are you sure you want to delete the selected asset?}} * {{Are you sure you want to delete the selected {$count} assets?}}`,confirm_deleting_all_assets:`Are you sure you want to delete all the assets?`,deleting_referenced_assets_note:`.input {$count :integer} .match $count one {{The reference to it in an entry will be removed as well.}} * {{The references to it in {$count} entries will be removed as well.}}`,cannot_delete_referenced_assets:`.input {$count :integer} .match $count one {{This asset can’t be deleted, because the following fields in the entries using it would no longer be valid without it. Update those entries first.}} * {{These assets can’t be deleted, because the following fields in the entries using them would no longer be valid without them. Update those entries first.}}`,checking_asset_references_failed:`.input {$count :integer} .match $count one {{Couldn’t check which entries use this asset. Close this dialog and try again.}} * {{Couldn’t check which entries use these assets. Close this dialog and try again.}}`,delete_entries:`.input {$count :integer} .match $count one {{Delete Entry}} * {{Delete Entries}}`,delete_selected_entries:`.input {$count :integer} .match $count one {{Delete Selected Entry}} * {{Delete Selected Entries}}`,confirm_deleting_this_entry:`Are you sure you want to delete this entry?`,confirm_deleting_this_entry_with_assets:`Are you sure you want to delete this entry and associated assets?`,deleting_entry_failed:`Couldn’t delete the entry. Please try again.`,confirm_deleting_selected_entries:`.input {$count :integer} .match $count one {{Are you sure you want to delete the selected entry?}} * {{Are you sure you want to delete the selected {$count} entries?}}`,confirm_deleting_selected_entries_with_assets:`.input {$count :integer} .match $count one {{Are you sure you want to delete the selected entry and associated assets?}} * {{Are you sure you want to delete the selected {$count} entries and associated assets?}}`,confirm_deleting_all_entries:`Are you sure you want to delete all the entries?`,confirm_deleting_all_entries_with_assets:`Are you sure you want to delete all the entries and associated assets?`,deleting_referenced_entries_note:`.input {$count :integer} .match $count one {{The reference to it in another entry will be removed as well.}} * {{The references to it in {$count} other entries will be removed as well.}}`,cannot_delete_referenced_entries:`.input {$count :integer} .match $count one {{This entry can’t be deleted, because the following fields in other entries would no longer be valid without it. Update those entries first.}} * {{These entries can’t be deleted, because the following fields in other entries would no longer be valid without them. Update those entries first.}}`,reorder_entries:`Reorder Entries`,done_reordering_entries:`Done Reordering Entries`,cancel_reordering_entries:`Cancel Reordering Entries`,saving_reorder_failed:`Failed to save new entry order. Please try again.`,bulk_edit_entries:`Edit Entries in Bulk`,save_bulk_edits:`Save Bulk Edits`,cancel_bulk_edits:`Cancel Bulk Edits`,bulk_edit_entry:`Entry`,bulk_edit_table:`Bulk Editor`,bulk_edit_cell:`{$field} of {$entry}`,bulk_edit_count:`.input {$count :integer} .match $count 0 {{No changes}} one {{1 change}} * {{{$count} changes}}`,bulk_edit_invalid:`Some of the values aren’t valid. Fix the highlighted fields and try again.`,saving_bulk_edits_failed:`Failed to save the changes. Please try again.`,discard_bulk_edits_confirm:`Discard the changes made to the entries?`,processing_files:`.input {$count :integer} .match $count one {{Processing a file. This may take a while.}} * {{Processing files. This may take a while.}}`,uploading_files:`Uploading Files`,confirm_replacing_file:`“{$name}” will be replaced with this file:`,confirm_uploading_files:`.input {$count :integer} .match $count one {{This file will be saved to the “{$folder}” folder:}} * {{These {$count} files will be saved to the “{$folder}” folder:}}`,oversized_files:`Oversized Files`,warning_oversized_files:`.input {$count :integer} .match $count one {{This file cannot be uploaded because it exceeds the maximum size of {$size}. Please reduce the size or select a different file.}} * {{These files cannot be uploaded because they exceed the maximum size of {$size}. Please reduce the sizes or select different files.}}`,invalid_files:`Invalid Files`,warning_invalid_files:`.input {$count :integer} .match $count one {{This file cannot be uploaded because it’s damaged, or its content doesn’t match its file extension. This often happens when a photo is renamed rather than converted, such as a HEIC image saved as a JPEG file. Please convert the file and try again.}} * {{These files cannot be uploaded because they’re damaged, or their content doesn’t match their file extensions. This often happens when photos are renamed rather than converted, such as HEIC images saved as JPEG files. Please convert the files and try again.}}`,warning_unsupported_files:`.input {$count :integer} .match $count one {{This file cannot be uploaded because it’s not one of the following types: {$types}.}} * {{These files cannot be uploaded because they’re not one of the following types: {$types}.}}`,warning_unsupported_image_files:`.input {$count :integer} .match $count one {{This file cannot be uploaded because only an image of the following types is accepted: {$types}.}} * {{These files cannot be uploaded because only images of the following types are accepted: {$types}.}}`,mismatched_files:`Mismatched Files`,warning_mismatched_files:`.input {$count :integer} .match $count one {{This file cannot replace “{$name}” because it’s in a different format. Please convert the file to the same format and try again.}} * {{These files cannot replace “{$name}” because they’re in a different format. Please convert the files to the same format and try again.}}`,file_name_conflict_confirmation:`.input {$count :integer} .match $count one {{A file with the same name already exists in this folder. Do you want to replace it?}} * {{{$count} files with the same names already exist in this folder. Do you want to replace them?}}`,file_name_conflict_confirmation_with_name:`.input {$count :integer} .input {$name :string} .match $count one {{A file named “{$name}” already exists in this folder. Do you want to replace it?}} * {{{$count} files with the same names already exist in this folder. Do you want to replace them?}}`,file_name_conflict_resolution:`File Name Conflict Resolution`,keep_both:`Keep Both`,uploading_files_progress:`Uploading…`,uploading_files_failed:`Upload failed.`,deleting_assets_failed:`Delete failed.`,renaming_asset_failed:`Rename failed.`,saving_asset_failed:`Save failed.`,file_meta_converted_from_x:`(converted from {$type})`,no_entries_created:`This collection has no entries yet.`,create_new_entry:`Create New Entry`,entry:`Entry`,index_file:`Index File`,no_files_in_collection:`No files available in this collection.`,duplicate_entry:`Duplicate Entry`,entry_duplicated:`Entry duplicated as a new draft.`,entry_validation_errors:`.input {$count :integer} .match $count one {{One field has an error. Please correct it to save the entry.}} * {{{$count} fields have errors. Please correct them to save the entry.}}`,show_errors:`Show Errors`,entry_saved:`.input {$count :integer} .match $count one {{Entry saved.}} * {{{$count} entries saved.}}`,entry_saved_and_published:`.input {$count :integer} .match $count one {{Entry saved and published.}} * {{{$count} entries saved and published.}}`,entries_deleted:`.input {$count :integer} .match $count one {{Entry deleted.}} * {{{$count} entries deleted.}}`,assets_saved:`.input {$count :integer} .match $count one {{Asset saved.}} * {{{$count} assets saved.}}`,assets_saved_and_published:`.input {$count :integer} .match $count one {{Asset saved and published.}} * {{{$count} assets saved and published.}}`,asset_urls_copied:`.input {$count :integer} .match $count one {{URL copied to clipboard.}} * {{{$count} URLs copied to clipboard.}}`,asset_paths_copied:`.input {$count :integer} .match $count one {{File path copied to clipboard.}} * {{{$count} file paths copied to clipboard.}}`,asset_ids_copied:`.input {$count :integer} .match $count one {{File ID copied to clipboard.}} * {{{$count} file IDs copied to clipboard.}}`,asset_data_copied:`.input {$count :integer} .match $count one {{File data copied to clipboard.}} * {{{$count} files’ data copied to clipboard.}}`,assets_downloaded:`.input {$count :integer} .match $count one {{Asset downloaded.}} * {{{$count} assets downloaded.}}`,assets_moved:`.input {$count :integer} .match $count one {{Asset moved.}} * {{{$count} assets moved.}}`,assets_renamed:`.input {$count :integer} .match $count one {{Asset renamed.}} * {{{$count} assets renamed.}}`,assets_deleted:`.input {$count :integer} .match $count one {{Asset deleted.}} * {{{$count} assets deleted.}}`,folder_created:`Folder created.`,folder_path:`Folder Path`,folder_contents:`Contents`,x_folders:`.input {$count :integer} .match $count 0 {{No folders}} one {{{$count} folder}} * {{{$count} folders}}`,folder_renamed:`Folder renamed.`,folder_deleted:`Folder deleted.`,content_editor:`Content Editor`,restore_backup_title:`Restore Draft`,restore_backup_description:`This entry has a backup from {$datetime}. Do you want to restore the edited draft?`,draft_backup_saved:`Draft backup saved.`,draft_backup_restored:`Draft backup restored.`,draft_backup_deleted:`Draft backup deleted.`,cancel_editing:`Cancel Editing`,create_entry_title:`Creating {$name}`,create_entry_announcement:`You’re now creating a new entry in the “{$collection}” collection.`,edit_entry_announcement:`You’re now editing the “{$entry}” entry in the “{$collection}” collection.`,edit_file_announcement:`You’re now editing the “{$file}” file in the “{$collection}” collection.`,edit_singleton_announcement:`You’re now editing the “{$file}” file.`,save_and_publish:`Save and Publish`,save_without_publishing:`Save without Publishing`,show_editor_options:`Show Editor Options`,editor_options:`Editor Options`,show_second_pane:`Show Second Pane`,show_preview:`Show Preview`,sync_scrolling:`Sync Scrolling`,switch_locale:`Switch Locale`,locale_content_disabled_short:`(disabled)`,locale_content_error_short:`(error)`,edit:`Edit`,preview:`Preview`,swap_panes:`Swap Panes`,edit_x_locale:`Edit {$locale} Content`,preview_x_locale:`Preview {$locale} Content`,edit_content:`Edit Content`,preview_content:`Preview Content`,content_preview:`Content Preview`,show_content_options_x_locale:`Show {$locale} Content Options`,content_options_x_locale:`{$locale} Content Options`,show_content_options:`Show Content Options`,content_options:`Content Options`,x_field:`“{$field}” Field`,show_field_options:`Show Field Options`,field_options:`Field Options`,unsupported_field_type_x:`Unsupported field type: {$name}`,enable_x_locale:`Enable {$locale}`,reenable_x_locale:`Reenable {$locale}`,disable_x_locale:`Disable {$locale}`,locale_x_has_been_disabled:`The {$locale} content has been disabled.`,locale_x_now_disabled:`The {$locale} content is now disabled. It will be deleted when you save the entry.`,view_in_repository:`View in Repository`,view_on_x:`View on {$service}`,view_on_live_site:`View on Live Site`,deploy_preview:{view:`View Preview`,building:`The preview is still being built.`,failed:`The preview couldn’t be built.`,checking:`Checking for a preview…`,check_again:`Check for Preview`,awaiting:`Checking for Preview`,short:{building:`Building…`,failed:`Build Failed`}},copy_from:`Copy from…`,copy_from_x:`Copy from {$locale}`,translation_options:`Translation Options`,translate:`Translate`,translate_fields:`.input {$count :integer} .match $count one {{Translate Field}} * {{Translate Fields}}`,translate_from:`Translate from…`,translate_from_x:`Translate from {$locale}`,revert_changes:`Revert Changes`,revert_all_changes:`Revert All Changes`,restore_default:`Restore Default`,clear_all:`Clear All`,confirm_reverting_changes:`Are you sure you want to revert all the changes made to this entry?`,confirm_reverting_changes_x_locale:`Are you sure you want to revert all the changes made to the {$locale} content?`,confirm_restoring_defaults:`Are you sure you want to restore the default values of all the fields in this entry? Your changes will be lost.`,confirm_restoring_defaults_x_locale:`Are you sure you want to restore the default values of all the fields in the {$locale} content? Your changes will be lost.`,confirm_clearing_fields:`Are you sure you want to clear all the fields in this entry? Your changes will be lost.`,confirm_clearing_fields_x_locale:`Are you sure you want to clear all the fields in the {$locale} content? Your changes will be lost.`,edit_slug:`Edit Slug`,edit_slug_error:{empty:`The slug cannot be empty.`,invalid:`The slug cannot contain special characters, including slashes and spaces.`,duplicate:`This slug is used for another entry.`},entry_parent_folder:`Parent Folder`,new_parent_folder:`New Folder`,new_parent_folder_create:`Create`,new_parent_folder_name:`Folder Name`,new_parent_folder_description:`The new folder will be created in “{$folder}”.`,new_parent_folder_error:{empty:`The folder name cannot be empty.`,invalid:`The folder name cannot contain slashes or start with a dot, and must include letters or numbers.`,duplicate:`A folder with this name already exists here.`},edit_path_error:{invalid:`The path cannot contain relative segments such as “..”.`,recursive:`The entry cannot be moved into one of its own subfolders.`,duplicate:`This path is used for another entry.`},required:`Required`,editor:{translation:{none:`Nothing to translate.`,started:`Translating…`,error:`Translation failed.`,complete:`.input {$count :integer} .match $count 0 {{No fields translated from {$source}.}} one {{Field translated from {$source}.}} * {{{$count} fields translated from {$source}.}}`},copy:{none:`Nothing to copy.`,complete:`.input {$count :integer} .match $count 0 {{No fields copied from {$source}.}} one {{Field copied from {$source}.}} * {{{$count} fields copied from {$source}.}}`}},validation:{value_missing:`This field is required.`,range_underflow:{"datetime-local":`The date/time must be at or after {$min}.`,date:`The date must be on or after {$min}.`,time:`The time must be at or after {$min}.`,number:`The value must be greater than or equal to {$min}.`,select:`.input {$min :integer} .match $min one {{You must select at least {$min} option.}} * {{You must select at least {$min} options.}}`,add:`.input {$min :integer} .match $min one {{You must add at least {$min} item.}} * {{You must add at least {$min} items.}}`},range_overflow:{"datetime-local":`The date/time must be at or before {$max}.`,date:`The date must be on or before {$max}.`,time:`The time must be at or before {$max}.`,number:`The value must be less than or equal to {$max}.`,select:`.input {$max :integer} .match $max one {{You cannot select more than {$max} option.}} * {{You cannot select more than {$max} options.}}`,add:`.input {$max :integer} .match $max one {{You cannot add more than {$max} item.}} * {{You cannot add more than {$max} items.}}`},too_short:`.input {$min :integer} .match $min one {{You must enter at least {$min} character.}} * {{You must enter at least {$min} characters.}}`,too_long:`.input {$max :integer} .match $max one {{You cannot enter more than {$max} character.}} * {{You cannot enter more than {$max} characters.}}`,type_mismatch:{number:`Please enter a number.`,email:`Please enter a valid email.`,url:`Please enter a valid URL.`},value_not_unique:`This value is used for another entry.`,key_not_unique:`This key is used for another item.`,key_numeric:`The key can’t be a whole number, as the items would lose their order.`,invalid_value:`Invalid value.`,unexpected_error:`Unexpected error occurred.`},entry_sidebar:{sidebar_panels:`Sidebar Panels`,validation:{title:`Validation`,placeholder:`Validation results will be shown here.`,no_errors_found:`No errors found.`,validate:`Validate`},slug:{title:`Slug`,generated_on_save:`The slug is generated from the entry’s content when it’s saved. Any date and time in it will be those of the save.`,unavailable:`This entry doesn’t have a slug.`},history:{title:`History`,fetch_failed:`Failed to load history.`,no_history:`No history found.`},backlinks:{title:`Backlinks`,no_entries:`No entries are referencing this entry.`}},save_progress:{preparing:`Preparing files: {$done} of {$total}`,committing:`Saving to GitHub: {$done} of about {$total} commits`},saving_entry:{error:{title:`Error`,description:`There was an error while saving the entry. Please try again later.`}},save_conflict:{title:`Entry Changed by Someone Else`,modified_by:`{$name} changed this entry on {$date}, after you opened it.`,modified:`This entry has been changed in the repository after you opened it.`,deleted:`This entry has been deleted from the repository after you opened it.`,overwrite_warning:`If you save now, their changes will be lost.`,recreate_warning:`If you save now, the entry will be created again.`,reload_warning:`As the entry is stored in the same file as other entries, it can’t be saved over the change. Cancel editing, then open the entry again from the list and make your edits.`,save_anyway:`Save Anyway`,branch_moved:`The repository has been updated by someone else while saving. Please try again.`,array_item_changed:`An entry stored in the same file has been changed by someone else. Please try again.`,array_file_invalid:`The {$path} file can’t be updated, as it doesn’t contain a valid list of entries.`},remote_change:{reload_entry:`Reload Entry`,confirm_reloading_entry:`Are you sure you want to reload the entry? Your unsaved changes will be lost.`},viewing_x_asset_details:`You’re viewing the details of the “{$name}” asset.`,asset_editor:`Asset Editor`,previous_asset:`Previous Asset`,next_asset:`Next Asset`,preview_unavailable:`Preview Unavailable.`,public_urls:`.input {$count :integer} .match $count one {{Public URL}} * {{Public URLs}}`,file_paths:`.input {$count :integer} .match $count one {{File Path}} * {{File Paths}}`,file_ids:`.input {$count :integer} .match $count one {{File ID}} * {{File IDs}}`,file_data:`File Data`,asset_info:`Asset Info`,select_asset_show_info:`Select an asset to show its info.`,kind:`Kind`,size:`Size`,dimensions:`Dimensions`,duration:`Duration`,used_in:`Used in`,created_date:`Created Date`,location:`Location`,map_lat_lng:`Map showing latitude {$latitude}, longitude {$longitude}`,remove_this_item:`Remove This Item`,move_up:`Move Up`,move_down:`Move Down`,reorder_options:`Reorder Options`,move_to_top:`Move to Top`,move_to_bottom:`Move to Bottom`,move_to:`Move to…`,move_to_description:`Enter a position from 1 to {$count}.`,move_to_position:`Position`,reorder_item:`Reorder Item`,list_item_value:`Item Value`,list_item_position:`Item {$position} of {$count}`,item_removed:`Item removed.`,add_x:`Add {$name}`,list_item_options:`List Item Options`,add_item_above:`Add Item Above`,add_item_below:`Add Item Below`,paste_item_above:`Paste Item Above`,paste_item_below:`Paste Item Below`,paste_item_to_replace:`Paste to Replace`,paste_item:`Paste Item`,list_item_copied:`Item copied.`,no_list_item_to_paste:`There’s no copied item to paste. To copy one, open an item’s ⋮ (List Item Options) menu and select Copy.`,list_item_not_compatible:`The copied item doesn’t fit in this list.`,list_item_pasted_without_values:`.input {$count :integer} .match $count one {{Item pasted. A value this list doesn’t take was left out.}} * {{Item pasted. {$count} values this list doesn’t take were left out.}}`,list_item_pasted_without_files:`.input {$count :integer} .match $count one {{Item pasted, but a file it uses couldn’t be found. Check the file fields in the item.}} * {{Item pasted, but {$count} files it uses couldn’t be found. Check the file fields in the item.}}`,select_list_type:`Select List Type`,unknown_variable_type:`This item can’t be displayed due to an unknown type. Check the browser console for details.`,opacity:`Opacity`,unselected_option:`(None)`,relation_field:{save_together_hint:`The new {$name} will be saved along with the entry you’re editing.`,add_failed:`The {$name} couldn’t be added. Check the browser console for details.`},assets_dialog:{title:{file:`Select File`,image:`Select Image`,folder:`Select Folder`},search_for_file:`Search for Files`,search_for_image:`Search for Images`,locations:`Locations`,selected_folder:`Selected folder: {$path}`,selected_folders:`.input {$count :integer} .match $count one {{{$count} folder selected}} * {{{$count} folders selected}}`,no_subfolders:`This folder has no subfolders.`,folder:{field:`Field Assets`,entry:`Entry Assets`,file:`File Assets`,collection:`Collection Assets`,global:`Global Assets`},error:{invalid_key:`Your API key is invalid or expired. Please double-check and try again.`,search_fetch_failed:`There was an error while searching assets. Please try again later.`,image_fetch_failed:`There was an error while downloading the selected asset. Please try again later.`},available_images:`Available Images`,available_files:`Available Files`,enter_url:`Enter URL`,enter_file_url:`Enter URL of the file:`,enter_image_url:`Enter URL of the image:`,large_file:{title:`Large File`},invalid_file:{title:`Invalid File`},rejected_files:{title:`Files Cannot Be Uploaded`},photo_credit:{title:`Photo Credit`,description:`Use the following credit if possible:`},unsaved:`Unsaved`},character_counter:{min_max:`.input {$count :integer} .match $count 0 {{No character entered. Minimum: {$min}. Maximum: {$max}.}} one {{{$count} character entered. Minimum: {$min}. Maximum: {$max}.}} * {{{$count} characters entered. Minimum: {$min}. Maximum: {$max}.}}`,min:`.input {$count :integer} .match $count 0 {{No character entered. Minimum: {$min}.}} one {{{$count} character entered. Minimum: {$min}.}} * {{{$count} characters entered. Minimum: {$min}.}}`,max:`.input {$count :integer} .match $count 0 {{No character entered. Maximum: {$max}.}} one {{{$count} character entered. Maximum: {$max}.}} * {{{$count} characters entered. Maximum: {$max}.}}`},youtube_video_player:`YouTube video player`,today:`Today`,now:`Now`,editor_components:{image:`Image`,src:`Source`,alt:`Alt Text`,title:`Title`,link:`Link`},key_value:{key:`Key`,value:`Value`,action:`Action`,empty_key:`Key is required.`,duplicate_key:`Key must be unique.`},find_place:`Find a Place`,use_your_location:`Use Your Location`,geolocation_error_title:`Geolocation Error`,geolocation_error_body:`There was an error while retrieving your location.`,geolocation_unsupported:`Geolocation API is not supported by this browser.`,boolean:{true:`Yes`,false:`No`},cloud_storage:{invalid:`The service is not configured properly.`,auth:{api_key:{key_label:`API Key`,initial:`Enter your {$key} for {$service}.`,requested:`Validating…`,error:`The provided {$key} is invalid. Please double-check and try again.`},password:{initial:`Enter your password for {$service}.`,requested:`Signing in…`,error:`Username or password is incorrect. Please double-check and try again.`}},cloudinary:{iframe_title:`Cloudinary media library`,activate:{button_label:`Activate Cloudinary`,description:`After signing in, click the Sign In button again to continue.`},auth_key_label:`API Secret`,open_library:`Open Cloudinary`},uploadcare:{auth_key_label:`API Secret Key`},aws_s3:{auth_key_label:`Secret Access Key`},bunny_storage:{auth_key_label:`Storage Zone Password`},cloudflare_r2:{auth_key_label:`Secret Access Key`},digitalocean_spaces:{auth_key_label:`Secret Access Key`}},config:{errors:`.input {$count :integer} .match $count one {{There is an error in the CMS configuration. Please solve the issue and try again.}} * {{There are errors in the CMS configuration. Please solve the issues and try again.}}`,error_locator:{collection:`{$collection} collection`,file:`{$file} file`,component:`{$component} component`,field:"`{$field}` field"},error:{no_secure_context:`Sveltia CMS only works with HTTPS or localhost URLs.`,insecure_urls:`.input {$count :integer} .match $count one {{The configuration file URL must use HTTPS protocol or a localhost address.}} * {{The configuration file URLs must use HTTPS protocol or localhost addresses.}}`,fetch_failed:`The configuration file could not be retrieved.`,fetch_failed_not_ok:`HTTP response returned with status {$status}.`,fetch_failed_with_manual_init:"The configuration file could not be retrieved. To prevent the `config.yml` file from loading, add <a>`load_config_file: false`</a> to the configuration object passed to `CMS.init()`.",parse_failed:`The configuration file could not be parsed.`,parse_failed_invalid_object:`The configuration file is not a valid JavaScript object.`,parse_failed_unsupported_type:`The configuration file is not a valid file type. Only YAML, TOML and JSON are supported.`,no_collection:`Collections are not defined.`,no_visible_collection:"At least one collection must be visible. Check the `hide` option.",missing_backend:`The backend is not defined.`,missing_backend_name:`The backend name is not defined.`,unsupported_known_backend:`The {$name} backend is <a>not supported</a> in Sveltia CMS.`,unsupported_deprecated_backend:`The deprecated {$name} backend is <a>not supported</a> in Sveltia CMS.`,unsupported_custom_backend:`Custom backends are <a>not supported</a> in Sveltia CMS.`,unsupported_backend_suggestion:`Use one of the <a>supported backends</a> instead.`,missing_repository:`The repository is not defined.`,invalid_repository:`The configured repository is invalid. It must be in “owner/repo” format.`,invalid_root_dir:`The root directory is invalid. It must be a path within the repository, without “..”.`,invalid_root_dir_branch:"The root directory can’t be used in the branch names of the `editorial_workflow` and `preview` publish modes. No part of its path can start with a dot, end with “.lock” or contain a space or a special character such as a colon or an asterisk.",path_outside_root_dir:`The path “{$path}” leads outside the root directory, where the CMS can’t list files.`,oauth_implicit_flow:`The configured authentication method (implicit flow) is not supported in Sveltia CMS. Use a different <a>authentication method</a> instead.`,github_pkce_unsupported:`PKCE authorization is not yet supported due to GitHub’s limitations. Use a different <a>authentication method</a> instead.`,oauth_no_app_id:`OAuth application ID is not defined.`,open_authoring_no_workflow:"The `open_authoring` option requires the `editorial_workflow` or `preview` publish mode. See the <a>documentation</a> for details.",no_auth_methods:"The `auth_methods` option must contain at least one method.",auth_scope_no_repo:"The `auth_scope` option must include `repo` or `public_repo`.",missing_media_folder:`The media folder is not defined.`,public_folder_relative_path:`The configured public folder is invalid. It must be an absolute path starting with “/”.`,public_folder_absolute_url:`An absolute URL for the public folder option is not supported in Sveltia CMS.`,unsupported_folder_template_tag:"The `{$option}` option contains the `{$tag}` template tag, which isn’t supported there. Only the slug template tags, such as `\\{\\{slug\\}\\}` and `\\{\\{year\\}\\}`, and the `\\{\\{dirname\\}\\}`, `\\{\\{filename\\}\\}`, `\\{\\{extension\\}\\}`, `\\{\\{media_folder\\}\\}` and `\\{\\{public_folder\\}\\}` tags can be used.",global_folder_template_tag:"The `{$option}` option contains the `{$tag}` template tag, which can only be used in the option of a collection, a collection file or a field, where there is an entry to fill it in with.",invalid_sanitize_replacement:"The `sanitize_replacement` option is set to `{$replacement}`, but it contains a character that can’t be used in a slug, so it can’t stand in for one.",invalid_url_option:"The `{$option}` option is set to `{$url}`, but it must be an absolute URL starting with `https://` or `http://`.",invalid_publish_mode_stages:"The `stages` option of `publish_mode` must start with `draft` and list the stages in the order `draft`, `pending_review`, `pending_publish`, without repeating any.",i18n_no_locales:"The `i18n.locales` option must list at least one locale.",i18n_invalid_default_locale:"The `default_locale` option is set to `{$locale}`, but it’s not one of the `locales`.",i18n_invalid_initial_locale:"The `initial_locales` option contains `{$locale}`, but it’s not one of the `locales`.",i18n_no_collections:"The `i18n` option is configured at the top level, but none of the collections or singletons have the `i18n` option, so no content can be translated. Add `i18n: true` to the collections and singletons to translate.",invalid_transformation_key:"The `transformations` option contains an unsupported `{$key}` key. It must be `raster_image`, `svg` or a supported raster image format.",invalid_transformation_quality:"The `quality` option for the `{$key}` transformation is invalid. It must be an integer between 0 and 100.",invalid_transformation_size:"The `{$prop}` option for the `{$key}` transformation is invalid. It must be a positive integer.",missing_asset_collection_name:"The asset collection {$count} must have the `name` option defined as a non-empty string.",invalid_asset_collection_name:"The asset collection name `{$name}` is invalid. It must not contain special characters.",duplicate_asset_collection_name:"Asset collection names must be unique, but `{$name}` is used more than once.",invalid_collection_no_options:"The collection must have either the `folder`, `file`, `files` or `divider` option defined.",invalid_collection_multiple_options:"The collection cannot have more than one of the `folder`, `file`, `files` and `divider` options.",file_format_mismatch:"The `{$extension}` extension doesn’t match the `{$format}` format.",front_matter_body_field_not_text:"The `{$name}` field is saved as the body below the front matter, which can only hold text, not a number, a boolean, a list or an object as a `{$widget}` field does. Use a field type holding text, or rename the field.",invalid_collection_data_file:"The `file` option `{$file}` is invalid. It must be the path to a JSON file, without the `\\{\\{locale\\}\\}` placeholder.",unsupported_collection_data_file_option:"The `{$prop}` option is not supported in a collection with the `file` option.",collection_data_file_workflow:"Editorial Workflow and Preview Workflow, including Open Authoring, are not supported in a collection with the `file` option. Set the collection’s `publish_mode` option to `simple`.",collection_data_file_slug_tag:"The `{$prop}` option can’t contain the `\\{\\{slug\\}\\}` tag in a collection with the `file` option, as an entry’s slug is its position, which changes when the entries are reordered or deleted. Use a field with a unique value instead.",invalid_slug_slash:"The slug template `{$slug}` is invalid as it cannot contain slashes. To organize entries in subfolders, use the `path` option instead of `slug`.",invalid_identifier_field:"The `identifier_field` option refers to `{$name}`, but no such field is defined in the collection.",invalid_filter_field:"The `filter` option refers to `{$name}`, but no such field is defined in the collection.",invalid_filter_no_condition:"The `filter` option must have either the `value` or `pattern` option to match entries against.",option_field_not_found:"The `{$option}` option refers to `{$name}`, but no such field is defined.",thumbnail_field_not_media:"The `thumbnail` option refers to `{$name}`, but it must be an Image or File field, not a `{$widget}` field.",invalid_inline_component_fields:"The `inline` mode requires a single Boolean, Color, DateTime, Number, Relation, Select or String field. A Relation or Select field can’t have the `multiple` option enabled.",invalid_regex:"The `{$option}` option contains an invalid regular expression `{$pattern}`, which is ignored.",invalid_reorder_group:"The `reorder` option refers to a view group named `{$name}`, but no such group is defined in the `view_groups` option.",invalid_bulk_edit_field:"The `fields` list of the `bulk_edit` option refers to a field named `{$name}`, but no such top-level field is defined in the collection.",unsupported_bulk_edit_field:"The `{$name}` field in the `fields` list of the `bulk_edit` option can’t be edited in bulk. Only a Boolean, Color, DateTime, Number, Relation, Select or String field that isn’t read-only, doesn’t have the `multiple` option enabled and isn’t set automatically on save is supported.",invalid_sortable_field:"The `sortable_fields` option refers to a field named `{$name}`, but no such field is defined in the collection.",invalid_table_column_field:"The `{$option}` option refers to a field named `{$name}`, but no such field is defined in the collection.",invalid_view_group_field:"The `view_groups` option refers to a field named `{$name}`, but no such field is defined in the collection.",invalid_view_filter_field:"The `view_filters` option refers to a field named `{$name}`, but no such field is defined in the collection.",missing_view_group_name:"The view group {$count} must have the `name` option defined as a non-empty string.",invalid_view_group_name:"The view group name `{$name}` is invalid. It must not contain special characters.",duplicate_view_group_name:"View group names must be unique, but `{$name}` is used more than once.",missing_view_filter_name:"The view filter {$count} must have the `name` option defined as a non-empty string.",invalid_view_filter_no_condition:"The view filter {$count} must have the `pattern` option or a comparison option such as `eq` or `gte` to match entries against.",invalid_view_filter_name:"The view filter name `{$name}` is invalid. It must not contain special characters.",duplicate_view_filter_name:"View filter names must be unique, but `{$name}` is used more than once.",invalid_view_group_default:"The `default` option of `view_groups` is set to `{$name}`, but no view group has that name.",invalid_view_filter_default:"The `default` option of `view_filters` is set to `{$name}`, but no view filter has that name.",missing_collection_name:"The collection {$count} must have the `name` option defined as a non-empty string.",invalid_collection_name:"The collection name `{$name}` is invalid. It must not contain special characters.",duplicate_collection_name:"Collection names must be unique, but `{$name}` is used more than once.",missing_collection_file_name:"The collection file {$count} must have the `name` option defined as a non-empty string.",invalid_collection_file_name:"The collection file name `{$name}` is invalid. It must not contain special characters.",duplicate_collection_file_name:"Collection file names must be unique, but `{$name}` is used more than once.",collection_no_fields:"The collection must have the `fields` option defined with at least one field.",collection_file_no_fields:"The collection file must have the `fields` option defined with at least one field.",collection_folder_i18n_required:"The collection must have the `i18n` option defined if the `locale` placeholder is used in the `folder` path.",invalid_collection_folder_locale:"The `folder` path `{$folder}` is invalid. The `locale` placeholder must be used only once as a whole folder name, like `content/\\{\\{locale\\}\\}/posts`.",collection_file_i18n_required:"The collection file must have the `i18n` option defined if the `locale` placeholder is used in the `file` path.",collection_i18n_no_fields:"The collection has the `i18n` option, but none of its fields have the `i18n` option, so no field can be translated. Add `i18n: true` or `i18n: duplicate` to the fields to translate.",collection_i18n_no_files:"The collection has the `i18n` option, but none of its files have the `i18n` option, so no file can be translated. Add `i18n: true` to the files to translate.",collection_file_i18n_no_fields:"The collection file has the `i18n` option, but none of its fields have the `i18n` option, so no field can be translated. Add `i18n: true` or `i18n: duplicate` to the fields to translate.",missing_field_name:"The field {$count} must have the `name` option defined as a non-empty string.",invalid_field_name:"The field name `{$name}` is invalid. It must not contain special characters. If you want to nest fields, <a>use Object fields instead of dot notation</a>.",duplicate_field_name:"Field names must be unique, but `{$name}` is used more than once.",missing_variable_type:"The variable type {$count} must have the `name` option defined as a non-empty string.",invalid_variable_type:"The variable type name `{$name}` is invalid. It must not contain special characters.",duplicate_variable_type:"Variable type names must be unique, but `{$name}` is used more than once.",date_field_type:"The deprecated Date field type is not supported in Sveltia CMS. Use the DateTime field type with the `type: date` option instead.",hidden_field_locale_without_i18n:"The `default` option of a Hidden field uses the `\\{\\{locale\\}\\}` placeholder, but i18n isn’t enabled for the collection, so the content has no locale to fill it with.",invalid_timezone:"Invalid timezone: {$timeZone}. Must be a valid IANA timezone identifier like `America/New_York` or `Asia/Tokyo`.",unsupported_deprecated_option:"The deprecated `{$prop}` option is not supported in Sveltia CMS. Use the `{$newProp}` option instead.",allow_multiple:"The `allow_multiple` option is not supported in Sveltia CMS. Use the `multiple` option instead, which defaults to `false`.",invalid_list_field:"The List field cannot have the `field`, `fields` and `types` options together.",invalid_list_variable_type:"The List field’s variable type is invalid. The `widget` option is set to `{$widget}` but it must be `object`.",invalid_object_field:"The Object field cannot have the `fields` and `types` options together.",invalid_range_options:"The `{$min}` option must not be greater than the `{$max}` option.",invalid_step:"The `step` option is set to `{$step}`, but it must be greater than zero, or `-1` to turn stepping off.",select_field_no_options:"The Select field must have at least one item in the `options` option.",select_field_duplicate_option:"The Select field’s `options` must be unique, but `{$value}` is used more than once.",select_field_invalid_default:"The Select field’s `default` option is set to `{$value}`, but it’s not one of the `options`.",list_field_no_subfields:"The List field’s `fields` or `types` option must have at least one item. Omit the option for a list of plain values.",list_field_invalid_default_object:"The List field’s `default` option contains an object, but each item must be a plain value because the field has no `fields` or `types`.",list_field_invalid_default_item:"The List field’s `default` option contains `{$value}`, but each item must be an object because the field has `fields` or `types`.",list_field_invalid_default_key:"The List field’s `default` option contains an item with the `{$key}` property, but no subfield has that name.",list_field_default_missing_type:"The List field’s `default` option contains an item without the `{$typeKey}` property, which identifies one of the `types`.",list_field_invalid_default_type:"The List field’s `default` option contains an item whose `{$typeKey}` property is `{$value}`, but it’s not one of the `types`.",list_field_map_key_no_subfields:"The List field’s `map_key_field` option requires the `fields` or `types` option, as each key is taken from a subfield.",list_field_map_key_not_found:"The List field’s `map_key_field` option refers to `{$name}`, but no subfield has that name.",list_field_map_key_missing_in_type:"The List field’s `map_key_field` option refers to `{$name}`, but the `{$type}` type has no subfield with that name.",list_field_map_key_invalid_type:"The List field’s `map_key_field` option refers to `{$name}`, but it must be a String, Relation or Select field, not a `{$widget}` field.",list_field_map_key_multiple:"The List field’s `map_key_field` option refers to `{$name}`, but the subfield can’t take multiple values, as each item needs a single key. Remove its `multiple` option.",list_field_map_key_option_not_string:"The List field’s `map_key_field` option refers to `{$name}`, but the subfield’s options must have string values, as each key is stored as a string.",list_field_map_key_not_required:"The List field’s `map_key_field` option refers to `{$name}`, but the subfield can’t be optional, as each item needs a key. Remove its `required` option.",list_field_map_key_not_localized:"The List field’s `map_key_field` option refers to `{$name}`, but the subfield can’t have `i18n: false`, as the items need a key in every locale. Use `i18n: duplicate` or remove the option.",duplicate_if_empty_multiple:"The `i18n: duplicate_if_empty` option is not supported for a field with the `multiple` option, so the field works like one with `i18n: true`.",invalid_default_multiple:"The `default` option must be an array because the `multiple` option is `true`.",invalid_default_single:"The `default` option must be a single value, not an array, because the `multiple` option is not `true`.",object_field_invalid_default_key:"The Object field’s `default` option has the `{$key}` property, but no subfield has that name.",object_field_default_missing_type:"The Object field’s `default` option doesn’t have the `{$typeKey}` property, which identifies one of the `types`.",object_field_invalid_default_type:"The `{$typeKey}` property of the Object field’s `default` option is `{$value}`, but it’s not one of the `types`.",code_field_invalid_default_object:"The Code field’s `default` option must be a string because the `output_code_only` option is `true`.",code_field_invalid_default_key:"The Code field’s `default` option has the `{$key}` property, but the `keys` option only allows `{$code}` and `{$lang}`.",compute_field_invalid_expression:"The Compute field’s `value` option must be a valid arithmetic expression, like `\\{\\{fields.price\\}\\} * \\{\\{fields.quantity\\}\\}`, because the `value_type` option is `{$valueType}`.",compute_field_uuid_in_expression:"The Compute field’s `value` option can’t use a UUID tag like `\\{\\{uuid\\}\\}` because the `value_type` option is `{$valueType}`, which makes it an arithmetic expression.",number_field_default_not_integer:"The Number field’s `default` option is set to `{$value}`, but it must be an integer because the `value_type` option is `{$valueType}`.",number_field_default_not_number:"The Number field’s `default` option is set to `{$value}`, but it must be a number because the `value_type` option is `{$valueType}`.",object_field_no_subfields:"The Object field’s `fields` or `types` option must have at least one item.",relation_field_invalid_collection:"The referenced `{$collection}` collection is invalid or not defined.",relation_field_invalid_collection_file:"The referenced `{$file}` file is invalid or not defined.",relation_field_missing_file_name:"The `file` option must be defined for a relation to a file collection.",relation_field_invalid_value_field:"The referenced value field `{$field}` is invalid or not defined.",relation_field_array_file_slug:"The relation to the `{$collection}` collection can’t store the `\\{\\{slug\\}\\}` value, as an entry’s slug in a collection with the `file` option is its position, which changes when the entries are reordered or deleted. Set the `value_field` option to a field with a unique value instead.",relation_field_array_file_workflow:"A collection with the `file` option can’t have a relation to the `{$collection}` collection, which uses Editorial Workflow or Preview Workflow, as the references to an entry renamed or deleted there can’t be updated in the file.",relation_field_invalid_display_field:"The referenced display field `{$field}` is invalid or not defined.",relation_field_invalid_search_field:"The referenced search field `{$field}` is invalid or not defined.",relation_field_invalid_filter_field:"The referenced filter field `{$field}` is invalid or not defined.",relation_field_invalid_sort_field:"The referenced sort field `{$field}` is invalid or not defined.",relation_field_sort_by_file_ignored:"The `sort_by` option doesn’t apply to a relation to a file, whose options follow the order of the list items. It will be ignored.",unexpected:`Unexpected error`,schema_invalid_type:"The `{$option}` option must be {$type}.",schema_invalid_enum:"The `{$option}` option must be one of these values: {$values}.",schema_invalid_const:"The `{$option}` option must be `{$value}`.",schema_invalid_empty_value:"The `{$option}` option must be an empty string.",schema_invalid_item_count:"The `{$option}` option must be an array of {$count} items.",schema_invalid_value:"The `{$option}` option has an invalid value.",schema_missing_option:"The `{$option}` option is required.",schema_missing_one_of:`One of these options is required: {$options}.`,schema_value_type:{string:`a string`,number:`a number`,integer:`an integer`,boolean:`a boolean`,array:`an array`,object:`an object`,null:`empty`}},warning:{oauth_no_app_id:`OAuth application ID is not defined. Users are required to provide an access token to sign in.`,unsupported_ignored_option:"The `{$prop}` option is not supported in Sveltia CMS. It will be ignored.",publish_mode_stages_ignored:"The `stages` option of `publish_mode` only applies to the `editorial_workflow` publish mode, so it’s ignored with `{$type}`.",conflicting_timezone_options:"Both `picker_utc` and newer timezone options (`input_timezone` or `output_utc`) are set. The new options take precedence. Consider removing `picker_utc` from your configuration.",localize_format_without_format:"The `localize_format` option has no effect, because the field has no `format` option and its value is stored in the ISO 8601 format.",compute_field_wildcard_without_item:"The Compute field’s `value` option refers to `{$name}`, but the field isn’t in an item of the list that `*` stands for, so it resolves to nothing. Only an aggregate function like `sum()` can use every item of a list.",compute_field_self_reference:"The Compute field’s `value` option refers to the field itself as `{$name}`, so its value changes every time it’s computed and never settles.",compute_field_reference_cycle:"The Compute field’s `value` option refers to `{$name}`, another Compute field that refers back to this field, directly or through other fields, so their values never settle.",localize_format_without_i18n:"The `localize_format` option is `true`, but i18n isn’t enabled for the collection, so the value is written in English. Set the option to a locale code like `de` instead.",localize_format_unsupported_locale:"The `localize_format` option is set to `{$locale}`, which isn’t a supported locale, so the value is written in English.",preview_path_no_date_field:"The `preview_path` option uses date and time tags, but the collection has no DateTime field to read them from, so the preview link won’t be shown.",preview_path_date_field_not_found:"The `preview_path_date_field` option refers to a field named `{$name}`, but no DateTime field with that name is defined, so the preview link won’t be shown.",preview_path_field_not_found:"The `preview_path` option refers to `{$name}`, but no such field is defined in the collection, so the preview link won’t be shown.",missing_identifier_field:"The collection has no `{$name}` field to name new entries with, so each new entry gets a random slug. Add a `{$name}` field, or set the `identifier_field` or `slug` option.",slug_i18n_ineffective:"The `i18n` option of `slug` has no effect, because the collection doesn’t use the `multiple_files`, `multiple_folders` or `multiple_root_folders` i18n structure, where each locale has a file of its own.",slug_template_ignored:"The `template` option of `slug` is ignored, because the `auto_increment` option numbers the slugs instead.",locale_not_omitted_from_file_path:"The `locale` placeholder can’t be removed from the `file` path `{$file}`, so the default locale is kept in it despite the `omit_default_locale_from_file_path` i18n option. To leave the locale out, use the placeholder as a whole folder name, like `\\{\\{locale\\}\\}/about.md`, or between the file name and the extension, like `about.\\{\\{locale\\}\\}.md`. To keep it, set the option to `false` in the file’s `i18n` option.",i18n_not_configured:"The `i18n` option is enabled, but i18n is not configured at the top level of the configuration or in the collection, so the option has no effect.",empty_public_folder:"The `public_folder` option is an empty string, so the `media_folder` path is used for the asset paths saved in entries instead. Remove the option, or set it to the path you want to use, such as `/images`.",schema_unknown_option:"The `{$option}` option is not defined in the Sveltia CMS configuration schema. It will be ignored. Check for a typo or a syntax mistake.",default_localized_without_i18n:"The `default_localized` option has no effect, because i18n isn’t enabled for the collection. Use the `default` option instead.",default_localized_unknown_locale:"The `default_localized` option has a value for `{$locale}`, which isn’t one of the collection’s locales, so the value is never used."},compatibility_link:`See the compatibility notes for details: {$link}`,schema_tip:`For a better developer experience, you can validate your configuration file against the JSON schema of Sveltia CMS. See {$link} for details.`},local_workflow:{indicator:`Local`,unsupported_browser:`Local Workflow is not supported in your browser. Please use Chrome or Edge instead.`,disabled:`Local Workflow is disabled in your browser. <a>Here’s how to enable it</a>.`},viewing_editorial_workflow:`You’re now viewing the Editorial Workflow board. Drafts: {$draft}. In Review: {$review}. Ready: {$ready}. Pending Deletion: {$deletion}.`,viewing_open_authoring_workflow:`You’re now viewing the Editorial Workflow board. Drafts: {$draft}. In Review: {$review}. Pending Deletion: {$deletion}.`,viewing_editorial_workflow_without_review:`You’re now viewing the Editorial Workflow board. Drafts: {$draft}. Ready: {$ready}. Pending Deletion: {$deletion}.`,viewing_preview_workflow:`You’re now viewing the Drafts page. Drafts: {$draft}. Pending Deletion: {$deletion}.`,status:{draft:`Draft`,drafts:`Drafts`,in_review:`In Review`,ready:`Ready`,pending_deletion:`Pending Deletion`,deploying:`Deploying`},workflow:{cancel_deletion:`Cancel Deletion`,confirm_cancelling_deletion:`Are you sure you want to cancel this deletion? The entry will remain published.`,confirm_completing_deletion:`Are you sure you want to delete this entry? It will be removed right away.`,deletion_pending:`.input {$count :integer} .match $count one {{Entry marked for deletion.}} * {{{$count} entries marked for deletion.}}`,changes_discarded:`.input {$count :integer} .match $count one {{Changes discarded.}} * {{Changes to {$count} entries discarded.}}`,cancelling_deletion:`Cancelling Deletion…`,deletion_cancelled:`Deletion cancelled.`,cancelling_deletion_failed:`Couldn’t cancel the deletion. Please try again.`,unpublished_entries:`Unpublished Entries`,published_entries:`Published Entries`,entry_status_value:`Status: {$status}`,change_entry_status:`Change Entry Status`,changing_status:`Changing Status…`,updating_status:`Updating Status…`,status_updated:`Status updated.`,status_change_failed:`Couldn’t change the status. Please try again.`,refresh:`Refresh`,refreshing:`Refreshing…`,refreshed:`The board is up to date.`,refresh_failed:`Couldn’t refresh the board. Please try again.`,status_change_blocked:`The entry has errors. Please correct them before changing the status.`,publish_blocked:`The entry has errors. Please correct them before publishing it.`,send_for_review:`Send for Review`,confirm_sending_for_review:`Your changes have been saved as a draft. Send the entry for review so someone can look at it and publish it?`,mark_as_ready:`Mark as Ready`,confirm_marking_as_ready:`Your changes have been saved as a draft. Mark the entry as ready so it can be published?`,publish_entry:`Publish Entry`,discard_changes:`Discard Changes`,confirm_deleting_published_entry:`Are you sure you want to delete this entry? It won’t be removed until the deletion is published. Until then you’ll still find it in the entry list, marked Pending Deletion.`,confirm_deleting_unpublished_entry:`This entry hasn’t been published yet, so deleting it will discard it completely.`,confirm_discarding_entry_changes:`This entry has unpublished changes. Discarding them will restore the published version. The entry itself won’t be deleted.`,deleting_unpublished_note_all:`.input {$count :integer} .match $count one {{It hasn’t been published yet, so your unpublished changes will be discarded. Any published version will remain published.}} * {{They haven’t been published yet, so your unpublished changes will be discarded. Any published versions will remain published.}}`,deleting_unpublished_note_some:`.input {$count :integer} .match $count one {{One of them hasn’t been published yet, so your unpublished changes will be discarded. Any published version will remain published.}} * {{{$count} of them haven’t been published yet, so your unpublished changes will be discarded. Any published versions will remain published.}}`,confirm_publishing_entry_after_build:`Are you sure you want to publish this entry? Your changes will go live once your site has been rebuilt.`,publishing_entry:`Publishing Entry…`,entry_published:`Entry published.`,deleting_entry:`Deleting Entry…`,discarding_changes:`Discarding Changes…`,entry_deleted:`Entry deleted.`,publishing_entry_failed:`Couldn’t publish the entry. Please try again.`,publish_refused_other_changes:`This entry can’t be published here, because it comes with other changes the CMS can’t show you. Ask a developer to review it.`,publish_refused_entry_changed:`The entry has been changed since you opened it. Reload the page to review the latest version before publishing it.`,branch_in_use:`Another request ({$number}) is already open for this entry outside the CMS. Ask a developer to close it first.`,no_entries:`No entries.`,drag_entry:`Drag to change the status`,deploying_deletion:`Deletion`,companion_entries:`Also adds {$entries}`,companion_entry:`{$collection}: {$title}`},commit_message:{title:`Commit Message`,description_replace:`Describe your changes. The message is recorded in the history along with them.`,description_addition:`Add a note to the message recorded in the history along with your changes, such as an issue number. It can be left empty.`,message:`Commit message`,addition:`Note`,preview:`Message: {$message}`},open_authoring:{fork_repository:`Fork Repository`,fork:`Fork`,confirm_forking_repository:`To suggest changes to “{$repo}”, a fork of the repository has to be created on your account. Your changes are saved to that fork, and a maintainer reviews them before they go live.`,fork_declined:`You need a fork of the repository on your account to suggest changes.`,fork_failed:`Couldn’t create a fork of the “{$repo}” repository on your account.`,fork_branch_missing:`Your “{$fork}” fork doesn’t have the “{$branch}” branch. Update the fork from the “{$repo}” repository, then sign in again.`,permission_check_failed:`Couldn’t check your access to the “{$repo}” repository. Please try again in a moment.`,forking_disabled:`The “{$repo}” repository doesn’t allow forks. Ask a maintainer to enable forking for it.`,invitation_pending:`You have a pending invitation to the “{$repo}” repository. Accept it on GitHub, then sign in again.`,private_repo_scope_required:`Your sign-in doesn’t include access to private repositories, so the “{$repo}” repository can’t be read. Ask a maintainer to check the CMS authentication settings.`,publish_unsupported:`Only a maintainer can publish changes to this site. Mark your entry as In Review instead, and someone will take a look.`,entry_already_published:`A maintainer has already published this entry, so there’s nothing left to review.`,direct_commit_unsupported:`This change can’t be made directly. Only edits to entries can be suggested for review.`,contributing_via_fork:`Your changes are saved to your fork of this repository at “{$repo}” and reviewed before they go live.`,view_fork:`View Fork`},categories:`Categories`,site_configuration_editor:`Site Configuration Editor`,prefs:{changes:{api_key_saved:`API key saved.`,api_key_removed:`API key removed.`,api_key_invalid:`The provided API key is invalid. Please double-check and try again.`},error:{permission_denied:`Cookie storage access has been denied. Please check your browser permissions and try again.`},appearance:{title:`Appearance`,theme:`Theme`,select_theme:`Select Theme`},theme:{dark:`Dark`,light:`Light`},language:{title:`Language`,ui_language:{title:`User Interface Language`,select_language:`Select Language`}},contents:{title:`Contents`,editor:{title:`Editor`,use_draft_backup:{switch_label:`Automatically back up entry drafts`},close_on_save:{switch_label:`Close the editor after saving a draft`},close_with_escape:{switch_label:`Close the editor with the Escape key`}}},i18n:{title:`Internationalization`,translators:{default:{title:`Default Translation Service`,select_service:`Select Service`},api_keys:{title:`Translation Service API Keys`,description:`Manage API keys for <a>translation services</a>.`},field_label:`{$service} Key`,description:`Sign up for <a {$homeHref}>{$service}</a> and enter <a {$apiKeyHref}>your API Key</a> here to enable quick translation of text entry fields.`}},media:{title:`Media`,stock_photos:{api_keys:{title:`Stock Photo Service API Keys`,description:`Manage API keys for <a>stock photo services</a>.`},field_label:`{$service} API Key`,description:`Sign up for <a {$homeHref}>{$service} API</a> and enter <a {$apiKeyHref}>your API Key</a> here to insert free stock photos to image entry fields.`,credit:`Photos provided by {$service}`,no_services:`No <a>stock photo services</a> are configured.`},cloud_storage:{api_keys:{title:`Cloud Storage Service API Keys`,description:`Manage API keys for <a>cloud storage services</a>.`},field_label:`{$service} API Key`,no_services:`No <a>cloud storage services</a> are configured.`}},accessibility:{title:`Accessibility`,underline_links:{title:`Underline Links`,description:`Show underline for links in the entry preview and user interface labels.`,switch_label:`Always Underline Links`}},data:{title:`Data Management`,clear_data:{title:`Clear Data`,file_cache:{description:`Delete the locally cached file contents and image thumbnails to free up storage space or resolve issues caused by stale data.`,button_label:`Clear File Cache`,confirmation:`The locally cached file contents and image thumbnails will be deleted. Your unsaved drafts and settings will be kept, and any deleted data will be downloaded or generated again as needed. The CMS will be reloaded once done.`},all_data:{description:`Delete everything the CMS keeps in this browser, including the cached files, unsaved drafts and settings. Anything already saved to your repository won’t be affected.`,button_label:`Erase All Data`,confirmation:`All the data stored in this browser will be deleted, including the cached file contents, image thumbnails, unsaved drafts, settings and sign-in state. Your repository won’t be affected, but any change you haven’t saved will be lost, and you’ll have to sign in again. The CMS will be reloaded once done.`}}},developer:{title:`Developer`,developer_mode:{title:`Developer Mode`,description:`Enable some developer-oriented features, including detailed console logs and native context menus.`,switch_label:`Enable Developer Mode`},local_git:{title:`Git Commits`,description:`Commit your changes to the current branch of your local repository whenever you save them, as the CMS does when you work with a remote repository. You can then review and push the commits with your usual Git tools.`,switch_label:`Commit Changes to Git`,checking:`Checking the repository…`,ready:`Changes will be committed to the {$branch} branch as {$name} ({$email}).`,not_ready:`Changes can’t be committed right now. {$reason}`},deploy_hook:{title:`Deploy Hook`,description:`Enter a webhook URL to be called when you manually trigger a deployment by selecting Publish Changes. This can be left blank if you’re using GitHub Actions.`,url:{field_label:`Hook URL`,saved:`Hook URL saved.`,removed:`Hook URL removed.`},auth:{field_label:`Authorization header (e.g., Bearer <token>) (optional)`,saved:`Authorization header saved.`,removed:`Authorization header removed.`}}}},keyboard_shortcuts_:{view_content_library:`View Content Library`,view_asset_library:`View Asset Library`,search:`Search for entries and assets`,create_entry:`Create a new entry`,save_entry:`Save an entry`,cancel_editing:`Cancel entry editing`},file_type_labels:{avif:`AVIF image`,bmp:`Bitmap image`,gif:`GIF image`,heic:`HEIC image`,heif:`HEIF image`,ico:`Icon`,jpeg:`JPEG image`,jpg:`JPEG image`,png:`PNG image`,svg:`SVG image`,tif:`TIFF image`,tiff:`TIFF image`,webp:`WebP image`,avi:`AVI video`,m4v:`MP4 video`,mov:`QuickTime video`,mp4:`MP4 video`,mpeg:`MPEG video`,mpg:`MPEG video`,ogg:`Ogg video`,ogv:`Ogg video`,ts:`MPEG video`,webm:`WebM video`,"3gp":`3GPP video`,"3g2":`3GPP2 video`,aac:`AAC audio`,mid:`MIDI`,midi:`MIDI`,m4a:`MP4 audio`,mp3:`MP3 audio`,oga:`Ogg audio`,opus:`OPUS audio`,wav:`WAV audio`,weba:`WebM audio`,csv:`CSV spreadsheet`,doc:`Word document`,docx:`Word document`,odp:`OpenDocument presentation`,ods:`OpenDocument spreadsheet`,odt:`OpenDocument text`,pdf:`PDF document`,ppt:`PowerPoint presentation`,pptx:`PowerPoint presentation`,rtf:`Rich text document`,xls:`Excel spreadsheet`,xlsx:`Excel spreadsheet`,html:`HTML text`,js:`JavaScript`,json:`JSON text`,md:`Markdown text`,toml:`TOML text`,yaml:`YAML text`,yml:`YAML text`},file_size_units:{b:`{$size} bytes`,kb:`{$size} KB`,mb:`{$size} MB`,gb:`{$size} GB`,tb:`{$size} TB`}},m5=`en-US`,h5=`ar,bg,ca,cs,da,de,el,en-CA,en-GB,en-US,en-ZA,es-CO,fa,fi,fr,he,hr,it,ja,ko,nl,pl,pt-BR,pt-PT,ru,sk,sv,tr,uk,vi,zh-CN,zh-TW`.split(`,`),D3e=()=>{let e=kne();return e&&h5.includes(e)?e:m5},O3e=`https://unpkg.com/@sveltia/cms@${lk}/locales`,k3e=5e3,g5=`sveltia-cms.locale`,_5=new Map,v5=pk(),y5=pk(),b5=hk(()=>Intl.NumberFormat(Jc.current)),A3e=()=>!0,j3e=async e=>{if(A3e())try{let{_locale:t,_version:n,...r}=await kE.get(g5)??{};if(t===e&&n===lk&&Object.keys(r).length)return r}catch{}},M3e=async(e,t)=>{if(A3e())try{await kE.set(g5,{_locale:e,_version:lk,...t})}catch{}},N3e=async()=>{try{await kE.delete(g5)}catch{}},P3e=async e=>{let t=await fetch(`${O3e}/${e}.json`,{signal:AbortSignal.timeout(k3e)});if(!t.ok)throw Error(`Failed to load the ${e} locale strings`,{cause:t});return t.json()},F3e=async e=>{let t=await j3e(e);if(t)return _5.set(e,t),t;v5.current=e;try{let t=await P3e(e);return _5.set(e,t),await M3e(e,t),t}catch(t){throw y5.current={locale:e},t}finally{v5.current=void 0}},I3e=async e=>{let t=_5.get(e);t?await j3e(e)||await M3e(e,t):e===m5&&_5.size&&await N3e()},L3e=()=>{try{let{locale:e}=JSON.parse(globalThis.localStorage.getItem(`sveltia-cms.prefs`)||`{}`)??{};return h5.includes(e)?e:void 0}catch{return}},R3e=()=>{Uc(m5,{...E3e,_sui:ebe}),h5.filter(e=>e!==m5).forEach(e=>{One(e,()=>F3e(e))}),RG.current=D3e(),window.addEventListener(`languagechange`,()=>{RG.current=D3e()}),Ane({fallbackLocale:m5,initialLocale:L3e()??RG.current}),_k(()=>{I3e(Jc.current)})};function z3e(e,t){O(t,!0);let n=j(!1);L(()=>{y5.current&&M(n,!0)});var r=H(),i=P(r),a=e=>{let t=A(()=>y5.current);Xu(e,{get show(){return z(n)},set show(e){M(n,e,!0)},children:(e,n)=>{el(e,{status:`error`,children:(e,n)=>{Qr();var r=V();R(e=>W(r,e),[()=>Y(`locale_load_failed`,{values:{locale:KA(z(t).locale)??z(t).locale}})]),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(i,e=>{y5.current&&e(a)}),U(e,r),k()}var B3e=B(`<li class="svelte-4yt8tl"><span class="entry svelte-4yt8tl"><bdi> </bdi></span> <span class="field svelte-4yt8tl"><bdi> </bdi> </span></li>`),V3e=B(`<div role="alert" class="svelte-4yt8tl"> </div> <ul class="blockers svelte-4yt8tl"></ul>`,1),H3e=B(`<div class="svelte-4yt8tl"> </div>`),U3e={hash:`svelte-4yt8tl`,code:`div.svelte-4yt8tl {margin-top:8px;}.blockers.svelte-4yt8tl {margin:8px 0 0;border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-tertiary-background-color);font-size:var(--sui-font-size-default);list-style:none;li:where(.svelte-4yt8tl) {margin:0;padding:0;&:not(:first-child) {margin-top:8px;}}span:where(.svelte-4yt8tl) {display:block;}.field:where(.svelte-4yt8tl) {color:var(--sui-secondary-foreground-color);}}`};function x5(e,t){O(t,!0),K(e,U3e);let n=J(t,`kind`,3,`entry`);var r=H(),i=P(r),a=e=>{var r=V3e(),i=P(r),a=F(i,!0),o=I(i,2);Bo(o,21,()=>t.plan.blockers,e=>`${e.entry.id}:${e.keyPath}`,(e,t)=>{var n=B3e(),r=N(n),i=F(N(r));D(r);var a=I(r,2),o=N(a),s=F(o,!0),c=I(o);D(a),D(n),R(e=>{W(i,`${z(t).collectionLabel??``} › ${z(t).summary??``}`),W(s,z(t).fieldLabel),W(c,`: ${e??``}`)},[()=>z(t).messages.join(` `)]),U(e,n)}),D(o),R(e=>W(a,e),[()=>Y(n()===`asset`?`cannot_delete_referenced_assets`:`cannot_delete_referenced_entries`,{values:{count:t.count}})]),U(e,r)},o=e=>{var r=H3e(),i=F(r,!0);R(e=>W(i,e),[()=>Y(n()===`asset`?`deleting_referenced_assets_note`:`deleting_referenced_entries_note`,{values:{count:t.plan.targets.length}})]),U(e,r)};G(i,e=>{t.plan.blockers.length?e(a):t.plan.targets.length&&e(o,1)}),U(e,r),k()}var W3e=B(`<div role="alert"> </div>`),G3e=B(`<!> <!>`,1);function S5(e,t){O(t,!0);let n=J(t,`assets`,19,()=>[]),r=J(t,`disabled`,3,!1),i=J(t,`planDeletion`,3,void 0),a=J(t,`buttonDescription`,3,``),o=J(t,`dialogDescription`,3,``),s=J(t,`onDelete`,3,void 0),c=J(t,`useButton`,3,!0),l=j(!1),u=j(void 0),d=j(!1),f=j(void 0),p=A(()=>r()||!n().length),m=A(()=>!!z(u)?.blockers.length);L(()=>{if(!z(l)||!i())return;let e=n();M(u,void 0),M(d,!1),i()(e).then(t=>{z(l)&&n()===e&&M(u,t,!0)},t=>{console.error(t),z(l)&&n()===e&&M(d,!0)})}),Sa(()=>{z(p)&&document.activeElement===z(f)&&co().then(()=>xU())});var h=G3e(),g=P(h),_=e=>{{let t=A(()=>Y(`delete`));Al(e,{variant:`ghost`,get disabled(){return z(p)},get label(){return z(t)},get"aria-label"(){return a()},onclick:()=>{M(l,!0)},get element(){return z(f)},set element(e){M(f,e,!0)}})}},v=e=>{{let t=A(()=>Y(`delete`));Du(e,{variant:`ghost`,get disabled(){return z(p)},get label(){return z(t)},get"aria-label"(){return a()},onclick:()=>{M(l,!0)}})}};G(g,e=>{c()?e(_):e(v,-1)});var y=I(g,2);{let e=A(()=>Y(`delete_assets`,{values:{count:n().length}})),r=A(()=>Y(`delete`)),a=A(()=>!!i()&&(!z(u)||z(m)));ru(y,{get title(){return z(e)},get okLabel(){return z(r)},get okDisabled(){return z(a)},onOk:async()=>{await t.deleteAssets(n())!==!1&&s()?.()},get open(){return z(l)},set open(e){M(l,e,!0)},children:(e,t)=>{var r=G3e(),i=P(r),a=e=>{var t=W3e(),r=F(t,!0);R(e=>W(r,e),[()=>Y(`checking_asset_references_failed`,{values:{count:n().length}})]),U(e,t)},s=e=>{var t=V();R(()=>W(t,o())),U(e,t)};G(i,e=>{z(d)?e(a):z(m)||e(s,1)});var c=I(i,2),l=e=>{x5(e,{get plan(){return z(u)},kind:`asset`,get count(){return n().length}})};G(c,e=>{z(u)&&e(l)}),U(e,r)},$$slots:{default:!0}})}U(e,h),k()}function C5(e,t){O(t,!0);let n=J(t,`useShortcut`,3,!1),r=J(t,`onclick`,3,void 0);{let i=e=>{{let t=A(()=>qc()?`arrow_forward`:`arrow_back`);Xc(e,{get name(){return z(t)}})}},a=A(()=>t[`aria-label`]??Y(`back`)),o=A(()=>n()?`Escape`:void 0);Al(e,{variant:`ghost`,iconic:!0,get"aria-label"(){return z(a)},get keyShortcuts(){return z(o)},class:`back`,get onclick(){return r()},startIcon:i,$$slots:{startIcon:!0}})}k()}var K3e=`input, textarea, select, audio, video, [role="grid"], [role="listbox"], [role="menu"], [role="menubar"], [role="radiogroup"], [role="slider"], [role="tablist"]`,q3e=(e,{container:t,rtl:n})=>{let{key:r,ctrlKey:i,metaKey:a,altKey:o,shiftKey:s,target:c}=e;if(!(![`ArrowLeft`,`ArrowRight`].includes(r)||i||a||o||s)&&c instanceof HTMLElement&&(c===document.body||t?.contains(c))&&!c.isContentEditable&&!c.closest(K3e))return r===(n?`ArrowRight`:`ArrowLeft`)?`previous`:`next`},J3e=e=>!(e instanceof Element&&e.closest(`audio, video, input, [role="slider"]`)),Y3e=({start:e,end:t,rtl:n})=>{let r=t.x-e.x,i=t.y-e.y;if(!(Math.abs(r)<50||Math.abs(r)<Math.abs(i)))return(n?r<0:r>0)?`previous`:`next`},X3e=B(`<bdi> </bdi>`),Z3e=B(`<!> <h2 role="none"><!></h2> <!> <!>`,1),Q3e=B(`<div role="none" class="preview svelte-1g7r4za"><!></div>`),$3e=B(`<div role="group" class="wrapper svelte-1g7r4za"><!> <div role="none" class="row svelte-1g7r4za"><div role="none" class="main svelte-1g7r4za"><!> <!> <!></div> <!></div></div>`),e6e={hash:`svelte-1g7r4za`,code:`
@keyframes svelte-1g7r4za-slide-out-to-left {
to {
transform: translateX(-100%);
}
}
@keyframes svelte-1g7r4za-slide-out-to-right {
to {
transform: translateX(100%);
}
}
@keyframes svelte-1g7r4za-slide-in-from-left {
from {
transform: translateX(-100%);
}
}
@keyframes svelte-1g7r4za-slide-in-from-right {
from {
transform: translateX(100%);
}
}
/*
* Slide the preview sideways when moving between the listed assets, as if they were laid out in
* a row: the next asset comes in from the end of the line, the previous one from the start. The
* toolbar, navigation buttons and info panel aren’t part of the transition, so they stay put and
* the info panel simply dissolves.
*/html:active-view-transition-type(next),
html:active-view-transition-type(previous) {
/* Keep the sliding snapshots within the preview area, off the info panel and the buttons */&::view-transition-image-pair(asset-details) {overflow:clip;}&::view-transition-old(asset-details),
&::view-transition-new(asset-details) {animation-duration:200ms;animation-timing-function:ease-out;animation-fill-mode:both;
@media (prefers-reduced-motion) {
animation: none;
}}}html:active-view-transition-type(next) {&::view-transition-old(asset-details) {
animation-name: svelte-1g7r4za-slide-out-to-left;}&::view-transition-new(asset-details) {
animation-name: svelte-1g7r4za-slide-in-from-right;}&:dir(rtl) {&::view-transition-old(asset-details) {
animation-name: svelte-1g7r4za-slide-out-to-right;}&::view-transition-new(asset-details) {
animation-name: svelte-1g7r4za-slide-in-from-left;}}}html:active-view-transition-type(previous) {&::view-transition-old(asset-details) {
animation-name: svelte-1g7r4za-slide-out-to-right;}&::view-transition-new(asset-details) {
animation-name: svelte-1g7r4za-slide-in-from-left;}&:dir(rtl) {&::view-transition-old(asset-details) {
animation-name: svelte-1g7r4za-slide-out-to-left;}&::view-transition-new(asset-details) {
animation-name: svelte-1g7r4za-slide-in-from-right;}}}
/*
* The preview and the navigation buttons are named only for the previous/next transition: the
* buttons to be layered above the sliding preview, and the preview to slide on its own. During
* the page transitions, e.g. when the overlay is opened or closed on a small screen, they must
* stay unnamed to move along with the rest of the page.
*/html:is(:active-view-transition-type(next), :active-view-transition-type(previous)) {.preview.svelte-1g7r4za {view-transition-name:asset-details;}.row.svelte-1g7r4za .nav-button.previous {view-transition-name:asset-nav-previous;}.row.svelte-1g7r4za .nav-button.next {view-transition-name:asset-nav-next;}}.wrapper.svelte-1g7r4za {position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;background-color:var(--sui-secondary-background-color);.row:where(.svelte-1g7r4za) {flex:auto;display:flex;overflow:hidden;
@media (width < 768px) {flex-direction:column;.main:where(.svelte-1g7r4za) {flex:none;aspect-ratio:1 / 1;}.detail {flex:auto;border-block-start:var(--area-border);width:auto;}
}
@media (768px <= width) {.detail {border-inline-start:var(--area-border);}
}.main:where(.svelte-1g7r4za) {position:relative;flex:auto;display:flex;overflow:hidden;}.preview:where(.svelte-1g7r4za) {flex:auto;overflow:hidden;iframe {display:block;width:100%;height:100%;}}.nav-button {position:absolute;top:50%;translate:0 -50%;margin:0;border-radius:50%;opacity:0.5;&:hover,
&:focus-visible {opacity:1;}&.previous {inset-inline-start:16px;}&.next {inset-inline-end:16px;}}.detail {background-color:var(--sui-primary-background-color);}}}`};function t6e(e,t){O(t,!0),K(e,e6e);let n=e=>{var n=H(),r=P(n),i=e=>{var n=H();Go(P(n),()=>t.actions,()=>!1),U(e,n)};G(r,e=>{iG.isSmallScreen&&e(i)}),U(e,n)},r=J(t,`title`,3,void 0),i=J(t,`contentKey`,3,void 0),a=J(t,`onPrevious`,3,void 0),o=J(t,`onNext`,3,void 0),s=J(t,`info`,3,void 0),c=j(void 0),l;L(()=>{OQ.current&&SU(()=>z(c))}),js(bU);let u=e=>e===`previous`?a():e===`next`?o():void 0,d=e=>{let t=u(q3e(e,{container:z(c),rtl:qc()}));t&&(e.preventDefault(),t())},f=({touches:e,target:t})=>{let{clientX:n,clientY:r}=e[0];l=J3e(t)?{x:n,y:r}:void 0},p=({changedTouches:e})=>{if(!l)return;let{clientX:t,clientY:n}=e[0],r=Y3e({start:l,end:{x:t,y:n},rtl:qc()});l=void 0,u(r)?.()};var m=$3e();yo(`keydown`,ia,d);var h=N(m);Io(h,i,e=>{{let i=A(()=>Y(`primary`));dO(e,{variant:`primary`,get ariaLabel(){return z(i)},children:(e,i)=>{var a=Z3e(),o=P(a);{let e=A(()=>Y(`cancel_editing`));C5(o,{get"aria-label"(){return z(e)},useShortcut:!0,get onclick(){return t.onBack}})}var s=I(o,2);fl(N(s),{children:(e,t)=>{var n=X3e(),i=F(n,!0);R(()=>W(i,r())),U(e,n)},$$slots:{default:!0}}),D(s);var c=I(s,2),l=e=>{var n=H();Go(P(n),()=>t.actions,()=>!0),U(e,n)};G(c,e=>{iG.isSmallScreen||e(l)}),Go(I(c,2),()=>t.editOptions,()=>n),U(e,a)},$$slots:{default:!0}})}});var g=I(h,2),_=N(g),v=N(_);Io(v,i,e=>{var n=Q3e();Go(N(n),()=>t.preview),D(n),U(e,n)});var y=I(v,2);{let e=e=>{{let t=A(()=>qc()?`arrow_forward`:`arrow_back`);Xc(e,{get name(){return z(t)}})}},t=A(()=>Y(`previous_asset`)),n=A(()=>!a());Al(y,{variant:`tertiary`,iconic:!0,class:`nav-button previous`,get"aria-label"(){return z(t)},get disabled(){return z(n)},onclick:()=>a()?.(),startIcon:e,$$slots:{startIcon:!0}})}var b=I(y,2);{let e=e=>{{let t=A(()=>qc()?`arrow_back`:`arrow_forward`);Xc(e,{get name(){return z(t)}})}},t=A(()=>Y(`next_asset`)),n=A(()=>!o());Al(b,{variant:`tertiary`,iconic:!0,class:`nav-button next`,get"aria-label"(){return z(t)},get disabled(){return z(n)},onclick:()=>o()?.(),startIcon:e,$$slots:{startIcon:!0}})}D(_),Io(I(_,2),i,e=>{var t=H();Go(P(t),()=>s()??kr),U(e,t)}),D(g),D(m),Ds(m,e=>M(c,e),()=>z(c)),R(e=>q(m,`aria-label`,e),[()=>Y(`asset_editor`)]),bo(`touchstart`,g,f,void 0,!0),bo(`touchend`,g,p),U(e,m),k()}xo([`touchstart`,`touchend`]);var n6e=B(`<!> <!>`,1);function w5(e,t){O(t,!0);let n=J(t,`assets`,19,()=>[]),r=J(t,`useButton`,3,!0),i=ta({show:!1,status:`success`}),a=A(()=>r()?Al:Du),o=async()=>{try{for(let e of n())ybe(await t.getBlob(e),t.getName(e)),await pl(300);i.status=`success`}catch(e){i.status=`error`,console.error(e)}finally{i.show=!0}};var s=n6e(),c=P(s);{let e=A(()=>!n().length),t=A(()=>Y(`download`));Ko(c,()=>z(a),(n,r)=>{r(n,{variant:`ghost`,get disabled(){return z(e)},get label(){return z(t)},onclick:()=>{o()}})})}Xu(I(c,2),{get show(){return i.show},set show(e){i.show=e},children:(e,t)=>{el(e,{get status(){return i.status},children:(e,t)=>{var r=H(),a=P(r),o=e=>{var t=V();R(e=>W(t,e),[()=>Y(`assets_downloaded`,{values:{count:n().length}})]),U(e,t)},s=e=>{var t=V();R(e=>W(t,e),[()=>Y(`assets_dialog.error.image_fetch_failed`)]),U(e,t)};G(a,e=>{i.status===`success`?e(o):e(s,-1)}),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,s),k()}var r6e=B(`<!> <!>`,1);function i6e(e,t){O(t,!0);let n=e=>{var n=H();Bo(P(n),17,()=>t.items,e=>e.label,(e,t)=>{Du(e,{get label(){return z(t).label},get disabled(){return z(t).disabled},onclick:()=>{a(z(t))}})}),U(e,n)},r=J(t,`useButton`,3,!0),i=ta({show:!1,text:``,status:`success`}),a=async({copy:e,toastKey:n})=>{try{await e(),i.status=`success`,i.text=Y(n,{values:{count:t.count}})}catch(e){i.status=`error`,i.text=Y(`clipboard_error`),console.error(e)}finally{i.show=!0}};var o=r6e(),s=P(o),c=e=>{{let r=e=>{{let t=A(()=>Y(`copy_options`));Eu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{n(e)},$$slots:{default:!0}})}},i=A(()=>!t.count),a=A(()=>Y(`copy`));Xl(e,{variant:`ghost`,get disabled(){return z(i)},get label(){return z(a)},popupPosition:`bottom-right`,popup:r,$$slots:{popup:!0}})}},l=e=>{{let r=e=>{n(e)},i=A(()=>!t.count),a=A(()=>Y(`copy`));Du(e,{get disabled(){return z(i)},get label(){return z(a)},popupPosition:`left-top`,items:r,$$slots:{items:!0}})}};G(s,e=>{r()?e(c):e(l,-1)}),Xu(I(s,2),{get show(){return i.show},set show(e){i.show=e},children:(e,t)=>{el(e,{get status(){return i.status},children:(e,t)=>{Qr();var n=V();R(()=>W(n,i.text)),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,o),k()}var a6e=e=>Hk(e)?!0:OH.includes(e)?typeof navigator.clipboard.write==`function`:!1,o6e=(e,{isImage:t=!1}={})=>{let n=rV.getType(e);return n?a6e(n):t},s6e=async e=>{let{type:t}=e;if(Hk(t))await navigator.clipboard.writeText(await e.text());else{if(!OH.includes(t))throw Error(`Unsupported type`);await navigator.clipboard.write([new ClipboardItem({"image/png":t===`image/png`?e:await KH(e)})])}};function c6e(e,t){O(t,!0);let n=J(t,`assets`,19,()=>[]),r=J(t,`useButton`,3,!0),i=A(()=>n().length===1&&o6e(n()[0].fileName,{isImage:n()[0].kind===`image`})),a=async()=>{await navigator.clipboard.writeText(n().map(e=>e.downloadURL).join(`
`))},o=async()=>{await navigator.clipboard.writeText(n().map(e=>e.description).join(`
`))},s=async()=>{await navigator.clipboard.writeText(n().map(e=>e.id).join(`
`))},c=A(()=>n().some(e=>e.description!==e.downloadURL)),l=A(()=>n().some(e=>e.id!==e.downloadURL)),u=A(()=>[{label:Y(`public_urls`,{values:{count:n().length}}),copy:a,toastKey:`asset_urls_copied`},z(c)&&{label:Y(`file_paths`,{values:{count:n().length}}),copy:o,toastKey:`asset_paths_copied`},z(l)&&{label:Y(`file_ids`,{values:{count:n().length}}),copy:s,toastKey:`asset_ids_copied`},{label:Y(`file_data`),disabled:!z(i),copy:async()=>{await s6e(await f1(n()[0]))},toastKey:`asset_data_copied`}].filter(e=>!!e));i6e(e,{get items(){return z(u)},get count(){return n().length},get useButton(){return r()}}),k()}var l6e=B(`<!> <!>`,1),u6e=B(`<!> <!> <!> <!> <!>`,1);function d6e(e,t){O(t,!0);let n=J(t,`readOnly`,3,!1),r=J(t,`canEdit`,3,!1),i=J(t,`canRename`,3,!1),a=J(t,`canReplace`,3,!1),o=J(t,`onEdit`,3,void 0),s=J(t,`onRename`,3,void 0),c=J(t,`onReplace`,3,void 0),l=J(t,`extraItems`,3,void 0),u=J(t,`moreItems`,3,void 0);{let t=e=>{{let t=A(()=>Y(`edit_options`));Eu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var d=u6e(),f=P(d);Go(f,()=>l()??kr);var p=I(f,2),m=e=>{{let t=A(()=>Y(`edit`)),i=A(()=>Y(`edit_asset`)),a=A(()=>n()||!r());Du(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(i)},get disabled(){return z(a)},get onclick(){return o()}})}};G(p,e=>{o()&&e(m)});var h=I(p,2),g=e=>{{let t=A(()=>Y(`rename`)),r=A(()=>Y(`rename_asset`)),a=A(()=>n()||!i());Du(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(r)},get disabled(){return z(a)},get onclick(){return s()}})}};G(h,e=>{s()&&e(g)});var _=I(h,2),v=e=>{{let t=A(()=>Y(`replace`)),r=A(()=>Y(`replace_asset`)),i=A(()=>n()||!a());Du(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(r)},get disabled(){return z(i)},get onclick(){return c()}})}};G(_,e=>{c()&&e(v)});var y=I(_,2),b=e=>{var t=l6e(),n=P(t);mu(n,{}),Go(I(n,2),u),U(e,t)};G(y,e=>{u()&&e(b)}),U(e,d)},$$slots:{default:!0}})}},d=A(()=>Y(`show_edit_options`));Xl(e,{variant:`ghost`,iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return z(d)},popup:t,$$slots:{popup:!0}})}k()}var f6e=B(`<!> <!>`,1);function p6e(e,t){O(t,!0);let n=J(t,`extraItems`,3,void 0),r=j(void 0),i=A(()=>aQ.current),a=e=>{t.asset&&(r1.current={files:[e],originalAsset:t.asset})};var o=f6e(),s=P(o);{let e=A(()=>!!t.asset),a=A(()=>!!t.asset),o=A(()=>z(i)?.rename?()=>{xQ.current=t.asset}:void 0),c=A(()=>z(i)?.replace?()=>{z(r)?.open()}:void 0);d6e(s,{get canRename(){return z(e)},get canReplace(){return z(a)},get onRename(){return z(o)},get onReplace(){return z(c)},get extraItems(){return n()}})}Ds(_u(I(s,2),{onSelect:({file:e})=>{a(e)}}),e=>M(r,e,!0),()=>z(r)),U(e,o),k()}var m6e=e=>Number.isFinite(e)?new Date(e*1e3).toISOString().substr(11,8):`–`,h6e=B(`<section><h4> </h4> <p><!></p></section>`),g6e=B(`<section><h4> </h4> <p> </p></section>`),_6e=B(`<section><h4> </h4> <p> </p></section> <!> <!> <!>`,1);function v6e(e,t){O(t,!0);let n=J(t,`size`,3,void 0),r=J(t,`hasDimensions`,3,!1),i=J(t,`dimensions`,3,void 0),a=J(t,`duration`,3,void 0),o=A(()=>Uk(t.fileName)),s=A(()=>Mr(z(o).extension,``));var c=_6e(),l=P(c),u=N(l),d=F(u,!0),f=F(I(u,2),!0);D(l);var p=I(l,2),m=e=>{var t=h6e(),r=N(t),i=F(r,!0),a=I(r,2);Io(N(a),()=>Jc.current,e=>{var t=V();R(e=>W(t,e),[()=>_$(n())]),U(e,t)}),D(a),D(t),R(e=>W(i,e),[()=>Y(`size`)]),U(e,t)};G(p,e=>{n()&&e(m)});var h=I(p,2),g=e=>{var t=g6e(),n=N(t),r=F(n,!0),a=F(I(n,2),!0);D(t),R(e=>{W(r,e),W(a,i()?`${i().width}×${i().height}`:`–`)},[()=>Y(`dimensions`)]),U(e,t)};G(h,e=>{r()&&e(g)});var _=I(h,2),v=e=>{var t=g6e(),n=N(t),r=F(n,!0),i=F(I(n,2),!0);D(t),R((e,t)=>{W(r,e),W(i,t)},[()=>Y(`duration`),()=>a()?m6e(a()):`–`]),U(e,t)},y=A(()=>[`audio`,`video`].includes(t.kind));G(_,e=>{z(y)&&e(v)}),R((e,t)=>{W(d,e),W(f,t)},[()=>Y(`kind`),()=>v$(t.fileName,{fallback:rV.getType(t.fileName)??(z(s)?z(s).toUpperCase():Y(t.kind))})]),U(e,c),k()}var y6e=B(`<div role="none" class="preview svelte-173w06p"><!></div>`),b6e=B(`<div role="none" class="detail svelte-173w06p"><!> <!></div>`),x6e={hash:`svelte-173w06p`,code:`.detail.svelte-173w06p {flex:none;overflow-x:hidden;overflow-y:auto;padding:16px;width:320px;.preview:where(.svelte-173w06p) {overflow:hidden;margin:0 0 16px;border-radius:var(--sui-control-large-border-radius);background-color:var(--sui-content-background-color);aspect-ratio:1 / 1;}section {&:not(:last-child) {margin:0 0 16px;}& > * {margin:0 0 4px;word-break:break-all;}}h4 {font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);color:var(--sui-secondary-foreground-color);}}`};function T5(e,t){K(e,x6e);let n=J(t,`preview`,3,void 0);var r=b6e(),i=N(r),a=e=>{var t=y6e();Go(N(t),n),D(t),U(e,t)};G(i,e=>{n()&&e(a)}),Go(I(i,2),()=>t.children),D(r),U(e,r)}var S6e=(e,t)=>{let n=()=>(t?.()).link,r=()=>(t?.()).collectionLabel,i=()=>(t?.()).entryLabel;var a=w6e();Al(N(a),{role:`link`,variant:`link`,onclick:()=>o$(n(),{transitionType:`forwards`}),children:(e,t)=>{var n=C6e(),a=F(n);R(()=>W(a,`${r()??``} › ${i()??``}`)),U(e,n)},$$slots:{default:!0}}),D(a),U(e,a)},C6e=B(`<span role="none"> </span>`),w6e=B(`<p><!></p>`),T6e=B(`<p> </p>`),E6e=B(`<section><h4> </h4> <!></section>`);function D6e(e,t){O(t,!0);let n=A(()=>t.entries?.map(e=>({entry:e,collections:$R(e)})).filter(({collections:e})=>e.length));var r=E6e(),i=N(r),a=F(i,!0),o=I(i,2),s=e=>{var t=T6e(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`loading`)]),U(e,t)},c=e=>{var t=H();Bo(P(t),17,()=>z(n),({entry:e,collections:t})=>e.id,(e,t)=>{let n=()=>z(t).entry,r=()=>z(t).collections;var i=H();Bo(P(i),17,r,e=>e.name,(e,t)=>{var r=H();Io(P(r),()=>Jc.current,e=>{let r=A(()=>pj(z(t)));var i=H();Bo(P(i),17,()=>wj(z(t),n()),e=>e.name,(e,n)=>{{let i=A(()=>({link:IP(`/collections/${z(t).name}/entries/${z(n).name}`),collectionLabel:z(r),entryLabel:Cj(z(n))}));S6e(e,()=>z(i))}},e=>{{let i=A(()=>({link:IP(`/collections/${z(t).name}/entries/${n().subPath}`),collectionLabel:z(r),entryLabel:jz(z(t),n(),{useTemplate:!0})}));S6e(e,()=>z(i))}}),U(e,i)}),U(e,r)}),U(e,i)},e=>{var t=T6e(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`sort_keys.none`)]),U(e,t)}),U(e,t)};G(o,e=>{z(n)?e(c,-1):e(s)}),D(r),R(e=>W(a,e),[()=>Y(`used_in`)]),U(e,r),k()}var O6e=B(`<div role="none" class="unavailable svelte-3zctzm"><!></div>`),k6e=B(`<section><h4> </h4> <p><bdi dir="ltr"> </bdi></p></section>`),A6e=B(`<section><h4> </h4> <p> </p></section>`),j6e=B(`<!> <!> <section><h4> </h4> <p><a dir="ltr" target="_blank" rel="noopener noreferrer"> </a></p></section> <!> <!> <!>`,1),M6e={hash:`svelte-3zctzm`,code:`.unavailable.svelte-3zctzm {margin:0 0 16px;}`};function N6e(e,t){O(t,!0),K(e,M6e);let n=e=>{{let t=A(()=>z(l)===`image`?z(s):z(c)),n=A(()=>z(l)===`image`),r=A(()=>[`audio`,`video`].includes(z(l)));u$(e,{get kind(){return z(l)},get src(){return z(t)},get alt(){return z(a)},variant:`tile`,get checkerboard(){return z(n)},get controls(){return z(r)}})}},r=j(ta({})),i=j(void 0),a=A(()=>t.asset.fileName),o=A(()=>t.asset.description),s=A(()=>t.asset.previewURL),c=A(()=>t.asset.downloadURL),l=A(()=>t.asset.kind),u=A(()=>t.asset.size),d=A(()=>t.asset.lastModified),f=A(()=>z(r).dimensions),p=A(()=>z(r).duration),m=A(()=>cV(z(l))),h=A(()=>YZ.current[t.asset.id]===!1),g=IR(),_=async e=>{let t=g.next();M(r,{},!0),M(i,void 0);try{let n=await qZ(e);if(!t())return;M(r,n,!0)}catch{}let n=await JZ(e);t()&&M(i,n,!0)};L(()=>{_(t.asset)});{let t=A(()=>z(m)?n:void 0);T5(e,{get preview(){return z(t)},children:(e,t)=>{var n=j6e(),r=P(n),s=e=>{var t=O6e();el(N(t),{status:`error`,ariaLive:`off`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`file_unavailable_description`)]),U(e,n)},$$slots:{default:!0}}),D(t),U(e,t)};G(r,e=>{z(h)&&e(s)});var g=I(r,2);v6e(g,{get fileName(){return z(a)},get kind(){return z(l)},get size(){return z(u)},get hasDimensions(){return z(m)},get dimensions(){return z(f)},get duration(){return z(p)}});var _=I(g,2),v=N(_),y=F(v,!0),b=I(v,2),x=N(b),S=F(x,!0);D(b),D(_);var C=I(_,2),w=e=>{var t=k6e(),n=N(t),r=F(n,!0),i=I(n,2),a=N(i),s=F(a,!0);D(i),D(t),R(e=>{W(r,e),W(s,z(o)),a.dir=a.dir},[()=>Y(`file_paths`,{values:{count:1}})]),U(e,t)};G(C,e=>{z(o)&&z(o)!==z(a)&&z(o)!==z(c)&&e(w)});var T=I(C,2);D6e(T,{get entries(){return z(i)}});var ee=I(T,2),te=e=>{var t=A6e(),n=N(t),r=F(n,!0),i=F(I(n,2),!0);D(t),R((e,t)=>{W(r,e),W(i,t)},[()=>Y(`sort_keys.last_modified`),()=>gP(z(d),Jc.current)]),U(e,t)};G(ee,e=>{z(d)&&e(te)}),R(e=>{W(y,e),q(x,`href`,z(c)),W(S,z(c)),x.dir=x.dir},[()=>Y(`public_urls`,{values:{count:1}})]),U(e,n)},$$slots:{default:!0}})}k()}var P6e=B(`<div role="figure" class="markdown svelte-1rq7jer"></div>`),F6e=B(`<pre role="figure" class="svelte-1rq7jer"> </pre>`),I6e={hash:`svelte-1rq7jer`,code:`.markdown.svelte-1rq7jer {
/* Make the preview the containing block of any positioned element in the content, so an element
with \`position: fixed\` from an inline style can’t cover the rest of the app */translate:0;}pre.svelte-1rq7jer,
.markdown.svelte-1rq7jer {display:block;margin:0;padding:16px;width:100%;height:100%;overflow:auto;}pre.svelte-1rq7jer {white-space:pre-wrap;}`};function L6e(e,t){O(t,!0),K(e,I6e);var n=H(),r=P(n),i=e=>{var n=H();Fo(P(n),()=>mr(t.text,{breaks:!0,async:!0}),null,(e,t)=>{var n=P6e();Wo(n,()=>J0e(z(t),{ADD_TAGS:[]}),!0),D(n),U(e,n)},e=>{var n=F6e(),r=F(n,!0);R(()=>W(r,t.text)),U(e,n)}),U(e,n)},a=A(()=>t.name.endsWith(`.md`)),o=e=>{var n=F6e(),r=F(n,!0);R(()=>W(r,t.text)),U(e,n)};G(r,e=>{z(a)?e(i):e(o,-1)}),U(e,n),k()}var R6e=B(`<span role="none"> </span> <!>`,1);function E5(e,t){O(t,!0);let n=J(t,`backPath`,3,`/collections`),r=()=>!0;VO(e,{children:(e,i)=>{var a=R6e(),o=P(a),s=F(o,!0);Al(I(o,2),{variant:`primary`,onclick:()=>{s$(n(),{returnTo:r})},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`back`)]),U(e,n)},$$slots:{default:!0}}),R(()=>W(s,t.message)),U(e,a)},$$slots:{default:!0}}),k()}var z6e=B(`<!> <!> <!>`,1),D5=B(`<span role="alert"> </span>`),B6e=B(`<iframe sandbox="allow-scripts"></iframe>`);function V6e(e,t){O(t,!0);let n=A(()=>aQ.current),r=A(()=>!!oQ.current),i=A(()=>oQ.current?.find(({id:e})=>e===bQ.current)),a=A(()=>z(i)?.kind),o=A(()=>z(i)?.fileName??``),s=A(()=>z(i)?.downloadURL??``),c=A(()=>rV.getType(z(o))),l=A(()=>z(i)?[z(i)]:[]),u=A(()=>tQ(z(n))),d=A(()=>FQ(A1.current,({id:e})=>e===z(i)?.id)),f=A(()=>z(d).previous),p=A(()=>z(d).next),m=(e,t)=>{o$(nQ(z(n),e),{replaceState:!0,transitionType:t})};{let t=(e,t=kr)=>{var r=z6e(),i=P(r);c6e(i,{get assets(){return z(l)},get useButton(){return t()}});var a=I(i,2);w5(a,{get assets(){return z(l)},getName:e=>e.fileName,get getBlob(){return f1},get useButton(){return t()}});var o=I(a,2),s=e=>{{let n=A(()=>Y(`delete_assets`,{values:{count:1}})),r=A(()=>Y(`confirm_deleting_this_asset`));S5(e,{get assets(){return z(l)},get deleteAssets(){return h1},get buttonDescription(){return z(n)},get dialogDescription(){return z(r)},onDelete:()=>{s$(z(u))},get useButton(){return t()}})}};G(o,e=>{z(n).delete&&e(s)}),U(e,r)},d=(e,t=kr)=>{var r=H(),a=P(r),o=e=>{p6e(e,{get asset(){return z(i)},get extraItems(){return t()}})};G(a,e=>{(z(n).rename||z(n).replace||iG.isSmallScreen)&&e(o)}),U(e,r)},h=e=>{var t=H(),n=P(t),l=e=>{VO(e,{children:(e,t)=>{var n=D5(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`loading`)]),U(e,n)},$$slots:{default:!0}})},d=e=>{{let t=A(()=>Y(`file_not_found`));E5(e,{get message(){return z(t)},get backPath(){return z(u)}})}},f=e=>{{let t=A(()=>[`image`,`video`].includes(z(a))),n=A(()=>z(a)===`image`),r=A(()=>z(a)===`image`?z(o):void 0),i=A(()=>[`audio`,`video`].includes(z(a)));u$(e,{get kind(){return z(a)},get src(){return z(s)},get blurBackground(){return z(t)},get checkerboard(){return z(n)},get alt(){return z(r)},get controls(){return z(i)},loading:`eager`,dissolve:!1,holdTransition:!0})}},p=A(()=>cV(z(a))),m=e=>{var t=B6e();R(()=>{q(t,`src`,z(s)),q(t,`title`,z(o))}),U(e,t)},h=e=>{var t=H();Fo(P(t),()=>f1(z(i)).then(e=>e.text()),e=>{VO(e,{children:(e,t)=>{var n=D5(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`loading`)]),U(e,n)},$$slots:{default:!0}})},(e,t)=>{L6e(e,{get text(){return z(t)},get name(){return z(o)}})},e=>{VO(e,{children:(e,t)=>{var n=D5(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`preview_unavailable`)]),U(e,n)},$$slots:{default:!0}})}),U(e,t)},g=A(()=>z(c)&&Hk(z(c))),_=e=>{VO(e,{children:(e,t)=>{var n=D5(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`preview_unavailable`)]),U(e,n)},$$slots:{default:!0}})};G(n,e=>{z(r)?!z(i)||!z(a)?e(d,1):z(p)?e(f,2):z(c)===`application/pdf`?e(m,3):z(g)?e(h,4):e(_,-1):e(l)}),U(e,t)},g=e=>{var t=H(),n=P(t),r=e=>{N6e(e,{get asset(){return z(i)}})};G(n,e=>{z(i)&&e(r)}),U(e,t)},_=A(()=>z(i)?.id),v=A(()=>z(f)?()=>m(z(f),`previous`):void 0),y=A(()=>z(p)?()=>m(z(p),`next`):void 0);t6e(e,{get title(){return z(o)},get contentKey(){return z(_)},onBack:()=>{s$(z(u))},get onPrevious(){return z(v)},get onNext(){return z(y)},actions:t,editOptions:d,preview:h,info:g,$$slots:{actions:!0,editOptions:!0,preview:!0,info:!0}})}k()}var H6e=new Set([`$$slots`,`$$events`,`$$legacy`,`children`]),U6e=B(`<div><!></div>`),W6e={hash:`svelte-1sdsl2g`,code:`.list-container.svelte-1sdsl2g {--icon-size: 36px;flex:auto;position:relative;height:100%;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;}`};function O5(e,t){K(e,W6e);let n=J(t,`children`,3,void 0),r=ks(t,H6e);var i=U6e();bs(i,()=>({role:`group`,class:`list-container`,...r}),void 0,void 0,void 0,`svelte-1sdsl2g`),Go(N(i),()=>n()??kr),D(i),U(e,i)}var G6e=new Set([`$$slots`,`$$events`,`$$legacy`,`viewType`,`aria-label`,`scrollKey`,`children`]),K6e=B(`<div role="none"><!></div>`),q6e={hash:`svelte-1sfbolp`,code:`:is(.grid-view.svelte-1sfbolp, .list-view.svelte-1sfbolp, .table-view.svelte-1sfbolp) {display:block;padding:0 16px 16px;height:100%;overflow-y:auto;}.grid-view.svelte-1sfbolp {
@media (width < 768px) {padding:4px;
}.row-group-caption {display:block;grid-column:1 / -1; /* span the entire row */th {display:block;}}.row-group:not(:first-child) .row-group-caption {margin-top:16px;}.grid-body {display:grid;grid-template-columns:repeat(auto-fill, minmax(var(--grid-size, 200px), 1fr));gap:16px;border-width:0;
@media (width < 768px) {grid-template-columns:repeat(auto-fill, minmax(var(--grid-size, 160px), 1fr));gap:8px;
}}.grid-row {display:block;position:relative;overflow:hidden;height:auto;text-align:start;.grid-cell {display:block;&.image:empty {aspect-ratio:1 / 1;}}.checkbox {position:absolute;inset-block-start:4px;inset-inline-start:4px;z-index:2;}.title {.label {overflow:hidden;margin:12px;height:calc(var(--sui-line-height-compact) * 2);line-height:var(--sui-line-height-compact);}}
/* Editorial Workflow status, shown below the title on a tile */.status {margin:-4px 12px 12px;}&[tabindex] {border-radius:var(--sui-control-large-border-radius);background-color:var(--sui-secondary-background-color);cursor:pointer;transition:background-color 200ms;&:is(:hover, :focus, :active) {background-color:var(--sui-hover-background-color);}}}}:is(.list-view.svelte-1sfbolp, .table-view.svelte-1sfbolp) {
@media (width < 768px) {padding:0;
}[role='grid'] {
@media (width < 768px) {width:100%;--sui-focus-ring-width: 0;
}.row-group {.row-group-caption + .grid-row {.grid-cell {border-top-width:0 !important;}}.row-group-caption ~ .grid-row:last-child {.grid-cell {border-bottom-width:0 !important;}}}.grid-row {transition-property:background-color, outline-color;transition-duration:200ms;&[tabindex] {cursor:pointer;}&:hover {background-color:var(--sui-hover-background-color);}&:last-child .grid-cell {border-width:1px 0;}}.grid-cell {overflow:hidden;border-width:1px 0 0;border-color:var(--sui-secondary-border-color);padding:0 16px 0 0;height:40px;max-width:100%;color:var(--sui-secondary-foreground-color);white-space:nowrap;vertical-align:middle;
@media (width < 768px) {border-width:0 !important;height:64px;
}&.checkbox {padding-inline-start:8px !important;width:44px;}&.title {width:100%; /* flex: auto */color:var(--sui-primary-foreground-color);}
/*
* The column is as wide as the widest Editorial Workflow status badge, so align the
* badges to the end of the row rather than letting the narrower ones float mid-column
*/&.status {text-align:end;}&:first-child {padding-inline-start:16px;}.label {overflow:hidden;
@media (width < 768px) {white-space:normal;line-height:var(--sui-line-height-compact);
}}&.image {width:48px;&:empty::before {display:block;border-radius:var(--sui-control-medium-border-radius);width:var(--icon-size);height:var(--icon-size);background-color:var(--sui-secondary-background-color);content:'';}}}}}
/* The table view is a list view with more columns, only shown on a large screen */.table-view.svelte-1sfbolp {[role='grid'] {
/* The header row can be focused, but it doesn’t open anything */.grid-head .grid-row {cursor:default;&:hover {background-color:transparent;}}.grid-col-header {position:sticky;inset-block-start:0;z-index:1;border-bottom:1px solid var(--sui-secondary-border-color);padding:0 16px 0 0;height:40px;background-color:var(--sui-primary-background-color);color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);text-align:start;white-space:nowrap;vertical-align:middle;&:first-child {padding-inline-start:16px;}}
/* Each column is as wide as its content, up to a limit; the text is truncated beyond */.grid-cell.title {width:auto;.label {width:max-content;min-width:160px;max-width:400px;}}.grid-cell.column .label {width:max-content;max-width:320px;}
/* The last column takes up the rest of the width, so the others are as wide as their
content */:is(.grid-cell, .grid-col-header).status {width:100%;}}}`};function k5(e,t){O(t,!0),K(e,q6e);let n=J(t,`aria-label`,3,void 0),r=J(t,`scrollKey`,3,void 0),i=J(t,`children`,3,void 0),a=ks(t,G6e),o;L(()=>{r(),o&&(o.scrollTop=0)});var s=K6e();Fo(N(s),pl,null,e=>{gae(e,As({multiple:!0,clickToSelect:!1,get ariaLabel(){return n()}},()=>a,{children:(e,t)=>{var n=H();Go(P(n),()=>i()??kr),U(e,n)},$$slots:{default:!0}}))}),D(s),es(s,()=>e=>{o=e}),R(()=>os(s,1,`${t.viewType??``}-view`,`svelte-1sfbolp`)),U(e,s),k()}var J6e=B(`<!> <!>`,1),Y6e=B(`<span role="none"> </span> <!>`,1),X6e={hash:`svelte-1lyfhki`,code:`
/* Keep the compact folder tiles apart from the asset tiles below them */.grid-view .grid-body.subfolders:not(:last-child) {margin-bottom:16px;}`};function Z6e(e,t){O(t,!0),K(e,X6e);let n=J(t,`onBlankClick`,3,void 0),r=J(t,`subfolders`,3,void 0),i=J(t,`hasSubfolders`,3,!1),a=J(t,`emptyAction`,3,void 0),o=A(()=>Object.values(t.groups).some(e=>e.length));{let s=A(()=>Y(`asset_list`));O5(e,{get"aria-label"(){return z(s)},onclick:e=>{e.target.closest(`[role="row"], button, [role="menu"]`)||n()?.()},children:(e,n)=>{b$(e,{get disabled(){return t.uploadDisabled},multiple:!0,onDrop:({files:e})=>{t.onDrop(e)},children:(e,n)=>{var s=H(),c=P(s),l=e=>{{let n=A(()=>Y(`assets`));k5(e,{id:`asset-list`,get viewType(){return t.viewType},get"aria-label"(){return z(n)},get"aria-rowcount"(){return t.totalCount},children:(e,n)=>{var a=J6e(),o=P(a),s=e=>{vu(e,{class:`subfolders`,children:(e,t)=>{var n=H();Go(P(n),()=>r()??kr),U(e,n)},$$slots:{default:!0}})};G(o,e=>{i()&&e(s)}),Bo(I(o,2),17,()=>Object.entries(t.groups),([e,t])=>e,(e,n)=>{var r=A(()=>Nr(z(n),2));let i=()=>z(r)[0],a=()=>z(r)[1];var o=H();Fo(P(o),pl,null,e=>{{let n=A(()=>i()===`*`?void 0:Kz(i())),r=A(()=>i()!==`*`),o=A(()=>!$z(DQ.current,i()));vu(e,{get label(){return z(n)},get collapsible(){return z(r)},get expanded(){return z(o)},onChange:({detail:{expanded:e}})=>{DQ.current=tB(DQ.current,i(),!e)},children:(e,n)=>{zu(e,{get items(){return a()},get itemKey(){return t.itemKey},get renderItem(){return t.renderItem}})},$$slots:{default:!0}})}}),U(e,o)}),U(e,a)},$$slots:{default:!0}})}},u=e=>{VO(e,{children:(e,n)=>{var r=Y6e(),i=P(r),o=F(i,!0),s=I(i,2),c=e=>{var t=H();Go(P(t),()=>a()??kr),U(e,t)};G(s,e=>{t.uploadDisabled||e(c)}),R(e=>W(o,e),[()=>Y(`no_files_found`)]),U(e,r)},$$slots:{default:!0}})};G(c,e=>{z(o)||i()?e(l):e(u,-1)}),U(e,s)},$$slots:{default:!0}})},$$slots:{default:!0}})}k()}var Q6e=B(`<bdi> </bdi>`),$6e=B(`<div role="none" class="label svelte-17zk54k"><!></div>`),e8e=B(`<!> <!>`,1),t8e=B(`<!> <!> <!>`,1),n8e={hash:`svelte-17zk54k`,code:`.label.svelte-17zk54k {word-break:break-all;}`};function r8e(e,t){O(t,!0),K(e,n8e);let n=J(t,`asset`,3,void 0),r=J(t,`src`,3,void 0),i=J(t,`status`,3,void 0),a=()=>{t.canPreview&&t.onPreview()};{let o=A(()=>t.rowIndex>=0?t.rowIndex+1:void 0);Su(e,{get"aria-rowindex"(){return z(o)},get"aria-label"(){return t.name},onChange:e=>{t.onSelectionChange(e.detail.selected)},get onfocus(){return t.onFocus},onclick:e=>{aG(e)&&a()},ondblclick:a,children:(e,a)=>{var o=t8e(),s=P(o),c=e=>{bu(e,{class:`checkbox`,children:(e,n)=>{{let n=A(()=>Y(`select_item`,{values:{name:t.name}}));Ql(e,{tabindex:`-1`,get ariaLabel(){return z(n)},get checked(){return t.selected},onChange:({detail:{checked:e}})=>{t.onSelectionChange(e)}})}},$$slots:{default:!0}})};G(s,e=>{iG.isSmallScreen||iG.isMediumScreen||e(c)});var l=I(s,2);bu(l,{class:`image`,children:(e,i)=>{{let i=A(()=>r()?t.name:``),a=A(()=>t.viewType===`list`?`icon`:`tile`),o=A(()=>t.kind===`image`);u$(e,{get kind(){return t.kind},get asset(){return n()},get src(){return r()},get alt(){return z(i)},get variant(){return z(a)},get cover(){return iG.isSmallScreen},get checkerboard(){return z(o)}})}},$$slots:{default:!0}});var u=I(l,2),d=e=>{var n=e8e(),r=P(n);bu(r,{class:`title`,children:(e,n)=>{var r=$6e();fl(N(r),{lines:2,children:(e,n)=>{var r=Q6e(),i=F(r,!0);R(()=>W(i,t.name)),U(e,r)},$$slots:{default:!0}}),D(r),U(e,r)},$$slots:{default:!0}});var a=I(r,2),o=e=>{bu(e,{class:`status`,children:(e,t)=>{var n=H();Go(P(n),i),U(e,n)},$$slots:{default:!0}})};G(a,e=>{i()&&e(o)}),U(e,n)};G(u,e=>{iG.isSmallScreen&&t.viewType!==`list`||e(d)}),U(e,o)},$$slots:{default:!0}})}k()}var i8e=B(`<span role="none" class="badge svelte-57ciq1"> </span>`),a8e={hash:`svelte-57ciq1`,code:`
/*
* Filled pill following the same background/foreground/border recipe as the Alert and Infobar
* components, so the colors adapt to both the light and dark themes.
*/.badge.svelte-57ciq1 {display:inline-block;border-width:1px;border-style:solid;border-radius:12px;border-color:var(--sui-error-border-color);padding:1px 6px;background-color:var(--sui-error-background-color);color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-x-small);line-height:var(--sui-line-height-compact);white-space:nowrap;}`};function o8e(e,t){O(t,!0),K(e,a8e);var n=i8e(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`file_unavailable`)]),U(e,n),k()}function s8e(e,t){O(t,!0);let n=e=>{var t=H(),n=P(t),r=e=>{o8e(e,{})};G(n,e=>{z(a)&&e(r)}),U(e,t)},r=A(()=>eze.current.has(t.asset.id)),i=A(()=>aQ.current?.serviceId===`linked`),a=A(()=>YZ.current[t.asset.id]===!1),o=A(()=>sQ(aQ.current)&&!O1.current?t.asset.description:t.asset.fileName),s=()=>{let e=aQ.current;e&&o$(nQ(e,t.asset),{transitionType:`forwards`})},c=e=>{_Q.current=iJ(_Q.current,t.asset,e,(e,t)=>e.id===t.id)};{let a=A(()=>rQ(t.asset)),l=A(()=>z(i)?n:void 0);r8e(e,{get name(){return z(o)},get kind(){return t.asset.kind},get src(){return t.asset.previewURL},get rowIndex(){return t.index},get viewType(){return t.viewType},get selected(){return z(r)},get canPreview(){return z(a)},onSelectionChange:c,onFocus:()=>{vQ.current=t.asset,uQ.current=void 0},onPreview:()=>{s()},get status(){return z(l)}})}k()}var c8e=B(`<div role="none" class="preview svelte-g07uie"><!></div>`),l8e=B(`<bdi> </bdi>`),u8e=B(`<!> <!>`,1),d8e=B(`<div role="none" class="menu svelte-g07uie"><!></div>`),f8e=B(`<div role="none" class="title-inner svelte-g07uie"><div role="none" class="label svelte-g07uie"><!></div> <!></div>`),p8e=B(`<!> <!> <!>`,1),m8e={hash:`svelte-g07uie`,code:`.preview.svelte-g07uie {display:inline-flex;align-items:center;justify-content:center;color:var(--sui-secondary-foreground-color);.sui.icon {font-size:24px;}}.title-inner.svelte-g07uie {display:flex;align-items:center;gap:8px;}.label.svelte-g07uie {flex:auto;min-width:0;word-break:break-all;}.menu.svelte-g07uie {flex:none;}
/* A folder is a compact tile in the grid view, with the icon, the name and the menu in a row,
unlike an asset, which needs the room for its thumbnail. The selectors are specific enough to
win over the tile styles of the listing grid */.grid-view .grid-body .grid-row.subfolder {display:flex;align-items:center;gap:12px;padding:8px 8px 8px 16px;.grid-cell.image {flex:none;display:flex;aspect-ratio:auto;}.grid-cell.title {flex:auto;min-width:0;.label {margin:0;height:auto;}}}.list-view .grid-body .grid-row.subfolder {
/* The icon sits in a box the size of an asset thumbnail, so the two line up */.preview {width:var(--icon-size);height:var(--icon-size);}.grid-cell.title {padding-inline-end:8px;}}`};function h8e(e,t){O(t,!0),K(e,m8e);let n=J(t,`hasCheckboxColumn`,3,!1),r=J(t,`onFocus`,3,void 0),i=J(t,`onRename`,3,void 0),a=J(t,`onDelete`,3,void 0),o=J(t,`actionsDisabled`,3,!1),s=e=>{e.stopPropagation()};{let c=A(()=>t.rowIndex+1),l=A(()=>Y(`folder`));Su(e,{class:`subfolder`,get"aria-rowindex"(){return z(c)},get"aria-label"(){return t.subfolder.name},get"aria-description"(){return z(l)},onfocus:()=>{r()?.()},onclick:e=>{aG(e)&&t.onOpen()},get ondblclick(){return t.onOpen},children:(e,r)=>{var c=p8e(),l=P(c),u=e=>{bu(e,{class:`checkbox`})};G(l,e=>{t.viewType===`list`&&n()&&e(u)});var d=I(l,2);bu(d,{class:`image`,children:(e,t)=>{var n=c8e();Xc(N(n),{name:`folder`}),D(n),U(e,n)},$$slots:{default:!0}}),bu(I(d,2),{class:`title`,children:(e,n)=>{var r=f8e(),c=N(r),l=N(c);{let e=A(()=>t.viewType===`list`?1:2);fl(l,{get lines(){return z(e)},children:(e,n)=>{var r=l8e(),i=F(r,!0);R(()=>W(i,t.subfolder.name)),U(e,r)},$$slots:{default:!0}})}D(c);var u=I(c,2),d=e=>{var t=d8e(),n=N(t);{let e=e=>{{let t=A(()=>Y(`folder_options`));Eu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=u8e(),r=P(n),s=e=>{{let t=A(()=>Y(`rename`)),n=A(()=>Y(`rename_folder`));Du(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(n)},get disabled(){return o()},get onclick(){return i()}})}};G(r,e=>{i()&&e(s)});var c=I(r,2),l=e=>{{let t=A(()=>Y(`delete`)),n=A(()=>Y(`delete_folder`));Du(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(n)},get disabled(){return o()},get onclick(){return a()}})}};G(c,e=>{a()&&e(l)}),U(e,n)},$$slots:{default:!0}})}},t=A(()=>Y(`show_folder_options`));Xl(n,{variant:`ghost`,iconic:!0,size:`small`,popupPosition:`bottom-right`,get"aria-label"(){return z(t)},popup:e,$$slots:{popup:!0}})}D(t),bo(`click`,t,s),bo(`dblclick`,t,s),U(e,t)};G(u,e=>{(i()||a())&&e(d)}),D(r),U(e,r)},$$slots:{default:!0}}),U(e,c)},$$slots:{default:!0}})}k()}xo([`click`,`dblclick`]);function g8e(e,t){O(t,!0);let n=A(()=>aQ.current),r=A(()=>!!z(n).move&&!!z(n).createFolder&&!!z(n).deleteFolder),i=A(()=>!!z(n).delete&&!!z(n).deleteFolder);{let n=A(()=>!(iG.isSmallScreen||iG.isMediumScreen)),a=A(()=>z(r)?()=>{fQ.current=t.subfolder}:void 0),o=A(()=>z(i)?()=>{pQ.current=t.subfolder}:void 0);h8e(e,{get subfolder(){return t.subfolder},get rowIndex(){return t.rowIndex},get viewType(){return t.viewType},get hasCheckboxColumn(){return z(n)},onOpen:()=>{TQ(t.subfolder.path)},onFocus:()=>{uQ.current=t.subfolder,vQ.current=void 0},get onRename(){return z(a)},get onDelete(){return z(o)}})}k()}function _8e(e,t){O(t,!0);let n=J(t,`label`,3,void 0),r=J(t,`disabled`,3,!1);{let i=e=>{Xc(e,{name:`cloud_upload`})},a=A(()=>!n()),o=A(()=>Y(`upload_assets`));Al(e,{variant:`primary`,get iconic(){return z(a)},get disabled(){return r()},get label(){return n()},get"aria-label"(){return z(o)},get onclick(){return t.onclick},startIcon:i,$$slots:{startIcon:!0}})}k()}var v8e=B(`<!> <!>`,1);function y8e(e,t){O(t,!0);let n=J(t,`label`,3,void 0),r=j(void 0),i=A(()=>aQ.current),a=A(()=>!z(i)?.upload||!wQ(z(i)));var o=v8e(),s=P(o);_8e(s,{get label(){return n()},get disabled(){return z(a)},onclick:()=>{z(r)?.open()}}),Ds(_u(I(s,2),{multiple:!0,onSelect:({files:e})=>{r1.current={files:e}}}),e=>M(r,e,!0),()=>z(r)),U(e,o),k()}var b8e=B(`<span role="alert"> </span>`);function x8e(e,t){O(t,!0);let n=A(()=>aQ.current),r=A(()=>DQ.current.type),i=A(()=>!z(n).upload),a=A(()=>k1.current.length),o=A(()=>new Map(Object.values(j1.current).flat(1).map(({id:e},t)=>[e,t+z(a)]))),s=e=>z(o).get(e.id);var c=H(),l=P(c),u=e=>{{let t=A(()=>Y(`asset_list`));O5(e,{get"aria-label"(){return z(t)},children:(e,t)=>{var r=H(),i=P(r),a=e=>{IV(e,{onSelect:()=>void 0})};G(i,e=>{z(n).serviceId===`cloudinary`&&e(a)}),U(e,r)},$$slots:{default:!0}})}},d=e=>{{let t=A(()=>Y(`asset_list`));O5(e,{get"aria-label"(){return z(t)},children:(e,t)=>{{let t=A(()=>hQ.current?Y(`assets_dialog.error.${hQ.current}`):void 0);m$(e,{get serviceProps(){return z(n)},get error(){return z(t)}})}},$$slots:{default:!0}})}},f=A(()=>!wQ(z(n))||hQ.current),p=e=>{{let t=A(()=>Y(`asset_list`));O5(e,{get"aria-label"(){return z(t)},children:(e,t)=>{VO(e,{children:(e,t)=>{var n=b8e(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`loading`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})}},m=e=>{{let t=e=>{var t=H();Bo(P(t),19,()=>k1.current,e=>e.path,(e,t,n)=>{g8e(e,{get subfolder(){return z(t)},get rowIndex(){return z(n)},get viewType(){return z(r)}})}),U(e,t)},n=(e,t=kr)=>{{let n=A(()=>s(t()));s8e(e,{get asset(){return t()},get index(){return z(n)},get viewType(){return z(r)}})}},o=e=>{{let t=A(()=>Y(`upload_assets`));y8e(e,{get label(){return z(t)}})}},c=A(()=>z(a)+A1.current.length),l=A(()=>!!z(a));Z6e(e,{get groups(){return j1.current},itemKey:`id`,get totalCount(){return z(c)},get hasSubfolders(){return z(l)},get viewType(){return z(r)},get uploadDisabled(){return z(i)},onDrop:e=>{r1.current={files:e}},onBlankClick:()=>{vQ.current=void 0,uQ.current=void 0},subfolders:t,renderItem:n,emptyAction:o,$$slots:{subfolders:!0,renderItem:!0,emptyAction:!0}})}};G(l,e=>{z(n).authType===`widget`?e(u):z(f)?e(d,1):oQ.current?e(m,-1):e(p,2)}),U(e,c),k()}function S8e(e,t){O(t,!0);let n=A(()=>pQ.current),r=A(()=>!!z(n)),i=A(()=>z(n)?.name??``),a=A(()=>z(n)?g1(z(n).path).length:0);{let t=A(()=>Y(`delete_folder`)),o=A(()=>Y(`delete`));ru(e,{get title(){return z(t)},get okLabel(){return z(o)},onOk:()=>{z(n)&&MBe(z(n))},onClose:()=>{pQ.current=void 0},get open(){return z(r)},set open(e){M(r,e)},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`confirm_deleting_folder`,{values:{name:z(i),count:z(a)}})]),U(e,n)},$$slots:{default:!0}})}k()}var C8e=e=>{var t=w8e();Xc(N(t),{name:`folder`}),D(t),U(e,t)},w8e=B(`<div role="none" class="folder-preview svelte-mzxrkp"><!></div>`),T8e=B(`<section><h4> </h4> <p><bdi dir="ltr"> </bdi></p></section>`),E8e=B(`<p> </p>`),D8e=B(`<section><h4> </h4> <p><bdi> </bdi></p></section> <!> <section><h4> </h4> <!> <p> </p></section>`,1),O8e={hash:`svelte-mzxrkp`,code:`.folder-preview.svelte-mzxrkp {display:flex;align-items:center;justify-content:center;height:100%;color:var(--sui-secondary-foreground-color);.sui.icon {font-size:96px;}}`};function k8e(e,t){O(t,!0),K(e,O8e);let n=J(t,`path`,3,void 0),r=J(t,`folderCount`,3,void 0);T5(e,{get preview(){return C8e},children:(e,i)=>{var a=D8e(),o=P(a),s=N(o),c=F(s,!0),l=I(s,2),u=F(N(l),!0);D(l),D(o);var d=I(o,2),f=e=>{var t=T8e(),r=N(t),i=F(r,!0),a=I(r,2),o=N(a),s=F(o,!0);D(a),D(t),R(e=>{W(i,e),W(s,`/${n()}`),o.dir=o.dir},[()=>Y(`folder_path`)]),U(e,t)};G(d,e=>{n()!==void 0&&e(f)});var p=I(d,2),m=N(p),h=F(m,!0),g=I(m,2),_=e=>{var t=E8e(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`x_folders`,{values:{count:r()}})]),U(e,t)};G(g,e=>{r()!==void 0&&e(_)});var v=F(I(g,2),!0);D(p),R((e,n,r)=>{W(c,e),W(u,t.name),W(h,n),W(v,r)},[()=>Y(`folder`),()=>Y(`folder_contents`),()=>Y(`x_assets`,{values:{count:t.assetCount}})]),U(e,a)},$$slots:{default:!0}}),k()}function A8e(e,t){O(t,!0);let n=A(()=>JBe.current);k8e(e,{get name(){return z(n).name},get path(){return z(n).path},get folderCount(){return z(n).folderCount},get assetCount(){return z(n).assetCount}}),k()}function j8e(e,t){O(t,!0);let n=A(()=>aQ.current),r=A(()=>uU({subfolders:k1.current,fileNames:A1.current.map(({fileName:e})=>e)})),i=A(()=>D1({dirPath:lQ.current,serviceLabel:z(n).serviceLabel}));{let t=A(()=>Y(`new_folder`)),n=A(()=>Y(`new_folder_create`)),a=A(()=>Y(`new_folder_description`,{values:{folder:z(i)}}));wU(e,{get title(){return z(t)},get okLabel(){return z(n)},get description(){return z(a)},get takenNames(){return z(r)},onSubmit:e=>{ABe(e)},get open(){return dQ.current},set open(e){dQ.current=e}})}k()}function M8e(e,t){O(t,!0);let n=J(t,`disabled`,3,!1);{let r=e=>{Xc(e,{name:`create_new_folder`})},i=A(()=>iG.isSmallScreen?`secondary`:`ghost`),a=A(()=>Y(`new_folder`));Al(e,{get variant(){return z(i)},iconic:!0,get disabled(){return n()},get"aria-label"(){return z(a)},get onclick(){return t.onclick},startIcon:r,$$slots:{startIcon:!0}})}k()}function N8e(e,t){O(t,!0);var n=H(),r=P(n),i=e=>{M8e(e,{onclick:()=>{dQ.current=!0}})};G(r,e=>{O1.current&&aQ.current?.createFolder&&e(i)}),U(e,n),k()}function P8e(e,t){O(t,!0);let n=J(t,`path`,3,void 0),r=J(t,`disabled`,3,!1),i=J(t,`state`,3,void 0);{let t=A(()=>r()||!n()),a=A(()=>Y(`preview`)),o=A(()=>Y(`show_preview`));Al(e,{variant:`ghost`,get disabled(){return z(t)},get label(){return z(a)},get"aria-label"(){return z(o)},onclick:()=>{o$(n(),{transitionType:`forwards`,state:i()})}})}k()}var F8e=B(`<bdi class="svelte-1okrlal"> </bdi>`),I8e=B(`<!> <h2 role="none" class="svelte-1okrlal"><!></h2> <!> <!>`,1),L8e={hash:`svelte-1okrlal`,code:`
/* Two floating buttons — New Folder and Upload — sit side by side on a small screen */.asset-library-toolbar .floating-action-button-wrapper {
@media (width < 768px) {display:flex;gap:12px;
}}h2.svelte-1okrlal {
/* A long name is cut short rather than wrapped, so the toolbar stays one line tall */& > bdi:where(.svelte-1okrlal) {overflow:hidden;min-width:0;white-space:nowrap;text-overflow:ellipsis;}
/* An ancestor folder in the breadcrumb reads as part of the heading, only dimmed to tell it
from the current folder. The class is repeated to make the selectors specific enough to exempt
the labels and the separators from the small type the toolbar gives any \`<span>\` in the
heading, which is a rule with a scoping class of its own */.breadcrumb.breadcrumb.breadcrumb {
/* Take the whole heading, so the trail is measured against the room it can actually use */flex:auto;font-size:inherit;.sui.button.crumb .label,
.sui.icon.separator,
span.current {font-size:inherit;opacity:1;}.sui.button.crumb .label {font-weight:var(--sui-font-weight-normal, normal);}span.current {font-weight:inherit;}}}`};function R8e(e,t){O(t,!0),K(e,L8e);let n=J(t,`subfolderNames`,19,()=>[]),r=J(t,`actions`,3,void 0),i=J(t,`fab`,3,void 0),a=A(()=>n().at(-1)??t.rootLabel),o=A(()=>dU({rootLabel:t.rootLabel,subfolderNames:n(),onBrowse:({depth:e})=>{t.onBrowse(e,!1)}}));{let s=A(()=>Y(`folder`));dO(e,{variant:`primary`,class:`asset-library-toolbar`,get ariaLabel(){return z(s)},children:(e,s)=>{var c=I8e(),l=P(c),u=e=>{{let r=A(()=>Y(n().length?`back_to_parent_folder`:`back_to_asset_folder_list`));C5(e,{get"aria-label"(){return z(r)},onclick:()=>{n().length?t.onBrowse(n().length-1,!0):s$(`/assets`)}})}};G(l,e=>{iG.isSmallScreen&&e(u)});var d=I(l,2),f=N(d),p=e=>{BV(e,{get items(){return z(o)}})},m=e=>{var t=F8e(),n=F(t,!0);R(()=>W(n,z(a))),U(e,t)};G(f,e=>{!iG.isSmallScreen&&z(o).length?e(p):e(m,-1)}),D(d);var h=I(d,2),g=e=>{var t=H();Go(P(t),()=>r()??kr),U(e,t)};G(h,e=>{iG.isSmallScreen||iG.isMediumScreen||e(g)}),Ml(I(h,2),{children:(e,t)=>{var n=H();Go(P(n),()=>i()??kr),U(e,n)},$$slots:{default:!0}}),U(e,c)},$$slots:{default:!0}})}k()}var z8e=B(`<!> <!> <!> <!> <!>`,1),B8e=B(`<!> <!>`,1);function V8e(e,t){O(t,!0);let n=A(()=>aQ.current),r=A(()=>vQ.current),i=A(()=>O1.current&&lQ.current?lQ.current.split(`/`):[]),a=A(()=>tze.current);R8e(e,{get rootLabel(){return z(n).serviceLabel},get subfolderNames(){return z(i)},onBrowse:e=>{TQ(z(i).slice(0,e).join(`/`))},actions:e=>{var t=z8e(),i=P(t);{let e=A(()=>z(r)?nQ(z(n),z(r)):void 0),t=A(()=>!z(r)||!rQ(z(r)));P8e(i,{get path(){return z(e)},get disabled(){return z(t)}})}var o=I(i,2);{let e=A(()=>z(r)?[z(r)]:[]);c6e(o,{get assets(){return z(e)}})}var s=I(o,2);w5(s,{get assets(){return z(a)},getName:e=>e.fileName,get getBlob(){return f1}});var c=I(s,2),l=e=>{{let t=A(()=>Y(`delete_selected_assets`,{values:{count:z(a).length}})),n=A(()=>Y(z(a).length>1&&z(a).length===A1.current.length?`confirm_deleting_all_assets`:`confirm_deleting_selected_assets`,{values:{count:z(a).length}}));S5(e,{get assets(){return z(a)},get deleteAssets(){return h1},get buttonDescription(){return z(t)},get dialogDescription(){return z(n)}})}};G(c,e=>{z(n).delete&&e(l)});var u=I(c,2),d=e=>{p6e(e,{get asset(){return z(r)}})};G(u,e=>{(z(n).rename||z(n).replace)&&e(d)}),U(e,t)},fab:e=>{var t=B8e(),r=P(t);N8e(r,{});var i=I(r,2),a=e=>{{let t=A(()=>iG.isSmallScreen?void 0:Y(`upload`));y8e(e,{get label(){return z(t)}})}};G(i,e=>{z(n).upload&&(!iG.isSmallScreen||oQ.current?.length)&&e(a)}),U(e,t)},$$slots:{actions:!0,fab:!0}}),k()}var H8e=B(`<p role="alert" class="svelte-1v918mk"> </p>`),U8e=B(`<p role="alert" class="warning svelte-1v918mk"> </p>`),W8e=B(`<p class="svelte-1v918mk"> </p> <!>`,1),G8e=B(`<div role="status" class="note svelte-1v918mk"> </div>`),K8e=B(`<!> <div role="none" class="svelte-1v918mk"><!></div> <!> <div role="none" class="error svelte-1v918mk"><!></div>`,1),q8e=B(`<!> <!>`,1),J8e={hash:`svelte-1v918mk`,code:`p.svelte-1v918mk {margin:0 0 8px;}div.svelte-1v918mk {display:flex;align-items:center;gap:4px;}.warning.svelte-1v918mk {color:var(--sui-warning-foreground-color);}.note.svelte-1v918mk {margin:4px 0 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.error.svelte-1v918mk {margin:0;color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-small);}`};function Y8e(e,t){let n=Eo();O(t,!0),K(e,J8e);let r=J(t,`open`,15,!1),i=J(t,`folderNames`,19,()=>[]),a=J(t,`usedEntryCount`,3,0),o=J(t,`warning`,3,void 0),s=J(t,`blockedMessage`,3,void 0),c=J(t,`slugificationEnabled`,3,!1),l=J(t,`onClose`,3,void 0),u=j(!1),d=j(void 0),f=!1,p=j(``),m=A(()=>Uk(t.name)),h=A(()=>z(m).extension),g=A(()=>z(p).trim()),_=A(()=>z(g)?YB(z(g),{slugificationEnabled:c()}):``),v=A(()=>Uk(z(_)).extension),y=A(()=>!HP(z(h),z(v))),b=A(()=>fDe({name:z(g),fileName:z(_),otherNames:t.otherNames,folderNames:i()})),x=A(()=>!!z(b)),S=async()=>{await co(),z(d)&&(z(d).focus(),z(d).setSelectionRange(0,Uk(z(d).value).filename.length))};L(()=>{r()&&(f||M(p,t.name,!0),f=!1)}),L(()=>{OQ.current||(r(!1),M(u,!1),l()?.())});var C=q8e(),w=P(C);{let e=A(()=>Y(`rename_x`,{values:{name:t.name}})),i=A(()=>Y(`rename`)),c=A(()=>!!s()||z(_)===t.name||z(x));tu(w,{get title(){return z(e)},get okLabel(){return z(i)},get okDisabled(){return z(c)},onOk:()=>{z(y)?M(u,!0):t.onRename(z(_))},onClose:()=>{z(u)||l()?.()},onOpen:()=>{S()},get open(){return r()},set open(e){r(e)},children:(e,t)=>{var r=K8e(),i=P(r),c=e=>{var t=H8e(),n=F(t,!0);R(()=>W(n,s())),U(e,t)},l=e=>{var t=W8e(),n=P(t),r=F(n,!0),i=I(n,2),s=e=>{var t=U8e(),n=F(t,!0);R(()=>W(n,o())),U(e,t)};G(i,e=>{o()&&e(s)}),R(e=>W(r,e),[()=>Y(`enter_new_name_for_asset`,{values:{count:a()}})]),U(e,t)};G(i,e=>{s()?e(c):e(l,-1)});var u=I(i,2),f=N(u);{let e=A(()=>!!s());fu(f,{dir:`auto`,flex:!0,get disabled(){return z(e)},get invalid(){return z(x)},get"aria-errormessage"(){return`${n}-error`},get value(){return z(p)},set value(e){M(p,e,!0)},get element(){return z(d)},set element(e){M(d,e,!0)}})}D(u);var m=I(u,2),h=e=>{var t=G8e(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`file_will_be_saved_as`,{values:{name:z(_)}})]),U(e,t)};G(m,e=>{!z(x)&&z(_)!==z(g)&&e(h)});var v=I(m,2),y=N(v),S=e=>{var t=V();R(e=>W(t,e),[()=>Y(`enter_new_name_for_asset_error.${z(b)}`)]),U(e,t)};G(y,e=>{z(x)&&e(S)}),D(v),R(()=>q(v,`id`,`${n}-error`)),U(e,r)},$$slots:{default:!0}})}var T=I(w,2);{let e=A(()=>Y(`rename`));RGe(T,{get oldExtension(){return z(h)},get newExtension(){return z(v)},get okLabel(){return z(e)},onOk:()=>{t.onRename(z(_)),l()?.()},onCancel:()=>{f=!0,r(!0)},get open(){return z(u)},set open(e){M(u,e,!0)}})}U(e,C),k()}function X8e(e,t){O(t,!0);let n=A(()=>xQ.current),r=A(()=>!!z(n)),i=A(()=>Uk(z(n)?.id??``)),a=A(()=>z(i).dirname),o=A(()=>oQ.current??[]),s=A(()=>z(o).filter(e=>e.id!==z(n)?.id&&Uk(e.id).dirname===z(a)).map(e=>e.fileName)),c=j(0),l=async e=>{if(M(c,0),!e)return;let t=await JZ(e);z(n)===e&&M(c,t.length,!0)};L(()=>{l(z(n))});let u=async e=>{let t=aQ.current;if(!z(n)||!t)return;let r=z(n).id,i=await OBe(z(n),e);i&&bQ.current===r&&(bQ.current=i.id,await o$(nQ(t,i),{replaceState:!0,notifyChange:!1}))};{let t=A(()=>z(n)?.fileName??``),i=A(()=>z(c)?Y(`renaming_external_asset_breaks_links`,{values:{count:z(c)}}):void 0);Y8e(e,{get name(){return z(t)},get otherNames(){return z(s)},get warning(){return z(i)},onRename:u,onClose:()=>{xQ.current=void 0},get open(){return z(r)},set open(e){M(r,e)}})}k()}function Z8e(e,t){O(t,!0);let n=A(()=>fQ.current),r=A(()=>!!z(n)),i=A(()=>z(n)?.name??``),a=A(()=>z(n)?g1(z(n).path):[]),o=j(0),s=async e=>{M(o,0);let t=await URe(e);z(a)===e&&M(o,t.length,!0)};L(()=>{s(z(a))});let c=A(()=>uU({subfolders:k1.current,fileNames:A1.current.map(({fileName:e})=>e),exclude:z(i)}));{let t=A(()=>Y(`rename_x`,{values:{name:z(i)}})),s=A(()=>Y(`rename`)),l=A(()=>Y(`enter_new_name_for_external_folder`,{values:{count:z(a).length}})),u=A(()=>z(o)?Y(`renaming_external_folder_breaks_links`,{values:{count:z(o)}}):void 0);wU(e,{get title(){return z(t)},get okLabel(){return z(s)},get description(){return z(l)},get warning(){return z(u)},get name(){return z(i)},get takenNames(){return z(c)},onSubmit:e=>{z(n)&&jBe(z(n),e)},onClose:()=>{fQ.current=void 0},get open(){return z(r)},set open(e){M(r,e)}})}k()}var Q8e=B(`<span role="none"> </span>`);function $8e(e,t){O(t,!0);let n=J(t,`fallback`,3,void 0);var r=H(),i=P(r),a=e=>{{let r=A(()=>Y(`asset_info`));HO(e,{id:`asset-info`,class:`secondary-sidebar`,get ariaLabel(){return z(r)},children:(e,r)=>{var i=H(),a=P(i),o=e=>{var n=H();Go(P(n),()=>t.children,()=>t.asset),U(e,n)},s=e=>{var t=H();Go(P(t),n),U(e,t)},c=e=>{VO(e,{children:(e,t)=>{var n=Q8e(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`select_asset_show_info`)]),U(e,n)},$$slots:{default:!0}})};G(a,e=>{t.asset?e(o):n()?e(s,1):e(c,-1)}),U(e,i)},$$slots:{default:!0}})}};G(i,e=>{iG.isLargeScreen&&DQ.current.showInfo&&e(a)}),U(e,r),k()}var e5e=B(`<!> <!>`,1);function t5e(e,t){O(t,!0);let n=J(t,`currentView`,7),r=J(t,`label`,3,``),i=J(t,`disabled`,3,!1),a=J(t,`multiple`,3,!1),o=J(t,`noneLabel`,3,``),s=J(t,`filters`,19,()=>[]);{let c=e=>{{let r=A(()=>Y(`filtering_options`));Eu(e,{get ariaLabel(){return z(r)},get"aria-controls"(){return t[`aria-controls`]},children:(e,t)=>{var r=H(),i=P(r),c=e=>{var t=H();Bo(P(t),17,s,e=>Gz(Uz(e)),(e,t)=>{let r=A(()=>{let{label:e}=z(t);return{_label:e}}),i=A(()=>Uz(z(t))),a=A(()=>Gz(z(i))),o=A(()=>(n().current.filters||[]).findIndex(e=>Gz(e)===z(a)));{let t=A(()=>z(o)>-1);ku(e,{get label(){return z(r)._label},get checked(){return z(t)},onChange:()=>{let e=n().current,t=e.filters?[...e.filters]:[];z(o)>-1?t.splice(z(o),1):t.push(z(i)),n().current={...e,filters:t}}})}}),U(e,t)},l=e=>{var t=e5e(),r=P(t);{let e=A(()=>o()||Y(`sort_keys.none`)),t=A(()=>!n().current.filter);Au(r,{get label(){return z(e)},get checked(){return z(t)},onSelect:()=>{n().current={...n().current,filter:void 0}}})}Bo(I(r,2),17,s,e=>Gz(Uz(e)),(e,t)=>{let r=A(()=>{let{label:e}=z(t);return{_label:e}}),i=A(()=>Uz(z(t))),a=A(()=>Gz(z(i)));{let t=A(()=>!!n().current.filter&&Gz(n().current.filter)===z(a));Au(e,{get label(){return z(r)._label},get checked(){return z(t)},onSelect:()=>{n().current={...n().current,filter:z(i)}}})}}),U(e,t)};G(i,e=>{a()?e(c):e(l,-1)}),U(e,r)},$$slots:{default:!0}})}},l=A(()=>r()||Y(`filter`));Xl(e,{variant:`ghost`,get label(){return z(l)},get disabled(){return i()},popupPosition:`bottom-right`,popup:c,$$slots:{popup:!0}})}k()}var n5e=B(`<!> <!> <!> <!> <!>`,1);function r5e(e,t){O(t,!0);let n=J(t,`currentView`,7),r=J(t,`label`,3,``),i=J(t,`disabled`,3,!1),a=J(t,`noneLabel`,3,``),o=J(t,`groups`,19,()=>[]),s=J(t,`groupNames`,19,()=>[]),c=A(()=>mEe(s())),l=A(()=>z(c).some(e=>$z(n().current,e))),u=A(()=>z(c).some(e=>!$z(n().current,e)));{let s=e=>{{let r=A(()=>Y(`grouping_options`));Eu(e,{get ariaLabel(){return z(r)},get"aria-controls"(){return t[`aria-controls`]},children:(e,t)=>{var r=n5e(),i=P(r);{let e=A(()=>a()||Y(`sort_keys.none`)),t=A(()=>!n().current.group);Au(i,{get label(){return z(e)},get checked(){return z(t)},onSelect:()=>{n().current={...n().current,group:null}}})}var s=I(i,2);Bo(s,17,o,e=>Gz(Uz(e)),(e,t)=>{let r=A(()=>{let{label:e}=z(t);return{_label:e}}),i=A(()=>Uz(z(t))),a=A(()=>Gz(z(i)));{let t=A(()=>!!n().current.group&&Gz(n().current.group)===z(a));Au(e,{get label(){return z(r)._label},get checked(){return z(t)},onSelect:()=>{n().current={...n().current,group:z(i)}}})}});var d=I(s,2);mu(d,{});var f=I(d,2);{let e=A(()=>Y(`expand_all`)),t=A(()=>!z(l));Du(f,{get label(){return z(e)},get disabled(){return z(t)},onclick:()=>{n().current=nB(n().current,z(c),!1)}})}var p=I(f,2);{let e=A(()=>Y(`collapse_all`)),t=A(()=>!z(u));Du(p,{get label(){return z(e)},get disabled(){return z(t)},onclick:()=>{n().current=nB(n().current,z(c),!0)}})}U(e,r)},$$slots:{default:!0}})}},d=A(()=>r()||Y(`group`));Xl(e,{variant:`ghost`,get label(){return z(d)},get disabled(){return i()},popupPosition:`bottom-right`,popup:s,$$slots:{popup:!0}})}k()}var i5e=B(`<span role="none" class="svelte-1sd2xgz"> </span>`),a5e=B(`<div role="none" class="wrapper svelte-1sd2xgz"><!> <!></div>`),o5e={hash:`svelte-1sd2xgz`,code:`.wrapper.svelte-1sd2xgz {display:flex;align-items:center;gap:4px;margin-inline:20px;}span.svelte-1sd2xgz {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}`};function s5e(e,t){O(t,!0),K(e,o5e);let n=J(t,`selectedItems`,7),r=A(()=>t.allItems.length),i=A(()=>n().current.length),a=A(()=>!!z(i)),o=A(()=>z(a)&&z(i)===z(r));var s=a5e(),c=N(s);{let e=A(()=>!z(r)),i=A(()=>Y(`select_all`)),s=A(()=>z(a)&&!z(o)?`mixed`:z(a));Ql(c,{get disabled(){return z(e)},get ariaLabel(){return z(i)},get checked(){return z(s)},onChange:()=>{n().current=z(o)?[]:[...t.allItems]}})}var l=I(c,2),u=e=>{var t=i5e(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`x_of_x_selected`,{values:{total:z(r),selected:z(i)}})]),U(e,t)};G(l,e=>{z(a)&&e(u)}),D(s),U(e,s),k()}var c5e=B(`<!> <!>`,1);function l5e(e,t){O(t,!0);let n=J(t,`currentView`,7),r=J(t,`label`,3,``),i=J(t,`disabled`,3,!1),a=J(t,`sortKeys`,19,()=>[]),o=J(t,`collectionName`,3,void 0),s=({key:e,label:t,type:n},r)=>Y(`${r}${n===`date`||xEe.includes(e)||o()&&bM({collectionName:o(),keyPath:e})?.widget===`datetime`?`_date`:n===`number`?`_number`:``}`,{values:{label:t}});{let o=e=>{{let r=A(()=>Y(`sorting_options`));Eu(e,{get ariaLabel(){return z(r)},get"aria-controls"(){return t[`aria-controls`]},children:(e,t)=>{var r=H();Bo(P(r),17,a,e=>e.key,(e,t)=>{let r=A(()=>z(t));var i=c5e(),o=P(i);Bo(o,16,()=>bEe,e=>e,(e,i)=>{{let a=A(()=>s(z(t),i)),o=A(()=>n().current.sort?.key===z(r).key&&n().current.sort.order===i);Au(e,{get label(){return z(a)},get checked(){return z(o)},onSelect:()=>{n().current={...n().current,sort:{key:z(r).key,order:i}}}})}});var c=I(o,2),l=e=>{mu(e,{})};G(c,e=>{z(r).key===`_summary`&&a().length>1&&e(l)}),U(e,i)}),U(e,r)},$$slots:{default:!0}})}},c=A(()=>r()||Y(`sort`));Xl(e,{variant:`ghost`,get label(){return z(c)},get disabled(){return i()},popupPosition:`bottom-right`,popup:o,$$slots:{popup:!0}})}k()}var u5e=B(`<!> <!>`,1),d5e=B(`<!> <!> <!> <!> <!> <!> <!> <!>`,1);function f5e(e,t){O(t,!0);let n=J(t,`groups`,19,()=>[]),r=J(t,`groupNames`,19,()=>[]),i=J(t,`searchTerms`,7,void 0),a=A(()=>!!t.totalCount),o=A(()=>t.totalCount>1);{let s=A(()=>Y(`asset_list`));dO(e,{variant:`secondary`,get ariaLabel(){return z(s)},children:(e,s)=>{var c=d5e(),l=P(c),u=e=>{s5e(e,{get allItems(){return t.allItems},get selectedItems(){return t.selectedItems}})};G(l,e=>{iG.isSmallScreen||iG.isMediumScreen||e(u)});var d=I(l,2);$l(d,{flex:!0});var f=I(d,2),p=e=>{{let t=A(()=>Y(`assets_dialog.search_for_file`));Vu(e,{dir:`auto`,get flex(){return iG.isSmallScreen},get ariaLabel(){return z(t)},"aria-controls":`asset-list`,get value(){return i().current},set value(e){i().current=e}})}};G(f,e=>{i()&&e(p)});var m=I(f,2);{let e=A(()=>!z(o));l5e(m,{get disabled(){return z(e)},get currentView(){return DQ},get sortKeys(){return t.sortKeys},"aria-controls":`asset-list`})}var h=I(m,2);{let e=A(()=>Y(`type`)),t=A(()=>!z(o)),n=A(()=>Y(`all`)),r=A(()=>mDe.map(e=>({label:Y(e),field:`fileType`,pattern:e})));t5e(h,{get label(){return z(e)},get disabled(){return z(t)},get currentView(){return DQ},get noneLabel(){return z(n)},get filters(){return z(r)},"aria-controls":`asset-list`})}var g=I(h,2),_=e=>{{let t=A(()=>!z(o));r5e(e,{get disabled(){return z(t)},get currentView(){return DQ},get groups(){return n()},get groupNames(){return r()},"aria-controls":`asset-list`})}};G(g,e=>{n().length&&e(_)});var v=I(g,2);{let e=A(()=>!z(a));b3(v,{get disabled(){return z(e)},get currentView(){return DQ},"aria-controls":`asset-list`})}var y=I(v,2),b=e=>{var t=u5e(),n=P(t);mu(n,{orientation:`vertical`});var r=I(n,2);{let e=e=>{Xc(e,{name:`info`})},t=A(()=>!z(a)),n=A(()=>!!DQ.current.showInfo),i=A(()=>!!DQ.current.showInfo),o=A(()=>Y(DQ.current.showInfo?`hide_info`:`show_info`));Al(r,{variant:`ghost`,iconic:!0,get disabled(){return z(t)},get pressed(){return z(n)},"aria-controls":`asset-info`,get"aria-expanded"(){return z(i)},get"aria-label"(){return z(o)},onclick:()=>{DQ.current={...DQ.current,showInfo:!DQ.current.showInfo}},startIcon:e,$$slots:{startIcon:!0}})}U(e,t)};G(y,e=>{iG.isSmallScreen||iG.isMediumScreen||e(b)}),U(e,c)},$$slots:{default:!0}})}k()}var p5e,m5e=new Set([`$$slots`,`$$events`,`$$legacy`,`primaryToolbar`,`secondaryToolbar`,`mainContent`,`secondarySidebar`]),h5e=B(`<main><!> <div role="none" class="main-inner svelte-1x2ldab"><div role="none" class="main-inner-main svelte-1x2ldab"><!> <!></div> <!></div></main>`),g5e={hash:`svelte-1x2ldab`,code:`.wrapper.svelte-1x2ldab {flex:auto;display:flex;flex-direction:column;overflow:hidden;height:100%;background-color:var(--sui-primary-background-color);
@media (768px <= width) {view-transition-name:page-main;
}.sui.toolbar.primary {justify-content:center;
@media (width < 768px) {border-block-end:var(--area-border);background-color:var(--sui-secondary-background-color);
}}}
/* The area sits next to the primary sidebar and below the global toolbar */.resizable-pane > .wrapper.svelte-1x2ldab {border-block-start:var(--area-border);border-inline-start:var(--area-border);border-start-start-radius:16px;}.main-inner.svelte-1x2ldab {flex:auto;display:flex;overflow:hidden;.main-inner-main:where(.svelte-1x2ldab) {flex:auto;display:flex;flex-direction:column;overflow:hidden;}.secondary-sidebar {flex:none;overflow:auto;box-sizing:content-box;width:320px;background-color:var(--sui-secondary-background-color);
@media (768px <= width) {border-block-start:var(--area-border);border-inline-start:var(--area-border);border-start-start-radius:16px;
}[role='listbox'] {padding:12px;}}}`};function A5(e,t){O(t,!0),K(e,g5e);let n=J(t,`primaryToolbar`,3,void 0),r=J(t,`secondaryToolbar`,3,void 0),i=J(t,`mainContent`,3,void 0),a=J(t,`secondarySidebar`,3,void 0),o=ks(t,m5e),s={};L(()=>(p5e=s,ZQ.current=o[`aria-label`]??``,()=>{p5e===s&&(ZQ.current=``)}));var c=h5e();bs(c,()=>({class:`wrapper`,...o}),void 0,void 0,void 0,`svelte-1x2ldab`);var l=N(c);Go(l,()=>n()??kr);var u=I(l,2),d=N(u),f=N(d);Go(f,()=>r()??kr),Go(I(f,2),()=>i()??kr),D(d),Go(I(d,2),()=>a()??kr),D(u),D(c),U(e,c),k()}var _5e=e=>{A8e(e,{})},v5e=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),y5e=B(`<!> <!>`,1),b5e=B(`<!> <!> <!>`,1),x5e=B(`<!> <!> <!> <!> <!>`,1);function S5e(e,t){O(t,!0);let n=A(()=>aQ.current),r=A(()=>i1().max_file_size??1/0),i=j(void 0);L(()=>{let{files:e,originalAsset:t}=r1.current;e.length&&fo(async()=>{r1.current={files:[]},z(i)?.report(await DBe(e,{originalAsset:t}))})});var a=x5e(),o=P(a);{let e=e=>{V8e(e,{})},t=e=>{var t=H(),n=P(t),r=e=>{{let t=A(()=>Object.keys(j1.current));f5e(e,{get allItems(){return A1.current},get selectedItems(){return _Q},get totalCount(){return oQ.current.length},get sortKeys(){return LBe.current},get groups(){return UBe.current},get groupNames(){return z(t)},get searchTerms(){return SQ}})}};G(n,e=>{oQ.current?.length&&e(r)}),U(e,t)},r=e=>{var t=y5e(),n=P(t),r=e=>{var t=v5e(),n=P(t);Lo(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),jl(n.lastChild,{status:`warning`,dismissible:!1,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`external_assets_truncated`)]),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)};G(n,e=>{gQ.current&&e(r)}),x8e(I(n,2),{}),U(e,t)},i=e=>{{let t=(e,t=kr)=>{N6e(e,{get asset(){return t()}})},r=A(()=>sQ(z(n))&&oQ.current?_5e:void 0);$8e(e,{get asset(){return vQ.current},get fallback(){return z(r)},children:t,$$slots:{default:!0}})}},a=A(()=>Y(`x_asset_folder`,{values:{folder:z(n).serviceLabel}}));A5(o,{id:`assets-container`,get"aria-label"(){return z(a)},primaryToolbar:e,secondaryToolbar:t,mainContent:r,secondarySidebar:i,$$slots:{primaryToolbar:!0,secondaryToolbar:!0,mainContent:!0,secondarySidebar:!0}})}var s=I(o,2);X8e(s,{});var c=I(s,2),l=e=>{var t=b5e(),n=P(t);j8e(n,{});var r=I(n,2);Z8e(r,{}),S8e(I(r,2),{}),U(e,t)},u=A(()=>sQ(z(n)));G(c,e=>{z(u)&&e(l)});var d=I(c,2);Xu(d,{get show(){return n1.current.show},set show(e){n1.current.show=e},children:(e,t)=>{el(e,{get status(){return n1.current.status},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(n1.current.message)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Ds(C$(I(d,2),{get maxSize(){return z(r)}}),e=>M(i,e,!0),()=>z(i)),U(e,a),k()}var j5=pk(null),M5=pk(``),C5e=/^\/search\/(?<terms>.+)$/,N5=e=>C5e.test(e),w5e=e=>{let{groups:t}=e.match(C5e)??{};if(!t)return!1;let{terms:n}=t;return n&&n!==M5.current&&(M5.current=n),j5.current||=`contents`,!0},T5e=/^\/assets(?:\/(?<folderPath>.+?)(?:\/(?<fileName>[^/]+\.[A-Za-z0-9]+))?)?$/,E5e=e=>iH.current.some(({internalPath:t})=>t===e)||[...pH.current,...SH.current].some(t=>t.path.startsWith(`${e}/`)),P5=0,D5e=()=>Jc.current&&oH.current?jQ(oH.current):``,F5=()=>({folder:oH.current}),O5e=({path:e},{transitionType:t=`forwards`,replaceState:n=!1}={})=>{o$(IP(`/assets/${e}`),{transitionType:t,replaceState:n,state:F5()})},k5e=()=>{P5+=1},A5e=(e,t,n)=>{let r=$Re(t);return oH.current=void 0,r?(aQ.current!==r&&(nze(),aQ.current=r),n?(bQ.current=n,OQ.current=!0,XQ.current=Y(`viewing_x_asset_details`,{values:{name:n.split(`/`).pop()}})):(bQ.current=void 0,OQ.current=!1,XQ.current=Y(`viewing_x_external_location`,{values:{service:r.serviceLabel}})),e):(aQ.current=void 0,OQ.current=!1,XQ.current=Y(`asset_folder_not_found`),{...e,notFound:!0})},j5e=e=>iG.isSmallScreen?(oH.current=void 0,OQ.current=!1,XQ.current=Y(`viewing_asset_folder_list`),{...e,isIndexPage:!0}):(iH.current.length?(oH.current=oU(`-/all`).folder,$H.current=``,o$(`/assets/-/all`,{replaceState:!0})):o$(tQ(eQ.current[0]??$Z),{replaceState:!0}),e),M5e=async e=>{await pl(100),e===P5&&(OQ.current=!1,XQ.current=Y(`viewing_x_asset_folder`,{values:{folder:D5e(),count:NQ.current.length}}))},N5e=()=>{let{path:e}=$Q(),t=e.match(T5e),n={isIndexPage:!1,isSearchPage:!1,notFound:!1};P5+=1;let r=P5;if(!t?.groups)return OQ.current=!1,{...n,isSearchPage:w5e(e)};let{folderPath:i,fileName:a}=t.groups;if(i?.startsWith(`-/`)&&i!==`-/all`){let[e,...t]=i.slice(2).split(`/`);return A5e(n,e,[...t,...a?[a]:[]].join(`/`))}if(aQ.current=void 0,!i)return j5e(n);if(!a&&i.includes(`/`)&&pH.current.some(e=>e.path===i)){let e=i.lastIndexOf(`/`);a=i.slice(e+1),i=i.slice(0,e)}if(a){let e=`${i}/${a}`;!pH.current.some(t=>t.path===e)&&E5e(e)&&(i=e,a=void 0)}let{folder:o,subfolderPath:s=``}=oU(i,window.history.state?.folder)??{};return!o&&!a?(oH.current=void 0,$H.current=``,OQ.current=!1,XQ.current=Y(`asset_folder_not_found`),{...n,notFound:!0}):(o?((0,yr.default)(oH.current,o)||(oH.current=o),$H.current=s):(oH.current=void 0,$H.current=``),a?(_H.current=pH.current.find(e=>e.path===`${i}/${a}`),XQ.current=_H.current?Y(`viewing_x_asset_details`,{values:{name:_H.current.name}}):Y(`file_not_found`),OQ.current=!0,n):(M5e(r),n))};function P5e(e,t){O(t,!0);let n=e=>{hH.current=iJ(hH.current,t.asset,e)};{let r=A(()=>mze.current.get(t.asset.path)??-1),i=A(()=>rOe.current.has(t.asset.path)),a=A(()=>uV(t.asset));r8e(e,{get name(){return t.asset.name},get kind(){return t.asset.kind},get asset(){return t.asset},get rowIndex(){return z(r)},get viewType(){return t.viewType},get selected(){return z(i)},get canPreview(){return z(a)},onSelectionChange:n,onFocus:()=>{gH.current=t.asset,eU.current=void 0},onPreview:()=>{O5e(t.asset)}})}k()}function F5e(e,t){O(t,!0);let n=()=>{o$(IP(`/assets/${t.subfolder.path}`),{transitionType:`forwards`,state:{folder:oH.current}})};{let r=A(()=>!(iG.isSmallScreen||iG.isMediumScreen)),i=A(()=>dH.current||!!oH.current?.readonly||KV(t.subfolder.path));h8e(e,{get subfolder(){return t.subfolder},get rowIndex(){return t.rowIndex},get viewType(){return t.viewType},get hasCheckboxColumn(){return z(r)},onOpen:n,onFocus:()=>{eU.current=t.subfolder,gH.current=void 0},onRename:()=>{tU.current=t.subfolder},onDelete:()=>{nU.current=t.subfolder},get actionsDisabled(){return z(i)}})}k()}function I5e(e,t){O(t,!0);let n=J(t,`label`,3,void 0),r=A(()=>dH.current||!uH(sH.current)||cU.current);_8e(e,{get label(){return n()},get disabled(){return z(r)},onclick:()=>{kQ.current=!0}}),k()}function L5e(e,t){O(t,!0);let n=A(()=>DQ.current.type),r=A(()=>sH.current),i=A(()=>PQ.current.length),a=A(()=>dH.current||!uH(z(r))||cU.current);{let t=e=>{var t=H();Bo(P(t),19,()=>PQ.current,e=>e.path,(e,t,r)=>{F5e(e,{get subfolder(){return z(t)},get rowIndex(){return z(r)},get viewType(){return z(n)}})}),U(e,t)},o=(e,t=kr)=>{var r=H();Io(P(r),()=>t().sha,e=>{P5e(e,{get asset(){return t()},get viewType(){return z(n)}})}),U(e,r)},s=e=>{{let t=A(()=>Y(`upload_assets`));I5e(e,{get label(){return z(t)}})}},c=A(()=>z(i)+NQ.current.length),l=A(()=>!!z(i));Z6e(e,{get groups(){return RQ.current},itemKey:`path`,get totalCount(){return z(c)},get viewType(){return z(n)},get uploadDisabled(){return z(a)},get hasSubfolders(){return z(l)},onDrop:e=>{vH.current={folder:z(r),subfolderPath:$H.current,files:e}},onBlankClick:()=>{gH.current=void 0,eU.current=void 0},subfolders:t,renderItem:o,emptyAction:s,$$slots:{subfolders:!0,renderItem:!0,emptyAction:!0}})}k()}var R5e=B(`<!> <!>`,1);function z5e(e,t){O(t,!0);let n=j(!1),r=j(!1),i=j(void 0),a=A(()=>nU.current),o=A(()=>z(a)?.name??``),s=A(()=>z(a)?u3(z(a).path):[]),c=A(()=>!!z(i)?.blockers.length),l=async()=>{if(!z(a))return;let{ok:e,cancelled:t}=await Y4(()=>uWe(z(a).path));!e&&!t&&M(r,!0)};L(()=>{if(!z(a))return;let e=z(s);M(i,void 0),M(n,!0),W4(e).then(e=>{nU.current===z(a)&&M(i,e,!0)})});var u=R5e(),d=P(u);{let e=A(()=>Y(`delete_folder`)),t=A(()=>Y(`delete`)),r=A(()=>!z(i)||z(c));ru(d,{get title(){return z(e)},get okLabel(){return z(t)},get okDisabled(){return z(r)},onOk:()=>{l()},onClose:()=>{nU.current=void 0},get open(){return z(n)},set open(e){M(n,e,!0)},children:(e,t)=>{var n=R5e(),r=P(n),a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`confirm_deleting_folder`,{values:{name:z(o),count:z(s).length}})]),U(e,t)};G(r,e=>{z(c)||e(a)});var l=I(r,2),u=e=>{x5(e,{get plan(){return z(i)},kind:`asset`,get count(){return z(s).length}})};G(l,e=>{z(i)&&e(u)}),U(e,n)},$$slots:{default:!0}})}Xu(I(d,2),{get show(){return z(r)},set show(e){M(r,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`deleting_folder_failed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,u),k()}var B5e=new Map,I5={publicURL:void 0,repoBlobURL:void 0,dimensions:void 0,duration:void 0,usedEntries:[]},V5e=async e=>{let{kind:t}=e;if(!cV(t))return{};let n=await FX(e);return n?VRe(e,n,t):{}},H5e=e=>{let{sha:t}=e;return t?LA(B5e,t,()=>V5e(e)):V5e(e)},L5=async e=>{let{path:t}=e,{blobBaseURL:n}=OY.current?.repository??{};return{...await H5e(e),publicURL:KX(e),repoBlobURL:n?`${n}/${IP(t)}`:void 0}},U5e=async e=>{let{url:t}=I1(e);if(t)return HZ(t);let[n]=await WZ([{asset:e}]);return n};function W5e(e,t){O(t,!0);let n=J(t,`assets`,19,()=>[]),r=J(t,`useButton`,3,!0),i=j(ta([])),a=j(!1),o=A(()=>z(i).filter(({publicURL:e})=>!!e).map(({publicURL:e})=>e)),s,c=A(()=>[{label:Y(`public_urls`,{values:{count:n().length}}),disabled:!z(o).length,copy:async()=>{await navigator.clipboard.writeText(z(o).join(`
`))},toastKey:`asset_urls_copied`},{label:Y(`file_paths`,{values:{count:n().length}}),copy:async()=>{await navigator.clipboard.writeText(n().map(({path:e})=>`/${e}`).join(`
`))},toastKey:`asset_paths_copied`},{label:Y(`file_data`),disabled:!z(a),copy:async()=>{await s6e(s)},toastKey:`asset_data_copied`}]);yk(()=>{let e=n();return M(i,[],!0),s=void 0,M(a,!1),Promise.all([Promise.all(e.map(L5)),e.length===1?PX(e[0]).catch(()=>void 0):void 0])},([e,t])=>{M(i,e,!0),s=t,M(a,!!t&&a6e(t.type),!0)},e=>{console.error(e)}),i6e(e,{get items(){return z(c)},get count(){return n().length},get useButton(){return r()}}),k()}var G5e=B(`<!> <!>`,1);function K5e(e,t){O(t,!0);let n=J(t,`extraItems`,3,void 0),r=j(ta({...I5})),i=A(()=>z(r).publicURL),a=A(()=>z(r).repoBlobURL);yk(()=>{let e=t.asset;return M(r,{...I5},!0),e?L5(e):Promise.resolve({...I5})},e=>{M(r,e,!0)},e=>{console.error(e)});{let r=e=>{var t=G5e(),n=P(t);{let e=A(()=>Y(`view_on_live_site`)),t=A(()=>!z(i));Du(n,{get label(){return z(e)},get disabled(){return z(t)},onclick:()=>{FV(z(i))}})}var r=I(n,2),o=e=>{{let t=A(()=>!OY.current?.repository||!z(a)),n=A(()=>OY.current?.repository?.label?Y(`view_on_x`,{values:{service:OY.current.repository.label}}):Y(`view_in_repository`));Du(e,{get disabled(){return z(t)},get label(){return z(n)},onclick:()=>{FV(`${z(a)}?plain=1`)}})}};G(r,e=>{IG.devModeEnabled&&e(o)}),U(e,t)},o=A(()=>dH.current||!!t.asset&&fH([t.asset])),s=A(()=>!!t.asset&&vDe(t.asset)),c=A(()=>!!t.asset),l=A(()=>!!t.asset);d6e(e,{get readOnly(){return z(o)},get canEdit(){return z(s)},get canRename(){return z(c)},get canReplace(){return z(l)},onEdit:()=>{yH.current=t.asset},onRename:()=>{bH.current=t.asset},onReplace:()=>{vH.current={folder:void 0,files:[],originalAssets:[t.asset]},kQ.current=!0},get extraItems(){return n()},moreItems:r,$$slots:{moreItems:!0}})}k()}var q5e=B(`<a dir="ltr" target="_blank" rel="noopener noreferrer"> </a>`),J5e=B(`<a dir="ltr"> </a>`),Y5e=B(`<bdi dir="ltr"> </bdi>`),R5=B(`<section><h4> </h4> <p> </p></section>`),X5e=B(`<section><h4> </h4> <!></section>`),Z5e=B(`<!> <section><h4> </h4> <p><!></p></section> <section><h4> </h4> <p><!></p></section> <!> <!> <!> <!> <!>`,1);function Q5e(e,t){O(t,!0);let n=e=>{{let n=A(()=>z(s)===`image`),r=A(()=>[`audio`,`video`].includes(z(s)));u$(e,{get kind(){return z(s)},get asset(){return t.asset},variant:`tile`,get checkerboard(){return z(n)},get controls(){return z(r)}})}},r=J(t,`showPreview`,3,!1),i=j(ta({...I5})),a=A(()=>t.asset.path),o=A(()=>t.asset.size),s=A(()=>t.asset.kind),c=A(()=>t.asset.commitAuthor),l=A(()=>t.asset.commitDate),u=A(()=>z(i).publicURL),d=A(()=>z(i).repoBlobURL),f=A(()=>z(i).dimensions),p=A(()=>z(i).duration),m=A(()=>z(i).createdDate),h=A(()=>z(i).coordinates),g=A(()=>z(i).usedEntries),_=A(()=>cV(z(s))||oV(z(a))),v=IR(),y=async()=>{let e=t.asset,n=v.next();M(i,{...I5,usedEntries:void 0},!0);try{let t=e?await L5(e):{...I5};if(!n())return;M(i,t,!0),z(i).usedEntries=e?await U5e(e):[]}catch(e){console.error(e),n()&&(z(i).usedEntries=[])}};L(()=>{t.asset,y()});{let t=A(()=>r()&&z(_)?n:void 0);T5(e,{get preview(){return z(t)},children:(e,t)=>{var n=Z5e(),r=P(n);v6e(r,{get fileName(){return z(a)},get kind(){return z(s)},get size(){return z(o)},get hasDimensions(){return z(_)},get dimensions(){return z(f)},get duration(){return z(p)}});var i=I(r,2),v=N(i),y=F(v,!0),b=I(v,2),x=N(b),S=e=>{var t=q5e(),n=F(t,!0);R(()=>{q(t,`href`,z(u)),W(n,z(u)),t.dir=t.dir}),U(e,t)},C=e=>{U(e,V(`–`))};G(x,e=>{z(u)?e(S):e(C,-1)}),D(b),D(i);var w=I(i,2),T=N(w),ee=F(T,!0),te=I(T,2),ne=N(te),re=e=>{var t=J5e(),n=F(t);R(()=>{q(t,`href`,z(d)),W(n,`/${z(a)??``}`),t.dir=t.dir}),U(e,t)},ie=e=>{var t=Y5e(),n=F(t);R(()=>{W(n,`/${z(a)??``}`),t.dir=t.dir}),U(e,t)};G(ne,e=>{z(d)?e(re):e(ie,-1)}),D(te),D(w);var ae=I(w,2);D6e(ae,{get entries(){return z(g)}});var oe=I(ae,2),se=e=>{var t=R5(),n=N(t),r=F(n,!0),i=F(I(n,2),!0);D(t),R((e,t)=>{W(r,e),W(i,t)},[()=>Y(`sort_keys.commit_author`),()=>wz(z(c))]),U(e,t)};G(oe,e=>{z(c)&&e(se)});var ce=I(oe,2),le=e=>{var t=R5(),n=N(t),r=F(n,!0),i=F(I(n,2),!0);D(t),R((e,t)=>{W(r,e),W(i,t)},[()=>Y(`sort_keys.commit_date`),()=>gP(z(l),Jc.current)]),U(e,t)};G(ce,e=>{z(l)&&e(le)});var ue=I(ce,2),de=e=>{var t=R5(),n=N(t),r=F(n,!0),i=F(I(n,2),!0);D(t),R((e,t)=>{W(r,e),W(i,t)},[()=>Y(`created_date`),()=>gP(z(m),Jc.current)]),U(e,t)};G(ue,e=>{z(m)&&e(de)});var fe=I(ue,2),pe=e=>{var t=X5e(),n=N(t),r=F(n,!0);rZe(I(n,2),{get coordinates(){return z(h)}}),D(t),R(e=>W(r,e),[()=>Y(`location`)]),U(e,t)};G(fe,e=>{z(h)&&e(pe)}),R((e,t)=>{W(y,e),W(ee,t)},[()=>Y(`public_urls`,{values:{count:1}}),()=>Y(`file_paths`,{values:{count:1}})]),U(e,n)},$$slots:{default:!0}})}k()}var $5e=B(`<!> <!> <!>`,1),e7e=B(`<iframe sandbox="allow-scripts"></iframe>`),t7e=B(`<span role="alert"> </span>`),n7e=B(`<!> <!>`,1);function r7e(e,t){O(t,!0);let n=j(void 0),r=j(!1),i=A(()=>_H.current),a=A(()=>z(n)?.asset===z(i)?z(n)?.blob:void 0),o=A(()=>z(i)?.kind),s=A(()=>z(i)?.blobURL),c=A(()=>z(i)?.name??``),l=A(()=>z(i)?[z(i)]:[]),u=A(()=>IP(`/assets/${sU.current??oH.current?.internalPath??`-/all`}`)),d=A(()=>FQ(Object.values(RQ.current).flat(1).filter(e=>e.path===z(i)?.path||uV(e)),e=>e.path===z(i)?.path)),f=A(()=>z(d).previous),p=A(()=>z(d).next),m=(e,t)=>{O5e(e,{replaceState:!0,transitionType:t})};L(()=>{let e=[z(f),z(p)].filter(e=>e?.kind===`image`),t=z(i)?[z(i)]:[];fo(()=>qX(e,{keep:t}))}),Ms(()=>{qX([])}),L(()=>{let e=z(i);e&&(async()=>{let t=await PX(e);_H.current===e&&M(n,{asset:e,blob:t})})()});var h=n7e(),g=P(h);{let e=(e,t=kr)=>{var n=$5e(),i=P(n);W5e(i,{get assets(){return z(l)},get useButton(){return t()}});var a=I(i,2);w5(a,{get assets(){return z(l)},getName:e=>e.name,get getBlob(){return PX},get useButton(){return t()}});var o=I(a,2);{let e=A(()=>dH.current||fH(z(l))),n=A(()=>Y(`delete_assets`,{values:{count:1}})),i=A(()=>Y(`confirm_deleting_this_asset`));S5(o,{get assets(){return z(l)},get disabled(){return z(e)},deleteAssets:async e=>{let{ok:t,cancelled:n}=await Y4(()=>o3(e));return!t&&!n&&M(r,!0),t},get planDeletion(){return W4},get buttonDescription(){return z(n)},get dialogDescription(){return z(i)},onDelete:()=>{s$(z(u),{returnTo:N5,state:F5()})},get useButton(){return t()}})}U(e,n)},t=(e,t=kr)=>{K5e(e,{get asset(){return z(i)},get extraItems(){return t()}})},n=e=>{var t=H(),n=P(t),r=e=>{{let t=A(()=>Y(`file_not_found`));E5(e,{get message(){return z(t)},get backPath(){return z(u)}})}},l=e=>{{let t=A(()=>[`image`,`video`].includes(z(o))),n=A(()=>z(o)===`image`),r=A(()=>z(o)===`image`?z(c):void 0),a=A(()=>[`audio`,`video`].includes(z(o)));u$(e,{get kind(){return z(o)},get asset(){return z(i)},get blurBackground(){return z(t)},get checkerboard(){return z(n)},get alt(){return z(r)},get controls(){return z(a)},loading:`eager`,dissolve:!1,holdTransition:!0})}},d=A(()=>z(o)&&cV(z(o))),f=e=>{var t=e7e();R(()=>{q(t,`src`,z(s)),q(t,`title`,z(c))}),U(e,t)},p=e=>{var t=H();Fo(P(t),()=>z(i).text??z(a).text(),null,(e,t)=>{L6e(e,{get text(){return z(t)},get name(){return z(c)}})}),U(e,t)},m=A(()=>z(a)?.type&&Hk(z(a).type)),h=e=>{VO(e,{children:(e,t)=>{var n=t7e(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`preview_unavailable`)]),U(e,n)},$$slots:{default:!0}})};G(n,e=>{z(i)?z(d)?e(l,1):z(a)?.type===`application/pdf`?e(f,2):z(m)?e(p,3):e(h,-1):e(r)}),U(e,t)},d=e=>{var t=H(),n=P(t),r=e=>{Q5e(e,{get asset(){return z(i)}})};G(n,e=>{z(i)&&e(r)}),U(e,t)},h=A(()=>z(i)?.sha),_=A(()=>z(f)?()=>m(z(f),`previous`):void 0),v=A(()=>z(p)?()=>m(z(p),`next`):void 0);t6e(g,{get title(){return z(c)},get contentKey(){return z(h)},onBack:()=>{s$(z(u),{returnTo:N5,state:F5()})},get onPrevious(){return z(_)},get onNext(){return z(v)},actions:e,editOptions:t,preview:n,info:d,$$slots:{actions:!0,editOptions:!0,preview:!0,info:!0}})}Xu(I(g,2),{get show(){return z(r)},set show(e){M(r,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`deleting_assets_failed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,h),k()}var i7e=e=>{let{files:t,originalAssets:n,replaceDuplicates:r=!1}=e,{slugify_filename:i=!1}=JH().config,a=hU(e),o=a===void 0?[]:yX(a),s=o.map(e=>e.name.normalize()),c=[];return t.map((e,t)=>{let l=n?.[t]??(r?o.find(t=>{let n=t.name.normalize().toLowerCase();return n===e.name.normalize().toLowerCase()&&!c.some(e=>e.toLowerCase()===n)}):void 0),u=l?.name??YB(e.name,{slugificationEnabled:i,assetNamesInSameFolder:s});return s.includes(u)||s.push(u),c.push(u.normalize()),{action:l?`update`:`create`,name:u,path:l?.path??UP([a,u]),file:e}})},a7e=({count:e})=>{J$(e=>e.path),q$.current={...G$,saved:!0,published:X8.current&&!Z8.current,count:e}},o7e=async(e,t)=>{let{files:n,folder:r}=e,i=i7e(e);JV(i.map(({path:e})=>e));let a=i.map(({name:e,path:t,file:n})=>({name:e,path:t,size:n.size,kind:pV(e),folder:r}));await a3({changes:i.map(({action:e,path:t,file:n})=>({action:e,path:t,data:n})),savingAssets:a,options:t}),a7e({count:n.length})},s7e=B(`<div role="none"><!></div>`),c7e=B(`<!> <!>`,1),l7e={hash:`svelte-1olui47`,code:`.wrapper.svelte-1olui47 {display:contents;textarea {min-height:40dvh;max-height:80dvh;font-family:var(--sui-font-family-monospace);font-size:var(--sui-font-size-monospace);text-wrap:nowrap;resize:vertical;}&.wrap textarea {text-wrap:wrap;}}`};function u7e(e,t){O(t,!0),K(e,l7e);let n=A(()=>yH.current),r=j(!1),i=j(void 0),a=j(void 0),o=j(void 0),s=j(!1),c=!1,l=j(!1),u=async()=>{M(i,await PX(z(n)),!0),M(a,await z(i).text(),!0),M(o,z(a),!0),M(r,!0)},d=()=>{yH.current=void 0,M(i,void 0),M(a,void 0),M(o,void 0)},f=async()=>{if(!z(n)||!z(i)||typeof z(o)!=`string`)return;c=!0;let{folder:e,name:t}=z(n),a=z(o),{type:s}=z(i),{ok:u,cancelled:f}=await Y4(()=>o7e({folder:e,files:[new File([a],t,{type:s})],originalAssets:[z(n)]},{commitType:`uploadMedia`}));c=!1,!u&&(f||M(l,!0),OQ.current)?M(r,!0):d()},p=A(()=>Y(`edit_x`,{values:{name:z(n)?.name??``}}));L(()=>{z(n)&&z(i)===void 0&&u()}),L(()=>{OQ.current||M(r,!1)});var m=c7e(),h=P(m);{let e=e=>{{let t=A(()=>Y(`wrap_long_lines`));Uu(e,{get label(){return z(t)},get checked(){return z(s)},set checked(e){M(s,e,!0)}})}},t=A(()=>Y(`save`)),n=A(()=>z(o)===z(a));tu(h,{size:`x-large`,get title(){return z(p)},get okLabel(){return z(t)},get okDisabled(){return z(n)},okShortcuts:`Accel+S`,onOk:()=>{f()},onClose:()=>{c||d()},get open(){return z(r)},set open(e){M(r,e,!0)},footerExtra:e,children:(e,t)=>{var n=s7e();let r;pO(N(n),{dir:`auto`,flex:!0,get value(){return z(o)},set value(e){M(o,e,!0)}}),D(n),R(()=>r=os(n,1,`wrapper svelte-1olui47`,null,r,{wrap:z(s)})),U(e,n)},$$slots:{footerExtra:!0,default:!0}})}Xu(I(h,2),{get show(){return z(l)},set show(e){M(l,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`saving_asset_failed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,m),k()}function d7e(e,t){O(t,!0);let n=A(()=>lze.current);k8e(e,{get name(){return z(n).name},get path(){return z(n).path},get folderCount(){return z(n).folderCount},get assetCount(){return z(n).assetCount}}),k()}function f7e(e,t){O(t,!0);let n=A(()=>uU({subfolders:PQ.current,fileNames:NQ.current.map(({name:e})=>e),dirPath:sU.current}));{let t=A(()=>sU.current??``);f3(e,{get dirPath(){return z(t)},get takenNames(){return z(n)},get open(){return AQ.current},set open(e){AQ.current=e}})}k()}function p7e(e,t){O(t,!0);let n=A(()=>oH.current),r=A(()=>dH.current||!uH(z(n))||cU.current);var i=H(),a=P(i),o=e=>{M8e(e,{get disabled(){return z(r)},onclick:()=>{AQ.current=!0}})},s=A(()=>rU(z(n)));G(a,e=>{z(s)&&e(o)}),U(e,i),k()}var m7e=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),h7e=B(`<!> <!> <!> <!> <!>`,1),g7e=B(`<!> <!>`,1),_7e=B(`<!> <!> <!>`,1);function v7e(e,t){O(t,!0);let n=j(!1),r=A(()=>oH.current),i=A(()=>Jc.current&&z(r)?jQ(z(r)):``),a=A(()=>$H.current?$H.current.split(`/`):[]),o=A(()=>gH.current),s=A(()=>iOe.current),c=A(()=>!!z(r)?.readonly||!!YV.current),l=A(()=>dH.current||!uH(sH.current)||cU.current),u=(e,t)=>{let n=IP(`/assets/${UP([z(r)?.internalPath,...z(a).slice(0,e)])}`),i={transitionType:`backwards`,state:{folder:z(r)}};t?s$(n,i):o$(n,i)};var d=_7e(),f=P(d),p=e=>{var t=m7e(),n=P(t);Lo(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),jl(n.lastChild,{dismissible:!1,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>B1(`asset_folder`,{folder:z(r)})]),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)};G(f,e=>{z(c)&&e(p)});var m=I(f,2);R8e(m,{get rootLabel(){return z(i)},get subfolderNames(){return z(a)},onBrowse:u,actions:e=>{var t=h7e(),r=P(t);{let e=A(()=>z(o)?IP(`/assets/${z(o).path}`):void 0),t=A(()=>!z(o)||!uV(z(o))),n=A(F5);P8e(r,{get path(){return z(e)},get disabled(){return z(t)},get state(){return z(n)}})}var i=I(r,2);{let e=A(()=>z(o)?[z(o)]:[]);W5e(i,{get assets(){return z(e)}})}var a=I(i,2);w5(a,{get assets(){return z(s)},getName:e=>e.name,get getBlob(){return PX}});var c=I(a,2);{let e=A(()=>dH.current||fH(z(s))),t=A(()=>Y(`delete_selected_assets`,{values:{count:z(s).length}})),r=A(()=>Y(z(s).length>1&&z(s).length===NQ.current.length?`confirm_deleting_all_assets`:`confirm_deleting_selected_assets`,{values:{count:z(s).length}}));S5(c,{get assets(){return z(s)},get disabled(){return z(e)},deleteAssets:async e=>{let{ok:t,cancelled:r}=await Y4(()=>o3(e));!t&&!r&&M(n,!0)},get planDeletion(){return W4},get buttonDescription(){return z(t)},get dialogDescription(){return z(r)}})}K5e(I(c,2),{get asset(){return z(o)}}),U(e,t)},fab:e=>{var t=g7e(),n=P(t);p7e(n,{});var r=I(n,2),i=e=>{{let t=A(()=>iG.isSmallScreen?void 0:Y(`upload`));I5e(e,{get label(){return z(t)}})}};G(r,e=>{(!iG.isSmallScreen||NQ.current.length&&!z(l))&&e(i)}),U(e,t)},$$slots:{actions:!0,fab:!0}}),Xu(I(m,2),{get show(){return z(n)},set show(e){M(n,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`deleting_assets_failed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,d),k()}var y7e=B(`<!> <!>`,1);function b7e(e,t){O(t,!0);let n=j(!1),r=j(!1),i=j(ta([])),a=A(()=>bH.current),o=A(()=>z(i).filter(e=>P4(e))),s=A(()=>z(o).length?Y(`cannot_move_referenced_asset`,{values:{entries:z(o).map(e=>F4(e)).join(`, `)}}):void 0),c=A(()=>Uk(z(a)?.path??``)),l=A(()=>Mr(z(c).dirname,``)),u=A(()=>Mr(z(c).basename,``)),d=A(()=>z(a)?yX(z(l)).map(e=>e.name).filter(e=>e!==z(a).name):[]),f=A(()=>z(a)?BOe(z(l)):[]),p=async e=>{if(!z(a))return;let t=z(a).path,n=`${z(l)}/${e}`,{ok:i,cancelled:o}=await Y4(()=>c3(`rename`,[{asset:z(a),path:n}]));i?$Q().path===`/assets/${t}`&&await o$(IP(`/assets/${n}`),{replaceState:!0,notifyChange:!1,state:F5()}):o||M(r,!0)};yk(()=>z(a)?U5e(z(a)):void 0,e=>{M(i,e,!0),M(n,!0)});var m=y7e(),h=P(m);{let e=A(()=>JH().config.slugify_filename);Y8e(h,{get name(){return z(u)},get otherNames(){return z(d)},get folderNames(){return z(f)},get usedEntryCount(){return z(i).length},get blockedMessage(){return z(s)},get slugificationEnabled(){return z(e)},onRename:p,onClose:()=>{bH.current=void 0},get open(){return z(n)},set open(e){M(n,e,!0)}})}Xu(I(h,2),{get show(){return z(r)},set show(e){M(r,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`renaming_asset_failed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,m),k()}var x7e=B(`<!> <!> <!>`,1);function S7e(e,t){O(t,!0);let n=j(!1),r=j(!1),i=A(()=>tU.current),a=A(()=>!!z(i)),o=A(()=>z(i)?.name??``),s=A(()=>z(i)?u3(z(i).path).length:0),c=A(()=>uU({subfolders:PQ.current,fileNames:NQ.current.map(({name:e})=>e),exclude:z(o),dirPath:sU.current})),l=async e=>{if(!z(i))return;let{path:t}=z(i);M(n,!0);let{ok:a,cancelled:o}=await Y4(()=>lWe({dirPath:t,newDirPath:UP([WP(t),e])}));M(n,!1),!a&&!o&&M(r,!0)};var u=x7e(),d=P(u);{let e=A(()=>Y(`rename_x`,{values:{name:z(o)}})),t=A(()=>Y(`rename`)),n=A(()=>Y(`enter_new_name_for_folder`,{values:{count:z(s)}}));wU(d,{get title(){return z(e)},get okLabel(){return z(t)},get description(){return z(n)},get name(){return z(o)},get takenNames(){return z(c)},onSubmit:e=>{l(e)},onClose:()=>{tU.current=void 0},get open(){return z(a)},set open(e){M(a,e)}})}var f=I(d,2);Xu(f,{get show(){return z(n)},duration:0,children:(e,t)=>{el(e,{status:`info`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`renaming_folder`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Xu(I(f,2),{get show(){return z(r)},set show(e){M(r,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`renaming_folder_failed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,u),k()}var z5=void 0,C7e=e=>{let t=!!M5.current,{path:n}=$Q(),r=N5(n);M5.current=e,e?(r||(z5=n),o$(`/search/${encodeURIComponent(e)}`,{replaceState:r})):t&&r&&(s$(z5??(j5.current===`assets`?`/assets`:`/collections`)),z5=void 0)},w7e=()=>{if(N5($Q().path))return;let e=window.history.state?.from;e&&N5($Q(e).path)||(z5=void 0,M5.current&&=``)},T7e=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),E7e=B(`<div role="none" class="wrapper svelte-lav5fn"><!></div>`),D7e={hash:`svelte-lav5fn`,code:`.wrapper.svelte-lav5fn {display:contents;--sui-textbox-border-width: 0;}`};function B5(e,t){O(t,!0),K(e,D7e);let n=J(t,`onclick`,3,void 0),r=j(``);L(()=>{let e=M5.current;fo(()=>{e!==z(r).trim()&&M(r,e,!0)})});var i=E7e();yo(`hashchange`,ia,()=>{w7e()});var a=N(i),o=e=>{var t=T7e(),i=P(t);{let e=A(()=>Y(`search_placeholder_${j5.current}`)),t=A(()=>Y(`search_placeholder_${j5.current}`));Lo(i,()=>({"--sui-textbox-placeholder-text-align":`center`})),Vu(i.lastChild,{debounce:!0,keyShortcuts:`Accel+F`,get placeholder(){return z(e)},get"aria-label"(){return z(t)},get onclick(){return n()},oninput:({target:e})=>{C7e(e.value.trim())},onClear:()=>{C7e(``)},get value(){return z(r)},set value(e){M(r,e,!0)}}),D(i)}U(e,t)};G(a,e=>{j5.current&&e(o)}),D(i),U(e,i),k()}var O7e=B(`<header><h2> </h2></header> <!>`,1),V5=B(`<span class="count"> </span>`),k7e=B(`<!> <!>`,1),A7e=B(`<!> <!>`,1),j7e=B(`<nav class="primary-sidebar"><!> <!></nav>`);function M7e(e,t){O(t,!0);let n=J(t,`isSearchPage`,3,!1),r=e=>Jc.current?jQ(e):``,i=A(()=>[...iH.current.filter(({typedKeyPath:e,isAssetCollection:t})=>!t&&e===void 0).sort((e,t)=>Ej(e.collectionName,e.fileName)-Ej(t.collectionName,t.fileName)).sort((e,t)=>mj(e.collectionName)-mj(t.collectionName)),...iH.current.filter(({isAssetCollection:e})=>e)]),a=e=>z(i)[e].collectionName===void 0&&z(i)[e+1]?.collectionName!==void 0||!z(i)[e].isAssetCollection&&!!z(i)[e+1]?.isAssetCollection;var o=j7e(),s=N(o),c=e=>{var t=O7e(),n=P(t),r=F(N(n),!0);D(n),B5(I(n,2),{onclick:e=>{e.preventDefault(),o$(`/search`)}}),R(e=>W(r,e),[()=>Y(`assets`)]),U(e,t)};G(s,e=>{iG.isSmallScreen&&e(c)});var l=I(s,2);{let e=A(()=>Y(`asset_folder_list`));Cu(l,{get ariaLabel(){return z(e)},"aria-controls":`assets-container`,children:(e,t)=>{var o=k7e(),s=P(o),c=e=>{{let t=A(()=>Y(`asset_location.repository`));wu(e,{get label(){return z(t)},children:(e,t)=>{var o=H();Bo(P(o),19,()=>z(i),e=>tOe(e),(e,t,i)=>{var o=k7e(),s=P(o);Fo(s,pl,null,e=>{let i=A(()=>z(t)),a=A(()=>z(i).collectionName?fj(z(i).collectionName):void 0),o=A(()=>z(a)&&z(i).fileName?xj(z(a),z(i).fileName):void 0),s=A(()=>!uH(z(t))),c=A(()=>(0,yr.default)(oH.current,z(t)));{let l=e=>{{let n=A(()=>z(t).icon||z(o)?.icon||z(a)?.icon||`folder`);Xc(e,{get name(){return z(n)}})}},u=e=>{var n=H();Io(P(n),()=>pH.current,e=>{var n=H();Fo(P(n),pl,null,e=>{let n=A(()=>(z(i).internalPath===void 0?pH.current:mLe(z(t))).length);var r=V5(),a=F(r,!0);R((e,t)=>{q(r,`aria-label`,`(${e??``})`),W(a,t)},[()=>Y(`x_assets`,{values:{count:z(n)}}),()=>b5.current.format(z(n))]),U(e,r)}),U(e,n)}),U(e,n)},d=A(()=>iG.isSmallScreen||n()?!1:z(c)),f=A(()=>r(z(t)));Tu(e,{get selected(){return z(d)},get label(){return z(f)},onSelect:()=>{o$(IP(`/assets/${z(i).internalPath??`-/all`}`),{transitionType:`forwards`,state:{folder:z(t)}})},onclick:()=>{z(c)&&$H.current&&o$(IP(`/assets/${z(i).internalPath}`),{transitionType:`backwards`,state:{folder:z(t)}})},ondragover:e=>{e.preventDefault(),!z(s)&&(z(i).internalPath===void 0||z(c)?e.dataTransfer.dropEffect=`none`:(e.dataTransfer.dropEffect=`move`,e.target.classList.add(`dragover`)))},ondragleave:e=>{e.preventDefault(),!z(s)&&e.target.classList.remove(`dragover`)},ondragend:e=>{e.preventDefault(),!z(s)&&e.target.classList.remove(`dragover`)},ondrop:e=>{e.preventDefault(),!z(s)&&e.target.classList.remove(`dragover`)},startIcon:l,endIcon:u,$$slots:{startIcon:!0,endIcon:!0}})}});var c=I(s,2),l=e=>{mu(e,{})},u=A(()=>a(z(i)));G(c,e=>{z(u)&&e(l)}),U(e,o)}),U(e,o)},$$slots:{default:!0}})}};G(s,e=>{z(i).length&&e(c)});var l=I(s,2),u=e=>{{let t=A(()=>Y(`asset_location.external`));wu(e,{get label(){return z(t)},children:(e,t)=>{let r=A(()=>QZ.current.length);var i=A7e(),a=P(i);Bo(a,17,()=>eQ.current,e=>e.serviceId,(e,t)=>{let r=A(()=>z(t)),i=A(()=>mQ.current[z(r).serviceId]);{let a=e=>{Xc(e,{name:`cloud`})},o=e=>{var t=H(),n=P(t),r=e=>{var t=V5(),n=F(t,!0);R((e,r)=>{q(t,`aria-label`,`(${e??``})`),W(n,r)},[()=>Y(`x_assets`,{values:{count:z(i)}}),()=>b5.current.format(z(i))]),U(e,t)};G(n,e=>{z(i)!==void 0&&e(r)}),U(e,t)},s=A(()=>iG.isSmallScreen||n()?!1:aQ.current?.serviceId===z(r).serviceId);Tu(e,{get selected(){return z(s)},get label(){return z(r).serviceLabel},onSelect:()=>{o$(tQ(z(t)),{transitionType:`forwards`})},startIcon:a,endIcon:o,$$slots:{startIcon:!0,endIcon:!0}})}});var o=I(a,2);{let e=e=>{Xc(e,{name:`link_2`})},t=e=>{var t=V5(),n=F(t,!0);R((e,r)=>{q(t,`aria-label`,`(${e??``})`),W(n,r)},[()=>Y(`x_assets`,{values:{count:z(r)}}),()=>b5.current.format(z(r))]),U(e,t)},i=A(()=>iG.isSmallScreen||n()?!1:aQ.current?.serviceId===$Z.serviceId);Tu(o,{get selected(){return z(i)},get label(){return $Z.serviceLabel},onSelect:()=>{o$(tQ($Z),{transitionType:`forwards`})},startIcon:e,endIcon:t,$$slots:{startIcon:!0,endIcon:!0}})}U(e,i)},$$slots:{default:!0}})}};G(l,e=>{(eQ.current.length||QZ.current.length)&&e(u)}),U(e,o)},$$slots:{default:!0}})}D(o),R(e=>q(o,`aria-label`,e),[()=>Y(`assets`)]),U(e,o),k()}var H5,U5=()=>{let e=OY.current?.repository,t=e?.databaseName;if(!t)H5=void 0;else return H5?.databaseName!==t&&(H5={databaseName:t,db:Vz(e,`ui-settings`)}),H5.db},N7e=async e=>{try{let t=(await U5()?.get(e))?.sidebarWidth;if(typeof t==`number`&&Number.isFinite(t))return t}catch{}return 240},P7e=async(e,t)=>{let n=U5();if(n)try{await n.set(e,{...await n.get(e),sidebarWidth:t})}catch{}},F7e=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`uiSettingsKey`,`primarySidebar`,`main`]),I7e=B(`<!> <!>`,1),L7e=B(`<!> <!> <!>`,1),R7e=B(`<div><!></div>`),z7e={hash:`svelte-1kkfo1f`,code:`.outer.svelte-1kkfo1f {flex:auto;display:flex;overflow:hidden;&[inert] {display:none;}.primary-sidebar {display:flex;flex-direction:column;flex:none;overflow-y:auto;height:100%;
@media (width < 768px) {flex:auto;width:auto;background-color:var(--sui-primary-background-color);
}
/* Mobile header */header {display:flex;align-items:center;justify-content:space-between;padding:0 10px;height:var(--sui-primary-toolbar-size);h2 {padding:0 10px;font-size:var(--sui-font-size-x-large);}}.sui.search-bar {margin-inline:12px;--sui-textbox-background-color: var(--sui-tertiary-background-color);}[role='radiogroup'] {width:100%;}[role='listbox'] {margin:8px;border-width:0;background-color:transparent;button {display:flex;justify-content:flex-start;border-radius:var(--sui-control-medium-border-radius);width:100%;text-align:start;
@media (pointer: coarse) {height:48px;
}&:not(:first-child) {margin-top:4px;}&:not(:focus) {border-color:transparent;}span {flex:none;}.label {flex:auto;overflow:hidden;}.icon {transition:color 200ms;}.icon.check {display:none;}.count {padding:2px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-small);transition:color 200ms;}}[role='option'][aria-selected='true'] {color:var(--sui-highlight-foreground-color);background-color:var(--sui-selected-background-color);.count {color:var(--sui-highlighted-foreground-color);}}[role='option'].dragover {color:var(--sui-primary-accent-color-inverted) !important;background-color:var(--sui-primary-accent-color) !important;}}
/* Styled like the listbox above, so the two sidebars look alike */[role='tree'] {margin:8px;border-width:0;background-color:transparent;
/* No item can expand, so the space kept for the chevrons is dropped */&.flat .chevron.placeholder {display:none;}[role='treeitem'] {> .row {border-radius:var(--sui-control-medium-border-radius);
@media (pointer: coarse) {min-height:48px;
}.icon {flex:none;transition:color 200ms;}.count {flex:none;padding:2px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-small);transition:color 200ms;}}&[aria-selected='true'] > .row .count {color:var(--sui-highlighted-foreground-color);}&.dragover > .row {color:var(--sui-primary-accent-color-inverted) !important;background-color:var(--sui-primary-accent-color) !important;}}}.sui.divider {margin:8px 0;}}}`};function W5(e,t){O(t,!0),K(e,z7e);let n=J(t,`class`,3,``),r=J(t,`uiSettingsKey`,3,void 0),i=J(t,`primarySidebar`,3,void 0),a=J(t,`main`,3,void 0),o=ks(t,F7e),s=j(void 0),c=j(void 0),l=async()=>{r()&&M(c,await N7e(r()),!0)},u=async e=>{let{clientWidth:t}=z(s);await P7e(r(),Math.round(e/100*t))};Sa(()=>{JQ.current,window.requestAnimationFrame(()=>{JQ.current||l()})});var d=R7e();bs(d,()=>({role:`group`,id:`page-container`,class:`outer ${n()??``}`,inert:JQ.current,...o}),void 0,void 0,void 0,`svelte-1kkfo1f`);var f=N(d),p=e=>{var t=I7e(),n=P(t);Go(n,()=>i()??kr),Go(I(n,2),()=>a()??kr),U(e,t)},m=e=>{Lu(e,{onResize:({sizes:e})=>{u(e[0])},children:(e,t)=>{var n=L7e(),r=P(n);Ru(r,{get defaultSize(){return`${z(c)??``}px`},minSize:`160px`,maxSize:`480px`,children:(e,t)=>{var n=H();Go(P(n),i),U(e,n)},$$slots:{default:!0}});var o=I(r,2);Iu(o,{}),Ru(I(o,2),{children:(e,t)=>{var n=H();Go(P(n),a),U(e,n)},$$slots:{default:!0}}),U(e,n)},$$slots:{default:!0}})};G(f,e=>{iG.isSmallScreen||!i()||!a()?e(p):z(c)!==void 0&&e(m,1)}),D(d),Ds(d,e=>M(s,e),()=>z(s)),U(e,d),k()}var B7e=B(`<bdi> </bdi>`),V7e=B(`<div role="none" class="label"><!></div>`),H7e=B(`<!> <!> <!>`,1);function U7e(e,t){O(t,!0);let n=A(()=>t.asset.path),r=A(()=>t.asset.name),i=A(()=>t.asset.folder),a=A(()=>t.asset.kind);Su(e,{onclick:()=>{o$(IP(`/assets/${z(n)}`),{transitionType:`forwards`})},children:(e,n)=>{var o=H7e(),s=P(o);bu(s,{class:`image`,children:(e,n)=>{u$(e,{get kind(){return z(a)},get asset(){return t.asset},variant:`icon`,cover:!0})},$$slots:{default:!0}});var c=I(s,2);bu(c,{class:`collection`,children:(e,t)=>{var n=H();Io(P(n),()=>Jc.current,e=>{var t=B7e(),n=F(t,!0);R(e=>W(n,e),[()=>jQ(z(i))]),U(e,t)}),U(e,n)},$$slots:{default:!0}}),bu(I(c,2),{class:`title`,children:(e,t)=>{var n=V7e();fl(N(n),{lines:2,children:(e,t)=>{var n=B7e(),i=F(n,!0);R(()=>W(i,z(r))),U(e,n)},$$slots:{default:!0}}),D(n),U(e,n)},$$slots:{default:!0}}),U(e,o)},$$slots:{default:!0}}),k()}var W7e=({assets:e,terms:t})=>{let n=S1(t);return!e.length||!n.length?[]:e.filter(e=>C1({value:e.name,tokens:n,normalizedValueCache:v1(e)}))},G5=hk(()=>W7e({assets:mH.current,terms:M5.current})),G7e=B(`<span role="none"> </span>`),K7e=B(`<div role="none"><!></div>`);function q7e(e,t){O(t,!0),L(()=>{XQ.current=Y(`viewing_asset_search_results`,{values:{terms:M5.current,count:G5.current.length}})}),HO(e,{"aria-labelledby":`search-results-assets`,children:(e,t)=>{var n=K7e(),r=N(n),i=e=>{{let t=A(()=>Y(`assets`));k5(e,{viewType:`list`,get"aria-label"(){return z(t)},get"aria-rowcount"(){return G5.current.length},children:(e,t)=>{var n=H();Io(P(n),()=>M5.current,e=>{zu(e,{get items(){return G5.current},itemKey:`path`,renderItem:(e,t=kr)=>{U7e(e,{get asset(){return t()}})},$$slots:{renderItem:!0}})}),U(e,n)},$$slots:{default:!0}})}},a=e=>{VO(e,{children:(e,t)=>{var n=G7e(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`no_files_found`)]),U(e,n)},$$slots:{default:!0}})};G(r,e=>{G5.current.length?e(i):M5.current&&e(a,1)}),D(n),U(e,n)},$$slots:{default:!0}}),k()}function K5(e,t){O(t,!0);let n=j(void 0);L(()=>fUe(t.collection,t.entry,e=>{M(n,e,!0)}));var r=H(),i=P(r),a=e=>{h$(e,{get src(){return z(n)},get variant(){return t.variant},cover:!0})};G(i,e=>{z(n)&&e(a)}),U(e,r),k()}var J7e=B(`<bdi> </bdi>`),Y7e=B(`<bdi><!></bdi>`),X7e=B(`<div role="none" class="label"><!></div>`),Z7e=B(`<!> <!> <!>`,1);function Q7e(e,t){O(t,!0);let n=(e,t)=>{let n=()=>(t?.()).collection,s=()=>(t?.()).collectionFile;Su(e,{onclick:()=>{o$(IP(`/collections/${n().name}/entries/${s()?.name||z(o)}`),{state:{highlight:{locale:z(i),keyPath:z(a)}},transitionType:`forwards`})},children:(e,t)=>{var i=Z7e(),a=P(i);bu(a,{class:`image`,children:(e,t)=>{var i=H(),a=P(i),o=e=>{K5(e,{get collection(){return n()},get entry(){return z(r)},variant:`icon`})};G(a,e=>{n()._type===`entry`&&e(o)}),U(e,i)},$$slots:{default:!0}});var o=I(a,2);bu(o,{class:`collection`,children:(e,t)=>{var r=H();Io(P(r),()=>Jc.current,e=>{var t=J7e(),r=F(t,!0);R(e=>W(r,e),[()=>pj(n())]),U(e,t)}),U(e,r)},$$slots:{default:!0}}),bu(I(o,2),{class:`title`,children:(e,t)=>{var i=X7e();fl(N(i),{lines:2,children:(e,t)=>{var i=Y7e(),a=N(i),o=e=>{var t=V();R(e=>W(t,e),[()=>Cj(s())]),U(e,t)},c=e=>{var t=H();Io(P(t),()=>Jc.current,e=>{var t=H();Wo(P(t),()=>jz(n(),z(r),{useTemplate:!0,allowMarkdown:!0})),U(e,t)}),U(e,t)};G(a,e=>{s()?e(o):e(c,-1)}),D(i),U(e,i)},$$slots:{default:!0}}),D(i),U(e,i)},$$slots:{default:!0}}),U(e,i)},$$slots:{default:!0}})},r=A(()=>t.result.entry),i=A(()=>t.result.locale),a=A(()=>t.result.keyPath),o=A(()=>z(r).subPath);var s=H();Bo(P(s),17,()=>$R(z(r)),e=>e.name,(e,t)=>{var i=H();Fo(P(i),pl,null,e=>{var i=H();Bo(P(i),17,()=>wj(z(t),z(r)),e=>e.name,(e,r)=>{var i=H();Fo(P(i),pl,null,e=>{n(e,()=>({collection:z(t),collectionFile:z(r)}))}),U(e,i)},e=>{n(e,()=>({collection:z(t)}))}),U(e,i)}),U(e,i)}),U(e,s),k()}var $7e=({entry:e,terms:t,normalizedValueCache:n=void 0})=>{let r=0,i,a,o=$R(e);if(!o.length)return{entry:e,points:0,locale:i,keyPath:a};o.forEach(i=>{x1({value:i.label||i.name,terms:t,normalizedValueCache:n})&&(r+=10),r+=wj(i,e).filter(e=>x1({value:e.label||e.name,terms:t,normalizedValueCache:n})).length});let s=jz(o[0],e,{useTemplate:!0}),c=v1(e);return x1({value:s,terms:t,normalizedValueCache:c})&&(r+=10),Object.entries(e.locales).forEach(([e,{content:n}])=>{r+=Object.entries(n).filter(([n,r])=>{let o=typeof r==`string`&&!!r&&x1({value:r,terms:t,normalizedValueCache:c})||typeof r==`number`&&x1({value:String(r),terms:t,normalizedValueCache:c});return o&&!i&&!a&&(i=e,a=n),o}).length}),{entry:e,points:r,locale:i,keyPath:a}},e9e=({entries:e,terms:t})=>{if(t=y1(t),!e.length||!t)return[];let n=new Map;return e.map(e=>$7e({entry:e,terms:t,normalizedValueCache:n})).filter(({points:e})=>e>0).sort((e,t)=>t.points-e.points)},q5=hk(()=>e9e({entries:aX(vj.current,VY.current),terms:M5.current})),t9e=B(`<span role="none"> </span>`),n9e=B(`<div role="none"><!></div>`);function r9e(e,t){O(t,!0),L(()=>{XQ.current=Y(`viewing_entry_search_results`,{values:{terms:M5.current,count:q5.current.length}})}),HO(e,{"aria-labelledby":`search-results-entries`,children:(e,t)=>{var n=n9e(),r=N(n),i=e=>{{let t=A(()=>Y(`entries`));k5(e,{viewType:`list`,get"aria-label"(){return z(t)},get"aria-rowcount"(){return q5.current.length},children:(e,t)=>{var n=H();Io(P(n),()=>M5.current,e=>{zu(e,{get items(){return q5.current},itemKey:`id`,renderItem:(e,t=kr)=>{Q7e(e,{get result(){return t()}})},$$slots:{renderItem:!0}})}),U(e,n)},$$slots:{default:!0}})}},a=e=>{VO(e,{children:(e,t)=>{var n=t9e(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`no_entries_found`)]),U(e,n)},$$slots:{default:!0}})};G(r,e=>{q5.current.length?e(i):M5.current&&e(a,1)}),D(n),U(e,n)},$$slots:{default:!0}}),k()}var i9e=B(`<h2 role="none"> </h2>`),a9e=B(`<div role="none" class="wrapper svelte-1p7vfqa"><!> <div role="none" class="results svelte-1p7vfqa"><!> <!></div></div>`),o9e={hash:`svelte-1p7vfqa`,code:`.wrapper.svelte-1p7vfqa {flex:auto;display:flex;flex-direction:column;overflow:hidden;width:100%;background-color:var(--sui-primary-background-color);}.results.svelte-1p7vfqa {flex:auto;overflow:auto;& > .sui.group {display:contents;& > .inner > div {display:contents;}}h3 {flex:none;margin:16px;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-large);& + div {overflow:auto;flex:auto;}
@media (width < 768px) {display:none;
}}}`};function s9e(e,t){O(t,!0),K(e,o9e);var n=a9e(),r=N(n),i=e=>{dO(e,{variant:`primary`,children:(e,t)=>{var n=i9e(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`search_results`)]),U(e,n)},$$slots:{default:!0}})};G(r,e=>{iG.isSmallScreen||e(i)});var a=I(r,2),o=N(a),s=e=>{r9e(e,{})};G(o,e=>{j5.current===`contents`&&e(s)});var c=I(o,2),l=e=>{q7e(e,{})};G(c,e=>{j5.current===`assets`&&e(l)}),D(a),D(n),U(e,n),k()}var c9e=B(`<!> <div role="search" class="svelte-1476at1"><!></div>`,1),l9e={hash:`svelte-1476at1`,code:`[role='search'].svelte-1476at1 {display:contents;.sui.search-bar {flex:auto;}}`};function J5(e,t){O(t,!0),K(e,l9e),A5(e,{primaryToolbar:e=>{var t=H(),n=P(t),r=e=>{dO(e,{variant:`primary`,children:(e,t)=>{var n=c9e(),r=P(n);{let e=A(()=>Y(j5.current===`assets`?`back_to_asset_folder_list`:`back_to_collection_list`));C5(r,{get"aria-label"(){return z(e)},onclick:()=>{M5.current=``,o$(j5.current===`assets`?`/assets`:`/collections`,{transitionType:`backwards`})}})}var i=I(r,2);B5(N(i),{}),D(i),U(e,n)},$$slots:{default:!0}})};G(n,e=>{iG.isSmallScreen&&e(r)}),U(e,t)},mainContent:e=>{s9e(e,{})},$$slots:{primaryToolbar:!0,mainContent:!0}}),k()}var u9e=hk(()=>{let{current:e}=pH,t=[`name`];return e.every(e=>!!e.commitAuthor)&&t.push(`commit_author`),e.every(e=>!!e.commitDate)&&t.push(`commit_date`),t.map(e=>({key:e,label:Y(`sort_keys.${e}`)}))}),d9e=B(`<!> <!> <!> <!> <!> <!> <!>`,1);function f9e(e,t){O(t,!0);let n=j(!1),r=j(!1),i=j(!1),a=A(D5e),o=()=>{(e=>{M(n,e.isIndexPage,!0),M(r,e.isSearchPage,!0),M(i,e.notFound,!0)})(N5e())};L(()=>{let e=aQ.current;e&&e.authType!==`widget`&&wQ(e)&&(e.serviceId===`linked`&&QZ.current,fo(()=>{p1(e)}))}),js(()=>(o(),()=>{k5e(),OQ.current=!1}));var s=d9e();yo(`hashchange`,ia,e=>{a$(e,o,T5e)});var c=P(s);{let e=e=>{var t=H(),i=P(t),a=e=>{M7e(e,{get isSearchPage(){return z(r)}})};G(i,e=>{(!iG.isSmallScreen||z(n))&&e(a)}),U(e,t)},t=e=>{var t=H(),o=P(t),s=e=>{J5(e,{})},c=e=>{{let t=e=>{{let t=A(()=>Y(`asset_folder_not_found`));E5(e,{get message(){return z(t)},backPath:`/assets`})}},n=A(()=>Y(`asset_library`));A5(e,{get"aria-label"(){return z(n)},mainContent:t,$$slots:{mainContent:!0}})}},l=e=>{S5e(e,{})},u=e=>{{let t=e=>{v7e(e,{})},n=e=>{var t=H(),n=P(t),r=e=>{{let t=A(()=>Object.values(RQ.current).flat(1));f5e(e,{get allItems(){return z(t)},get selectedItems(){return hH},get totalCount(){return NQ.current.length},get sortKeys(){return u9e.current}})}};G(n,e=>{NQ.current.length&&e(r)}),U(e,t)},r=e=>{L5e(e,{})},i=e=>{$8e(e,{get asset(){return gH.current},children:(e,t=kr)=>{Q5e(e,{get asset(){return t()},showPreview:!0})},fallback:e=>{d7e(e,{})},$$slots:{default:!0,fallback:!0}})},o=A(()=>Y(`x_asset_folder`,{values:{folder:z(a)}}));A5(e,{id:`assets-container`,get"aria-label"(){return z(o)},primaryToolbar:t,secondaryToolbar:n,mainContent:r,secondarySidebar:i,$$slots:{primaryToolbar:!0,secondaryToolbar:!0,mainContent:!0,secondarySidebar:!0}})}};G(o,e=>{z(r)?e(s):z(i)?e(c,1):aQ.current?e(l,2):iG.isSmallScreen&&z(n)||e(u,3)}),U(e,t)},o=A(()=>Y(`asset_library`));W5(c,{uiSettingsKey:`assets-page`,get"aria-label"(){return z(o)},primarySidebar:e,main:t,$$slots:{primarySidebar:!0,main:!0}})}var l=I(c,2),u=e=>{var t=H(),n=P(t),r=e=>{V6e(e,{})},i=e=>{r7e(e,{})};G(n,e=>{aQ.current?e(r):e(i,-1)}),U(e,t)};G(l,e=>{OQ.current&&e(u)});var d=I(l,2);u7e(d,{});var f=I(d,2);b7e(f,{});var p=I(f,2);f7e(p,{});var m=I(p,2);S7e(m,{}),z5e(I(m,2),{}),U(e,s),k()}var p9e=B(`<iframe id="cloudinary-iframe" allow="camera; storage-access" sandbox="allow-same-origin allow-scripts allow-popups allow-forms
allow-storage-access-by-user-activation" class="svelte-1y1y5aq"></iframe>`),m9e={hash:`svelte-1y1y5aq`,code:`iframe.svelte-1y1y5aq {display:block;width:calc(100% - 32px);height:calc(100% - 32px);border:none;}
/* Avoid scrolling issue https://github.com/sveltia/sveltia-cms/issues/824 */dialog[inert] > iframe.svelte-1y1y5aq {display:none;}`};function h9e(e,t){O(t,!0),K(e,m9e);let n=j(``),r=j(``);js(()=>{let e=NDe();if(!e)return;let{cloud_name:t,api_key:i}=e.config??{};if(!t||!i)return;M(r,window.crypto.randomUUID(),!0);let a=new URLSearchParams({...Object.fromEntries(Object.entries(e.config).filter(([e])=>jDe.includes(e))),ml_id:z(r),pmHost:window.location.origin,new_cms:`true`});M(n,`https://console.cloudinary.com/console/media_library/cms?${a}`)});var i=H(),a=P(i),o=e=>{Dl(e,{keepContent:!0,get open(){return AV.current},set open(e){AV.current=e},children:(e,t)=>{var i=p9e();R(e=>{q(i,`src`,z(n)),q(i,`title`,e),q(i,`data-ml-id`,z(r))},[()=>Y(`cloud_storage.cloudinary.iframe_title`)]),U(e,i)},$$slots:{default:!0}})};G(a,e=>{z(n)&&e(o)}),U(e,i),k()}var g9e=B(`<!> <!> <!> <!> <!> <!> <!>`,1);function _9e(e,t){O(t,!0);var n=g9e(),r=P(n);Xu(r,{get show(){return q$.current.saved},set show(e){q$.current.saved=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(q$.current.published?`assets_saved_and_published`:`assets_saved`,{values:{count:q$.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var i=I(r,2);Xu(i,{get show(){return q$.current.moved},set show(e){q$.current.moved=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`assets_moved`,{values:{count:q$.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var a=I(i,2);Xu(a,{get show(){return q$.current.renamed},set show(e){q$.current.renamed=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`assets_renamed`,{values:{count:q$.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var o=I(a,2);Xu(o,{get show(){return q$.current.folderCreated},set show(e){q$.current.folderCreated=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`folder_created`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var s=I(o,2);Xu(s,{get show(){return q$.current.folderRenamed},set show(e){q$.current.folderRenamed=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`folder_renamed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var c=I(s,2);Xu(c,{get show(){return q$.current.folderDeleted},set show(e){q$.current.folderDeleted=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`folder_deleted`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Xu(I(c,2),{get show(){return q$.current.deleted},set show(e){q$.current.deleted=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`assets_deleted`,{values:{count:q$.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,n),k()}var v9e=B(`<div role="status"> </div>`),y9e=B(`<div role="group" class="section uploading svelte-96nj3d"><div role="none"><!></div> <!></div>`),b9e=B(`<div role="group" class="section oversized svelte-96nj3d"><!> <!></div>`),x9e=B(`<div role="group" class="section invalid svelte-96nj3d"><!> <!></div>`),S9e=B(`<div role="group" class="section mismatched svelte-96nj3d"><!> <!></div>`),C9e=B(`<!> <!>`,1),w9e=B(`<div role="group" class="section svelte-96nj3d"> <!></div>`),T9e=B(`<!> <!> <!> <!> <!> <!>`,1),E9e=B(`<!> <!> <!>`,1),D9e={hash:`svelte-96nj3d`,code:`.section.svelte-96nj3d {display:flex;flex-direction:column;gap:12px;&:not(:first-child) {margin-top:16px;}& > * {flex:none;}&.oversized .files,
&.invalid .files,
&.mismatched .files {opacity:0.5;}}`};function O9e(e,t){O(t,!0),K(e,D9e);let n=j(!1),r=j(!1),i=A(()=>vH.current),a=A(()=>z(i).files),o=A(()=>z(i).folder),s=A(()=>z(i).subfolderPath),c=A(()=>z(i).originalAssets),l=A(()=>z(c)?.[0]),u=A(()=>t1.current),d=A(()=>z(u).processing),f=A(()=>z(u).validFiles),p=A(()=>z(u).oversizedFiles),m=A(()=>z(u).invalidFiles),h=A(()=>z(u).transformedFileMap),g=A(()=>JH().config),_=A(()=>z(g).max_file_size),v=A(()=>hU(vH.current)),y=A(()=>z(l)||z(v)===void 0?[]:yX(z(v))),b=A(()=>z(l)?z(f).filter(e=>!HP(Uk(e.name).extension,Uk(z(l).name).extension)):[]),x=A(()=>z(f).filter(e=>!z(b).includes(e))),S=A(()=>z(x)),C=A(()=>(z(x),!0)),w=A(()=>bX(z(S),z(y))),T=A(()=>z(w).length);L(()=>{OQ.current||(vH.current={folder:void 0,files:[]})});var ee=E9e(),te=P(ee);{let e=A(()=>Y(z(l)?`replace_asset`:`upload_assets`)),t=A(()=>Y(z(l)?`replace`:`upload`)),i=A(()=>!z(S).length);ru(te,{get open(){return cze.current},get title(){return z(e)},get okLabel(){return z(t)},get okDisabled(){return z(i)},onOk:async()=>{let e=z(l)?{files:z(S),folder:z(o),originalAssets:z(c)}:{files:z(S),folder:z(o),subfolderPath:z(s),replaceDuplicates:z(C)};vH.current={folder:void 0,files:[]},M(n,!0);let{ok:t,cancelled:i}=await Y4(()=>o7e(e,{commitType:`uploadMedia`}));M(n,!1),!t&&!i&&M(r,!0)},onCancel:()=>{vH.current={folder:void 0,files:[]}},children:(e,t)=>{var n=T9e(),r=P(n),i=e=>{var t=v9e(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`processing_files`,{values:{count:z(a).length}})]),U(e,t)};G(r,e=>{z(d)&&e(i)});var o=I(r,2),s=e=>{var t=y9e(),n=N(t),r=N(n),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`confirm_replacing_file`,{values:{name:z(l).name}})]),U(e,t)},a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`confirm_uploading_files`,{values:{count:z(S).length,folder:`/${z(v)}`}})]),U(e,t)};G(r,e=>{z(l)?e(i):e(a,-1)}),D(n),y$(I(n,2),{get transformedFileMap(){return z(h)},get files(){return z(S)},set files(e){M(S,e)}}),D(t),R(e=>q(t,`aria-label`,e),[()=>Y(`uploading_files`)]),U(e,t)};G(o,e=>{z(S).length&&e(s)});var c=I(o,2),u=e=>{var t=b9e(),n=N(t);el(n,{status:`warning`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`warning_oversized_files`,{values:{count:z(p).length,size:_$(z(_))}})]),U(e,n)},$$slots:{default:!0}}),y$(I(n,2),{get files(){return z(p)},get transformedFileMap(){return z(h)},removable:!1}),D(t),R(e=>q(t,`aria-label`,e),[()=>Y(`oversized_files`)]),U(e,t)};G(c,e=>{z(p).length&&e(u)});var f=I(c,2),g=e=>{var t=x9e(),n=N(t);el(n,{status:`warning`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`warning_invalid_files`,{values:{count:z(m).length}})]),U(e,n)},$$slots:{default:!0}}),y$(I(n,2),{get files(){return z(m)},removable:!1,showThumbnail:!1}),D(t),R(e=>q(t,`aria-label`,e),[()=>Y(`invalid_files`)]),U(e,t)};G(f,e=>{z(m).length&&e(g)});var y=I(f,2),x=e=>{var t=S9e(),n=N(t);el(n,{status:`warning`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`warning_mismatched_files`,{values:{count:z(b).length,name:z(l)?.name}})]),U(e,n)},$$slots:{default:!0}}),y$(I(n,2),{get files(){return z(b)},get transformedFileMap(){return z(h)},removable:!1}),D(t),R(e=>q(t,`aria-label`,e),[()=>Y(`mismatched_files`)]),U(e,t)};G(y,e=>{z(b).length&&e(x)});var w=I(y,2),ee=e=>{var t=w9e(),n=N(t),r=I(n);{let e=A(()=>Y(`file_name_conflict_resolution`));ju(r,{get ariaLabel(){return z(e)},onChange:({detail:e})=>{M(C,e.value===`replace`)},children:(e,t)=>{var n=C9e(),r=P(n);Mu(r,{value:`replace`,get checked(){return z(C)},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`replace`)]),U(e,n)},$$slots:{default:!0}});var i=I(r,2);{let e=A(()=>!z(C));Mu(i,{value:`keep`,get checked(){return z(e)},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`keep_both`)]),U(e,n)},$$slots:{default:!0}})}U(e,n)},$$slots:{default:!0}})}D(t),R(e=>W(n,`${e??``} `),[()=>Y(`file_name_conflict_confirmation`,{values:{count:z(T)}})]),U(e,t)};G(w,e=>{z(T)&&e(ee)}),U(e,n)},$$slots:{default:!0}})}var ne=I(te,2);Xu(ne,{get show(){return z(n)},duration:0,children:(e,t)=>{el(e,{status:`info`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`uploading_files_progress`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Xu(I(ne,2),{get show(){return z(r)},set show(e){M(r,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`uploading_files_failed`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,ee),k()}function k9e(e,t){O(t,!0);let n=j(void 0),r=A(()=>vH.current),i=A(()=>z(r).originalAssets),a=A(()=>z(i)?.[0]),o=A(()=>!z(a)),s=A(()=>z(a)?rV.getType(z(a).name)??void 0:void 0),c=e=>{e.length&&(vH.current=z(a)?{folder:z(a).folder,files:e,originalAssets:z(i)}:{folder:sH.current,subfolderPath:$H.current,files:e},kQ.current=!1)};L(()=>{!iG.hasMouse&&kQ.current&&z(n)?.open()}),L(()=>{OQ.current||(kQ.current=!1)}),L(()=>{kQ.current||fo(()=>{!vH.current.files.length&&vH.current.originalAssets&&(vH.current={folder:void 0,files:[]})})});var l=H(),u=P(l),d=e=>{{let t=A(()=>z(a)?Y(`replace_x`,{values:{name:z(a).name}}):Y(`upload_assets`));tu(e,{get title(){return z(t)},showOk:!1,get open(){return kQ.current},set open(e){kQ.current=e},children:(e,t)=>{b$(e,{showUploadButton:!0,get accept(){return z(s)},get multiple(){return z(o)},filterDroppedFiles:!1,onDrop:({files:e})=>{c(e)}})},$$slots:{default:!0}})}},f=e=>{Ds(_u(e,{get accept(){return z(s)},get multiple(){return z(o)},onSelect:({files:e})=>{c(e)},onCancel:()=>{kQ.current=!1}}),e=>M(n,e,!0),()=>z(n))};G(u,e=>{iG.hasMouse?e(d):e(f,-1)}),U(e,l),k()}var A9e=B(`<div role="blockquote" class="svelte-2picl5"><pre class="svelte-2picl5"> </pre></div>`),j9e={hash:`svelte-2picl5`,code:`div.svelte-2picl5 {flex:auto;overflow:auto;}pre.svelte-2picl5 {margin:0;padding:16px;width:100%;min-width:fit-content;min-height:-moz-available;min-height:-webkit-fill-available;min-height:stretch;background-color:var(--sui-primary-background-color);}`};function M9e(e,t){O(t,!0),K(e,j9e);{let t=e=>{var t=A9e(),n=F(N(t),!0);D(t),R((e,r)=>{q(t,`aria-label`,e),W(n,r)},[()=>Y(`cms_config`),()=>UL(Ck)]),U(e,t)},n=A(()=>Y(`site_configuration_editor`));W5(e,{get"aria-label"(){return z(n)},main:t,$$slots:{main:!0}})}k()}var N9e=B(`<!> <!> <!> <!>`,1);function P9e(e,t){O(t,!0);let n=A(()=>new Date),r=A(()=>i8.current),i=A(()=>z(r).resolve),a=A(()=>z(r).timestamp),o=A(()=>z(n).getUTCFullYear()===z(a)?.getUTCFullYear()),s=A(()=>z(o)&&z(n).getUTCMonth()===z(a)?.getUTCMonth()),c=A(()=>z(s)&&z(n).getUTCDate()===z(a)?.getUTCDate()),l=A(()=>z(a)?.toLocaleString(Jc.current,{year:z(o)?void 0:`numeric`,month:z(c)?void 0:`short`,day:z(c)?void 0:`numeric`,hour:`numeric`,minute:`numeric`}));L(()=>{!zQ.current&&i8.current.show&&(i8.current.show=!1,z(i)?.())});var u=N9e(),d=P(u);{let e=A(()=>Y(`restore_backup_title`)),t=A(()=>Y(`restore`)),n=A(()=>Y(`discard`));ru(d,{get title(){return z(e)},get okLabel(){return z(t)},get cancelLabel(){return z(n)},onOk:()=>{z(i)?.(!0)},onCancel:()=>{z(i)?.(!1)},get open(){return i8.current.show},set open(e){i8.current.show=e},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`restore_backup_description`,{values:{datetime:z(l)}})]),U(e,n)},$$slots:{default:!0}})}var f=I(d,2);Xu(f,{get show(){return a8.current.saved},set show(e){a8.current.saved=e},children:(e,t)=>{el(e,{status:`info`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`draft_backup_saved`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var p=I(f,2);Xu(p,{get show(){return a8.current.restored},set show(e){a8.current.restored=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`draft_backup_restored`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Xu(I(p,2),{get show(){return a8.current.deleted},set show(e){a8.current.deleted=e},children:(e,t)=>{el(e,{status:`info`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`draft_backup_deleted`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,u),k()}var F9e=({collectionName:e,fileName:t})=>ok.get(t??e),I9e=({lang:e,dir:t,styleURLs:n,origin:r})=>`
<!DOCTYPE html>
<html${e?` lang="${gA(e)}"`:``}${t?` dir="${t}"`:``}>
<head>
<meta charset="UTF-8">
<base href="${gA(r)}" target="_blank">
${n.map(e=>`<link rel="stylesheet" href="${gA(e)}">`).join(`
`)}
</head>
<body></body>
</html>
`,L9e=B(`<iframe class="preview svelte-1k58u5t" sandbox="allow-same-origin allow-scripts allow-popups allow-forms"></iframe>`),R9e={hash:`svelte-1k58u5t`,code:`iframe.svelte-1k58u5t {display:block;border:none;width:100%;height:100%;}`};function z9e(e,t){O(t,!0),K(e,R9e);let n=$M(),r=j(!1),i=j(void 0),a=j(void 0),o,s=A(()=>WA(t.locale)),c=A(()=>t.locale===`_default`?void 0:GA(t.locale)),l=()=>{let e=z(i)?.contentDocument?.body;e&&(o=Oo(Tl,{target:e,context:eN(n),props:{children:t.children}}))},u=()=>{let{contentDocument:e,contentWindow:n}=z(i);if(!z(a)||!t.reactComponent||!t.reactProps||!e||!n)return;let r={...t.reactProps,document:e,window:n};z(a).render((0,gr.createElement)(t.reactComponent,r))},d=async()=>{if(!t.reactComponent)return;let{createRoot:e}=await q3(),n=z(i)?.contentDocument,r=n?.body;if(!n||!r)return;let o=e=>{BYe({event:e,locale:t.locale})};n.addEventListener(`click`,o),n.addEventListener(`keydown`,o),M(a,e(r),!0)},f=e=>{console.error(e)},p=()=>{if(!z(i)||z(r))return;let e=t.reactComponent?d:l,n=I9e({lang:z(s),dir:z(c),styleURLs:t.styleURLs,origin:window.location.origin}),a=URL.createObjectURL(new Blob([n],{type:`text/html`}));z(i).addEventListener(`load`,async()=>{try{await e()}catch(e){f(e)}URL.revokeObjectURL(a),M(r,!0),t.onLoad?.(z(i))},{once:!0}),z(i).src=a};L(()=>{z(i)&&!z(r)&&p()}),L(()=>{let e=z(r)?z(i)?.contentDocument?.documentElement:void 0;e&&(z(s)?e.lang=z(s):e.removeAttribute(`lang`),z(c)?e.dir=z(c):e.removeAttribute(`dir`))}),L(()=>{q1.current,z(r)&&z(a)&&t.reactComponent&&t.reactProps&&u()}),L(()=>()=>{z(a)?.unmount(),o&&jo(o)});var m=L9e();Ds(m,e=>M(i,e),()=>z(i)),R(e=>q(m,`title`,e),[()=>Y(`content_preview`)]),U(e,m),k()}var B9e=({collectionName:e,fileName:t})=>[...new Set([...ak].filter(({collection:n,file:r})=>(n===void 0||n===e)&&(r===void 0||r===t)).map(({url:e})=>e))],V9e=({target:e,entryDraft:t,locale:n,keyPath:r,fieldConfig:i})=>Oo(e8,{target:e,context:eN(t),props:{keyPath:r,typedKeyPath:``,locale:n,fieldConfig:i,showLabel:!1}}),H9e=({entryDraft:e,locale:t,keyPath:n,fieldConfig:r})=>{let i=(0,gr.useRef)(null);return(0,gr.useLayoutEffect)(()=>{let a=V9e({target:i.current,entryDraft:e,locale:t,keyPath:n,fieldConfig:r});return()=>{jo(a)}},[e,t,n,r]),(0,gr.createElement)(`div`,{ref:i})},U9e=({entryDraft:e,locale:t,getFieldArgs:n})=>r=>{let i=bM({...n,keyPath:r});return i?(0,gr.createElement)(H9e,{entryDraft:e,locale:t,keyPath:r,fieldConfig:i}):null},W9e=(e,t,n)=>K1().Map(Object.fromEntries(Object.keys(e).map(e=>[e,n(`${t}.${e}`)]).filter(([,e])=>e!==null))),G9e=(e,t)=>n=>{let r=e[n];if(r==null)return r;let{fromJS:i,Map:a}=K1();return Array.isArray(r)?r.map((e,r)=>{let o=typeof e==`object`&&!!e;return a({data:i(e),widgets:o?W9e(e,`${n}.${r}`,t):a({})})}):typeof r==`object`?a({data:i(r),widgets:W9e(r,n,t)}):r},K9e=async(e,t)=>{let n=fj(e);if(!n)throw Error(`Collection "${e}" not found`);let{defaultLocale:r}=n._i18n,i=rz(e),a={locale:r,collectionName:e,associatedAssets:Q1({collectionName:e})},o=e=>X1({...a,entry:e});return t?o(i.find(e=>e.slug===t)):i.map(o)},q9e=({entryDraft:e,draft:t,locale:n})=>{let{entryMap:r,valueMap:i,getFieldArgs:a,fieldsMetaData:o,getAsset:s}=$1({draft:t,locale:n}),c=U9e({entryDraft:e,locale:n,getFieldArgs:a});return{entry:r,widgetFor:c,widgetsFor:G9e(Vj(i),c),getAsset:s,getCollection:K9e,fieldsMetaData:o}},J9e=B(`<div role="none"><!></div>`),Y9e=B(`<div role="document" class="svelte-17akd4q"><!></div>`),X9e={hash:`svelte-17akd4q`,code:`[role='document'].svelte-17akd4q {--entry-preview-padding-block: 8px;--entry-preview-padding-inline: 16px;padding-block:var(--entry-preview-padding-block);padding-inline:var(--entry-preview-padding-inline);
/* Keep the content written by other users within the preview, even if it’s positioned */contain:paint;}`};function Z9e(e,t){O(t,!0),K(e,X9e);let n=e=>{var n=H();Bo(P(n),17,()=>z(s),e=>e.name,(e,n)=>{var r=J9e();UO(N(r),{children:(e,r)=>{e8(e,{get keyPath(){return z(n).name},get typedKeyPath(){return z(n).name},get locale(){return t.locale},get fieldConfig(){return z(n)}})},$$slots:{default:!0}}),D(r),R(()=>q(r,`data-lazy-key-path`,z(n).name)),U(e,r)}),U(e,n)},r=$M(),i=A(()=>r.current??{}),a=A(()=>z(i).collectionName),o=A(()=>z(i).fileName),s=A(()=>Mr(z(i).fields,()=>[],!0)),c=A(()=>B9e({collectionName:z(a),fileName:z(o)})),l=A(()=>F9e({collectionName:z(a),fileName:z(o)})),u=A(()=>r.current&&z(l)&&U1.current?q9e({entryDraft:r,draft:{...r.current,currentValues:KM(r.current)},locale:t.locale}):void 0);L(()=>{z(l)&&W1().catch(e=>{console.error(e)})}),UO(e,{children:(e,r)=>{var i=H(),a=P(i),o=e=>{z9e(e,{get locale(){return t.locale},get styleURLs(){return z(c)},get reactComponent(){return z(l)},get reactProps(){return z(u)},get onLoad(){return t.onFrameLoad}})},s=e=>{z9e(e,{get locale(){return t.locale},get styleURLs(){return z(c)},get children(){return n},get onLoad(){return t.onFrameLoad}})},d=e=>{var t=Y9e(),r=N(t);n(r),D(t),R(e=>q(t,`aria-label`,e),[()=>Y(`content_preview`)]),U(e,t)};G(a,e=>{z(l)&&z(u)?e(o):z(c).length?e(s,1):e(d,-1)}),U(e,i)},$$slots:{default:!0}}),k()}var Y5,Q9e=IR(),X5={capture:!0,passive:!0},$9e={passive:!0},eet=e=>{if(e===e.ownerDocument.documentElement)return{x:0,y:0};let{left:t,top:n}=e.getBoundingClientRect();return{x:t,y:n}},tet=e=>eet(e).y,net=(e,t)=>t.getBoundingClientRect().top-tet(e)+e.scrollTop,ret=(e,t,n=!1)=>{let{top:r,height:i}=t.getBoundingClientRect(),{scrollTop:a,clientHeight:o}=e;return GYe({viewTop:tet(e),viewHeight:o,scrollTop:a,top:r,height:i,always:n})},iet=e=>{let t,n,r=()=>{window.requestAnimationFrame(()=>{let{contentArea:t}=e,{thisPaneContentArea:n}=e,{thatPaneContentArea:r}=e;if(!e.syncScrolling||!t||!n||!r)return;let{x:i,y:a}=eet(n),{ownerDocument:o,scrollTop:s,scrollHeight:c,clientHeight:l}=n;if(s<=0){r.scrollTop=0;return}let u=o.elementsFromPoint(i+80,a).findLast(e=>e.matches(`[data-key-path]`));if(!u){r.scrollTop=VYe({scrollTop:s,scrollHeight:c,clientHeight:l,targetScrollHeight:r.scrollHeight,targetClientHeight:r.clientHeight});return}let{keyPath:d}=u.dataset,{top:f,height:p}=u.getBoundingClientRect(),m=r.querySelector(`[data-key-path="${CSS.escape(d)}"]`),h=m?HYe({y:a,top:f,height:p,targetTop:net(r,m),targetHeight:m.getBoundingClientRect().height}):void 0;h!==void 0&&(r.scrollTop=h)})},i=()=>{Y5=e.thisPaneContentArea,Q9e.next()},a=()=>{Y5===e.thisPaneContentArea&&r()},o=async t=>{let{thisPaneContentArea:n}=e,{thatPaneContentArea:r}=e;if(!e.syncScrolling||!n||!r||!t.isConnected)return;let i=Q9e.next(),a=r,{scrollTop:o}=a,{keyPath:s}=t.dataset,c=await WYe({container:a,keyPath:s,scrollTo:e=>{let{scrollTop:t}=a;return Y5=n,a.scrollTo({top:ret(a,e,!0),behavior:`instant`}),Math.abs(a.scrollTop-t)>=1},isOutdated:()=>!i()||!e.syncScrolling});if(!c){i()&&e.syncScrolling&&a.scrollTop!==o&&(Y5=n,a.scrollTo({top:o,behavior:`instant`}));return}let l=ret(a,c);l!==void 0&&(Y5=n,a.scrollTo({top:l,behavior:`smooth`}))};return{initialize:()=>{let{contentArea:r}=e;if(!r)return;let o=e.thisPaneContentArea;o&&(o.removeEventListener(`wheel`,i,X5),o.removeEventListener(`touchstart`,i,X5),t?.removeEventListener(`scroll`,a,$9e)),n&&!r.contains(n)&&(n=void 0);let s=n?.contentDocument?.documentElement??void 0,c=s??r;e.thisPaneContentArea=c,t=s?s.ownerDocument:r,c.scrollTop=0,c.addEventListener(`wheel`,i,X5),c.addEventListener(`touchstart`,i,X5),t.addEventListener(`scroll`,a,$9e)},setPreviewFrame:e=>{n=e},onFocusIn:t=>{let n=t.target.closest(`.field[data-key-path]`);e.mode===`edit`&&n&&window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{o(n)})})},destroy:()=>{Y5===e.thisPaneContentArea&&(Y5=void 0)}}},aet=B(`<div role="none" class="content svelte-1vy4qxn"><!></div>`),oet=B(`<span role="alert"> </span> <!>`,1),set=B(`<div role="none" class="wrapper svelte-1vy4qxn"><!></div>`),cet={hash:`svelte-1vy4qxn`,code:`.wrapper.svelte-1vy4qxn {display:contents;}.content.svelte-1vy4qxn {--field-editor-padding: 16px;flex:auto;overflow-y:auto;scroll-behavior:auto; /* Don’t use smooth scroll for syncing */overscroll-behavior-y:contain;
@media (width < 768px) {--field-editor-padding: 12px;
}}`};function uet(e,t){O(t,!0),K(e,cet);let n=$M(),r=J(t,`thisPaneContentArea`,15),i=J(t,`thatPaneContentArea`,3,void 0),a=A(()=>v8.current??{}),o=A(()=>z(a).syncScrolling),s=A(()=>t.thisPane.current?.locale),c=A(()=>t.thisPane.current?.mode),l=A(()=>!!z(s)&&!!n.current?.currentValues[z(s)]),u=A(()=>z1(n.current)||eX(n.current?.originalEntry)),d=A(()=>({values:{locale:z(s)?KA(z(s))??z(s):``}})),f=j(void 0),p=iet({get syncScrolling(){return z(o)},get mode(){return z(c)},get contentArea(){return z(f)},get thisPaneContentArea(){return r()},set thisPaneContentArea(e){r(e)},get thatPaneContentArea(){return i()}});L(()=>{t.thisPane.current?.mode,z(f),fo(()=>p.initialize())}),L(()=>()=>{p.destroy()});var m=set(),h=N(m),g=e=>{var t=aet(),n=N(t),r=e=>{Z9e(e,{get locale(){return z(s)},onFrameLoad:e=>{p.setPreviewFrame(e),p.initialize()}})},i=e=>{aQe(e,{get locale(){return z(s)}})};G(n,e=>{z(c)===`preview`?e(r):e(i,-1)}),D(t),Ds(t,e=>M(f,e),()=>z(f)),bo(`focusin`,t,function(...e){p.onFocusIn?.apply(this,e)}),U(e,t)},_=e=>{VO(e,{children:(e,t)=>{var r=oet(),i=P(r),a=F(i,!0),o=I(i,2),c=e=>{{let t=A(()=>Y(z(l)?`reenable_x_locale`:`enable_x_locale`,z(d)));Al(e,{variant:`tertiary`,get label(){return z(t)},onclick:()=>{z(s)&&n.current&&mGe({draft:n.current,locale:z(s)})}})}};G(o,e=>{z(u)||e(c)}),R(e=>W(a,e),[()=>Y(z(l)?`locale_x_now_disabled`:`locale_x_has_been_disabled`,z(d))]),U(e,r)},$$slots:{default:!0}})};G(h,e=>{z(s)&&n.current?.currentLocales[z(s)]?e(g):z(c)===`edit`&&e(_,1)}),D(m),R(()=>q(m,`id`,t.id)),U(e,m),k()}xo([`focusin`]);function det(e,t){O(t,!0);let n=$M(),r=J(t,`open`,15,!1),i=J(t,`locale`,3,void 0),a=J(t,`onClose`,3,void 0),o=A(()=>zJe(t.action,i()?`locale`:`entry`));ru(e,{get title(){return z(o)},get okLabel(){return z(o)},onOk:()=>{let e=n.current;e&&(t.action===`revert`?nYe({draft:e,locale:i()}):YJe({draft:e,locale:i(),restore:t.action===`restore`}))},onClose:()=>{a()?.()},get open(){return r()},set open(e){r(e)},children:(e,n)=>{Qr();var r=V();R(e=>W(r,e),[()=>BJe(t.action,i())]),U(e,r)},$$slots:{default:!0}}),k()}function fet(e,t){O(t,!0);let n=J(t,`thisPane`,7);{let t=e=>{Xc(e,{name:`visibility`})},r=A(()=>Y(`preview`)),i=A(()=>n().current?.mode===`preview`);Al(e,{variant:`ghost`,iconic:!0,get"aria-label"(){return z(r)},get pressed(){return z(i)},onclick:()=>{sN(()=>{n().current={mode:n().current?.mode===`preview`?`edit`:`preview`,locale:n().current?.locale??``}})},startIcon:t,$$slots:{startIcon:!0}})}k()}var pet=(e,t)=>e===`error`||!t||t===`unknown`?e:t===`ready`?`ready`:e===`ready`?`pending`:e,met=({entry:e,locale:t,collection:n,collectionFile:r,pullRequest:i,deployments:a,productionSHA:o,pollTimedOut:s=!1})=>{let c=(i,a=!1)=>oUe(e,t,n,r,{baseURL:i,fallbackToRoot:a});if(i){let e=i.headSHA?a[i.headSHA]:void 0,t=e?.url?c(e.url,!0):void 0;if(e&&t)return{url:t,state:e.state,isDeployPreview:!0,awaitingPreview:!1,pingable:!0};let n=c();if(!n)return;let r=e?.state??`unknown`;return{url:n,state:r,isDeployPreview:!1,awaitingPreview:!s&&(r===`checking`||r===`pending`),pingable:!1}}let l=o?a[o]:void 0,u=c()??c(l?.url);if(u)return{url:u,state:l?.state??`unknown`,isDeployPreview:!1,awaitingPreview:!1,pingable:!0}},het=B(`<div role="none" class="icon-wrapper svelte-13aw5dy"><!></div>`),get={hash:`svelte-13aw5dy`,code:`.icon-wrapper.svelte-13aw5dy {display:contents;& .spinning {
animation: svelte-13aw5dy-spin 1.6s linear infinite;}
@media (prefers-reduced-motion: reduce) {& .spinning {
animation: none;}
}}
@keyframes svelte-13aw5dy-spin {
to {
transform: rotate(360deg);
}
}`};function Z5(e,t){O(t,!0),K(e,get);let n=J(t,`as`,3,`button`),r=J(t,`variant`,3,`ghost`),i=J(t,`size`,3,`medium`),a=J(t,`iconic`,3,!1),o=A(()=>met({entry:t.entry,locale:t.locale,collection:t.collection,collectionFile:t.collectionFile,pullRequest:t.pullRequest,deployments:BK.current,productionSHA:VK.current,pollTimedOut:UK.current})),s=A(()=>z(o)?.url),c=A(()=>z(o)?pet(z(o).state,z(s)?J8.current[z(s)]:void 0):void 0),l=A(()=>z(o)?.isDeployPreview??!1),u=A(()=>z(o)?.pingable??!1),d=A(()=>z(o)?.awaitingPreview??!1),f=A(()=>z(d)||!z(s)||z(l)&&z(c)===`error`),p=A(()=>z(d)?Y(`deploy_preview.awaiting`):z(l)?Y(`deploy_preview.view`):Y(`view_on_live_site`)),m=A(()=>z(c)===`error`?Y(`deploy_preview.failed`):z(c)===`checking`?Y(`deploy_preview.checking`):z(c)===`pending`?Y(`deploy_preview.building`):void 0),h=()=>{z(s)&&FV(z(s))};L(()=>{let e=z(u),t=z(s);e&&t&&d4e(t)});var g=H(),_=P(g),v=e=>{var t=H(),o=P(t),s=e=>{Du(e,{get label(){return z(p)},get disabled(){return z(f)},get"aria-description"(){return z(m)},onclick:h})},c=e=>{{let t=e=>{var t=het(),n=N(t);{let e=A(()=>z(d)?`spinning`:void 0),t=A(()=>z(d)?`progress_activity`:`open_in_new`);Xc(n,{get class(){return z(e)},get name(){return z(t)}})}D(t),U(e,t)},n=A(()=>a()?void 0:z(p)),o=A(()=>a()?z(p):void 0);Al(e,{get variant(){return r()},get size(){return i()},get iconic(){return a()},get label(){return z(n)},get"aria-label"(){return z(o)},get disabled(){return z(f)},get"aria-description"(){return z(m)},onclick:h,endIcon:t,$$slots:{endIcon:!0}})}};G(o,e=>{n()===`menuitem`?e(s):e(c,-1)}),U(e,t)};G(_,e=>{z(o)&&e(v)}),U(e,g),k()}var _et={edit_x_locale:`edit_content`,preview_x_locale:`preview_content`,show_content_options_x_locale:`show_content_options`,content_options_x_locale:`content_options`},Q5=(e,t)=>t===`_default`?Y(_et[e]):Y(e,{values:{locale:KA(t)??t}}),vet=({collection:e,collectionFile:t})=>t?.name?[e?.name,t.name].join(`|`):e?.name,yet=({firstPane:e,secondPane:t})=>!e&&!t?[0,0,0]:!e||!t?[e?100:0,t?100:0,0]:typeof e.width==`number`&&typeof t.width==`number`&&e.width>=30&&t.width>=30&&e.width+t.width===100?[e.width,t.width,30]:[50,50,30],bet=({savedPanes:e=[null,null],editorLocale:t,allLocales:n,defaultLocale:r,canPreview:i,showPreview:a,showSecondPane:o})=>{let[s,c]=t?[{mode:`edit`,locale:t},{mode:`preview`,locale:t}]:e;if(s&&c&&(!s.locale||n.includes(s.locale))&&(!c.locale||n.includes(c.locale))&&o&&(a&&i||s.mode!==`preview`&&c.mode!==`preview`)&&(t||n.length!==2||s.locale===r))return[s,c]},xet=({editorLocale:e,currentLocale:t,defaultLocale:n,allLocales:r,i18nEnabled:i,canPreview:a,showPreview:o,showSecondPane:s,singlePane:c})=>{let l=(e&&r.includes(e)?e:void 0)??t??n,u={mode:`edit`,locale:l};if(c||!s)return[u,null];if(!o||!a){let e=i?r.find(e=>e!==l):void 0;return[u,e?{mode:`edit`,locale:e}:null]}return[u,{mode:`preview`,locale:l}]},Cet=({firstPane:e,secondPane:t,locale:n})=>{let r={mode:`edit`,locale:n};if(!(e?.mode===`edit`&&e.locale===n||t?.mode===`edit`&&t.locale===n))return t?.mode===`preview`?[e,r]:e?.mode===`preview`?[r,t]:t?[e,r]:[r,t]},wet=(e,t)=>{let n=fo(()=>v8.current);v8.current={...n,paneStates:{...n?.paneStates,[e]:t}}},$5=0,e7=0,t7=0,n7=0,r7=void 0,i7=``,a7=0,Tet=()=>{let e=BK.current;return n5.current.every(({sha:t})=>{let n=e[t]?.state;return n===`ready`||n===`error`||n===`unknown`})},Eet=(e,t)=>{if(!e.length)return;IG.devModeEnabled&&console.info(`deployPreview: ${t}`,{shas:e,remaining:6e4-(Date.now()-t7)});let n=BK.current;BK.current={...n,...Object.fromEntries(e.map(e=>[e,{...n[e],state:`checking`}]))}},Det=e=>{if(Date.now()-t7>=6e4)return;let t=BK.current;Eet(n5.current.map(({sha:e})=>e).filter(n=>{if(t[n]?.state!==`unknown`)return!1;let r=e[n];return!r||r.state===`checking`||r.state===`unknown`&&r.checkedTime>=t7}),`nothing reported yet, still waiting`)},Oet=()=>{let e=BK.current,t=Date.now();Eet(n5.current.map(({sha:e})=>e).filter(n=>{let r=e[n];return r?.state===`unknown`&&t-r.checkedTime<6e4}),`concluded only moments ago, waiting a little longer`)},ket=()=>n5.current.map(({sha:e})=>e).join(`,`),o7=()=>{globalThis.clearTimeout($5),$5=0,a7+=1},s7=()=>{o7(),m4e()},Aet=()=>{if(!e7||!r5()||Tet()){IG.devModeEnabled&&console.info(`deployPreview: not re-checking`,{watchers:e7,canResolve:r5(),settled:Tet(),attempts:n7}),s7();return}if(Date.now()-t7>6e5){UK.current=!0,s7();return}let e=a7;$5=globalThis.setTimeout(async()=>{$5=0,n7+=1;let t=BK.current;await i5({pendingOnly:!0}),Det(t),e===a7&&Aet()},5e3)},c7=()=>{o7(),n7=0,t7=Date.now(),UK.current=!1,r5()&&(_4e(),Oet()),Aet()},jet=()=>{e7+=1,e7===1&&(i7=ket(),r7=_k(()=>{let e=ket();e!==i7&&(i7=e,fo(c7))}),c7());let e=!1;return()=>{e||(e=!0,--e7,e7||(r7?.(),r7=void 0,s7()))}},Met=()=>fo(jet),Net=async()=>{o7(),UK.current=!1,await i5({force:!0}),c7()},l7=B(`<!> <!>`,1),Pet=B(`<h3 role="none"> </h3>`),Fet=B(`<!> <!> <!>`,1),Iet=B(`<!> <!> <!> <!>`,1),Let=B(`<div role="none" class="header svelte-uj56is"><!></div> <!>`,1),Ret={hash:`svelte-uj56is`,code:`.header.svelte-uj56is {flex:none !important;& > .sui.toolbar {margin-inline:auto;max-width:800px;
@media (width < 768px) {padding:0;
}h3 {margin:0 8px;font-size:var(--sui-font-size-default);}}}`};function zet(e,t){O(t,!0),K(e,Ret);let n=$M(),r=J(t,`thatPane`,19,()=>pk(null)),i=A(()=>n.current?.collection),a=A(()=>n.current?.collectionFile),o=A(()=>n.current?.originalEntry),s=A(()=>n.current?.originalValues??{}),c=A(()=>rj(n.current)),l=A(()=>z(c).i18nEnabled),u=A(()=>z(c).saveAllLocales),d=A(()=>z(c).allLocales),f=A(()=>z(c).defaultLocale),p=A(()=>n.current?.currentLocales[t.thisPane.current?.locale??``]),m=A(()=>Object.values(n.current?.currentLocales??{}).filter(e=>e).length===1),h=A(()=>z(l)?z(d).filter(e=>e!==t.thisPane.current?.locale):[]),g=A(()=>!!z(h).length),_=A(()=>eX(n.current?.originalEntry)),v=A(()=>z1(n.current)),y=A(()=>!!t.thisPane.current?.locale&&LM(z(s)[t.thisPane.current.locale]??{},GM(n.current,t.thisPane.current.locale))),b=B6(()=>{let e=n.current,r=t.thisPane.current?.locale;if(e&&r)return{restore:z6({draft:e,locale:r,restore:!0}),clear:z6({draft:e,locale:r})}}),x=j(void 0),S=A(()=>n.current?.canPreview??!0),C=A(()=>!(iG.isSmallScreen||iG.isMediumScreen)&&!r().current&&z(S)&&!!v8.current?.showPreview),w=A(()=>zY.current&&n.current?QY(n.current)?.workflow.pullRequest:void 0),T=A(()=>z(o)&&z(i)&&t.thisPane.current?met({entry:z(o),locale:t.thisPane.current.locale,collection:z(i),collectionFile:z(a),pullRequest:z(w),deployments:BK.current,productionSHA:VK.current,pollTimedOut:UK.current}):void 0),ee=A(()=>!!z(o)&&!!z(i)&&!!(z(T)||UK.current||IG.devModeEnabled));var te=Let(),ne=P(te),re=N(ne);{let e=A(()=>Y(`secondary`));dO(re,{variant:`secondary`,get ariaLabel(){return z(e)},children:(e,s)=>{var c=Fet(),T=P(c),te=e=>{var n=l7(),i=P(n);a$e(i,{get id(){return t.id},get thisPane(){return t.thisPane},get thatPane(){return r()},get previewInThisPane(){return z(C)}});var a=I(i,2),o=e=>{fet(e,{get thisPane(){return t.thisPane}})};G(a,e=>{(iG.isSmallScreen||iG.isMediumScreen)&&z(S)&&e(o)}),U(e,n)},ne=e=>{var n=Pet(),r=F(n,!0);R(e=>W(r,e),[()=>t.thisPane.current?.mode===`preview`?Y(`preview`):Y(`edit`)]),U(e,n)},re=e=>{fet(e,{get thisPane(){return t.thisPane}})};G(T,e=>{z(l)&&z(d).length>1||z(C)?e(te):iG.isSmallScreen||iG.isMediumScreen?z(S)&&e(re,2):e(ne,1)});var ie=I(T,2);$l(ie,{flex:!0});var ae=I(ie,2),oe=e=>{let r=A(()=>t.thisPane.current.locale),s=A(()=>KA(z(r))??z(r));var c=l7(),l=P(c),d=e=>{HJe(e,{get locale(){return t.thisPane.current.locale},get otherLocales(){return z(h)}})};G(l,e=>{z(g)&&!z(v)&&e(d)});var S=I(l,2),C=e=>{{let c=e=>{{let c=A(()=>Q5(`content_options_x_locale`,z(r)));Eu(e,{get ariaLabel(){return z(c)},children:(e,r)=>{var c=l7(),l=P(c),d=e=>{var r=Fet(),i=P(r),a=e=>{F6(e,{get locale(){return t.thisPane.current.locale},get otherLocales(){return z(h)},submenu:!0})};G(i,e=>{z(g)&&t.thisPane.current?.locale&&e(a)});var o=I(i,2);{let e=A(()=>({revert:!!z(y),...b.availability}));L6(o,{scope:`locale`,get separator(){return z(g)},get available(){return z(e)},get onSelect(){return b.select}})}var c=I(o,2),l=e=>{var r=l7(),i=P(r);mu(i,{});var a=I(i,2);{let e=A(()=>Y(z(p)?`disable_x_locale`:n.current?.currentValues[t.thisPane.current.locale]?`reenable_x_locale`:`enable_x_locale`,{values:{locale:z(s)}})),r=A(()=>t.thisPane.current.locale===z(f)||z(p)&&z(m));Du(a,{get label(){return z(e)},get disabled(){return z(r)},onclick:()=>{n.current&&mGe({draft:n.current,locale:t.thisPane.current?.locale??``})}})}U(e,r)};G(c,e=>{!z(u)&&t.thisPane.current?.locale&&e(l)}),U(e,r)};G(l,e=>{z(v)||e(d)});var _=I(l,2),x=e=>{var n=Iet(),r=P(n),s=e=>{mu(e,{})};G(r,e=>{!z(v)&&z(ee)&&e(s)});var c=I(r,2);Z5(c,{as:`menuitem`,get entry(){return z(o)},get locale(){return t.thisPane.current.locale},get collection(){return z(i)},get collectionFile(){return z(a)},get pullRequest(){return z(w)}});var l=I(c,2),u=e=>{{let t=A(()=>Y(`deploy_preview.check_again`));Du(e,{get label(){return z(t)},onclick:()=>{Net()}})}};G(l,e=>{UK.current&&e(u)});var d=I(l,2),f=e=>{{let n=A(()=>!OY.current?.repository?.blobBaseURL),r=A(()=>OY.current?.repository?.label?Y(`view_on_x`,{values:{service:OY.current.repository.label}}):Y(`view_in_repository`));Du(e,{get disabled(){return z(n)},get label(){return z(r)},onclick:()=>{z(o)&&t.thisPane.current&&FV(sUe(z(o),t.thisPane.current.locale))}})}};G(d,e=>{IG.devModeEnabled&&e(f)}),U(e,n)};G(_,e=>{z(o)&&z(i)&&t.thisPane.current&&e(x)}),U(e,c)},$$slots:{default:!0}})}},l=A(()=>Q5(`show_content_options_x_locale`,z(r)));Ds(Xl(e,{variant:`ghost`,iconic:!0,get disabled(){return z(_)},popupPosition:`bottom-right`,get"aria-label"(){return z(l)},get onclick(){return b.update},get onkeydown(){return b.update},popup:c,$$slots:{popup:!0}}),e=>M(x,e,!0),()=>z(x))}};G(S,e=>{(!z(v)||z(ee))&&e(C)}),U(e,c)};G(ae,e=>{t.thisPane.current?.mode===`edit`&&e(oe)}),U(e,c)},$$slots:{default:!0}})}D(ne);var ie=I(ne,2);{let e=A(()=>t.thisPane.current?.locale);det(ie,{get action(){return b.action},get locale(){return z(e)},onClose:()=>{z(x)?.focus()},get open(){return b.dialogOpen},set open(e){b.dialogOpen=e}})}R(()=>q(ne,`id`,t.id)),U(e,te),k()}var u7=e=>{let t=vj.current.find(({id:t})=>t===e.id),n=e.arrayIndex===void 0;if(!t)return{type:`deleted`,canOverwrite:n};if(!(0,yr.default)(t.locales,e.locales))return{type:`modified`,entry:t,canOverwrite:n}},Bet=async e=>{let{isNew:t,originalEntry:n}=e;if(!t&&n){try{await r3()}catch(e){console.error(`Failed to check the repository for changes.`,e)}return u7(n)}},Vet=({type:e,entry:t,canOverwrite:n},r)=>{if(e===`deleted`)return{description:Y(`save_conflict.deleted`),warning:Y(n?`save_conflict.recreate_warning`:`save_conflict.reload_warning`)};let{commitAuthor:i,commitDate:a}=t,o=wz(i);return{description:o&&a?Y(`save_conflict.modified_by`,{values:{name:o,date:gP(a,r)}}):Y(`save_conflict.modified`),warning:Y(n?`save_conflict.overwrite_warning`:`save_conflict.reload_warning`)}},Het=async({entryDraft:e,entry:t})=>{let n=e.current,{collectionName:r,collection:i,collectionFile:a,expanderStates:o}=n;return l8(),await o8(r,c8(n)),m8({entryDraft:e,collection:i,collectionFile:a,originalEntry:t,expanderStates:o})},Uet=(e,t)=>e.current===t&&!t.interacted&&!zM(t),Wet=async e=>{let t=e.current;if(!t||t.isNew||!t.originalEntry||$Y(t))return;try{await r3({maxAge:1e4})}catch(e){console.error(`Failed to check the repository for changes.`,e);return}if(!Uet(e,t))return;let n=u7(t.originalEntry);if(n?.type!==`modified`||!n.canOverwrite)return;let{collectionName:r,collection:i,collectionFile:a,expanderStates:o}=t;await s8(r,c8(t))||Uet(e,t)&&m8({entryDraft:e,collection:i,collectionFile:a,originalEntry:n.entry,expanderStates:o})},Get=B(` <!>`,1),Ket=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),qet=B(`<!> <!>`,1);function Jet(e,t){O(t,!0);let n=$M(),r=A(()=>n.current),i=A(()=>z(r)&&!z(r).isNew&&!$Y(z(r))?z(r).originalEntry:void 0),a=A(()=>z(i)?u7(z(i)):void 0),o=j(void 0),s=j(!1),c=A(()=>!!z(a)&&z(o)!==(z(a).entry??`deleted`)),l=async()=>{z(a)?.entry&&await Het({entryDraft:n,entry:z(a).entry})};var u=qet(),d=P(u),f=e=>{let t=A(()=>Vet(z(a),Jc.current));var n=Ket(),i=P(n);Lo(i,()=>({"--sui-infobar-message-justify-content":`center`})),jl(i.lastChild,{status:`warning`,onDismiss:()=>{M(o,z(a).entry??`deleted`)},children:(e,n)=>{Qr();var i=Get(),o=P(i),c=I(o),u=e=>{{let t=A(()=>Y(`remote_change.reload_entry`));Al(e,{variant:`link`,get label(){return z(t)},onclick:()=>{zM(z(r))?M(s,!0):l()}})}};G(c,e=>{z(a).type===`modified`&&z(a).canOverwrite&&e(u)}),R(()=>W(o,`${z(t).description??``}
${z(t).warning??``} `)),U(e,i)},$$slots:{default:!0}}),D(i),U(e,n)};G(d,e=>{z(a)&&z(c)&&e(f)});var p=I(d,2);{let e=A(()=>Y(`remote_change.reload_entry`)),t=A(()=>Y(`remote_change.reload_entry`));ru(p,{get title(){return z(e)},get okLabel(){return z(t)},onOk:async()=>{await l()},get open(){return z(s)},set open(e){M(s,e,!0)},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`remote_change.confirm_reloading_entry`)]),U(e,n)},$$slots:{default:!0}})}U(e,u),k()}var Yet=B(`<section role="group" class="panel svelte-1bq1or9"><header class="svelte-1bq1or9"><h3 class="svelte-1bq1or9"> </h3> <!></header> <div class="svelte-1bq1or9"><!></div></section>`),Xet={hash:`svelte-1bq1or9`,code:`section.svelte-1bq1or9 {overflow:hidden;height:100%;display:flex;flex-direction:column;}header.svelte-1bq1or9 {flex:none;display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--sui-secondary-border-color);padding:0 16px;height:var(--sui-primary-toolbar-size);}h3.svelte-1bq1or9 {flex:auto;font-size:var(--sui-font-size-x-large);}div.svelte-1bq1or9 {flex:auto;overflow:auto;h4 {display:flex;align-items:center;padding:12px 12px 8px;font-size:var(--sui-font-size-large);}& > .empty {padding:16px;}.empty {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.sui.button.ref {display:flex;justify-content:flex-start;gap:8px;padding:8px;width:-moz-available;width:-webkit-fill-available;width:stretch;height:auto;}}`};function d7(e,t){let n=Eo();K(e,Xet);let r=J(t,`actions`,3,void 0),i=J(t,`children`,3,void 0);var a=Yet(),o=N(a),s=N(o),c=F(s,!0);Go(I(s,2),()=>r()??kr),D(o);var l=I(o,2);Go(N(l),()=>i()??kr),D(l),D(a),R(()=>{q(a,`aria-labelledby`,`panel-${n}-label`),q(s,`id`,`panel-${n}-label`),W(c,t.title)}),U(e,a)}var f7=e=>e==null,Zet=({collection:e,collectionFile:t,componentName:n,isIndexFile:r,typedKeyPath:i=``})=>{let a=i.split(`.`);if(!a.includes(`*`))return i;let o={collectionName:e?.name,fileName:t?.name,componentName:n,isIndexFile:r},s=[];for(let e=0;e<a.length;e+=1){let t=a[e];if(t===`*`&&s.length){let n=bM({...o,keyPath:s.join(`.`)}),{field:r}=n??{};s.push(t),n?.widget===`list`&&r?.name===a[e+1]&&(e+=1)}else s.push(t)}return s.join(`.`)},Qet=({fieldConfig:e,context:t})=>{let n=Zet(t).replace(/<[^>]+>/g,``)||e.name;if(!n.includes(`*`))return{keyPath:n,valuePattern:void 0};let r=e.multiple?`\\.\\d+`:``;return{keyPath:n,valuePattern:RegExp(`^${WO(n)}${r}$`)}},p7=({content:e,keyPath:t,valuePattern:n,multiple:r=!1})=>n?Object.keys(e).filter(t=>n.test(t)&&!f7(e[t])):r?XO(e,t).filter(t=>!f7(e[t])):f7(e[t])?[]:[t],$et=e=>p7(e).map(t=>e.content[t]),m7=({fieldConfig:e,entry:t,locale:n})=>AB({locale:n,fieldConfig:e,refEntry:t}).map(({value:e})=>e),h7=({collectionName:e,fileName:t})=>[...Dk.relationFields].filter(({fieldConfig:n})=>n.collection===e&&!(t&&n.file&&n.file!==t)).map(e=>{let{fieldConfig:t,context:n}=e,r=n.collection?.name,i=r?fj(r):void 0;if(!i)return;let a=n.collectionFile?.name;return{fieldConfig:t,sourceCollection:i,sourceCollectionFile:a?xj(i,a):void 0,...Qet(e),multiple:!!t.multiple}}).filter(e=>!!e),ett=({collectionName:e,fileName:t,entry:n})=>{let r=new Set,i=h7({collectionName:e,fileName:t}).flatMap(({fieldConfig:e,sourceCollection:t,sourceCollectionFile:i,keyPath:a,valuePattern:o,multiple:s})=>{let c=(i??t)._i18n.defaultLocale,l=new Set(m7({fieldConfig:e,entry:n,locale:c}));if(!l.size)return[];let u=t.name,d=i?.name;return rz(u).filter(e=>e.id!==n.id&&!r.has(e.id)&&(!d||e.slug===d)).map(n=>{let i=ZP(n,{locale:c})?.content;if(i&&$et({content:i,keyPath:a,valuePattern:o,multiple:s}).some(e=>l.has(e)))return r.add(n.id),{collectionName:u,collectionLabel:t.label||u,fieldLabel:pB({config:e}),entry:n,summary:jz(t,n)}}).filter(e=>!!e)}),a=[...new Set(i.map(e=>e.collectionName))];return i.sort((e,t)=>a.indexOf(e.collectionName)-a.indexOf(t.collectionName)||TE(e.summary,t.summary))},ttt=B(`<span class="summary"><bdi> </bdi></span>`),ntt=B(`<section class="collection svelte-1lhuwki" role="group"><h4> </h4> <!></section>`),rtt=B(`<div class="empty"> </div>`),itt={hash:`svelte-1lhuwki`,code:`.collection.svelte-1lhuwki {padding:4px;&:not(:first-child) {border-top:2px solid var(--sui-secondary-background-color);}}`};function att(e,t){let n=Eo();O(t,!0),K(e,itt);let r=$M(),i=A(()=>{let e=r.current;return e?.originalEntry?ett({collectionName:e.collectionName,fileName:e.fileName,entry:e.originalEntry}):[]}),a=A(()=>{let e=[];return z(i).forEach(t=>{let n=e.find(e=>e.collectionLabel===t.collectionLabel);n?n.items.push(t):e.push({collectionLabel:t.collectionLabel,items:[t]})}),e});{let t=A(()=>Y(`entry_sidebar.backlinks.title`));d7(e,{get title(){return z(t)},children:(e,t)=>{var r=H(),o=P(r),s=e=>{var t=H();Bo(P(t),19,()=>z(a),({collectionLabel:e,items:t})=>e,(e,t,r)=>{let i=()=>z(t).collectionLabel,a=()=>z(t).items;var o=ntt(),s=N(o),c=F(s,!0);Bo(I(s,2),17,a,e=>e.entry.id,(e,t)=>{Al(e,{class:`ref`,variant:`ghost`,onclick:()=>{o$(IP(`/collections/${z(t).collectionName}/entries/${z(t).entry.subPath}`),{transitionType:`forwards`})},children:(e,n)=>{var r=ttt(),i=F(N(r),!0);D(r),R(()=>W(i,z(t).summary)),U(e,r)},$$slots:{default:!0}})}),D(o),R(()=>{q(o,`aria-labelledby`,`${n}-${z(r)??``}-label`),q(s,`id`,`${n}-${z(r)??``}-label`),W(c,i())}),U(e,o)}),U(e,t)},c=e=>{var t=rtt(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.backlinks.no_entries`)]),U(e,t)};G(o,e=>{z(i).length>0?e(s):e(c,-1)}),U(e,r)},$$slots:{default:!0}})}k()}var g7=new Map,ott=async e=>{let{id:t}=e,n=g7.get(t);if(n)return n;let r=OY.current;if(!r?.fetchFileCommits)return{commits:[],loading:!1,error:!1};let i=$P(e);try{let e={commits:await r.fetchFileCommits(i),loading:!1,error:!1};return g7.set(t,e),e}catch{let e={commits:[],loading:!1,error:!0};return g7.set(t,e),e}},stt=e=>{g7.delete(e)},_7=B(`<div class="empty"> </div>`),ctt=B(`<img class="avatar svelte-14rpg2i" alt="" width="24" height="24" loading="lazy"/>`),ltt=B(`<span class="avatar placeholder svelte-14rpg2i" aria-hidden="true"></span>`),utt=B(`<span class="message svelte-14rpg2i"><bdi> </bdi></span>`),dtt=B(`<!> <span class="details svelte-14rpg2i"><!> <span><span class="author svelte-14rpg2i"><bdi> </bdi></span> <span class="date svelte-14rpg2i"> </span></span></span>`,1),ftt=B(`<div role="listitem"><!></div>`),ptt=B(`<div role="list" class="commits svelte-14rpg2i"></div>`),mtt={hash:`svelte-14rpg2i`,code:`.commits.svelte-14rpg2i {padding:4px;}.avatar.svelte-14rpg2i {flex:none;width:24px;height:24px;border-radius:50%;background-color:var(--sui-secondary-background-color);}.details.svelte-14rpg2i {display:flex;flex-direction:column;gap:2px;overflow:hidden;font-size:var(--sui-font-size-small);}.message.svelte-14rpg2i,
.author.svelte-14rpg2i {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.meta.svelte-14rpg2i {display:flex;flex-direction:column;gap:2px;overflow:hidden;&.secondary {flex-direction:row;gap:8px;color:var(--sui-tertiary-foreground-color);font-size:var(--sui-font-size-x-small);}}.date.svelte-14rpg2i {flex:none;color:var(--sui-tertiary-foreground-color);}`};function htt(e,t){O(t,!0),K(e,mtt);let n=$M(),r=j(ta([])),i=j(!1),a=j(!1),o=A(()=>!!X4()),s=async()=>{let e=n.current?.originalEntry;e&&(M(i,!0),await(async e=>{M(r,e.commits,!0),M(a,e.error,!0)})(await ott(e)),M(i,!1))};js(()=>{s()});{let t=A(()=>Y(`entry_sidebar.history.title`));d7(e,{get title(){return z(t)},children:(e,t)=>{var n=H(),s=P(n),c=e=>{var t=_7(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`loading`)]),U(e,t)},l=e=>{var t=_7(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.history.fetch_failed`)]),U(e,t)},u=e=>{var t=ptt();Bo(t,21,()=>z(r),e=>e.sha,(e,t)=>{let n=A(()=>OY.current?.repository?.commitBaseURL?`${OY.current.repository.commitBaseURL}/${z(t).sha}`:void 0),r=A(()=>z(o)?z(t).message:``);var i=ftt(),a=N(i);{let e=A(()=>!z(n));Al(a,{class:`ref`,variant:`ghost`,role:`link`,get disabled(){return z(e)},onclick:()=>{FV(z(n))},children:(e,n)=>{var i=dtt(),a=P(i),o=e=>{var n=ctt();R(()=>q(n,`src`,z(t).authorAvatarURL)),U(e,n)},s=e=>{U(e,ltt())};G(a,e=>{z(t).authorAvatarURL?e(o):e(s,-1)});var c=I(a,2),l=N(c),u=e=>{var t=utt(),n=F(N(t),!0);D(t),R(()=>{q(t,`title`,z(r)),W(n,z(r))}),U(e,t)};G(l,e=>{z(r)&&e(u)});var d=I(l,2);let f;var p=N(d),m=F(N(p),!0);D(p);var h=F(I(p,2),!0);D(d),D(c),R(e=>{f=os(d,1,`meta svelte-14rpg2i`,null,f,{secondary:!!z(r)}),W(m,z(t).authorName),W(h,e)},[()=>gP(z(t).date,Jc.current)]),U(e,i)},$$slots:{default:!0}})}D(i),U(e,i)}),D(t),U(e,t)},d=e=>{var t=_7(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.history.no_history`)]),U(e,t)};G(s,e=>{z(i)?e(c):z(a)?e(l,1):z(r).length>0?e(u,2):e(d,-1)}),U(e,n)},$$slots:{default:!0}})}k()}var gtt=B(`<h4 class="svelte-1twofal"> </h4>`),_tt=B(`<span hidden=""> </span>`),vtt=B(`<section class="section svelte-1twofal"><!> <div role="none" class="content svelte-1twofal"><!></div></section>`),ytt={hash:`svelte-1twofal`,code:`.section.svelte-1twofal {padding:4px;&:not(:first-child) {border-top:2px solid var(--sui-secondary-background-color);}}h4.svelte-1twofal {margin:0 !important;padding:12px;}.content.svelte-1twofal {padding:4px 8px 8px;}`};function v7(e,t){let n=Eo();K(e,ytt);let r=J(t,`showLabel`,3,!0),i=`${n}-label`;var a=vtt(),o=N(a),s=e=>{var n=gtt(),r=F(n,!0);R(()=>{q(n,`id`,i),W(r,t.label)}),U(e,n)},c=e=>{var n=_tt(),r=F(n,!0);R(()=>{q(n,`id`,i),W(r,t.label)}),U(e,n)};G(o,e=>{r()?e(s):e(c,-1)});var l=I(o,2);Go(N(l),()=>t.children,()=>i),D(l),D(a),R(()=>{q(a,`role`,r()?`group`:`none`),q(a,`aria-labelledby`,r()?i:void 0)}),U(e,a)}var btt=({draft:e,ownFolderPaths:t})=>{let n=o2(e.collection),r=e=>(t?!n:[`_`,`_default`].includes(e))?{label:Y(t?`folder`:`slug`),showLabel:!1}:{label:KA(e)??e,showLabel:!0};return t?Object.entries(t).map(([e,t])=>({locale:e,...r(e),value:r4(t)})):Object.entries(e.currentSlugs).filter(([,e])=>e!==void 0).map(([e,t])=>({locale:e,...r(e),value:t}))},xtt=({draft:e,ownFolderPaths:t,takenFolderNames:n,takenSlugs:r,locale:i,text:a})=>{if(t){let e=NN({takenNames:n[i],name:a});return e?Y(`new_parent_folder_error.${e}`):void 0}let{pattern:o}=Z0(e.collection),s=f2({slug:a,pattern:o,takenSlugs:r[i],locale:i});return s?p2({error:s,pattern:o}):void 0},Stt=B(`<!> <p class="error svelte-1woercx"><!></p>`,1),Ctt={hash:`svelte-1woercx`,code:`p.error.svelte-1woercx:empty {display:none;}p.error.svelte-1woercx {margin:0;padding:0 4px;color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-small);}`};function wtt(e,t){O(t,!0),K(e,Ctt);let n=$M(),r=A(()=>n.current),i=A(()=>RQe(z(r))),a=A(()=>u2(z(r))),o=A(()=>z(i)?zQe({draft:z(r),ownFolderPaths:z(i)}):{}),s=A(()=>btt({draft:z(r),ownFolderPaths:z(i)})),c=ta({}),l=ta({}),u=e=>{if(c[e])return xtt({draft:z(r),ownFolderPaths:z(i),takenFolderNames:z(o),takenSlugs:z(a),locale:e,text:l[e]})},d=({locale:e,value:t},n)=>!u(e)&&(n!==t&&(z(i)?BQe({draft:z(r),ownFolderPaths:z(i),folderNames:{[e]:n}}):LQe({draft:z(r),slugs:{[e]:n}})),!0);var f=H();Bo(P(f),17,()=>z(s),e=>e.locale,(e,t)=>{let n=A(()=>z(t)),r=A(()=>u(z(n).locale));v7(e,{get label(){return z(n).label},get showLabel(){return z(n).showLabel},children:(e,a=kr)=>{var o=Stt(),s=P(o);{let e=A(()=>z(i)?Y(`rename_folder`):Y(`edit_slug`)),o=A(()=>!!z(r)),u=A(()=>!!z(r));p6(s,{get id(){return`${a()??``}-value`},get value(){return z(n).value},get editLabel(){return z(e)},get invalid(){return z(o)},get applyDisabled(){return z(u)},get ariaLabelledby(){return a()},get ariaErrormessage(){return`${a()??``}-error`},onApply:e=>d(z(t),e),get editing(){return c[z(n).locale]},set editing(e){c[z(n).locale]=e},get text(){return l[z(n).locale]},set text(e){l[z(n).locale]=e}})}var u=I(s,2),f=N(u),p=e=>{var t=V();R(()=>W(t,z(r))),U(e,t)};G(f,e=>{z(r)&&e(p)}),D(u),R(()=>q(u,`id`,`${a()??``}-error`)),U(e,o)},$$slots:{default:!0}})}),U(e,f),k()}var Ttt=B(`<div class="empty svelte-ka7cth"> </div>`),Ett=B(`<p class="hint svelte-ka7cth"> </p>`),Dtt=B(`<div role="none" class="editor svelte-ka7cth"><!></div>`),Ott=B(`<p class="note svelte-ka7cth"> </p>`),ktt=B(`<!> <!>`,1),Att={hash:`svelte-ka7cth`,code:`.editor.svelte-ka7cth {
/* The section has padding of its own */--field-editor-padding: 0;}.hint.svelte-ka7cth,
.empty.svelte-ka7cth {margin:0;padding:12px 16px;}.hint.svelte-ka7cth {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.note.svelte-ka7cth {margin:0;padding:0 16px 16px;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}`};function jtt(e,t){O(t,!0),K(e,Att);let n=$M(),r=A(()=>n.current),i=A(()=>h8(z(r))),a=A(()=>PQe(z(r))),o=A(()=>z(i)&&z(r)?Z0(z(r).collection).hint:void 0),s=A(()=>z(i)&&!!z(r)&&o2(z(r).collection)),c=A(()=>Object.entries(z(r)?.slugEditor??{}).filter(([e,t])=>t===!0&&!!z(r)?.currentLocales[e]).map(([e])=>e)),l=A(()=>Object.entries(z(r)?.isNew?IQe(z(r)):z(r)?.currentSlugs??{}).filter(([e,t])=>t!==void 0&&(e===`_`||!!z(r)?.currentLocales[e]))),u=e=>z(s)&&![`_`,`_default`].includes(e)?{label:KA(e)??e,showLabel:!0}:{label:Y(`slug`),showLabel:!1};{let t=A(()=>Y(`entry_sidebar.slug.title`));d7(e,{get title(){return z(t)},children:(e,t)=>{var n=H(),s=P(n),d=e=>{var t=Ttt(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.slug.unavailable`)]),U(e,t)},f=e=>{var t=ktt(),n=P(t),i=e=>{var t=Ett(),n=F(t,!0);R(()=>W(n,z(o))),U(e,t)};G(n,e=>{z(o)&&e(i)});var s=I(n,2),d=e=>{var t=H();Bo(P(t),16,()=>z(c),e=>e,(e,t)=>{{let n=(e,n=kr)=>{var r=Dtt();WQe(N(r),{get locale(){return t},get ariaLabelledby(){return n()}}),D(r),U(e,r)},r=A(()=>u(t));v7(e,As(()=>z(r),{children:n,$$slots:{default:!0}}))}}),U(e,t)},f=e=>{wtt(e,{})},p=e=>{var t=ktt(),n=P(t);Bo(n,17,()=>z(l),([e,t])=>e,(e,t)=>{var n=A(()=>Nr(z(t),2));let r=()=>z(n)[0],i=()=>z(n)[1];{let t=(e,t=kr)=>{p6(e,{get id(){return`${t()??``}-value`},get value(){return i()},canEdit:!1,get ariaLabelledby(){return t()}})},n=A(()=>u(r()));v7(e,As(()=>z(n),{children:t,$$slots:{default:!0}}))}});var i=I(n,2),a=e=>{var t=Ott(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.slug.generated_on_save`)]),U(e,t)};G(i,e=>{z(r)?.isNew&&e(a)}),U(e,t)};G(s,e=>{z(r)?.isNew&&z(c).length?e(d):z(a)?e(f,1):e(p,-1)}),U(e,t)};G(s,e=>{z(i)?e(f,-1):e(d)}),U(e,n)},$$slots:{default:!0}})}k()}var y7=pk(null),Mtt=e=>{let{collectionName:t,fileName:n,isNew:r=!0}=e??{};return[{key:`slug`,icon:`anchor`,disabled:!h8(e)},{key:`validation`,icon:`check_circle`,disabled:!1},{key:`history`,icon:`history`,disabled:!OY.current?.isGit||r},{key:`backlinks`,icon:`article_shortcut`,disabled:!t||!h7({collectionName:t,fileName:n}).length}]},b7=e=>{iG.isSmallScreen?y7.current=e:v8.current={...v8.current,sidebarPanel:e}},Ntt=B(`<h4 class="svelte-mwf2jd"> </h4>`),x7=B(`<span class="summary svelte-mwf2jd"> </span> <!>`,1),Ptt=B(`<!> <!> <!>`,1),Ftt=B(`<div class="empty svelte-mwf2jd"> </div>`),Itt=B(`<section class="locale svelte-mwf2jd" role="group"><!> <!></section>`),Ltt=B(`<div class="empty"> </div>`),Rtt={hash:`svelte-mwf2jd`,code:`.locale.svelte-mwf2jd {padding:4px;&:not(:first-child) {border-top:2px solid var(--sui-secondary-background-color);}h4:where(.svelte-mwf2jd),
.empty:where(.svelte-mwf2jd) {margin:0 !important;padding:12px;}.summary:where(.svelte-mwf2jd) {display:block;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-heading-font-weight);}.sui.button.ref {flex-direction:column;align-items:flex-start;gap:4px;}}`};function ztt(e,t){O(t,!0),K(e,Rtt);let n=J(t,`onSelectField`,3,q6),r=$M(),i=A(()=>r.current??{}),a=A(()=>z(i).validationMessages),o=A(()=>z(i).validities),s=A(()=>Object.values(z(o)??{}).some(e=>!!Object.keys(e).length)),c=j(!1),l=e=>{let t=r.current,{_slug:n,_path:i}=t.validities[e];return{slugValidity:n?.valid===!1?n:void 0,pathMessages:w0(e===t.defaultLocale?i:void 0),invalidFields:FVe({draft:t,locale:e})}},u=async()=>{let e=r.current;e&&!z(c)&&(M(c,!0),await _8({draft:e,awaitFieldUpdates:!1}),M(c,!1))};{let t=e=>{{let t=A(()=>Y(`entry_sidebar.validation.validate`)),n=A(()=>!r.current||z(c));Al(e,{variant:`tertiary`,size:`small`,get label(){return z(t)},get disabled(){return z(n)},onclick:()=>{u()}})}},i=A(()=>Y(`entry_sidebar.validation.title`));d7(e,{get title(){return z(i)},actions:t,children:(e,t)=>{var r=H(),i=P(r),o=e=>{var t=H();Bo(P(t),16,()=>Object.keys(z(a)),e=>e,(e,t)=>{let r=A(()=>KA(t)),i=A(()=>l(t));var a=Itt(),o=N(a),s=e=>{var t=Ntt(),n=F(t,!0);R(()=>W(n,z(r))),U(e,t)};G(o,e=>{z(r)&&e(s)});var c=I(o,2),u=e=>{var r=Ptt(),a=P(r),o=e=>{Al(e,{class:`ref`,variant:`ghost`,onclick:()=>{b7(`slug`)},children:(e,t)=>{var n=x7(),r=P(n),a=F(r,!0);S6(I(r,2),{live:`off`,children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(i).slugValidity.customErrorMessage)),U(e,n)},$$slots:{default:!0}}),R(e=>W(a,e),[()=>Y(`slug`)]),U(e,n)},$$slots:{default:!0}})};G(a,e=>{z(i).slugValidity&&e(o)});var s=I(a,2),c=e=>{Al(e,{class:`ref`,variant:`ghost`,onclick:()=>{n()({locale:t,keyPath:`_path`})},children:(e,t)=>{var n=x7(),r=P(n),a=F(r,!0);Bo(I(r,2),17,()=>z(i).pathMessages,Ro,(e,t)=>{S6(e,{live:`off`,children:(e,n)=>{Qr();var r=V();R(()=>W(r,z(t))),U(e,r)},$$slots:{default:!0}})}),R(e=>W(a,e),[()=>Y(`entry_parent_folder`)]),U(e,n)},$$slots:{default:!0}})};G(s,e=>{z(i).pathMessages.length&&e(c)}),Bo(I(s,2),17,()=>z(i).invalidFields,({keyPath:e,label:t,messages:n})=>e,(e,r)=>{let i=()=>z(r).keyPath,a=()=>z(r).label,o=()=>z(r).messages;Al(e,{class:`ref`,variant:`ghost`,onclick:()=>{n()({locale:t,keyPath:i()})},children:(e,t)=>{var n=x7(),r=P(n),i=F(r,!0);Bo(I(r,2),17,o,Ro,(e,t)=>{S6(e,{live:`off`,children:(e,n)=>{Qr();var r=V();R(()=>W(r,z(t))),U(e,r)},$$slots:{default:!0}})}),R(()=>W(i,a())),U(e,n)},$$slots:{default:!0}})}),U(e,r)},d=e=>{var t=Ftt(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.validation.no_errors_found`)]),U(e,t)};G(c,e=>{z(i).slugValidity||z(i).pathMessages.length||z(i).invalidFields.length?e(u):e(d,-1)}),D(a),U(e,a)}),U(e,t)},c=e=>{var t=Ltt(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`entry_sidebar.validation.placeholder`)]),U(e,t)};G(i,e=>{z(s)?e(o):e(c,-1)}),U(e,r)},$$slots:{actions:!0,default:!0}})}k()}function Btt(e,t){let n=J(t,`onSelectField`,3,void 0);var r=H(),i=P(r),a=e=>{jtt(e,{})},o=e=>{htt(e,{})},s=e=>{att(e,{})},c=e=>{ztt(e,{get onSelectField(){return n()}})};G(i,e=>{t.key===`slug`?e(a):t.key===`history`?e(o,1):t.key===`backlinks`?e(s,2):e(c,-1)}),U(e,r)}var Vtt={hash:`svelte-1n87oxn`,code:`.entry-sidebar-sheet {--sui-drawer-bottom-content-border-start-start-radius: 16px;--sui-drawer-bottom-content-border-start-end-radius: 16px;
/* The panel scrolls its own content below the header */--sui-drawer-main-padding: 0;}`};function Htt(e,t){O(t,!0),K(e,Vtt);let n=j(null),r,i=A(()=>z(n)??y7.current),a=A(()=>!!y7.current&&!z(n)),o=()=>{M(n,y7.current,!0),y7.current=null};js(()=>()=>{y7.current=null});var s=()=>z(a),c=o;{let t=e=>{},a=A(()=>z(i)?Y(`entry_sidebar.${z(i)}.title`):``);Zie(e,{get open(){return s()},set open(e){c(e)},class:`entry-sidebar-sheet`,position:`bottom`,size:`medium`,swipeDismiss:!0,get title(){return z(a)},onClose:()=>{M(n,null),r&&!y7.current&&q6(r),r=void 0},header:t,children:(e,t)=>{var n=H(),a=P(n),s=e=>{Btt(e,{get key(){return z(i)},onSelectField:e=>{r=e,o()}})};G(a,e=>{z(i)&&e(s)}),U(e,n)},$$slots:{header:!0,default:!0}})}k()}var Utt=B(`<div role="none" class="content svelte-19e8zut" id="entry-sidebar-content"><!></div>`),Wtt=B(`<div role="none" class="sidebar svelte-19e8zut"><!> <!></div>`),Gtt={hash:`svelte-19e8zut`,code:`.sidebar.svelte-19e8zut {flex:none;display:flex;flex-direction:row-reverse;.tabs {flex:none;display:flex;flex-direction:column;align-items:center;gap:8px;margin:0;padding:8px 0;width:48px;button {border-radius:4px !important;}}}.content.svelte-19e8zut {flex:none;width:320px;margin-inline-start:8px;border:var(--area-border);border-block-end:0;border-radius:16px 16px 0 0;background-color:var(--sui-primary-background-color);}`};function Ktt(e,t){O(t,!0),K(e,Gtt);let n=$M(),r=A(()=>Mtt(n.current)),i=A(()=>v8.current?.sidebarPanel??null),a=j(null),o,s=A(()=>z(a)??(z(i)?z(r).find(e=>e.key===z(i))?.key??`validation`:null));vk(()=>[n.current?.id,z(i)],()=>{let e=n.current;e?.id===o?M(a,null):(o=e?.id,M(a,FQe(e)?`slug`:null,!0))});var c=Wtt(),l=N(c);{let e=A(()=>Y(`entry_sidebar.sidebar_panels`)),t=A(()=>z(s)?`entry-sidebar-content`:void 0);Jl(l,{class:`tabs`,get ariaLabel(){return z(e)},get"aria-controls"(){return z(t)},children:(e,t)=>{var n=H();Bo(P(n),17,()=>z(r),({key:e,icon:t,disabled:n})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).icon,i=()=>z(t).disabled;{let t=A(()=>Y(`entry_sidebar.${n()}.title`)),o=A(()=>z(s)===n());Yl(e,{iconic:!0,get"aria-label"(){return z(t)},get selected(){return z(o)},get disabled(){return i()},onclick:()=>{let e=z(s)===n()?null:n();M(a,null),v8.current={...v8.current,sidebarPanel:e}},children:(e,t)=>{Xc(e,{get name(){return r()}})},$$slots:{default:!0}})}}),U(e,n)},$$slots:{default:!0}})}var u=I(l,2),d=e=>{var t=Utt();Btt(N(t),{get key(){return z(s)}}),D(t),U(e,t)};G(u,e=>{z(s)&&e(d)}),D(c),U(e,c),k()}var qtt=B(`<!> <!> <!> <!>`,1);function Jtt(e,t){O(t,!0);let n=$M(),r=A(()=>rj(n.current)),i=A(()=>z(r).i18nEnabled),a=A(()=>z(r).allLocales),o=A(()=>n.current?.canPreview??!0),s=A(()=>n.current?.canShowSecondPane??!0),c=A(()=>z(s)&&(v8.current?.showSecondPane??!0)),l=A(()=>z(s)&&(z(i)&&z(a).length>1||z(o))),u=A(()=>z(o)&&!!v8.current?.showPreview),d=A(()=>Object.keys(n.current?.currentValues??{}).length===1);var f=qtt(),p=P(f);mu(p,{});var m=I(p,2);{let e=A(()=>Y(`show_second_pane`)),t=A(()=>!z(l));ku(m,{get label(){return z(e)},get checked(){return z(c)},get disabled(){return z(t)},onChange:()=>{y8(`showSecondPane`,!0)}})}var h=I(m,2);{let e=A(()=>Y(`show_preview`)),t=A(()=>v8.current?.showPreview),n=A(()=>!z(o));ku(h,{get label(){return z(e)},get checked(){return z(t)},get disabled(){return z(n)},onChange:()=>{y8(`showPreview`)}})}var g=I(h,2);{let e=A(()=>Y(`sync_scrolling`)),t=A(()=>v8.current?.syncScrolling),n=A(()=>!z(c)||!z(u)&&z(d));ku(g,{get label(){return z(e)},get checked(){return z(t)},get disabled(){return z(n)},onChange:()=>{y8(`syncScrolling`)}})}U(e,f),k()}var Ytt=({relation:e,excludeIds:t})=>{let{sourceCollection:n,sourceCollectionFile:r}=e,i=r?.name;return rz(n.name).filter(e=>!t.has(e.id)&&(!i||e.slug===i))},Xtt=({relation:e,excludeIds:t,targets:n,getLocaleValues:r,getContentUpdater:i})=>{let{sourceCollection:a,sourceCollectionFile:o}=e,{allLocales:s}=o?._i18n??a._i18n,c=new Map(s.map(e=>[e,r(e)]));[...c.values()].some(({size:e})=>e>0)&&Ytt({relation:e,excludeIds:t}).forEach(e=>{let t=n.get(e.id)?.entry??e,s={},l=i(e);Object.entries(t.locales).forEach(([e,t])=>{let{content:n}=t;if(!n)return;let i=PA(c,e,()=>r(e));if(!i.size)return;let a=l({locale:e,content:n,values:i});a&&(s[e]={...t,content:a})}),Object.keys(s).length&&n.set(e.id,{entry:{...t,locales:{...t.locales,...s}},collection:a,collectionFile:o})})},Ztt=({fieldConfig:e,entries:t,locale:n})=>new Set(t.flatMap(t=>m7({fieldConfig:e,entry:t,locale:n}))),Qtt=({content:e,relation:t,values:n})=>{let{keyPath:r,valuePattern:i,multiple:a}=t,o=p7({content:e,keyPath:r,valuePattern:i,multiple:a}).filter(t=>n.has(e[t]));if(!o.length)return;let s={...e};if(!a)return o.forEach(t=>{s[t]=typeof e[t]==`number`?null:``}),{content:s,fieldKeyPaths:o};let c=EO(o.map(e=>e.replace(I4,``))),l=(e,t)=>n.has(t);return c.forEach(e=>{L4({content:s,listKeyPath:e,isStale:l})}),{content:s,fieldKeyPaths:c}},$tt=({draft:e,entry:t,relation:n,locale:r,content:i,fieldKeyPaths:a})=>R4({draft:e,entry:t,collection:n.sourceCollection,collectionFile:n.sourceCollectionFile,locale:r,content:i,fields:new Map(a.map(e=>[e,n.fieldConfig]))}),ent=({relation:e,entries:t,deletedIds:n,targets:r,blockers:i})=>{let{fieldConfig:a,sourceCollection:o,sourceCollectionFile:s}=e;Xtt({relation:e,excludeIds:n,targets:r,getLocaleValues:e=>Ztt({fieldConfig:a,entries:t,locale:e}),getContentUpdater:t=>{let n=M4({collection:o,collectionFile:s,isIndexFile:aA(o,t)});return({locale:r,content:a,values:o})=>{let s=Qtt({content:a,relation:e,values:o});if(s)return i.push(...$tt({draft:n,entry:t,relation:e,locale:r,content:s.content,fieldKeyPaths:s.fieldKeyPaths})),s.content}}})},tnt=e=>{let t=e.flatMap(t=>{let n=oX(t);return n&&!e.includes(n)?[n]:[]});return t.length?[...e,...new Set(t)]:e},nnt={targets:[],blockers:[]},S7=({collection:e,collectionFile:t,entries:n})=>{let r=new Map,i=[];if(n.length){let a=tnt(n),o=new Set(a.map(({id:e})=>e));h7({collectionName:e.name,fileName:t?.name}).forEach(e=>{ent({relation:e,entries:a,deletedIds:o,targets:r,blockers:i})})}return{targets:[...r.values()],blockers:z4(i)}},C7=(e,t)=>{let{targets:n,blockers:r}=S7(e);if(r.length)throw Error(t,{cause:r});return n},rnt=async({targets:e,cacheDB:t})=>B4({targets:e,cacheDB:t}),int=B(`<!> <!>`,1);function ant(e,t){O(t,!0);let n=$M(),r=J(t,`open`,15,!1),i=A(()=>n.current?.collection),a=A(()=>n.current?.collectionFile),o=A(()=>n.current?.originalEntry),s=A(()=>r()&&z(i)&&z(o)&&!t.discardsDraft?S7({collection:z(i),collectionFile:z(a),entries:[z(o)]}):nnt);{let n=A(()=>Y(`delete_entries`,{values:{count:1}})),i=A(()=>Y(`delete`)),a=A(()=>!!z(s).blockers.length);ru(e,{get title(){return z(n)},get okLabel(){return z(i)},get okDisabled(){return z(a)},get onOk(){return t.onOk},get onClose(){return t.onClose},get open(){return r()},set open(e){r(e)},children:(e,n)=>{var r=H(),i=P(r),a=e=>{x5(e,{get plan(){return z(s)},count:1})},o=e=>{var n=int(),r=P(n),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`workflow.confirm_deleting_unpublished_entry`)]),U(e,t)},a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`workflow.confirm_deleting_published_entry`)]),U(e,t)},o=e=>{var n=V();R(e=>W(n,e),[()=>Y(t.withAssets?`confirm_deleting_this_entry_with_assets`:`confirm_deleting_this_entry`)]),U(e,n)};G(r,e=>{t.discardsDraft?e(i):t.useWorkflow?e(a,1):e(o,-1)}),x5(I(r,2),{get plan(){return z(s)},count:1}),U(e,n)};G(i,e=>{z(s).blockers.length?e(a):e(o,-1)}),U(e,r)},$$slots:{default:!0}})}k()}var ont=(e,t,n)=>{let r=Object.fromEntries(Object.entries(e.locales).map(([e,r])=>[e,r.content?{...r,content:{...r.content,[t]:n}}:{...r}]));return{...e,locales:r}},snt=async(e,t,{cacheDB:n}={})=>{let r=sz(e);if(!r)return{changes:[],savingEntries:[]};let{_i18n:{defaultLocale:i}}=e,a=e4(n),o=[];for(let[e,n]of t.entries()){let t=e+1;Number(n.locales[i]?.content?.[r])!==t&&o.push(ont(n,r,t))}let s=M4({collection:e});return{changes:(await Promise.all(o.map(t=>N4({collection:e,entry:t,draft:s,cacheDB:a})))).flat(),savingEntries:o}},cnt=(e,t)=>{let n=t.map(({arrayIndex:e})=>e).sort((e,t)=>e-t),r=t.filter(({arrayIndex:e},t)=>e!==n[t]);return r.length?{changes:[{action:`update`,path:e._file.fullPath,arrayOrder:t.map(({arrayIndex:e,locales:t})=>({index:e,locales:t}))}],savingEntries:r}:{changes:[],savingEntries:[]}},lnt=async(e,t)=>{let{changes:n,savingEntries:r}=jk(e)?cnt(e,t):await snt(e,t);return n.length?(await a3({changes:n,savingEntries:r,options:{commitType:`update`,collection:e}}),K$.current={...G$,saved:!0,count:r.length},r.length):0},unt=(e,{excludeIds:t,updatedEntries:n}={})=>uz(rz(e.name).filter(n=>!aA(e,n)&&!(t&&t.has(n.id))).map(e=>n?.get(e.id)??e),e),dnt=async(e,{excludeIds:t,updatedEntries:n,cacheDB:r}={})=>!e||e._type!==`entry`||!sz(e)?{changes:[],savingEntries:[]}:snt(e,unt(e,{excludeIds:t,updatedEntries:n}),{cacheDB:r}),fnt=({ids:e,assetPaths:t})=>{let n=vj.current,r=new Set(e);if(vj.current=n.filter(e=>!r.has(e.id)),K$.current={...G$,deleted:!0,count:e.length},t.length){let e=new Set(t);pH.current=pH.current.filter(t=>!e.has(t.path))}},pnt=async(e,t=[])=>{let n=sj.current,r=n?C7({collection:n,entries:e},`Cannot delete entries that other entries require`):[],i=e4(),a=[],o=`delete`,s=await Promise.all(e.map(async e=>{let{id:t,slug:n}=e,r=$P(e);return await Promise.all(r.map(async t=>{let r=await t4({cacheDB:i,previousPath:t});a.push({action:o,slug:n,path:t,previousSha:r,...A4(e)})})),t})),c=t.map(({path:e,sha:t})=>(a.push({action:o,path:e,previousSha:t}),e)),{changes:l,savingEntries:u}=await dnt(n,{excludeIds:new Set(s),updatedEntries:new Map(r.map(({entry:e})=>[e.id,e])),cacheDB:i}),d=new Set(u.map(({id:e})=>e)),{changes:f,savingEntries:p}=await rnt({targets:r.filter(({entry:e})=>!d.has(e.id)),cacheDB:i});a.push(...l,...f),await a3({changes:a,savingEntries:[...u,...p],options:{commitType:`delete`,collection:sj.current}}),fnt({ids:s,assetPaths:c})},mnt=({originalEntry:e,savingEntry:t,canonicalSlugKey:n})=>({...e,slug:t.slug,locales:Object.fromEntries(Object.entries(e.locales).map(([e,r])=>{let{slug:i,content:a}=t.locales[e]??{},o=n?a?.[n]:void 0;return[e,{...r,slug:i??r.slug,content:n&&o!==void 0&&r.content?{...r.content,[n]:o}:r.content}]}))}),hnt=({fieldConfig:e,originalEntry:t,renamedEntry:n,locale:r})=>{let i={fieldConfig:e,locale:r},a=m7({...i,entry:t}),o=m7({...i,entry:n}),s=new Map;return a.length===o.length&&a.forEach((e,t)=>{e!==o[t]&&s.set(e,o[t])}),s},gnt=({content:e,relation:t,replacements:n})=>{let{keyPath:r,valuePattern:i,multiple:a}=t,o=p7({content:e,keyPath:r,valuePattern:i,multiple:a}).filter(t=>n.has(e[t]));if(!o.length)return;let s={...e};return o.forEach(t=>{s[t]=n.get(e[t])}),s},_nt=({collection:e,collectionFile:t,originalEntry:n,savingEntry:r})=>{if(!n||n.slug===r.slug)return[];let i=h7({collectionName:e.name,fileName:t?.name});if(!i.length)return[];let{_i18n:{canonicalSlug:{key:a}}}=t??e,o=mnt({originalEntry:n,savingEntry:r,canonicalSlugKey:a}),s=new Map;return i.forEach(e=>{let{fieldConfig:t}=e;Xtt({relation:e,excludeIds:new Set([n.id]),targets:s,getLocaleValues:e=>hnt({fieldConfig:t,originalEntry:n,renamedEntry:o,locale:e}),getContentUpdater:()=>({content:t,values:n})=>gnt({content:t,relation:e,replacements:n})})}),[...s.values()]},vnt=async({collection:e,collectionFile:t,originalEntry:n,savingEntry:r,cacheDB:i})=>{let a={changes:[],savingEntries:[]},o=_nt({collection:e,collectionFile:t,originalEntry:n,savingEntry:r});if(!o.length)return a;let s=o.filter(e=>L1({collection:e.collection,collectionFile:e.collectionFile})||P4(e.entry));if(s.length){let e=s.map(e=>F4(e.entry,e.collection)).join(`, `);throw Error(Y(`cannot_rename_referenced_entry`,{values:{entries:e}}))}return B4({targets:o,cacheDB:i})},ynt=[`100644`,`100755`],bnt=e=>e.flatMap(({path:e,status:t,previousPath:n,mode:r})=>t===`renamed`?[...n?[{path:n,change:`removed`}]:[],{path:e,change:`added`,mode:r}]:[{path:e,change:t,mode:r}]),xnt=e=>{let{entryFiles:t,assetFiles:n}=YW([jK(e)]);if(t.length)return{type:`entry`,collectionName:t[0].folder.collectionName};if(n.length)return{type:`asset`}},Snt=e=>{let t=yj($P(e));if(t)return t;let n=e=>e.subPath.split(`/`).length;return(e.workflow.previousPaths??[]).map(e=>yj([e])).filter(e=>!!e).reduce((e,t)=>!e||n(t)<n(e)?t:e,void 0)},Cnt=(e,t)=>{if(!e||!wA(e)?.subfolders)return[];let n=jA(t.subPath);return n?rz(e.name).filter(e=>e.id!==t.id&&MA(n,e.subPath)).flatMap(e=>$P(e)):[]},wnt=(e,t)=>!e||!wA(e)?.subfolders||!jA(t.subPath)?[]:$P(t).map(e=>e.slice(0,e.lastIndexOf(`/`)+1)),Tnt=({entry:e,collection:t,updatedEntry:n,deletion:r})=>{let{collectionName:i,fileName:a}=e.workflow;if(!t)return[];let o=a?xj(t,a):void 0;return(r?S7({collection:t,collectionFile:o,entries:[e,...VY.current.filter(t=>t!==e&&t.workflow.status===`pending_deletion`&&t.workflow.collectionName===i&&t.workflow.fileName===a)]}).targets:_nt({collection:t,collectionFile:o,originalEntry:n,savingEntry:e})).flatMap(e=>$P(e.entry))},Ent=(e,t)=>{let{collectionName:n}=e.workflow,r=fj(n),i=Snt(e),a=e.workflow.status===`pending_deletion`,o=$P(e),s=i?$P(i):[],c=new Set([...o,...s]),l=new Set((e.workflow.companions??[]).flatMap(({entry:e})=>$P(e))),u=!a&&!!i&&i.subPath!==e.subPath,d=new Set(u?Cnt(r,i):[]),f=u?wnt(r,e):[],p=new Set(Tnt({entry:e,collection:r,updatedEntry:i,deletion:a})),m=({path:e,change:t,mode:r})=>{if(t!==`removed`&&!ynt.includes(r))return!1;if(c.has(e))return!0;if(l.has(e))return t===`added`;let i=xnt(e);if(!i)return!1;if(i.type===`asset`)return!qV(e)&&(t!==`removed`||a||u);let o=i.collectionName===n;return t===`removed`?o&&d.has(e):t===`added`?o&&f.some(t=>e.startsWith(t)):p.has(e)||o&&d.has(e)};return[...new Set(bnt(t).filter(e=>!m(e)).map(({path:e})=>e))]},w7=e=>Error(`publish_refused`,{cause:e}),Dnt=async(e,t,n)=>{let{headSHA:r}=e.workflow.pullRequest;if(!t.onConfiguredBranches||!t.complete)throw w7({reason:`other_changes`,paths:[]});if(!r||t.headSHA!==r)throw w7({reason:`entry_changed`,paths:[]});let i=Ent(e,t.files);if(!i.length)return;let a=new Set(await n({headSHA:r,paths:i})),o=i.filter(e=>!a.has(e));if(o.length)throw w7({reason:`other_changes`,paths:o})},Ont=(e,t)=>{let{workflow:n}=e;return n.pullRequest.headSHA===t?e:{...e,workflow:{...n,pullRequest:{...n.pullRequest,headSHA:t}}}},T7=(e,t)=>e?.message===`publish_refused`?Y(e.cause.reason===`entry_changed`?`workflow.publish_refused_entry_changed`:`workflow.publish_refused_other_changes`):CW(e,t),E7=()=>{let e=OY.current?.workflow;if(!e)throw Error(`Editorial Workflow is not supported by the current backend`);return e},knt=e=>{let{collectionName:t,fileName:n}=e.workflow,r=fj(t);if(r)return{entry:e,collection:r,collectionFile:n?xj(r,n):void 0}},Ant=e=>(e.workflow.companions??[]).flatMap(({collectionName:e,entry:t})=>{let n=fj(e);return n?[{entry:t,collection:n}]:[]}),jnt=({collectionName:e,slug:t,entry:n})=>{let r=n?.workflow?.pullRequest.branch,i=(r?ZY(r):void 0)??YY({collectionName:e,slug:t,entry:n});return{existingEntry:i,branch:i?.workflow.pullRequest.branch??LMe({collectionName:e,slug:t})}},Mnt=(e,t)=>e?.workflow.previousPaths?.length?e.workflow.previousPaths:t,D7=e=>{let{branch:t}=e.workflow.pullRequest,n=VY.current,r=n.findIndex(e=>e.workflow.pullRequest.branch===t);VY.current=r===-1?[...n,e]:n.with(r,e)},Nnt=e=>{VY.current=VY.current.filter(t=>t.workflow.pullRequest.branch!==e)},Pnt=(e,{pullRequest:t,collectionName:n,fileName:r,previousPaths:i,companions:a})=>{let o={...e,workflow:{pullRequest:t,status:t.status,collectionName:n,fileName:r,previousPaths:i,...a.length?{companions:a}:{}}};return D7(o),o},Fnt=(e,t)=>{Nnt(e.branch),t(e.branch),rMe([e.headSHA])},Int=e=>{e.size&&(pH.current=pH.current.flatMap(t=>e.has(t.path)?t.workflow?[{...t,workflow:{branch:t.workflow.branch}}]:[]:[t]))},Lnt=(e,{deletion:t=!1,cascadedEntries:n=new Map,removedPaths:r=new Set}={})=>{let{workflow:i,...a}=e,o=t?[]:(i.companions??[]).map(({entry:e})=>e),s=new Set([a,...o].flatMap(e=>$P(e,{includePrevious:!0}))),c=vj.current.filter(e=>!Object.values(e.locales).some(({path:e})=>s.has(e))).map(e=>n.get(e.id)??e);vj.current=t?c:[...c,a,...o],Fnt(i.pullRequest,cUe),Int(r)},Rnt=(e,t)=>{let n=new Set(t.flatMap(({entry:e})=>$P(e)));return[...e.filter(({entry:e})=>!$P(e).some(e=>n.has(e))),...t]},znt=async({changes:e,savingEntry:t,savingAssets:n=[],options:r,collectionName:i,fileName:a,slug:o,originalEntry:s,companions:c=[]})=>{let l=E7(),u=await Z4(e,r),{existingEntry:d,branch:f}=jnt({collectionName:i,slug:o,entry:s}),{commit:p,pullRequest:m}=await l.savePullRequest({changes:e,options:u,branch:f,title:PW(PU(e),u),status:`draft`,pullRequest:d?.workflow.pullRequest}),h=i3(),{date:g}=p,_=Mnt(d,s?$P(s):[]),v=n.map(e=>({...e,sha:p.files[e.path]?.sha??e.sha,commitAuthor:h,commitDate:g,workflow:{branch:f}})),y=Pnt({...t,id:d?.id??t.id,commitAuthor:h,commitDate:g},{pullRequest:{...m,headSHA:p.sha},collectionName:i,fileName:a,previousPaths:_,companions:Rnt(d?.workflow.companions??[],c)});return v4(v),{commit:{...p,author:h},savedEntries:[y],savedAssets:v}},Bnt=async(e,t)=>{let{number:n,author:r}=e;if($V.current||n===void 0||r?.login&&r.login===OW.account?.login)return;let i=E7();try{await(t?i.approve(e):i.withdrawApproval(e))}catch(e){console.warn(`Failed to ${t?`approve`:`withdraw the approval of`} the pull request.`,e)}},O7=async(e,t)=>{let n=E7(),{pullRequest:r}=e.workflow;D7({...e,workflow:{...e.workflow,status:t,pullRequest:{...r,status:t}}});let i;try{i=await n.updateStatus(r,t)}catch(t){throw tH(t)?Lnt(e):D7(e),t}let a={...e,workflow:{...e.workflow,pullRequest:i,status:t}};D7(a);let{status:o}=e.workflow,s=[`draft`,`pending_review`];return t===`pending_publish`&&s.includes(o)?await Bnt(i,!0):o===`pending_publish`&&s.includes(t)&&await Bnt(i,!1),a},Vnt=new Map,Hnt=async e=>{let t=E7(),{status:n}=e.workflow,{pullRequest:r}=e.workflow,i=n===`pending_deletion`,a=knt(e),o=i?[]:Ant(e),[s,c]=i?[`preUnpublish`,`postUnpublish`]:[`prePublish`,`postPublish`],l=await t.fetchMergeState(r);await Dnt(e,l,t.fetchUnchangedPaths),a&&await E4({...a,type:s}),await Promise.all(o.map(e=>E4({...e,type:s}))),n===`draft`&&({pullRequest:r}=(await O7(e,`pending_publish`)).workflow),await t.publish(r),Lnt(e,{deletion:i,cascadedEntries:new Map(i&&a?S7({collection:a.collection,collectionFile:a.collectionFile,entries:[e]}).targets.map(({entry:e})=>[e.id,e]):[]),removedPaths:new Set(l.files.flatMap(({status:e,path:t,previousPath:n})=>e===`removed`?[t]:e===`renamed`&&n?[n]:[]))}),await v4e(),T4e(e),a&&await E4({...a,type:c}),await Promise.all(o.map(e=>E4({...e,type:c})))},Unt=async e=>{let{branch:t}=e.workflow.pullRequest;return IA(Vnt,t,()=>{let n=Hnt(e).finally(()=>{WY.current=WY.current.filter(e=>e!==t)});return WY.current=[...WY.current,t],n})},Wnt=async(e,t)=>Unt(Ont(e,t?.workflow?.pullRequest.headSHA)),k7=async e=>{let t=E7(),{pullRequest:n}=e.workflow;await t.discard(n),Fnt(n,y4)},Gnt=e=>[{action:`delete`,slug:e.slug,path:$P(e)[0]}],Knt=async(e,t,n,r=[],{targets:i=void 0,userMessage:a=void 0}={})=>{if($V.current)throw SW(`Cannot delete a published entry as an Open Authoring contributor`,`open_authoring.direct_commit_unsupported`);i??=C7({collection:t,collectionFile:n,entries:[e]},`Cannot delete an entry that other entries require`);let o=E7(),s=t.name,{slug:c}=e,{existingEntry:l,branch:u}=jnt({collectionName:s,slug:c,entry:e}),d=$P(e),f=Gnt(e),p=await Z4(f,{commitType:`delete`,collection:t,userMessage:a}),m=EO(r.map(({path:e})=>e)),h=(l?.workflow.companions??[]).flatMap(({entry:e})=>$P(e)),{changes:g}=await rnt({targets:i}),{commit:_,pullRequest:v}=await o.savePullRequest({changes:[...[...d,...m,...h].map(e=>({action:`delete`,slug:c,path:e})),...g],options:p,branch:u,title:PW(PU(f),p),status:`pending_deletion`,pullRequest:l?.workflow.pullRequest}),y=t=>Pnt(e,{pullRequest:{...t,headSHA:_.sha},collectionName:s,fileName:n?.name,previousPaths:Mnt(l,d),companions:[]});return v.status===`pending_deletion`?y(v):(y(v),y(await o.updateStatus(v,`pending_deletion`)))},qnt=async e=>{await yW(e,k7)},Jnt=async e=>{let t=({collection:e,collectionFile:t})=>`${e.name}\0${t?.name??``}`,n=Map.groupBy(e,t),r=new Map;n.forEach((e,t)=>{let[{collection:n,collectionFile:i}]=e;r.set(t,C7({collection:n,collectionFile:i,entries:e.map(({entry:e})=>e)},`Cannot delete entries that other entries require`))});let[{entry:i,collection:a}]=e,{userMessage:o}=await Z4(Gnt(i),{commitType:`delete`,collection:a});await yW(e,async e=>{let{entry:n,collection:i,collectionFile:a,assets:s}=e;await Knt(n,i,a,s,{targets:r.get(t(e)),userMessage:o})})},A7=async({entries:e,collection:t,collectionFile:n})=>{l8(),t&&await Promise.all(e.map(async({slug:e})=>{try{await o8(t.name,n?.name??e)}catch(e){console.error(e)}}))},Ynt=async({drafts:e=[],items:t=[],collection:n=void 0,collectionFile:r=void 0,useWorkflow:i})=>{let a=async()=>{e.length&&(await qnt(e),await A7({entries:e,collection:n,collectionFile:r}))};if(t.length){let e=t.map(({entry:e})=>e);if(i&&n)return await Jnt(t.map(({entry:e,assets:t})=>({entry:e,collection:n,collectionFile:r,assets:t}))),await A7({entries:e,collection:n,collectionFile:r}),await a(),{deleted:!0,deletionPending:!0,count:t.length};await pnt(e,t.flatMap(({assets:e})=>e)),await A7({entries:e,collection:n,collectionFile:r}),await a()}else return await a(),e.length?{deleted:!0,count:e.length}:void 0},j7=({pendingDeletion:e,publishedVersionExists:t})=>e?{label:Y(`workflow.cancel_deletion`),title:Y(`workflow.cancel_deletion`),message:Y(`workflow.confirm_cancelling_deletion`)}:t?{label:Y(`discard`),title:Y(`workflow.discard_changes`),message:Y(`workflow.confirm_discarding_entry_changes`)}:{label:Y(`delete`),title:Y(`delete_entries`,{values:{count:1}}),message:Y(`workflow.confirm_deleting_unpublished_entry`)},Xnt=({deletion:e})=>e?{label:Y(`delete`),title:Y(`delete_entries`,{values:{count:1}}),message:Y(`workflow.confirm_completing_deletion`)}:{label:Y(`publish`),title:Y(`workflow.publish_entry`),message:Y(`workflow.confirm_publishing_entry_after_build`)},Znt=B(`<!> <!> <!> <!>`,1);function Qnt(e,t){O(t,!0);let n=$M(),r=J(t,`deleting`,15,!1),i=j(!1),a=j(!1),o=j(!1),s=j(``),c=j(``),l=A(()=>j7({pendingDeletion:t.pendingDeletion,publishedVersionExists:!0})),u=()=>{M(i,!0)},d=()=>{M(a,!0)},f=async(e,i)=>{let a=n.current;M(c,i,!0),r(!0);let{ok:l,cancelled:u,result:d,error:f}=await Y4(e);r(!1),l?(d&&(K$.current={...G$,count:1,...d}),n.current===a&&t.onDone()):u||(M(s,CW(f,`deleting_entry_failed`),!0),M(o,!0))},p=async()=>{await f(()=>Ynt({drafts:t.discardsDraft?[t.unpublishedEntry]:[],items:t.discardsDraft?[]:[{entry:t.originalEntry,assets:t.associatedAssets}],collection:t.collection,collectionFile:t.collectionFile,useWorkflow:t.useWorkflow}),`workflow.deleting_entry`)},m=async()=>{await f(async()=>(t.unpublishedEntry&&await k7(t.unpublishedEntry),t.pendingDeletion?{deletionCancelled:!0}:{discarded:!0}),t.pendingDeletion?`workflow.cancelling_deletion`:`workflow.discarding_changes`)};var h={confirmDelete:u,confirmDiscard:d},g=Znt(),_=P(g);{let e=A(()=>!!t.associatedAssets.length);ant(_,{get discardsDraft(){return t.discardsDraft},get useWorkflow(){return t.useWorkflow},get withAssets(){return z(e)},onOk:async()=>{await p()},get onClose(){return t.onClose},get open(){return z(i)},set open(e){M(i,e,!0)}})}var v=I(_,2);ru(v,{get title(){return z(l).title},get okLabel(){return z(l).label},onOk:async()=>{await m()},get onClose(){return t.onClose},get open(){return z(a)},set open(e){M(a,e,!0)},children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(l).message)),U(e,n)},$$slots:{default:!0}});var y=I(v,2),b=e=>{Xu(e,{get id(){return z(c)},get show(){return r()},duration:0,children:(e,t)=>{el(e,{status:`info`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(z(c))]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};return G(y,e=>{z(c)&&e(b)}),Xu(I(y,2),{get show(){return z(o)},set show(e){M(o,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(s))),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,g),k(h)}function $nt(e,t){O(t,!0);let n=e=>{var n=H(),r=P(n),i=e=>{let n=A(()=>Vet(t.conflict,Jc.current));var r=V();R(()=>W(r,`${z(n).description??``}
${z(n).warning??``}`)),U(e,r)};G(r,e=>{t.conflict&&e(i)}),U(e,n)},r=J(t,`open`,15,!1);var i=H(),a=P(i),o=e=>{{let i=A(()=>Y(`save_conflict.title`));nu(e,{get title(){return z(i)},get onClose(){return t.onClose},get open(){return r()},set open(e){r(e)},children:(e,t)=>{n(e)},$$slots:{default:!0}})}},s=e=>{{let i=A(()=>Y(`save_conflict.title`)),a=A(()=>Y(`save_conflict.save_anyway`));ru(e,{get title(){return z(i)},get okLabel(){return z(a)},get onOk(){return t.onOverwrite},get onClose(){return t.onClose},get open(){return r()},set open(e){r(e)},children:(e,t)=>{n(e)},$$slots:{default:!0}})}};G(a,e=>{t.conflict?.canOverwrite===!1?e(o):e(s,-1)}),U(e,i),k()}var ert=B(`<span role="none"> </span>`),trt={hash:`svelte-xa0q0i`,code:`
/*
* Filled pill following the same background/foreground/border recipe as the Alert and Infobar
* components, so the colors adapt to both the light and dark themes. The border does most of the
* work in dark mode, where the alert background is nearly the same as the row background.
*/.status-badge.svelte-xa0q0i {display:inline-block;border-width:1px;border-style:solid;border-radius:12px;padding:1px 6px;font-size:var(--sui-font-size-x-small);line-height:var(--sui-line-height-compact);white-space:nowrap;&.draft {border-color:var(--sui-info-border-color);background-color:var(--sui-info-background-color);color:var(--sui-info-foreground-color);}&.pending_review {border-color:var(--sui-warning-border-color);background-color:var(--sui-warning-background-color);color:var(--sui-warning-foreground-color);}&.pending_publish {border-color:var(--sui-success-border-color);background-color:var(--sui-success-background-color);color:var(--sui-success-foreground-color);}&.pending_deletion {border-color:var(--sui-error-border-color);background-color:var(--sui-error-background-color);color:var(--sui-error-foreground-color);}}`};function M7(e,t){O(t,!0),K(e,trt);var n=ert(),r=F(n,!0);R(e=>{os(n,1,`status-badge ${t.status??``}`,`svelte-xa0q0i`),W(r,e)},[()=>Y(mq[t.status])]),U(e,n),k()}var nrt=({entryDraft:e,branch:t,collectionName:n})=>{(e.current?.originalEntry)?.workflow?.pullRequest.branch===t&&(e.current=null,s$(`/collections/${n}`))},rrt=(e,{entryDraft:t,branch:n,collectionName:r})=>tH(e)?(t.modified||nrt({entryDraft:t,branch:n,collectionName:r}),K$.current={...G$,alreadyPublished:!0},!0):!1,irt=({entry:e,draft:t})=>{if(t?.originalEntry?.id===e.id)return ZQe({draft:t});let{collectionName:n,fileName:r}=e.workflow,i=Sj(n,r);if(!i)return!0;let{collection:a,collectionFile:o}=i;return g8({draft:p8({collection:a,collectionFile:o,originalEntry:e})}).valid},art=({entry:e,status:t,draft:n})=>t===`draft`||irt({entry:e,draft:n}),ort=({entry:e,draft:t})=>e.workflow.status===`pending_deletion`||irt({entry:e,draft:t}),srt=B(`<!> <!> <!>`,1);function crt(e,t){O(t,!0);let n=$M(),r=J(t,`disabled`,3,!1),i=j(!1),a=j(!1),o=j(``),s=j(!1),c=A(()=>PY(t.entry)),l=A(()=>FY(t.entry)),u=A(()=>Y(mq[z(l)])),d=A(()=>Y(`workflow.entry_status_value`,{values:{status:z(u)}})),f=async e=>{if(e===z(l)||z(i))return;if(!art({entry:t.entry,status:e,draft:n.current})){M(s,!0);return}M(i,!0);let{collectionName:r,pullRequest:c}=t.entry.workflow;try{await O7(t.entry,e)}catch(e){rrt(e,{entryDraft:n,branch:c.branch,collectionName:r})||(M(o,T7(e,`workflow.status_change_failed`),!0),M(a,!0),console.error(e))}finally{M(i,!1)}};var p=srt(),m=P(p),h=e=>{M7(e,{get status(){return z(l)}})},g=e=>{{let t=e=>{{let t=A(()=>Y(`workflow.change_entry_status`));Eu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();Bo(P(n),16,()=>z(c),e=>e,(e,t)=>{{let n=A(()=>Y(mq[t])),r=A(()=>t===z(l));Au(e,{get label(){return z(n)},get checked(){return z(r)},onChange:()=>{f(t)}})}}),U(e,n)},$$slots:{default:!0}})}},n=A(()=>z(i)?Y(`workflow.changing_status`):iG.isLargeScreen?z(d):z(u)),a=A(()=>r()||z(i)),o=A(()=>z(i)?Y(`workflow.changing_status`):z(d));Xl(e,{variant:`ghost`,get label(){return z(n)},get disabled(){return z(a)},popupPosition:`bottom-right`,get"aria-label"(){return z(o)},popup:t,$$slots:{popup:!0}})}};G(m,e=>{z(c).length===1?e(h):e(g,-1)});var _=I(m,2);Xu(_,{get show(){return z(a)},set show(e){M(a,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(o))),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Xu(I(_,2),{get show(){return z(s)},set show(e){M(s,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`workflow.status_change_blocked`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,p),k()}var lrt=B(`<!> <!> <!> <!>`,1);function urt(e,t){O(t,!0);let n=$M(),r=J(t,`disabled`,3,!1),i=J(t,`modified`,3,!1),a=j(!1),o=j(!1),s=j(``),c=j(!1),l=A(()=>t.entry.workflow.status===`pending_deletion`),u=A(()=>Xnt({deletion:z(l)})),d=A(()=>WY.current.includes(t.entry.workflow.pullRequest.branch)),f=A(()=>rX(t.entry,fj(t.entry.workflow.collectionName))),p=async()=>{if(!ort({entry:t.entry,draft:n.current})){M(c,!0);return}let{collectionName:e,pullRequest:r}=t.entry.workflow;try{await Wnt(t.entry,n.current?.originalEntry),nrt({entryDraft:n,branch:r.branch,collectionName:e})}catch(e){M(s,T7(e,`workflow.publishing_entry_failed`),!0),M(o,!0),console.error(e)}};var m=lrt(),h=P(m),g=e=>{{let t=A(()=>z(d)&&!z(l)?Y(`publishing`):z(u).label),n=A(()=>r()||i()&&!z(l)||z(d));Al(e,{variant:`primary`,get label(){return z(t)},get"aria-label"(){return z(u).title},get disabled(){return z(n)},onclick:()=>{M(a,!0)}})}};G(h,e=>{z(f)&&e(g)});var _=I(h,2);ru(_,{get title(){return z(u).title},get okLabel(){return z(u).label},onOk:()=>{p()},get open(){return z(a)},set open(e){M(a,e,!0)},children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(u).message)),U(e,n)},$$slots:{default:!0}});var v=I(_,2);Xu(v,{get show(){return z(o)},set show(e){M(o,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(s))),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Xu(I(v,2),{get show(){return z(c)},set show(e){M(c,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`workflow.publish_blocked`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,m),k()}var N7=(e,t)=>e.find(e=>e.name===t),drt=e=>A8([e])&&!e.readonly&&!(e.widget===`number`&&e.auto_increment)&&!y2(e),frt=e=>e?._type===`entry`&&!!e.bulk_edit,prt=e=>{if(!e||!frt(e))return[];let{bulk_edit:t}=e,n=E(t)&&Array.isArray(t.fields)?t.fields:void 0;return(n?n.map(t=>N7(e.fields,t)):e.fields).filter(e=>!!e&&drt(e))},mrt=/^\d{4}-\d{2}-\d{2}$/,P7=e=>Array.isArray(e)?e.some(P7):typeof e==`string`&&Kk.test(e),hrt=e=>!!e&&(P7(e.pattern)||Hz.some(t=>P7(e[t]))),F7=(e,t=new Date)=>{if(typeof e!=`string`||!Kk.test(e))return e;if(e===`{{now}}`)return t;let{year:n,month:r,day:i,hour:a,minute:o,second:s}=_z({date:t}),c=`${n}-${r}-${i}`,l={year:n,month:r,day:i,hour:a,minute:o,second:s};return e.replace(qk,(e,t)=>t===`now`?`${c}T${a}:${o}:${s}`:t===`today`?c:Yk.includes(t)?l[t]:e)},grt=e=>{let{format:t,dateOnly:n,timeOnly:r,utc:i}=IN(e);return!t&&!n&&!r&&!i},I7=(e,t,n)=>{if(e instanceof Date)return KN(e)?e:void 0;if(e==null||e===``)return;if(mrt.test(String(e))&&(!t||grt(t))){let[t,n,r]=String(e).split(`-`).map(Number);return new Date(t,n-1,r)}if(t)return iP(String(e),t,n);let r=new Date(e);return KN(r)?r:void 0},_rt=e=>typeof e==`number`&&Number.isFinite(e)||typeof e==`string`&&e.trim()!==``&&Number.isFinite(Number(e)),vrt=({value:e,target:t,dateFieldConfig:n,locale:r})=>{if(e==null||t==null)return;if(n||e instanceof Date||t instanceof Date){let i=I7(e,n,r),a=I7(t,n,r);return i&&a?i.getTime()-a.getTime():void 0}if(_rt(e)&&_rt(t))return Number(e)-Number(t);let i=String(e),a=String(t);return i<a?-1:+(i>a)},L7=(e,t)=>e===t||e!=null&&t!==void 0&&String(e)===String(t),yrt=(e,{dateFieldConfig:t,now:n=new Date,locale:r=void 0}={})=>{let i=F7(e.pattern,n),a=Hz.filter(t=>e[t]!==void 0).map(i=>{let a=e[i];if(i===`empty`)return{operator:i,target:a};if(i===`in`||i===`not_in`)return{operator:i,target:(Array.isArray(a)?a:[a]).map(e=>F7(e,n))};let o=F7(a,n);return t&&i!==`eq`&&i!==`ne`?{operator:i,target:I7(o,t,r)}:{operator:i,target:o}});return{pattern:i,regex:XR(i),comparisons:a,dateFieldConfig:t,locale:r}},brt=({rawValue:e,refValue:t,conditions:n})=>{let{pattern:r,regex:i,comparisons:a,dateFieldConfig:o,locale:s}=n,c=[e].flat().filter(e=>e!==void 0),l=[...new Set([...c,...[t].flat().filter(e=>e!==void 0)])];return r!==void 0&&!l.some(e=>Yz(e,r,i))?!1:a.every(({operator:t,target:n})=>{switch(t){case`eq`:return l.some(e=>L7(e,n));case`ne`:return!l.some(e=>L7(e,n));case`in`:return l.some(e=>n.some(t=>L7(e,t)));case`not_in`:return!l.some(e=>n.some(t=>L7(e,t)));case`empty`:return[e].flat().every(Hj)===n;default:return c.some(e=>{let r=vrt({value:e,target:n,dateFieldConfig:o,locale:s});return r===void 0?!1:t===`lt`?r<0:t===`lte`?r<=0:t===`gt`?r>0:r>=0})}})},R7=e=>iB(e,`filters`),xrt=(e,t,n,r=new Date)=>{let{name:i,view_filters:a=[],_i18n:{defaultLocale:o}}=t,{options:s}=R7(a),c=s.map(e=>Gz(Uz(e))),l=n.filter(e=>e.field!==void 0&&c.includes(Gz(e))).map(e=>{let t=bM({collectionName:i,keyPath:e.field}),n=t?.widget===`datetime`?t:void 0;return{field:e.field,conditions:yrt(e,{dateFieldConfig:n,now:r,locale:o})}});return e.filter(e=>l.every(({field:t,conditions:n})=>{let r={entry:e,locale:o,collectionName:i,key:t};return brt({rawValue:LB({...r,resolveRef:!1}),refValue:LB({...r}),conditions:n})}))},Srt=hk(()=>{let e=sj.current;return e?._type===`entry`?R7(e.view_filters).options:[]}),z7=e=>iB(e,`groups`),Crt=e=>{if(e?._type!==`entry`)return;let t=cz(e);if(!t)return;let n=z7(e.view_groups).options.find(e=>e.name===t);return n?Uz(n):void 0},wrt=(e,t,n,r)=>{let{name:i,view_groups:a,_i18n:{defaultLocale:o}}=t,{field:s}=n,c=Gz(n),l=bM({collectionName:i,keyPath:s}),u=yrt(n,{dateFieldConfig:l?.widget===`datetime`?l:void 0,now:r,locale:o}),d=z7(a).options.find(e=>Gz(Uz(e))===c)?.label||s,f=[],p=[];return e.forEach(e=>{let t={entry:e,locale:o,collectionName:i,key:s};(brt({rawValue:LB({...t,resolveRef:!1}),refValue:LB({...t}),conditions:u})?f:p).push(e)}),[{name:d,entries:f},{name:`*other`,entries:p}].filter(e=>e.entries.length)},Trt=(e,t,n,r=new Date)=>{let{field:i,pattern:a}=n??{field:``,pattern:void 0};if(!i)return e.length?[{name:`*`,entries:e}]:[];if(Wz(n))return wrt(e,t,n,r);let{name:o,_i18n:{defaultLocale:s}}=t,c=g3.current.sort,l=qz(e,a,e=>LB({entry:e,locale:s,collectionName:o,key:i})).map(([e,t])=>({name:e,entries:t}));return c?.key===i&&c.order===`descending`&&l.reverse(),l},Ert=hk(()=>{let e=sj.current;return e?._type===`entry`?z7(e.view_groups).options:[]}),B7=pk(!1),V7=pk([]),H7=pk(!1),U7=pk(!1),W7=pk({}),G7=pk(!1),K7=pk([]),q7=pk({}),Drt=()=>B7.current||U7.current,Ort=6e4,J7=pk(new Date),krt=hk(()=>{let{filters:e=[],group:t}=g3.current;return e.some(hrt)||hrt(t)}),Art=gk(()=>g3.current.sort),Y7=gk(()=>g3.current.filters),jrt=gk(()=>g3.current.group),X7=hk(()=>{let{current:e}=vj,{current:t}=sj,{current:n}=CA;if(!e||!t)return[];let r=e=>NA({collection:t,entries:e,dirPath:n}),i=rz(t.name);return Drt()?r(i):r(iX(i,VY.current.filter(({workflow:e})=>e.collectionName===t.name)))}),Z7=hk(()=>{let{current:e}=sj;if(e?._type!==`entry`||Drt())return[];let t=new Set(X7.current),n=NA({collection:e,entries:VY.current.filter(n=>n.workflow.collectionName===e.name&&!t.has(n)),dirPath:CA.current});if(!n.length)return[];let{current:r}=Art,{current:i}=Y7;return r&&(n=wB(n,e,r)),i&&(n=xrt(n,e,i,J7.current)),n}),Mrt=hk(()=>new Map(X7.current.map((e,t)=>[e.id,t]))),Nrt=5,Q7=hk(()=>{let{current:e}=sj,t=!!e&&R1({collection:e});if(e?._type===`entry`){let n=(e.create??!0)&&e.limit!==0,r=!t&&(e.delete??!0),i=!t&&!$V.current&&!YV.current,a=i&&oz(e),o=i&&!!prt(e).length,s=e?.limit??1/0,c=C8(e.name),l=s<1/0?s-c:1/0;return{isEntryCollection:!0,readonly:t,canCreate:n,canDelete:r,canReorder:a,canBulkEdit:o,quota:s,remaining:l,nearingQuota:l>0&&l<=Nrt,creationDisabled:!n||t||l<=0}}return{isEntryCollection:!1,readonly:t,canCreate:!1,canDelete:!1,canReorder:!1,canBulkEdit:!1,quota:1/0,remaining:1/0,nearingQuota:!1,creationDisabled:!1}}),Prt=hk(()=>{let e=sj.current,{current:t}=X7,{current:n}=Art;return n?wB(t,e,n):t}),Frt=hk(()=>{let e=sj.current,{current:t}=Prt,{current:n}=Y7;return n?xrt(t,e,n,J7.current):t}),$7=hk(()=>{let e=sj.current,{current:t}=X7;if(!t.length||wj(e,t[0]).length)return[];let{current:n}=jrt;return Trt(Frt.current,e,n,J7.current)}),Irt=hk(()=>new Set([...Z7.current,...$7.current.flatMap(({entries:e})=>e)])),Lrt=(e,t)=>{let{view_filters:n,view_groups:r}=e,i={...h3.current?.[e.name]},{default:a}=vB({collection:e,isCommitAuthorAvailable:t.some(e=>!!e.commitAuthor),isCommitDateAvailable:t.some(e=>!!e.commitDate)}),{keys:o}=vB({collection:e,isCommitAuthorAvailable:!0,isCommitDateAvailable:!0}),{default:s}=R7(n),{options:c,default:l}=z7(r);i.sort?.key!==void 0&&!o.includes(i.sort.key)&&delete i.sort,i.group&&!c.some(e=>Gz(Uz(e))===Gz(i.group))&&delete i.group,i.sort===void 0&&a&&(i.sort=a),i.filters===void 0&&s&&(i.filters=[s]),i.group===void 0&&l&&(i.group=l),(0,yr.default)(i,g3.current)||(g3.current=i)},e9=e=>{if(!e){V7.current=[],H7.current=!1,y3.current&&=(g3.current=y3.current.view,void 0),B7.current=!1;return}let t=g3.current,n=Crt(sj.current);y3.current={collectionName:sj.current?.name,view:t};let r={};t.sort?.key!==`_manual`&&(r.sort={key:`_manual`,order:`ascending`}),t.filters?.length&&(r.filters=[]),n?Qz(t.group)!==Qz(n)&&(r.group=n):t.group&&(r.group=null),Object.keys(r).length&&(g3.current={...t,...r}),B7.current=!0},t9=e=>{W7.current={},q7.current={},K7.current=[],U7.current=e};_k(()=>{let e=sj.current,{current:t}=vj;e?._type===`entry`&&fo(()=>{y3.current?.collectionName!==e.name&&Lrt(e,t)})}),_k(()=>{if(!krt.current)return;J7.current=new Date;let e=setInterval(()=>{J7.current=new Date},Ort);return()=>{clearInterval(e)}}),_k(()=>{let{current:e}=OY;e&&!fo(()=>h3.current)&&SWe(e)}),_k(()=>{let e=X7.current;Y7.current,ZR.current=[],fo(()=>IG.devModeEnabled)&&console.info(`listedEntries`,e)}),_k(()=>{let e=ZR.current;if(!e.length)return;let{current:t}=Irt;e.some(e=>!t.has(e))&&(ZR.current=e.filter(e=>t.has(e)))}),_k(()=>{let e=sj.current;fo(()=>{y3.current=void 0,B7.current&&e9(!1),U7.current&&t9(!1)}),e&&fo(()=>IG.devModeEnabled)&&console.info(`selectedCollection`,e)});var Rrt=[...Lk,...Rk],zrt=async({draft:e,currentValues:t})=>{let{originalEntry:n,collection:r,collectionName:i,fileName:a,isIndexFile:o}=e,s={};if(!n)return s;let{defaultLocale:c}=e,l=ZP(n,{defaultLocale:c})?.path,u=!!l&&!!d4(r,l),d=YYe({files:s}),f=async({value:e,folder:t,typedKeyPath:r,locale:o})=>{let s=_4(_X({value:e,entry:n,collectionName:i,fileName:a,typedKeyPath:r,locale:o}),n);if(s&&lH(s.path).some(e=>e.collectionName===i&&e.fileName===a&&e.entryRelative))return d(s.path,async()=>{try{return await JYe(s)}catch{return}},t)},p=async({valueMap:t,locale:n,keyPath:r})=>{let s=t[r];if(typeof s!=`string`||!s)return;let c=yM(e,{valueMap:t,keyPath:r}),l=bM(c),{widget:d=`string`}=l??{};if(!Rrt.includes(d))return;let p=gxe(c),m=E3({collectionName:i,fileName:a,typedKeyPath:p,isIndexFile:o});if(!m.entryRelative||!(u||m.hasTemplateTags))return;let h=await ZYe({value:s,format:Lk.includes(d)?void 0:bZ(l),rewrite:e=>f({value:e,folder:m,typedKeyPath:p,locale:n})});h!==void 0&&(t[r]=h)};return await Promise.all(Object.entries(t).flatMap(([e,t])=>Object.keys(t).map(n=>p({valueMap:t,locale:e,keyPath:n})))),s},Brt=({keyPath:e,...t})=>{let n=e.split(`.`);for(let e=1;e<=n.length;e+=1){let r=n.slice(0,e).join(`.`),i=bM({...t,keyPath:r});if(i?.widget===`hidden`)return{fieldConfig:i,keyPath:r}}},Vrt=({getFieldArgs:e,locale:t,defaultLocale:n,valueMap:r,canonicalSlugKey:i,aliasesKey:a,orderFieldKey:o})=>{let s=new Set,c=new Map;delete r[i],H2(r,a),o&&delete r[o];let l={...e,valueMap:r},u=new Map;return Object.keys(r).forEach(e=>{let i=bM({...l,keyPath:e});i?.widget===`uuid`&&(t===n||R0(i.i18n)?r[e]=c6(i):F2({fieldConfig:i,getFieldArgs:{...l,keyPath:e}})&&(r[e]=``,c.set(e,i))),i?.widget===`compute`&&qB(i.value)&&(t===n||z0(i?.i18n))&&(r[e]=``);let a=Brt({...l,keyPath:e});a&&(t===n||R0(a.fieldConfig.i18n)?(delete r[e],u.set(a.keyPath,a.fieldConfig)):F2({fieldConfig:a.fieldConfig,getFieldArgs:{...l,keyPath:a.keyPath}})&&(delete r[e],s.add(a.keyPath)))}),u.forEach((e,i)=>{Object.assign(r,Z3({fieldConfig:e,keyPath:i,locale:t,defaultLocale:n}))}),{duplicatedHiddenKeyPaths:s,clearedUuidFields:c}},Hrt=({currentValues:e,defaultLocale:t,getFieldArgs:n,duplicatedHiddenFieldMap:r,clearedUuidFieldMap:i})=>{let a=e[t];r.forEach((t,n)=>{t.forEach(t=>{t in a&&(e[n][t]=structuredClone(a[t]))})}),kQe({contentMap:e,defaultLocale:t,getFieldArgs:n}),i.forEach((t,n)=>{t.forEach((t,r)=>{e[n][r]||(e[n][r]=c6(t))})})},Urt=({draft:e,currentValues:t,files:n})=>{let{collection:r,collectionFile:i,currentPath:a}=e,o=a!==void 0&&OA(r)?jA(a):a,s=dk({...e,id:crypto.randomUUID(),createdAt:Date.now(),isNew:!0,originalEntry:void 0,originalSlugs:{},currentSlugs:{},originalPath:o,currentPath:o,originalLocales:fk(e.currentLocales),currentLocales:fk(e.currentLocales),originalValues:structuredClone(t),currentValues:{},files:n,validities:Object.fromEntries(Object.keys(e.validities).map(e=>[e,{}])),slugEditor:AQe({collection:r,collectionFile:i,originalSlugs:{}}),interacted:!1},AM);return Object.entries(t).forEach(([e,t])=>{s.currentValues[e]=R2({draft:s,locale:e,target:t})}),s},Wrt=async e=>{let t=e.current,{collection:n,fields:r}=t,{defaultLocale:i,canonicalSlug:{key:a}}=rj(t),o=yM(t),s=sz(n),c=B2({collection:n,fields:r}),l=Object.fromEntries(Object.entries(t.currentValues).map(([e,t])=>[e,fk(t)])),u=new Map,d=new Map;Object.entries(l).forEach(([e,t])=>{let{duplicatedHiddenKeyPaths:n,clearedUuidFields:r}=Vrt({getFieldArgs:o,locale:e,defaultLocale:i,valueMap:t,canonicalSlugKey:a,aliasesKey:c,orderFieldKey:s});u.set(e,n),d.set(e,r)}),Hrt({currentValues:l,defaultLocale:i,getFieldArgs:o,duplicatedHiddenFieldMap:u,clearedUuidFieldMap:d});let f={...t.files,...await zrt({draft:t,currentValues:l})};if(e.current!==t)return;let p=Urt({draft:t,currentValues:l,files:f});return e.current=p,BQ.current=!0,p},Grt=(e,{oldDir:t,newDir:n})=>{let r=e.slice(t.length+1);return n?`${n}/${r}`:r},Krt=({entry:e,dirMove:t,localeDirMoves:n})=>{let{subPath:r}=e,i=Grt(r,t),a=!1,o=Object.fromEntries(Object.entries(e.locales).map(([e,t])=>{let{slug:r,path:i}=t,o=n[e];if(!r||!MA(o.oldDir,r))return[e,t];let s=Grt(r,o);if(s===r)return[e,t];let c=i.lastIndexOf(r);return c===-1?[e,t]:(a=!0,[e,{...t,slug:s,path:`${i.slice(0,c)}${s}${i.slice(c+r.length)}`}])}));if(a)return{...e,slug:i,subPath:i,locales:o}},qrt=({collection:e,entry:t})=>{if(!o2(e))return t;let{_i18n:{defaultLocale:n,canonicalSlug:{key:r,value:i}}}=e,{subPath:a,locales:o}=t,s=i===`{{slug}}`?a:cX(i,{collection:e,locale:n,content:o[n]?.content??{},currentSlug:a});return{...t,locales:Object.fromEntries(Object.entries(o).map(([e,t])=>[e,t.content?{...t,content:{...t.content,[r]:s}}:t]))}},Jrt=async({collection:e,originalEntry:t,movedEntry:n,draft:r,cacheDB:i})=>{let{defaultLocale:a}=e._i18n;return n4({draft:r,config:e,_file:$A({collection:e,isIndexFile:r.isIndexFile}),entry:n,cacheDB:i,planChange:e=>{if(e===void 0){let e=t.locales[a].path,{slug:r,path:i}=n.locales[a];return{action:`move`,slug:r,path:i,previousPath:e,currentPath:e}}let r=n.locales[e];if(!r?.content)return;let i=t.locales[e],{path:o}=i,s=o!==r.path;if(s||!(0,yr.default)(r.content,i.content))return{action:s?`move`:`update`,slug:r.slug,path:r.path,previousPath:s?o:void 0,currentPath:o}}})},Yrt=async({collection:e,originalEntry:t,savingEntry:n,cacheDB:r})=>{let i={changes:[],savingEntries:[]},a=OA(e);if(!t||!a||t.subPath.slice(t.subPath.lastIndexOf(`/`)+1)!==a)return i;let o=jA(t.subPath),s=jA(n.subPath);if(!o||MA(o,s))return i;let c=rz(e.name).filter(e=>e.id!==t.id&&MA(o,e.subPath));if(!c.length)return i;let{_i18n:{allLocales:l}}=e,u={oldDir:o,newDir:s},d=Object.fromEntries(l.map(e=>[e,{oldDir:jA(t.locales[e]?.slug??``)||o,newDir:jA(n.locales[e]?.slug??``)||s}])),f=c.flatMap(t=>{let n=Krt({entry:t,dirMove:u,localeDirMoves:d});return n?[{originalEntry:t,movedEntry:qrt({collection:e,entry:n})}]:[]});if(!f.length)return i;let p=e4(r),m=M4({collection:e});return{changes:(await Promise.all(f.map(({originalEntry:t,movedEntry:n})=>Jrt({collection:e,originalEntry:t,movedEntry:n,draft:m,cacheDB:p})))).flat(),savingEntries:f.map(({movedEntry:e})=>e)}},Xrt=({collection:e,originalEntry:t,savingEntry:n})=>{let r=new Map;return Object.entries(n.locales).forEach(([n,{path:i}])=>{let a=t.locales[n]?.path;if(!a)return;let o=d4(e,a),s=d4(e,i);o&&s&&o!==s&&r.set(o,s)}),r},Zrt=async({collection:e,fileName:t,originalEntry:n,savingEntry:r,changes:i})=>{let a={changes:[],savingAssets:[]};if(!n||!cH({collectionName:e.name,fileName:t})?.entryRelative)return a;let o=Xrt({collection:e,originalEntry:n,savingEntry:r});if(!o.size)return a;let s=new Set(i.map(({path:e})=>e)),c=pH.current.map(e=>_4(e,n)).filter(Boolean),l=[],u=[];return await Promise.all([...o].map(async([e,t])=>Promise.all(c.filter(({path:t})=>t.startsWith(`${e}/`)).map(async n=>{let r=`${t}${n.path.slice(e.length)}`;if(s.has(r)){l.push({action:`delete`,path:n.path,previousSha:n.sha});return}let i=n.file??await PX(n);l.push({action:`move`,path:r,previousPath:n.path,previousSha:n.sha,data:new File([await i.arrayBuffer()],n.name,{type:i.type})}),u.push({...n,path:r})})))),{changes:l,savingAssets:u}},Qrt=async e=>{let{isNew:t,originalEntry:n,collectionName:r,fileName:i}=e,{branch:a,headSHA:o}=n?.workflow?.pullRequest??{},s=OY.current?.workflow;if(t||!n||!a||!o||!s)return;let c;try{c=await s.fetchBranchHead(a)}catch(e){console.error(`Failed to check the workflow branch for changes.`,e);return}if(c===o)return;try{await G8({fresh:!0})}catch(e){console.error(`Failed to reload the unpublished entries.`,e)}if(!c)return;let l=n.arrayIndex===void 0,u=QY({collectionName:r,fileName:i,originalEntry:n});if(!u)return{type:`deleted`,canOverwrite:l};if(!(0,yr.default)(u.locales,n.locales))return{type:`modified`,entry:u,canOverwrite:l}},$rt=({useWorkflow:e,skipCI:t,count:n})=>{let r=!e&&X8.current&&!(t??Z8.current);K$.current={...G$,saved:!0,published:r,count:n},WK(r)},eit=async({draft:e,slugs:t,recreate:n})=>{let{collection:r,fileName:i,originalEntry:a}=e;try{let{savingEntry:o,changes:s,savingAssets:c}=await j4({draft:e,slugs:t,recreate:n}),{changes:l,savingEntries:u}=await vnt({collection:r,collectionFile:e.collectionFile,originalEntry:a,savingEntry:o});s.push(...l);let{changes:d,savingEntries:f}=await Yrt({collection:r,originalEntry:a,savingEntry:o});s.push(...d);let{changes:p,savingAssets:m}=await Zrt({collection:r,fileName:i,originalEntry:n?void 0:a,savingEntry:o,changes:s});return s.push(...p),c.push(...m),{savingEntry:k4(o),changes:s,savingAssets:c,cascadeEntries:u,movedEntries:f}}catch(e){throw console.error(e),Error(`saving_failed`,{cause:e})}},tit=async({draft:e,useWorkflow:t,overwrite:n,publish:r})=>{if(z1(e)){let{collection:t,collectionFile:n}=e;throw Error(`saving_failed`,{cause:Error(B1(`entry`,{collection:t,collectionFile:n}))})}if(!await _8({draft:e,enforceRequired:r||J0(e)}))throw Error(`validation_failed`);let i=t?await Qrt(e):await Bet(e);if(i&&!n)throw Error(`save_conflict`,{cause:i});return i},nit=e=>{let{isNew:t,collection:n,collectionName:r}=e,i=e.pendingEntries.filter(e=>e.collectionName===r).length;t&&n._type===`entry`&&S2(e,i),w2(e,i),b2(e)},rit=async e=>{let t=[];for(let n of y$e(e))t.push(await MUe(n));return t},iit=async({draft:e,useWorkflow:t,changes:n,savingEntry:r,otherSavingEntries:i,pendingEntries:a,savingAssets:o,options:s})=>{let{collectionName:c,fileName:l,originalEntry:u}=e;try{return t?await znt({changes:n,savingEntry:r,savingAssets:o,options:s,collectionName:c,fileName:l,slug:r.slug,originalEntry:u,companions:a.map(({collectionName:e,entry:t})=>({collectionName:e,entry:t}))}):await a3({changes:n,savingEntries:[r,...i],savingAssets:o,options:s})}catch(e){throw J4(e)?e:(console.error(e.cause??e),Error(`saving_failed`,{cause:e.cause??e}))}},ait=async({draft:e,savingEntry:t,pendingEntries:n,useWorkflow:r,skipCI:i,count:a})=>{let{isNew:o,collection:s,collectionName:c,originalEntry:l}=e;l8();try{await o8(c,c8(e))}catch(e){console.error(e)}await E4({type:`postSave`,entry:t,collection:s,collectionFile:e.collectionFile,isNew:o}),await Promise.all(n.map(({collectionName:e,entry:t})=>E4({type:`postSave`,entry:t,collection:fj(e),isNew:!0}))),$rt({useWorkflow:r,skipCI:i,count:a}),l&&stt(l.id)},oit=async({draft:e,skipCI:t=void 0,overwrite:n=!1,publish:r=!1})=>{let i=r?!!QY(e):$Y(e),a=await tit({draft:e,useWorkflow:i,overwrite:n,publish:r});nit(e);let o=c2({draft:e}),s=a?.type===`deleted`,{savingEntry:c,changes:l,savingAssets:u,cascadeEntries:d,movedEntries:f}=await eit({draft:e,slugs:o,recreate:s}),p=await rit(e);l.push(...p.flatMap(e=>e.changes)),u.push(...p.flatMap(e=>e.savingAssets));let m=await iit({draft:e,useWorkflow:i,changes:l,savingEntry:c,otherSavingEntries:[...d,...f,...p.map(e=>e.entry)],pendingEntries:p,savingAssets:u,options:{commitType:e.isNew||s?`create`:`update`,collection:e.collection,skipCI:t}});return await ait({draft:e,savingEntry:c,pendingEntries:p,useWorkflow:i,skipCI:t,count:1+d.length+f.length+p.length}),m.savedEntries[0]},sit=({collection:e,collectionFile:t,isIndexFile:n,readonly:r,creationDisabled:i})=>!r&&!t&&!n&&(e?._type!==`entry`||e.duplicate!==!1)&&!i,cit=({publishedVersionExists:e,canDeleteEntry:t,isCollectionFile:n,readonly:r,locked:i})=>({discard:!r&&(e||t&&!n),delete:e&&t&&!n&&!i}),lit=e=>e.message===`validation_failed`?{type:`validation`}:e.message===`save_conflict`?{type:`conflict`,conflict:e.cause}:e.message===`saving_failed`?{type:`error`,message:e.cause?.message??``,unexpected:!1}:{type:`error`,message:``,unexpected:!0},uit=({collection:e,collectionFile:t,isIndexFile:n,hasPullRequest:r,workflowEnabled:i,publishedVersionExists:a,pendingDeletion:o,readonly:s,openAuthoring:c,creationDisabled:l})=>{let u=r||i,d=e?._type!==`entry`||e.delete!==!1,f=r&&!a,p=d&&(f||!c),m=o||s;return{useWorkflow:u,discardsDraft:f,locked:m,canDuplicate:sit({collection:e,collectionFile:t,isIndexFile:n,readonly:s,creationDisabled:l}),removalMenuItems:cit({publishedVersionExists:a,canDeleteEntry:p,isCollectionFile:!!t,readonly:s,locked:m})}},dit=async({entryDraft:e,useWorkflow:t,skipCI:n=void 0,overwrite:r=!1,publish:i=!1,askForReview:a,closeOnSave:o})=>{let s=e.current,{isNew:c,collection:l,collectionFile:u}=s,d=()=>e.current===s;try{if(await oN(),!d()||!c&&!e.modified)return{type:`skipped`};fNe(Object.keys(s.files??{}).length);let f=await oit({draft:s,skipCI:n,overwrite:r,publish:i}),p=f,m;if(i&&p.workflow)try{await Unt(p);let{workflow:e,...t}=p;f=t}catch(e){m=T7(e,`workflow.publishing_entry_failed`),console.error(e)}if(!d())return{type:`saved`,savedEntry:f,statusError:m};let h=!i&&t()&&p.workflow?aLe(p,l):void 0;if(h&&NY(p,l)===`draft`&&g8({draft:s}).valid&&await a(h))try{await O7(p,h)}catch(e){m=T7(e,`workflow.status_change_failed`),console.error(e)}if(!d())return{type:`saved`,savedEntry:f,statusError:m};let g=c?IP(`/collections/${l.name}/entries/${u?.name??f.subPath}`):void 0,_=o()&&m===void 0?`close`:`reset`;return{type:`saved`,savedEntry:f,statusError:m,path:g,next:_}}catch(e){if(J4(e))return{type:`skipped`};let t=lit(e);return t.type===`validation`?{type:`invalid`,errorCount:$Qe(s.validities)}:t.type===`conflict`?d()?{type:`conflict`,conflict:t.conflict}:{type:`error`,message:``}:(t.unexpected&&console.error(e),{type:`error`,message:t.message})}finally{Qq()}},fit=async e=>{let{collectionName:t}=e.current;return await Wrt(e)?`/collections/${t}/new`:void 0},pit=B(`<bdi> </bdi> › <bdi> </bdi>`,1),mit=B(`<h2 role="none"><!></h2>`),n9=B(`<!> <!>`,1),hit=B(`<!> <!> <!> <!> <!> <!> <!>`,1),git=B(`<!> <!> <!> <!> <span class="save-progress svelte-zjrq31" aria-live="polite"><!></span> <!> <!> <!>`,1),_it=B(`<div role="none" class="error svelte-zjrq31"> </div>`),vit=B(` <!>`,1),yit=B(`<!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),bit={hash:`svelte-zjrq31`,code:`.save-progress.svelte-zjrq31 {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;}.error.svelte-zjrq31 {margin-top:8px;border-radius:var(--sui-control-medium-border-radius);padding:12px;background-color:var(--sui-secondary-background-color);font-size:var(--sui-font-size-default);line-height:1.5;}`};function xit(e,t){O(t,!0),K(e,bit);let n=e=>{var t=H(),n=P(t),r=e=>{{let t=A(()=>z(pe)?.workflow?.pullRequest),n=A(()=>!iG.isLargeScreen),r=A(()=>iG.isSmallScreen?`menuitem`:`button`);Z5(e,{get entry(){return z(ee)},get locale(){return z(ne)},get collection(){return z(w)},get collectionFile(){return z(T)},get pullRequest(){return z(t)},get iconic(){return z(n)},get as(){return z(r)}})}};G(n,e=>{!i()&&z(w)&&z(ee)&&e(r)}),U(e,t)},r=$M(),i=J(t,`disabled`,3,!1),a=j(!1),o=j(0),s=j(!1),c=j(void 0),l=j(void 0),u=j(!1),d=j(void 0),f=j(!1),p=j(``),m=j(!1),h=j(!1),g=j(!1),_=j(!1),v=j(void 0),y=j(void 0),b=B6(()=>{let e=r.current;return{restore:!!e&&z6({draft:e,restore:!0}),clear:!!e&&z6({draft:e})}}),x=A(()=>r.current===void 0),S=A(()=>r.current?.isNew??!0),C=A(()=>!!r.current?.isIndexFile),w=A(()=>r.current?.collection),T=A(()=>r.current?.collectionFile),ee=A(()=>r.current?.originalEntry),te=A(()=>rj(r.current)),ne=A(()=>z(te).defaultLocale),re=A(()=>z(w)?.name),ie=A(()=>z(T)?.name),ae=A(()=>Jc.current&&z(w)?pj(z(w)):``),oe=A(()=>Jc.current&&z(w)?pj(z(w),{useSingular:!0}):``),se=A(()=>z(T)?Cj(z(T)):z(w)&&z(ee)&&Jc.current?jz(z(w),z(ee)):``),ce=A(()=>z(x)?``:z(S)?Y(`create_entry_title`,{values:{name:z(oe)}}):`${z(ae)} › ${z(se)}`);L(()=>(QQ.current=z(ce),()=>{QQ.current=``}));let le=A(()=>z(m)||z(g)||z(_)),ue=A(()=>i()||z(le)),de=A(()=>z(S)||r.modified||iN.current),fe=A(()=>z(re)&&z(ee)?bUe({entry:z(ee),collectionName:z(re),fileName:z(ie)}):[]),pe=A(()=>zY.current&&z(re)?QY({collectionName:z(re),fileName:z(ie),originalEntry:z(ee)}):void 0),me=A(()=>sX(z(pe))),he=A(()=>eX(z(pe))),ge=A(()=>z1(r.current)),_e=A(()=>uit({collection:z(w),collectionFile:z(T),isIndexFile:z(C),hasPullRequest:!!z(pe),workflowEnabled:BY(z(w)),publishedVersionExists:z(me),pendingDeletion:z(he),readonly:z(ge),openAuthoring:$V.current,creationDisabled:Q7.current.creationDisabled})),ve=A(()=>z(_e).useWorkflow),ye=A(()=>z(_e).discardsDraft),be=A(()=>z(_e).locked),xe=A(()=>z(_e).canDuplicate),Se=A(()=>z(_e).removalMenuItems),Ce=A(()=>z(ve)&&sLe(z(w),z(pe))),we=A(()=>Y(z(c)===`pending_publish`?`workflow.mark_as_ready`:`workflow.send_for_review`)),Te=A(()=>j7({pendingDeletion:z(he),publishedVersionExists:z(me)}));L(()=>Met());let Ee=()=>{let e=z(w)&&TA(z(w))?CA.current:``;s$(wze({collectionName:z(re),dirPath:e}),{returnTo:N5})},De=e=>new Promise(t=>{M(c,e,!0),M(l,t,!0),M(s,!0)}),Oe=()=>z(ve),ke=()=>IG.closeOnSave??!0,Ae=async({skipCI:e=void 0,overwrite:t=!1,publish:n=!1}={})=>{let i=r.current;if(z(w)&&i){M(m,!0),M(h,n,!0);try{let s=await dit({entryDraft:r,useWorkflow:Oe,skipCI:e,overwrite:t,publish:n,askForReview:De,closeOnSave:ke});s.type===`saved`?(s.statusError!==void 0&&(M(f,!0),M(p,s.statusError,!0)),s.path&&o$(s.path,{replaceState:!0,notifyChange:!1}),s.next===`close`?(Ee(),r.current=null):s.next===`reset`&&m8({entryDraft:r,collection:z(w),collectionFile:z(T),originalEntry:s.savedEntry,extraValues:i.extraValues,expanderStates:i.expanderStates})):s.type===`invalid`?(M(o,s.errorCount,!0),M(a,!0)):s.type===`conflict`?(M(d,{conflict:s.conflict,skipCI:e,publish:n},!0),M(u,!0)):s.type===`error`&&(M(f,!0),M(p,s.message,!0))}finally{M(m,!1),M(h,!1)}}};var je=yit(),Me=P(je);{let e=A(()=>Y(`primary`));dO(Me,{variant:`primary`,get ariaLabel(){return z(e)},children:(e,t)=>{var a=git(),o=P(a);{let e=A(()=>Y(`cancel_editing`)),t=A(()=>IG.closeWithEscape&&!VQ.current);C5(o,{get"aria-label"(){return z(e)},get useShortcut(){return z(t)},onclick:()=>{Ee()}})}var s=I(o,2),c=e=>{$l(e,{flex:!0})},l=e=>{var t=mit(),n=N(t),r=e=>{fl(e,{children:(e,t)=>{var n=H(),r=P(n),i=e=>{var t=V();R(()=>W(t,z(ce))),U(e,t)},a=e=>{var t=pit(),n=P(t),r=F(n,!0),i=F(I(n,2),!0);R(()=>{W(r,z(ae)),W(i,z(se))}),U(e,t)};G(r,e=>{z(S)?e(i):e(a,-1)}),U(e,n)},$$slots:{default:!0}})};G(n,e=>{z(x)||e(r)}),D(t),U(e,t)};G(s,e=>{iG.isSmallScreen?e(c):e(l,-1)});var u=I(s,2),d=e=>{n(e)};G(u,e=>{iG.isSmallScreen||e(d)});var f=I(u,2),p=e=>{crt(e,{get entry(){return z(pe)},get disabled(){return z(ue)}})};G(f,e=>{z(pe)&&!z(be)&&e(p)});var g=I(f,2),C=N(g),w=e=>{var t=V();R(e=>W(t,e),[()=>Y(`save_progress.${Zq.current.phase}`,{values:{done:Zq.current.done,total:Zq.current.total}})]),U(e,t)};G(C,e=>{z(m)&&Zq.current&&e(w)}),D(g);var T=I(g,2),ee=e=>{},te=e=>{{let t=e=>{Eu(e,{children:(e,t)=>{{let t=A(()=>Y(Z8.current?`save_and_publish`:`save_without_publishing`));Du(e,{get label(){return z(t)},onclick:()=>{Ae({skipCI:!Z8.current})}})}},$$slots:{default:!0}})},n=A(()=>Y(Z8.current?z(m)?`saving`:`save`:z(m)?`publishing`:`publish`)),r=A(()=>z(ue)||!z(de));Zl(e,{variant:`primary`,get label(){return z(n)},get disabled(){return z(r)},keyShortcuts:`Accel+S`,onclick:()=>{Ae()},popup:t,$$slots:{popup:!0}})}},ne=e=>{{let t=e=>{Eu(e,{children:(e,t)=>{{let t=A(()=>Y(`save_and_publish`));Du(e,{get label(){return z(t)},onclick:()=>{Ae({publish:!0,skipCI:!1})}})}},$$slots:{default:!0}})},n=A(()=>Y(z(m)?z(h)?`publishing`:`saving`:`save`)),r=A(()=>z(ue)||!z(de));Zl(e,{variant:`primary`,get label(){return z(n)},get disabled(){return z(r)},keyShortcuts:`Accel+S`,onclick:()=>{Ae()},popup:t,$$slots:{popup:!0}})}},re=e=>{{let t=A(()=>Y(z(m)?`saving`:`save`)),n=A(()=>z(ue)||!z(de));Al(e,{variant:`primary`,get label(){return z(t)},get disabled(){return z(n)},keyShortcuts:`Accel+S`,onclick:()=>{Ae()}})}};G(T,e=>{z(be)?e(ee):X8.current&&!z(ve)?e(te,1):z(Ce)?e(ne,2):e(re,-1)});var ie=I(T,2),oe=e=>{urt(e,{get entry(){return z(pe)},get disabled(){return z(ue)},get modified(){return z(de)}})};G(ie,e=>{z(pe)&&!z(ge)&&e(oe)});var le=I(ie,2);{let e=e=>{{let t=A(()=>Y(`editor_options`));Eu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var a=hit(),o=P(a),s=e=>{var t=n9(),i=P(t);n(i);var a=I(i,2),o=e=>{var t=n9(),n=P(t);Bo(n,17,()=>Mtt(r.current),({key:e,disabled:t})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).disabled;{let t=A(()=>Y(`entry_sidebar.${n()}.title`));Du(e,{get label(){return z(t)},get disabled(){return r()},onclick:()=>{b7(n())}})}}),mu(I(n,2),{}),U(e,t)};G(a,e=>{z(x)||e(o)}),U(e,t)};G(o,e=>{iG.isSmallScreen&&e(s)});var c=I(o,2),l=e=>{var t=n9(),n=P(t),i=e=>{{let t=A(()=>Y(`duplicate`)),n=A(()=>Y(`duplicate_entry`));Du(e,{variant:`ghost`,get disabled(){return z(ue)},get label(){return z(t)},get"aria-label"(){return z(n)},onclick:async()=>{M(_,!0);let e=await fit(r);M(_,!1),e&&o$(e,{replaceState:!0,notifyChange:!1,transitionType:`forwards`})}})}};G(n,e=>{z(xe)&&e(i)});var a=I(n,2),o=e=>{Du(e,{variant:`ghost`,get disabled(){return z(ue)},get label(){return z(Te).label},get"aria-label"(){return z(Te).title},onclick:()=>{z(me)?z(y)?.confirmDiscard():z(y)?.confirmDelete()}})};G(a,e=>{z(Se).discard&&e(o)}),U(e,t)};G(c,e=>{!i()&&!z(S)&&e(l)});var u=I(c,2),d=e=>{{let t=A(()=>Y(`delete`));Du(e,{get label(){return z(t)},onclick:()=>{z(y)?.confirmDelete()}})}};G(u,e=>{z(Se).delete&&e(d)});var f=I(u,2),p=e=>{{let t=A(()=>Y(`edit_slug`)),n=A(()=>!PQe(r.current));Du(e,{get label(){return z(t)},get disabled(){return z(n)},onclick:()=>{b7(`slug`)}})}};G(f,e=>{iG.isSmallScreen||e(p)});var m=I(f,2);{let e=A(()=>!iG.isSmallScreen||!i()&&!z(S)),t=A(()=>({revert:z(de)&&!z(be),restore:b.availability.restore&&!z(be),clear:b.availability.clear&&!z(be)}));L6(m,{scope:`entry`,get separator(){return z(e)},get available(){return z(t)},get onSelect(){return b.select}})}var h=I(m,2),g=e=>{var t=n9(),n=P(t);mu(n,{});var r=I(n,2);{let e=A(()=>Y(`deploy_preview.check_again`));Du(r,{get label(){return z(e)},onclick:()=>{Net()}})}U(e,t)};G(h,e=>{UK.current&&e(g)});var v=I(h,2),C=e=>{Jtt(e,{})};G(v,e=>{iG.isLargeScreen&&e(C)}),U(e,a)},$$slots:{default:!0}})}},t=A(()=>Y(`show_editor_options`));Ds(Xl(le,{get disabled(){return z(ue)},variant:`ghost`,iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return z(t)},get onclick(){return b.update},get onkeydown(){return b.update},popup:e,$$slots:{popup:!0}}),e=>M(v,e,!0),()=>z(v))}U(e,a)},$$slots:{default:!0}})}var Ne=I(Me,2);KQe(Ne,{get count(){return z(o)},onShowErrors:()=>{b7(`validation`)},get show(){return z(a)},set show(e){M(a,e,!0)}});var Pe=I(Ne,2);Xu(Pe,{get id(){return UQ.current.id},get show(){return UQ.current.show},set show(e){UQ.current.show=e},children:(e,t)=>{let n=A(()=>UQ.current);el(e,{get status(){return z(n).status},children:(e,t)=>{Qr();var r=V();R(e=>W(r,e),[()=>Y(`editor.${z(n).message}`,{values:{count:z(n).count,source:z(n).sourceLanguage?KA(z(n).sourceLanguage)??z(n).sourceLanguage:``}})]),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}});var Fe=I(Pe,2);Xu(Fe,{get id(){return WQ.current.id},get show(){return WQ.current.show},set show(e){WQ.current.show=e},children:(e,t)=>{el(e,{get status(){return WQ.current.status},children:(e,t)=>{Qr();var n=V();R(()=>W(n,WQ.current.message)),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var Ie=I(Fe,2);det(Ie,{get action(){return b.action},onClose:()=>{z(v)?.focus()},get open(){return b.dialogOpen},set open(e){b.dialogOpen=e}});var Le=I(Ie,2);{let e=A(()=>Y(`later`));ru(Le,{get title(){return z(we)},get okLabel(){return z(we)},get cancelLabel(){return z(e)},onOk:()=>{z(l)?.(!0)},onClose:()=>{z(l)?.(!1)},get open(){return z(s)},set open(e){M(s,e,!0)},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(z(c)===`pending_publish`?`workflow.confirm_marking_as_ready`:`workflow.confirm_sending_for_review`)]),U(e,n)},$$slots:{default:!0}})}var Re=I(Le,2);Ds(Qnt(Re,{get collection(){return z(w)},get collectionFile(){return z(T)},get originalEntry(){return z(ee)},get unpublishedEntry(){return z(pe)},get associatedAssets(){return z(fe)},get discardsDraft(){return z(ye)},get useWorkflow(){return z(ve)},get pendingDeletion(){return z(he)},onDone:()=>{Ee()},onClose:()=>{z(v)?.focus()},get deleting(){return z(g)},set deleting(e){M(g,e,!0)}}),e=>M(y,e,!0),()=>z(y));var ze=I(Re,2);{let e=A(()=>z(d)?.conflict);$nt(ze,{get conflict(){return z(e)},onOverwrite:async()=>{await Ae({skipCI:z(d)?.skipCI,overwrite:!0,publish:z(d)?.publish})},onClose:()=>{z(v)?.focus()},get open(){return z(u)},set open(e){M(u,e,!0)}})}var Be=I(ze,2);{let e=A(()=>Y(`saving_entry.error.title`));nu(Be,{get title(){return z(e)},onClose:()=>{z(v)?.focus()},get open(){return z(f)},set open(e){M(f,e,!0)},children:(e,t)=>{Qr();var n=vit(),r=P(n),i=I(r),a=e=>{var t=_it(),n=F(t,!0);R(()=>W(n,z(p))),U(e,t)};G(i,e=>{z(p)&&e(a)}),R(e=>W(r,`${e??``} `),[()=>Y(`saving_entry.error.description`)]),U(e,n)},$$slots:{default:!0}})}U(e,je),k()}var Sit=B(`<!> <!>`,1),Cit=B(`<div class="pane-wrapper svelte-jrunrx"><!></div>`),wit=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),Tit=B(`<div role="none"> </div>`),Eit=B(`<div role="none"><!></div> <div role="none"><!></div>`,1),Dit=B(`<div role="none" class="pane-measure svelte-jrunrx"><!></div>`),Oit=B(`<!> <!> <!>`,1),kit=B(`<div role="none" class="content-area svelte-jrunrx"><!></div> <!>`,1),Ait=B(`<!> <div role="none" class="body svelte-jrunrx"><!></div>`,1),jit=B(`<div role="group" class="wrapper content-editor svelte-jrunrx"><!></div> <!>`,1),Mit={hash:`svelte-jrunrx`,code:`.wrapper.svelte-jrunrx {position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;background-color:var(--sui-secondary-background-color);}.pane-wrapper.svelte-jrunrx {display:contents;& > .pane {flex:auto;height:100%;overflow:hidden;display:flex;flex-direction:column;}}.body.svelte-jrunrx {flex:auto;display:flex;overflow:hidden;}.content-area.svelte-jrunrx {position:relative;flex:auto;border-block-start:var(--area-border); /* below the toolbar */background-color:var(--sui-primary-background-color);&:not(:only-child) {border-inline-end:var(--area-border); /* sidebar is present */border-start-end-radius:16px;}.sui.resizable-handle {border-inline:var(--area-border); /* between the panes */background-color:var(--sui-secondary-background-color); /* same as toolbar */}
/* Centred over the gutter, whose position is the first pane’s width */.swap-button {position:absolute;top:calc(50% - 12px);inset-inline-start:calc(
var(--gutter-position) + var(--sui-resizable-handle-size, 4px) / 2
);
/* Above the handle’s hit area, a positioned \`::before\` pseudo-element at \`z-index: 1\` */z-index:2;margin:0;border-radius:50%;opacity:0.5;translate:-50%;&:dir(rtl) {translate:50%;}&:hover,
&:focus-visible {opacity:1;}}}.pane-measure.svelte-jrunrx {display:flex;flex-direction:column;height:100%;}`};function Nit(e,t){O(t,!0),K(e,Mit);let n=(e,t=kr,n)=>{let r=()=>(n?.()).locale,i=()=>(n?.()).mode,a=A(()=>t()===`first`?GQ:KQ),o=A(()=>t()===`first`?KQ:GQ);var s=Cit(),c=N(s);{let e=A(()=>Q5(i()===`edit`?`edit_x_locale`:`preview_x_locale`,r()));HO(c,{class:`pane`,get ariaLabel(){return z(e)},get"data-locale"(){return r()},get"data-mode"(){return i()},children:(e,n)=>{var r=Sit(),i=P(r);{let e=A(()=>`${t()}-pane-header`);zet(i,{get id(){return z(e)},get thisPane(){return z(a)},get thatPane(){return z(o)}})}var s=I(i,2),c=e=>{uet(e,{id:`first-pane-body`,get thisPane(){return z(a)},get thatPaneContentArea(){return z(p)},get thisPaneContentArea(){return z(f)},set thisPaneContentArea(e){M(f,e,!0)}})},l=e=>{uet(e,{id:`second-pane-body`,get thisPane(){return z(a)},get thatPaneContentArea(){return z(f)},get thisPaneContentArea(){return z(p)},set thisPaneContentArea(e){M(p,e,!0)}})};G(s,e=>{t()===`first`?e(c):e(l,-1)}),U(e,r)},$$slots:{default:!0}})}D(s),U(e,s)},r=J(t,`entryDraft`,7),i=J(t,`editorLocale`,3,void 0),a=J(t,`loading`,3,!1);QM(r());let o=!1,s=!1,c=IR(),l=j(0),u=j(!0),d=j(void 0),f=j(void 0),p=j(void 0),m=A(()=>r().current===void 0),h=A(()=>r().current??{}),g=A(()=>Mr(z(h).isNew,!0)),_=A(()=>Mr(z(h).canPreview,!0)),v=A(()=>Mr(z(h).canShowSecondPane,!0)),y=A(()=>z(h).collection),b=A(()=>z(h).collectionName),x=A(()=>z(h).collectionFile),S=A(()=>z(h).fileName),C=A(()=>z(h).isIndexFile),w=A(()=>v8.current??{}),T=A(()=>z(w).showPreview),ee=A(()=>Mr(z(w).showSecondPane,!0)),te=A(()=>z(v)&&z(ee)),ne=A(()=>rj(r().current)),re=A(()=>z(ne).i18nEnabled),ie=A(()=>z(ne).allLocales),ae=A(()=>z(ne).defaultLocale),oe=A(()=>vet({collection:z(y),collectionFile:z(x)})),se=A(()=>Q7.current),ce=A(()=>z(se).readonly),le=A(()=>z(se).canCreate),ue=A(()=>z(se).quota),de=A(()=>z(se).creationDisabled),fe=A(()=>z1(r().current)),pe=A(()=>yet({firstPane:GQ.current,secondPane:KQ.current})),me=A(()=>Nr(z(pe),3)),he=A(()=>z(me)[0]),ge=A(()=>z(me)[1]),_e=A(()=>z(me)[2]),ve=async()=>{if(o)return!1;let e=bet({savedPanes:v8.current?.paneStates?.[z(oe)??``],editorLocale:i(),allLocales:z(ie),defaultLocale:z(ae),canPreview:z(_),showPreview:z(T),showSecondPane:z(te)});return e?(o=!0,await co(),[GQ.current,KQ.current]=e,(iG.isSmallScreen||iG.isMediumScreen)&&(KQ.current=null),await co(),o=!1,!0):!1},ye=async()=>{r().current&&!s&&(s=!0,await ve()||([GQ.current,KQ.current]=xet({editorLocale:i(),currentLocale:GQ.current?.locale,defaultLocale:z(ae),allLocales:z(ie),i18nEnabled:z(re),canPreview:z(_),showPreview:z(T),showSecondPane:z(te),singlePane:iG.isSmallScreen||iG.isMediumScreen})),s=!1)},be=()=>{let e=GQ.current,t=KQ.current;z(y)&&!o&&e&&t&&z(oe)&&wet(z(oe),[e,t])},xe=()=>{sN(()=>{[GQ.current,KQ.current]=[KQ.current,GQ.current]})},Se=e=>{e.isTrusted&&r().current&&!r().current.interacted&&(r().current.interacted=!0)},Ce=async e=>{await oN();let t=Cet({firstPane:GQ.current,secondPane:KQ.current,locale:e});t&&([GQ.current,KQ.current]=t,await pl(100))},we=async({locale:e,keyPath:t})=>{let n=c.next();await Ce(e);let i=r().current;i&&await zYe({draft:i,locale:e,keyPath:t,isOutdated:()=>!n()})},Te=async()=>{let{state:e}=window.history,{locale:t,keyPath:n}=e?.highlight??{};typeof t==`string`&&typeof n==`string`&&t&&n&&(await we({locale:t,keyPath:n}),window.history.replaceState({...e,highlight:null},``))},Ee=e=>{e.source===window&&e.data?.type===`highlight-editor-field`&&e.data.payload&&we(e.data.payload)};js(()=>{zQ.current||(r().current=null);let e=bU();return window.addEventListener(`message`,Ee),()=>{window.removeEventListener(`message`,Ee),e()}}),L(()=>{IG.devModeEnabled&&console.info(`entryDraft`,ni(r().current))}),h$e(()=>r(),()=>z(d)),L(()=>{let e=r().current;e&&(Object.values(e.currentValues).forEach(VM),ni(e.currentLocales),ni(e.currentSlugs),Object.values(e.files).forEach(({file:e})=>void 0),e.pendingEntries.length,e.interacted),fo(()=>gQe(e))}),L(()=>{z(oe)&&(GQ.current=null,KQ.current=null)}),vk(()=>[z(y),z(te),z(T),z(_),iG.isSmallScreen,iG.isMediumScreen],()=>{ye()}),L(()=>{GQ.current,KQ.current,be()}),L(()=>{z(d)&&(async()=>{z(u)&&(M(u,!1),await ye(),await SU(()=>z(d)),await Te(),hQe())})()});var De=jit(),Oe=P(De);Io(N(Oe),()=>r().current?.id,e=>{var t=Oit(),i=P(t),o=e=>{var t=wit(),n=P(t);Lo(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),jl(n.lastChild,{dismissible:!1,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>B1(`entry`,{collection:z(y),collectionFile:z(x)})]),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)};G(i,e=>{z(fe)&&!a()&&!(z(g)&&z(de))&&e(o)});var s=I(i,2);{let e=A(()=>a()||z(g)&&z(de));xit(s,{get disabled(){return z(e)}})}var c=I(s,2),u=e=>{VO(e,{children:(e,t)=>{var n=Tit(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`loading_entries`,{values:{count:1}})]),U(e,n)},$$slots:{default:!0}})},d=e=>{},f=e=>{VO(e,{children:(e,t)=>{var n=Eit(),r=P(n),i=N(r),a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`entry_not_found`)]),U(e,t)},o=e=>{var t=V();R(e=>W(t,e),[()=>B1(`collection`,{collection:z(y)})]),U(e,t)},s=e=>{var t=V();R(e=>W(t,e),[()=>Y(`creating_entries_disabled_by_admin`)]),U(e,t)},c=e=>{var t=V();R(e=>W(t,e),[()=>Y(`creating_entries_disabled_by_quota`,{values:{quota:z(ue)}})]),U(e,t)};G(i,e=>{z(m)?e(a):z(ce)?e(o,1):z(le)?e(c,-1):e(s,2)}),D(r);var l=I(r,2);Al(N(l),{variant:`primary`,onclick:()=>{let e=z(b)??sj.current?.name;o$(e?`/collections/${e}`:`/collections`,{replaceState:!0,transitionType:`backwards`})},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`back_to_collection`)]),U(e,n)},$$slots:{default:!0}}),D(l),U(e,n)},$$slots:{default:!0}})},p=e=>{var t=Ait(),r=P(t);Jet(r,{});var i=I(r,2);Io(N(i),()=>`${z(b)}|${z(S)}|${z(C)}`,e=>{var t=kit(),r=P(t),i=N(r),a=e=>{var t=Sit(),r=P(t);Lu(r,{onResize:({sizes:e})=>{if(GQ.current&&KQ.current){let[t,n]=e;GQ.current={...GQ.current,width:t},KQ.current={...KQ.current,width:n}}},children:(e,t)=>{var r=Oit(),i=P(r);Ru(i,{get defaultSize(){return z(he)},get minSize(){return z(_e)},children:(e,t)=>{var r=Dit(),i=N(r);n(i,()=>`first`,()=>GQ.current),D(r),Ute(r,`clientWidth`,e=>M(l,e)),U(e,r)},$$slots:{default:!0}});var a=I(i,2);Iu(a,{}),Ru(I(a,2),{get defaultSize(){return z(ge)},get minSize(){return z(_e)},children:(e,t)=>{n(e,()=>`second`,()=>KQ.current)},$$slots:{default:!0}}),U(e,r)},$$slots:{default:!0}});var i=I(r,2);{let e=A(()=>Y(`swap_panes`));Al(i,{class:`swap-button`,iconic:!0,size:`small`,variant:`tertiary`,get"aria-label"(){return z(e)},get style(){return`--gutter-position: ${z(l)??``}px`},onclick:xe,children:(e,t)=>{Xc(e,{name:`swap_horiz`})},$$slots:{default:!0}})}U(e,t)},o=e=>{n(e,()=>`first`,()=>GQ.current)},s=e=>{n(e,()=>`second`,()=>KQ.current)},c=e=>{$l(e,{flex:!0})};G(i,e=>{GQ.current&&KQ.current?e(a):GQ.current?e(o,1):KQ.current?e(s,2):e(c,-1)}),D(r);var u=I(r,2),d=e=>{Htt(e,{})},f=e=>{Ktt(e,{})};G(u,e=>{iG.isSmallScreen?e(d):e(f,-1)}),U(e,t)}),D(i),bo(`pointerdown`,i,Se),bo(`keydown`,i,Se),U(e,t)};G(c,e=>{a()?e(u):r().current===null?e(d,1):z(m)||z(g)&&z(de)?e(f,2):e(p,-1)}),U(e,t)}),D(Oe),Ds(Oe,e=>M(d,e),()=>z(d)),Xu(I(Oe,2),{get show(){return BQ.current},set show(e){BQ.current=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`entry_duplicated`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),R(e=>q(Oe,`aria-label`,e),[()=>Y(`content_editor`)]),U(e,De),k()}xo([`pointerdown`,`keydown`]);var Pit=B(`<div role="none"> </div>`),Fit=B(`<div role="alert" class="error svelte-1n3qj92"></div>`),Iit=B(`<div role="none"><span hidden=""> </span> <!> <!></div>`),Lit={hash:`svelte-1n3qj92`,code:`.cell.svelte-1n3qj92 {--sui-textbox-singleline-min-width: 10em;--sui-combobox-min-width: 10em;display:flex;flex-direction:column;gap:4px;border-radius:var(--sui-control-medium-border-radius);padding:2px;&.edited {background-color:var(--sui-secondary-background-color);}.sui:is(.text-input, .number-input, .combobox) {margin:0;}}.error.svelte-1n3qj92 {color:var(--sui-error-foreground-color);font-size:var(--sui-font-size-small);}`};function Rit(e,t){let n=Eo();O(t,!0),K(e,Lit);let r=J(t,`edited`,3,!1),i=J(t,`errors`,19,()=>[]),a=J(t,`readonly`,3,!1),o=A(()=>t.fieldConfig.name),s=A(()=>Mr(t.fieldConfig.widget,`string`)),c=A(()=>pB({config:t.fieldConfig,locale:t.locale})),l=A(()=>P8[z(s)]),u=A(()=>!!i().length),d=A(()=>oYe({fieldConfig:t.fieldConfig,inline:!0}));var f=Iit();let p;var m=N(f),h=F(m,!0),g=I(m,2),_=()=>t.value,v=e=>t.onChange(e);{let e=A(()=>SM({fieldConfig:t.fieldConfig,locale:t.locale}));Ko(g,()=>z(l),(r,i)=>{i(r,{get locale(){return t.locale},get keyPath(){return z(o)},get typedKeyPath(){return z(o)},get fieldId(){return n},get fieldLabel(){return z(c)},get fieldConfig(){return z(d)},get currentValue(){return _()},set currentValue(e){v(e)},get required(){return z(e)},get readonly(){return a()},get invalid(){return z(u)}})})}var y=I(g,2),b=e=>{var t=Fit();Bo(t,21,i,Ro,(e,t)=>{var n=Pit(),r=F(n,!0);R(()=>W(r,z(t))),U(e,n)}),D(t),R(()=>q(t,`id`,`${n}-error`)),U(e,t)};G(y,e=>{z(u)&&e(b)}),D(f),R(e=>{p=os(f,1,`cell svelte-1n3qj92`,null,p,{edited:r(),invalid:z(u)}),q(f,`data-field-type`,z(s)),q(m,`id`,`${n}-label`),W(h,e)},[()=>Y(`bulk_edit_cell`,{values:{field:z(c),entry:t.entryLabel}})]),U(e,f),k()}var zit=(e,t)=>!!t.locales[e._i18n.defaultLocale]?.content&&!aA(e,t)&&!P4(t),Bit=(e,t,n)=>t.locales[e._i18n.defaultLocale]?.content[n],Vit=({collection:e,entry:t,keyPath:n,edits:r})=>{let i=r[t.id];return i&&Object.hasOwn(i,n)?i[n]:Bit(e,t,n)},Hit=(e,t)=>{let n=e=>Hj(e)?``:e;return(0,yr.default)(n(e),n(t))},Uit=({collection:e,entry:t,keyPath:n,value:r,edits:i})=>{let{[n]:a,...o}=i[t.id]??{},{[t.id]:s,...c}=i,l=Bit(e,t,n),u=Hit(r,N7(e.fields,n)?.widget===`boolean`?l??!1:l)?o:{...o,[n]:r};return Object.keys(u).length?{...c,[t.id]:u}:c},Wit=e=>Object.values(e).reduce((e,t)=>e+Object.keys(t).length,0),Git=({collection:e,entry:t,entryEdits:n})=>{let{defaultLocale:r}=e._i18n,i=Object.fromEntries(Object.entries(t.locales).filter(([,{content:e}])=>!!e).map(([e,{content:t}])=>[e,{...t}]));return Object.entries(n).forEach(([t,n])=>{let a=N7(e.fields,t),o=!!a&&P0(a),s=i[r][t];Object.entries(i).forEach(([e,i])=>{e===r?i[t]=n:(a?.i18n===`duplicate`||o&&L0({fieldConfig:a,targetValue:i[t],previousValue:s,sourceLocale:r,targetLocale:e}))&&(i[t]=N0({fieldConfig:a,value:n,sourceLocale:r,targetLocale:e}))})}),b2({...M4({collection:e}),isNew:!1,currentValues:i}),{...t,locales:Object.fromEntries(Object.entries(t.locales).map(([e,t])=>[e,i[e]?{...t,content:i[e]}:{...t}]))}},Kit=({collection:e,keyPath:t,fieldType:n,edits:r})=>{let i=new Map,a=rz(e.name).filter(t=>!aA(e,t)),o=new Set(a.flatMap(e=>$P(e))),s=KY(e.name).filter(t=>!aA(e,t)&&!$P(t,{includePrevious:!0}).some(e=>o.has(e)));return[...a,...s].forEach(a=>{let o=h2(Vit({collection:e,entry:a,keyPath:t,edits:r}),n);o!==void 0&&i.set(o,(i.get(o)??0)+1)}),i},qit=({collection:e,entries:t,edits:n})=>{let{defaultLocale:r}=e._i18n,i=M4({collection:e}),a=new Map,o={};return t.forEach(t=>{let s=n[t.id];if(!s)return;let c={...t.locales[r]?.content,...s};Object.entries(s).forEach(([s,l])=>{let u=N7(e.fields,s),d=E2({draft:{...i,originalEntry:t},locale:r,keyPath:s,value:l,valueMap:c,validities:{[r]:{}}});if(d&&g2({draft:i,fieldConfig:u,keyPath:s})){let t=u.widget??`string`,r=h2(l,t),i=PA(a,s,()=>Kit({collection:e,keyPath:s,fieldType:t,edits:n})),o={...d};delete o.valid,o.duplicateError=r!==void 0&&i.get(r)>1,d=_2(o)}d&&!d.valid&&(o[t.id]={...o[t.id],[s]:C0({validity:d,fieldConfig:u})})})}),o},Jit=async({collection:e,entries:t,edits:n})=>{let r=new Map(rz(e.name).map(e=>[e.id,e])),i=t.filter(e=>!!n[e.id]&&r.has(e.id)).map(t=>Git({collection:e,entry:r.get(t.id),entryEdits:n[t.id]})),a=M4({collection:e}),o=e4();return{changes:(await Promise.all(i.map(t=>N4({collection:e,entry:t,draft:a,cacheDB:o})))).flat(),savingEntries:i}},Yit=async({collection:e,entries:t,edits:n})=>{if(L1({collection:e}))return 0;try{await r3()}catch(e){console.error(`Failed to check the repository for changes.`,e)}let{changes:r,savingEntries:i}=await Jit({collection:e,entries:t,edits:n});return r.length?(await a3({changes:r,savingEntries:i,options:{commitType:`update`,collection:e}}),K$.current={...G$,saved:!0,count:i.length},i.length):0},Xit=e=>{let t=$7.current.map(({name:t,entries:n})=>({name:t,entries:n.filter(t=>zit(e,t))})).filter(({entries:e})=>e.length);return K7.current=t.flatMap(({entries:e})=>e),t},Zit=({collection:e,entry:t,keyPath:n,value:r})=>{W7.current=Uit({collection:e,entry:t,keyPath:n,value:r,edits:W7.current}),Object.keys(q7.current).length&&(q7.current=qit({collection:e,entries:K7.current,edits:W7.current}))},Qit=B(`<div role="columnheader" class="cell svelte-bf9j9b"> </div>`),$it=B(`<div class="group-header svelte-bf9j9b" aria-hidden="true"> </div>`),eat=B(`<bdi></bdi>`),tat=B(`<div role="cell" class="cell svelte-bf9j9b"><!></div>`),nat=B(`<div role="row" class="row svelte-bf9j9b"><div role="rowheader" class="cell title svelte-bf9j9b"><!></div> <!> <div role="none" class="cell filler svelte-bf9j9b"></div></div>`),rat=B(`<div role="rowgroup" class="rowgroup svelte-bf9j9b"><!> <!></div>`),iat=B(`<div role="none" class="wrapper svelte-bf9j9b"><div role="table" class="table svelte-bf9j9b"><div role="row" class="row header svelte-bf9j9b"><div role="columnheader" class="cell title svelte-bf9j9b"> </div> <!> <div role="none" class="cell filler svelte-bf9j9b"></div></div> <!></div></div>`),aat={hash:`svelte-bf9j9b`,code:`.wrapper.svelte-bf9j9b {height:100%;overflow:auto;overscroll-behavior:contain;}.table.svelte-bf9j9b {display:grid;
/* The entry titles, a column sized to its control for each field, and a filler taking up the
rest of the width so the row borders run across the list */grid-template-columns:minmax(160px, 280px) repeat(var(--column-count), max-content) 1fr;width:max-content;min-width:100%;.spinner {grid-column:1 / -1;}}.rowgroup.svelte-bf9j9b,
.row.svelte-bf9j9b {display:contents;}.group-header.svelte-bf9j9b {grid-column:1 / -1;border-bottom:1px solid var(--sui-secondary-border-color);padding:4px 8px;font-weight:var(--sui-font-weight-bold);background-color:var(--sui-secondary-background-color);}.cell.svelte-bf9j9b {display:flex;align-items:center;border-bottom:1px solid var(--sui-secondary-border-color);padding:4px 8px;min-width:0;&.filler {padding:0;}
/* The entry titles stay in view as the table is scrolled sideways, like a frozen column */&.title {position:sticky;inset-inline-start:0;z-index:1;border-inline-end:1px solid var(--sui-secondary-border-color);background-color:var(--sui-primary-background-color);}}.header.svelte-bf9j9b .cell:where(.svelte-bf9j9b) {position:sticky;top:0;z-index:2;background-color:var(--sui-primary-background-color);font-size:var(--sui-font-size-small);font-weight:var(--sui-font-weight-bold);&.title {z-index:3;}}`};function oat(e,t){O(t,!0),K(e,aat),QM({current:void 0});let n=A(()=>prt(t.collection)),r=A(()=>t.collection._i18n.defaultLocale),i=j([]),a=(e,n,r)=>{Zit({collection:t.collection,entry:e,keyPath:n,value:r})},o=e=>Jc.current?jz(t.collection,e):``,s=A(()=>new Map(K7.current.map((e,t)=>[e.id,t+2])));js(()=>{M(i,Xit(t.collection))});var c=iat(),l=N(c);let u;var d=N(l);q(d,`aria-rowindex`,1);var f=N(d),p=F(f,!0);Bo(I(f,2),17,()=>z(n),e=>e.name,(e,t)=>{var n=Qit(),i=F(n,!0);R(e=>W(i,e),[()=>pB({config:z(t),locale:z(r)})]),U(e,n)}),Qr(2),D(d),Bo(I(d,2),17,()=>z(i),({name:e,entries:t})=>e,(e,i)=>{let c=()=>z(i).name,l=()=>z(i).entries,u=A(()=>c()===`*`?void 0:Kz(c()));var d=rat(),f=N(d),p=e=>{var t=$it(),n=F(t,!0);R(()=>W(n,z(u))),U(e,t)};G(f,e=>{z(u)&&e(p)}),zu(I(f,2),{get items(){return l()},itemKey:`id`,renderItem:(e,i=kr)=>{let c=A(()=>o(i()));var l=nat(),u=N(l);fl(N(u),{lines:2,children:(e,n)=>{var r=H();Io(P(r),()=>Jc.current,e=>{var n=eat();Wo(n,()=>jz(t.collection,i(),{useTemplate:!0,allowMarkdown:!0}),!0),D(n),U(e,n)}),U(e,r)},$$slots:{default:!0}}),D(u),Bo(I(u,2),17,()=>z(n),e=>e.name,(e,n)=>{let o=A(()=>z(n).name),s=A(()=>W7.current[i().id]);var l=tat(),u=N(l);{let e=A(()=>Vit({collection:t.collection,entry:i(),keyPath:z(o),edits:W7.current})),l=A(()=>!!z(s)&&Object.hasOwn(z(s),z(o))),d=A(()=>q7.current[i().id]?.[z(o)]);Rit(u,{get locale(){return z(r)},get fieldConfig(){return z(n)},get entryLabel(){return z(c)},get value(){return z(e)},get edited(){return z(l)},get errors(){return z(d)},get readonly(){return G7.current},onChange:e=>{a(i(),z(o),e)}})}D(l),U(e,l)}),Qr(2),D(l),R(e=>q(l,`aria-rowindex`,e),[()=>z(s).get(i().id)]),U(e,l)},$$slots:{renderItem:!0}}),D(d),R(()=>q(d,`aria-label`,z(u))),U(e,d)}),D(l),D(c),R((e,t)=>{q(l,`aria-label`,e),q(l,`aria-rowcount`,K7.current.length+1),u=cs(l,``,u,{"--column-count":z(n).length}),W(p,t)},[()=>Y(`bulk_edit_table`),()=>Y(`bulk_edit_entry`)]),U(e,c),k()}var sat=B(`<bdi></bdi>`),cat=B(`<!> <!>`,1),lat=B(`<div role="none" class="label svelte-b1f01"><!></div>`),uat=B(`<bdi> </bdi>`),dat=B(`<!> <!> <!> <!>`,1),fat={hash:`svelte-b1f01`,code:`.label.svelte-b1f01 {.icon.home {opacity:0.5;font-size:20px;vertical-align:-4px;}}`};function pat(e,t){O(t,!0),K(e,fat);let n=e=>{bu(e,{class:`title`,children:(e,n)=>{var r=lat();fl(N(r),{lines:2,children:(e,n)=>{var r=cat(),i=P(r);Io(i,()=>Jc.current,e=>{var n=sat();Wo(n,()=>jz(t.collection,t.entry,{useTemplate:!0,allowMarkdown:!0}),!0),D(n),U(e,n)});var a=I(i,2),o=e=>{{let n=A(()=>rA(t.collection)?.icon);Xc(e,{get name(){return z(n)},class:`home`})}},s=A(()=>aA(t.collection,t.entry));G(a,e=>{z(s)&&e(o)}),U(e,r)},$$slots:{default:!0}}),D(r),U(e,r)},$$slots:{default:!0}})},r=J(t,`showCheckbox`,3,!1),i=J(t,`onSelect`,3,void 0),a=J(t,`columns`,19,()=>[]),o=A(()=>t.entry.workflow),s=A(()=>Jc.current?jz(t.collection,t.entry):``);var c=dat(),l=P(c),u=e=>{bu(e,{class:`checkbox`,children:(e,n)=>{{let n=A(()=>Y(`select_item`,{values:{name:z(s)}})),r=A(()=>DTe.current.has(t.entry.id));Ql(e,{tabindex:`-1`,get ariaLabel(){return z(n)},get checked(){return z(r)},onChange:({detail:{checked:e}})=>{i()?.(e)}})}},$$slots:{default:!0}})};G(l,e=>{r()&&!(iG.isSmallScreen||iG.isMediumScreen)&&e(u)});var d=I(l,2),f=e=>{bu(e,{class:`image`,children:(e,n)=>{{let n=A(()=>t.viewType===`grid`?`tile`:`icon`);K5(e,{get collection(){return t.collection},get entry(){return t.entry},get variant(){return z(n)}})}},$$slots:{default:!0}})};G(d,e=>{t.collection._thumbnailFieldNames.length&&e(f)});var p=I(d,2),m=e=>{var r=H();Bo(P(r),17,a,e=>e.key,(e,r)=>{var i=H(),a=P(i),o=e=>{n(e)},s=e=>{let n=A(()=>vWe({collection:t.collection,entry:t.entry,column:z(r)}));bu(e,{class:`column`,get"data-key"(){return z(r).key},children:(e,t)=>{var r=H(),i=P(r),a=e=>{var t=H(),r=P(t),i=e=>{{let t=A(()=>Y(`boolean.true`));Xc(e,{name:`check`,role:`img`,get"aria-label"(){return z(t)}})}};G(r,e=>{z(n).value&&e(i)}),U(e,t)},o=e=>{var t=lat();fl(N(t),{children:(e,t)=>{var r=uat(),i=F(r,!0);R(()=>W(i,z(n).value)),U(e,r)},$$slots:{default:!0}}),D(t),U(e,t)};G(i,e=>{z(n).type===`boolean`?e(a):e(o,-1)}),U(e,r)},$$slots:{default:!0}})};G(a,e=>{z(r).key===`_summary`?e(o):e(s,-1)}),U(e,i)}),U(e,r)},h=e=>{n(e)};G(p,e=>{t.viewType===`table`?e(m):e(h,-1)}),bu(I(p,2),{class:`status`,children:(e,n)=>{var r=H(),i=P(r),a=e=>{{let n=A(()=>NY(t.entry,t.collection));M7(e,{get status(){return z(n)}})}};G(i,e=>{z(o)&&e(a)}),U(e,r)},$$slots:{default:!0}}),U(e,c),k()}function mat(e,t){O(t,!0);let n=J(t,`columns`,19,()=>[]),r=A(()=>{let e=Mrt.current.get(t.entry.id);if(e!==void 0)return t.viewType===`table`?e+2:e+1}),i=A(()=>Jc.current?jz(t.collection,t.entry):``),a=e=>{ZR.current=iJ(ZR.current,t.entry,e)};Su(e,{get"aria-rowindex"(){return z(r)},get"aria-label"(){return z(i)},onChange:e=>{a(e.detail.selected)},onclick:()=>{o$(IP(`/collections/${t.collection.name}/entries/${t.entry.subPath}`),{transitionType:`forwards`})},children:(e,r)=>{{let r=A(()=>!$V.current);pat(e,{get collection(){return t.collection},get entry(){return t.entry},get viewType(){return t.viewType},get columns(){return n()},get showCheckbox(){return z(r)},onSelect:a})}},$$slots:{default:!0}}),k()}var hat=B(`<!> <!>`,1);function gat(e,t){O(t,!0);let n=J(t,`canMoveUp`,3,!1),r=J(t,`canMoveDown`,3,!1),i=J(t,`onMoveUp`,3,void 0),a=J(t,`onMoveDown`,3,void 0),o=async(e,t,n)=>{e.stopPropagation();let r=e.currentTarget.closest(`[role="row"]`);n?.(),await co(),XGe({item:r,action:t})};var s=hat(),c=P(s);pat(c,{get collection(){return t.collection},get entry(){return t.entry},get viewType(){return t.viewType}}),bu(I(c,2),{class:`reorder-actions`,children:(e,t)=>{var s=hat(),c=P(s);{let e=e=>{Xc(e,{name:`arrow_upward`})},t=A(()=>!n()),r=A(()=>Y(`move_up`));Al(c,{variant:`ghost`,iconic:!0,get disabled(){return z(t)},"data-action":`move-up`,get"aria-label"(){return z(r)},onclick:e=>o(e,`move-up`,i()),startIcon:e,$$slots:{startIcon:!0}})}var l=I(c,2);{let e=e=>{Xc(e,{name:`arrow_downward`})},t=A(()=>!r()),n=A(()=>Y(`move_down`));Al(l,{variant:`ghost`,iconic:!0,get disabled(){return z(t)},"data-action":`move-down`,get"aria-label"(){return z(n)},onclick:e=>o(e,`move-down`,a()),startIcon:e,$$slots:{startIcon:!0}})}U(e,s)},$$slots:{default:!0}}),U(e,s),k()}var _at=B(`<div role="row" tabindex="0" aria-selected="false" draggable="true"><!></div>`),vat=B(`<div role="none" class="wrapper svelte-1txp9gj"></div>`),yat={hash:`svelte-1txp9gj`,code:`.wrapper.svelte-1txp9gj {
/* The rows aren’t \`<GridRow>\` components, so they don’t get its scoped layout rules */.grid-row {display:table-row;height:var(--sui-primary-row-height);}
/* The dragged row is left as a faint placeholder marking the gap it would drop into. The
pointer already carries the browser’s own drag image of it, so showing it twice at full
strength would just be confusing. */.grid-row.drag-source {opacity:0.25;cursor:grabbing;}.grid-row[draggable='true']:not(.drag-source) {cursor:grab;}}`};function bat(e,t){O(t,!0),K(e,yat);let n=j({}),r=j(void 0),i=j(void 0),a=(e=z(n))=>{V7.current=$7.current.flatMap(({name:t,entries:n})=>e[t]??n)},o=(e,t)=>z(n)[e]??t,s=e=>{let t=Mrt.current.get(e.id);return t===void 0?void 0:t+1},c=(e,t,r)=>{if(t===r)return;let i=z(n)[e]??[];M(n,{...z(n),[e]:m6(i,t,r)}),H7.current=!0,a()},l=e=>{if(z(r)){let{name:t,entries:i}=z(r);e?(z(n)[t]??[]).some((e,t)=>e.id!==i[t]?.id)&&(H7.current=!0,a()):M(n,{...z(n),[t]:i})}M(r,void 0),M(i,void 0)};js(()=>{let e=Object.fromEntries($7.current.map(({name:e,entries:n})=>[e,uz(n.filter(e=>!aA(t.collection,e)),t.collection)]));M(n,e),a(e)});var u=vat();Bo(u,21,()=>$7.current,({name:e,entries:t})=>e,(e,a)=>{let u=()=>z(a).name,d=()=>z(a).entries;var f=H();Fo(P(f),pl,null,e=>{{let a=A(()=>u()===`*`?void 0:Kz(u()));vu(e,{get label(){return z(a)},children:(e,a)=>{let f=A(()=>o(u(),d()));var p=H();Bo(P(p),27,()=>z(f),e=>e.id,(e,a,o)=>{var d=_at();let p;var m=N(d);{let e=A(()=>z(o)>0),n=A(()=>z(o)<z(f).length-1);gat(m,{get collection(){return t.collection},get entry(){return z(a)},get viewType(){return t.viewType},get canMoveUp(){return z(e)},get canMoveDown(){return z(n)},onMoveUp:()=>{c(u(),z(o),z(o)-1)},onMoveDown:()=>{c(u(),z(o),z(o)+1)}})}D(d),R(e=>{p=os(d,1,`sui grid-row`,null,p,{"drag-source":z(i)?.id===z(a).id}),q(d,`aria-rowindex`,e)},[()=>s(z(a))]),yo(`dragstart`,d,e=>{M(r,{name:u(),entries:[...z(f)]}),M(i,z(a)),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`)}),yo(`dragover`,d,e=>{let t=u()===z(r)?.name;if(t){e.preventDefault();let t=z(n)[u()]??[],r=t.findIndex(({id:e})=>e===z(i)?.id),a=WGe({dragIndex:r,dropIndex:UGe({index:z(o),clientY:e.clientY,rect:e.currentTarget.getBoundingClientRect()})});a!==void 0&&M(n,{...z(n),[u()]:m6(t,r,a)})}e.dataTransfer&&(e.dataTransfer.dropEffect=t?`move`:`none`)}),yo(`drop`,d,e=>{e.preventDefault(),l(u()===z(r)?.name)}),yo(`dragend`,d,()=>{l(!1)}),Zo(d,()=>Bu,()=>({duration:200})),U(e,d)}),U(e,p)},$$slots:{default:!0}})}}),U(e,f)}),D(u),U(e,u),k()}var xat=B(`<!> <!> <!> <!>`,1);function Sat(e,t){O(t,!0);let n=A(()=>xB.current.map(({key:e})=>e));dae(e,{children:(e,r)=>{Su(e,{"aria-rowindex":1,children:(e,r)=>{var i=xat(),a=P(i),o=e=>{xu(e,{class:`checkbox`})};G(a,e=>{t.showCheckbox&&e(o)});var s=I(a,2),c=e=>{xu(e,{class:`image`})};G(s,e=>{t.collection._thumbnailFieldNames.length&&e(c)});var l=I(s,2);Bo(l,17,()=>t.columns,e=>e.key,(e,r)=>{let i=A(()=>yWe({collection:t.collection,column:z(r),sortKeys:z(n)})),a=A(()=>g3.current);var o=H(),s=P(o),c=e=>{{let t=A(()=>z(r).key===`_summary`?`title`:`column`),n=A(()=>z(a).sort?.key===z(i)?z(a).sort.order:`none`);xu(e,{get class(){return z(t)},get sortOrder(){return z(n)},onSort:e=>{g3.current={...g3.current,sort:{key:z(i),order:e.detail.sortOrder}}},children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(r).label)),U(e,n)},$$slots:{default:!0}})}},l=e=>{{let t=A(()=>z(r).key===`_summary`?`title`:`column`);xu(e,{get class(){return z(t)},children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(r).label)),U(e,n)},$$slots:{default:!0}})}};G(s,e=>{z(i)?e(c):e(l,-1)}),U(e,o)}),xu(I(l,2),{class:`status`}),U(e,i)},$$slots:{default:!0}})},$$slots:{default:!0}}),k()}var Cat=B(`<!> <!>`,1);function wat(e,t){O(t,!0);let n=e=>{Eu(e,{children:(e,t)=>{var n=Cat(),r=P(n);{let e=A(()=>Y(`entry`));Du(r,{get label(){return z(e)},onclick:()=>c()})}Du(I(r,2),{get label(){return z(o)},onclick:()=>c(!0)}),U(e,n)},$$slots:{default:!0}})},r=J(t,`label`,3,void 0),i=J(t,`keyShortcuts`,3,void 0),a=A(()=>vj.current&&sj.current?MTe(sj.current):!1),o=A(()=>Jc.current&&sj.current?rA(sj.current)?.label:``),s=A(()=>z(a)?Zl:Al),c=(e=!1)=>{let n=!e&&sj.current&&EA(sj.current)&&CA.current?`?path=${zP(CA.current)}`:``;o$(`/collections/${t.collectionName}/new${n}`,{state:{index:e},transitionType:`forwards`})};var l=H(),u=P(l);{let e=e=>{Xc(e,{name:`edit`})},t=A(()=>!r()),o=A(()=>Y(`create_new_entry`)),l=A(()=>z(a)?n:void 0);Ko(u,()=>z(s),(n,a)=>{a(n,{variant:`primary`,get iconic(){return z(t)},get disabled(){return Q7.current.creationDisabled},get label(){return r()},get"aria-label"(){return z(o)},get keyShortcuts(){return i()},onclick:()=>c(),get popup(){return z(l)},startIcon:e,$$slots:{startIcon:!0}})})}U(e,l),k()}var Tat=B(`<!> <!> <!>`,1),Eat=B(`<span role="none"> </span>`),Dat=B(`<span role="none"> </span> <!>`,1);function Oat(e,t){O(t,!0);let n=(e,t=kr,n=kr,r=kr)=>{let o=A(()=>t()._i18n);{let s=A(()=>n()===`*`?Z7.current.length?Y(`workflow.published_entries`):void 0:Kz(n())),c=A(()=>n()!==`*`),l=A(()=>!$z(g3.current,n()));vu(e,{get label(){return z(s)},get collapsible(){return z(c)},get expanded(){return z(l)},onChange:({detail:{expanded:e}})=>{g3.current=tB(g3.current,n(),!e)},children:(e,n)=>{{let n=(e,n=kr)=>{mat(e,{get collection(){return t()},get entry(){return n()},get viewType(){return z(i)},get columns(){return z(a)}})},s=A(()=>r().filter(e=>!!ZP(e,{defaultLocale:z(o).defaultLocale})?.content));zu(e,{get items(){return z(s)},itemKey:`id`,renderItem:n,$$slots:{renderItem:!0}})}},$$slots:{default:!0}})}},r=A(()=>sj.current),i=A(()=>bWe({type:g3.current.type,types:_3(z(r)),isLargeScreen:iG.isLargeScreen,reordering:B7.current})),a=A(()=>z(i)===`table`&&z(r)?gWe({collection:z(r),sortKeys:xB.current.map(({key:e})=>e)}):[]),o=A(()=>$7.current.flatMap(({entries:e})=>e)),s=A(()=>xWe(g3.current)),c=()=>fo(()=>z(i))===`table`?void 0:pl();{let t=A(()=>Y(`entry_list`));O5(e,{get"aria-label"(){return z(t)},children:(e,t)=>{var l=H(),u=P(l),d=e=>{var t=H(),l=P(t),u=e=>{oat(e,{get collection(){return z(r)}})},d=e=>{{let t=A(()=>Y(`entries`)),o=A(()=>X7.current.length+Z7.current.length+ +(z(i)===`table`));k5(e,{get viewType(){return z(i)},id:`entry-list`,get"aria-label"(){return z(t)},get scrollKey(){return z(s)},get"aria-rowcount"(){return z(o)},children:(e,t)=>{var o=H(),l=P(o),u=e=>{bat(e,{get collection(){return z(r)},get viewType(){return z(i)}})},d=e=>{var t=Tat(),o=P(t),l=e=>{{let t=A(()=>!$V.current);Sat(e,{get collection(){return z(r)},get columns(){return z(a)},get showCheckbox(){return z(t)}})}};G(o,e=>{z(i)===`table`&&e(l)});var u=I(o,2),d=e=>{{let t=A(()=>Y(`workflow.unpublished_entries`));vu(e,{get label(){return z(t)},children:(e,t)=>{var n=H();Bo(P(n),17,()=>Z7.current,e=>e.id,(e,t)=>{mat(e,{get collection(){return z(r)},get entry(){return z(t)},get viewType(){return z(i)},get columns(){return z(a)}})}),U(e,n)},$$slots:{default:!0}})}};G(u,e=>{Z7.current.length&&e(d)}),Io(I(u,2),()=>z(s),e=>{var t=H();Bo(P(t),17,()=>$7.current,({name:e,entries:t})=>e,(e,t)=>{let i=()=>z(t).name,a=()=>z(t).entries;var o=H();Fo(P(o),c,null,e=>{n(e,()=>z(r),i,a)}),U(e,o)}),U(e,t)}),U(e,t)};G(l,e=>{B7.current?e(u):e(d,-1)}),U(e,o)},$$slots:{default:!0}})}},f=e=>{VO(e,{children:(e,t)=>{var n=Eat(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`no_entries_found`)]),U(e,n)},$$slots:{default:!0}})},p=e=>{VO(e,{children:(e,t)=>{var n=Dat(),i=P(n),a=F(i,!0),o=I(i,2);{let e=A(()=>Y(`create_new_entry`));wat(o,{get collectionName(){return z(r).name},get label(){return z(e)}})}R(e=>W(a,e),[()=>Y(`no_entries_created`)]),U(e,n)},$$slots:{default:!0}})};G(l,e=>{U7.current?e(u):z(o).length||Z7.current.length?e(d,1):X7.current.length?e(f,2):e(p,-1)}),U(e,t)},f=e=>{VO(e,{children:(e,t)=>{var n=Eat(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`collection_not_found`)]),U(e,n)},$$slots:{default:!0}})};G(u,e=>{z(r)?e(d):e(f,-1)}),U(e,l)},$$slots:{default:!0}})}k()}var kat=B(`<div role="none" class="label svelte-1nfjp1"><!> <!></div>`),Aat=B(`<!> <!>`,1),jat=B(`<span role="none"> </span>`),Mat={hash:`svelte-1nfjp1`,code:`.label.svelte-1nfjp1 {display:flex;align-items:center;gap:16px;.icon {display:flex;align-items:center;justify-content:center;border-radius:var(--sui-control-medium-border-radius);width:var(--icon-size);height:var(--icon-size);background-color:var(--sui-secondary-background-color);}}`};function Nat(e,t){O(t,!0),K(e,Mat);let n=A(()=>sj.current?.files.filter(Mk)??[]),r=A(()=>Object.fromEntries(VY.current.filter(({workflow:e})=>e.collectionName===sj.current?.name).map(e=>[e.workflow.fileName,NY(e,sj.current)])));{let t=A(()=>Y(`file_list`));O5(e,{get"aria-label"(){return z(t)},children:(e,t)=>{var i=H(),a=P(i),o=e=>{{let t=A(()=>Y(`files`));k5(e,{viewType:`list`,get"aria-label"(){return z(t)},get"aria-rowcount"(){return z(n).length},children:(e,t)=>{zu(e,{get items(){return z(n)},itemKey:`name`,renderItem:(e,t)=>{let n=()=>(t?.()).name,i=()=>(t?.()).label,a=()=>(t?.()).icon;Su(e,{onclick:()=>{o$(IP(`/collections/${sj.current?.name}/entries/${n()}`),{transitionType:`forwards`})},children:(e,t)=>{var o=Aat(),s=P(o);bu(s,{class:`title`,children:(e,t)=>{var r=kat(),o=N(r),s=e=>{Xc(e,{get name(){return a()}})};G(o,e=>{a()&&e(s)}),fl(I(o,2),{lines:2,children:(e,t)=>{Qr();var r=V();R(()=>W(r,i()||n())),U(e,r)},$$slots:{default:!0}}),D(r),U(e,r)},$$slots:{default:!0}}),bu(I(s,2),{class:`status`,children:(e,t)=>{var i=H(),a=P(i),o=e=>{M7(e,{get status(){return z(r)[n()]}})};G(a,e=>{z(r)[n()]&&e(o)}),U(e,i)},$$slots:{default:!0}}),U(e,o)},$$slots:{default:!0}})},$$slots:{renderItem:!0}})},$$slots:{default:!0}})}},s=e=>{VO(e,{children:(e,t)=>{var n=jat(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`no_files_in_collection`)]),U(e,n)},$$slots:{default:!0}})};G(a,e=>{z(n)?.length?e(o):e(s,-1)}),U(e,i)},$$slots:{default:!0}})}k()}function Pat(e,t){O(t,!0);let n=e=>{var n=H();Bo(P(n),17,()=>z(a),e=>e.path,(e,n)=>{Pat(e,{get node(){return z(n)},get collectionName(){return t.collectionName}})}),U(e,n)},r=A(()=>t.node.path),i=A(()=>t.node.label),a=A(()=>t.node.children),o=A(()=>sj.current?.name===t.collectionName),s=A(()=>z(o)&&CA.current===z(r)),c=A(()=>z(o)&&MA(z(r),CA.current)),l=j(!1);L(()=>{(z(s)||z(c))&&fo(()=>{M(l,!0)})});{let o=e=>{Xc(e,{name:`folder`})},c=A(()=>z(a).length?n:void 0);RO(e,{get label(){return z(i)},get selected(){return z(s)},get items(){return z(c)},onSelect:()=>{o$(IP(`/collections/${t.collectionName}/filter/${z(r)}`),{transitionType:`forwards`})},get expanded(){return z(l)},set expanded(e){M(l,e,!0)},startIcon:o,$$slots:{startIcon:!0}})}k()}var Fat=B(`<span class="count"> </span>`);function Iat(e,t){O(t,!0);let n=e=>{var t=H();Bo(P(t),17,()=>z(d),e=>e.path,(e,t)=>{Pat(e,{get node(){return z(t)},get collectionName(){return z(i)}})}),U(e,t)},r=J(t,`isSearchPage`,3,!1),i=A(()=>t.collection.name),a=A(()=>t.collection.label),o=A(()=>t.collection.icon),s=A(()=>sj.current?.name===z(i)),c=A(()=>iG.isSmallScreen||r()?!1:z(s)&&!CA.current),l=A(()=>`files`in t.collection?[]:a4(t.collection)),u=A(()=>`files`in t.collection?t.collection.files.length:az(z(i),z(l))),d=A(()=>{let e=fj(z(i));return e?WZe({collection:e,entries:z(l)}):[]}),f=j(!1);L(()=>{z(s)&&fo(()=>{M(f,!0)})});{let t=e=>{{let t=A(()=>z(o)||`bookmark_manager`);Xc(e,{get name(){return z(t)}})}},r=e=>{var t=Fat(),n=F(t,!0);R((e,r)=>{q(t,`aria-label`,`(${e??``})`),W(n,r)},[()=>Y(`x_entries`,{values:{count:z(u)}}),()=>b5.current.format(z(u))]),U(e,t)},s=A(()=>z(a)||z(i)),l=A(()=>z(d).length?n:void 0);RO(e,{get label(){return z(s)},get selected(){return z(c)},get items(){return z(l)},onSelect:()=>{o$(`/collections/${z(i)}`,{transitionType:`forwards`})},get expanded(){return z(f)},set expanded(e){M(f,e,!0)},startIcon:t,endIcon:r,$$slots:{startIcon:!0,endIcon:!0}})}k()}var Lat=B(`<div class="wrapper svelte-ozneys"><!></div>`),Rat={hash:`svelte-ozneys`,code:`.wrapper.svelte-ozneys {display:contents;}`};function zat(e,t){O(t,!0),K(e,Rat);let n=A(()=>t.file.name),r=A(()=>t.file.icon),i=A(()=>t.file.label||z(n)),a=j(!1),o=j(void 0);var s=Lat();RO(N(s),{get label(){return z(i)},onSelect:()=>{XQ.current=Y(`singleton_selected_announcement`,{values:{file:z(i)}})},onclick:()=>{o$(IP(`/collections/_singletons/entries/${z(n)}`),{transitionType:`forwards`}),M(a,!1),z(o)?.querySelector(`[role="treeitem"]`)?.classList.remove(`focused`)},get selected(){return z(a)},set selected(e){M(a,e,!0)},startIcon:e=>{{let t=A(()=>z(r)||`edit_document`);Xc(e,{get name(){return z(t)}})}},$$slots:{startIcon:!0}}),D(s),Ds(s,e=>M(o,e),()=>z(o)),U(e,s),k()}var Bat=hk(()=>{let{published:e,time:t}=HK.current,{current:n}=VK,r=n?BK.current[n]:void 0;return!r||r.checkedTime<=t?e:r.state===`ready`||r.state===`pending`||r.state!==`error`&&e}),Vat=hk(()=>(!!IG.deployHookURL||typeof OY.current?.triggerDeployment==`function`)&&!Bat.current),Hat=async()=>{let{deployHookURL:e,deployHookAuthHeader:t}=IG;if(e&&!nG(e))throw Error(`Deploy hook URL must use HTTPS or localhost`);let{ok:n,status:r}=e?await fetch(e,{method:`POST`,mode:t?`cors`:`no-cors`,headers:t?{Authorization:t}:{}}):await OY.current?.triggerDeployment?.()??{};if(!n&&(t||r!==0))throw Error(`Webhook returned ${r} error`);WK(!0)},Uat=B(`<!> <!>`,1);function Wat(e,t){O(t,!0);let n=j(`info`),r=j(!1),i=async()=>{M(n,`info`),M(r,!0);try{await Hat()}catch(e){M(n,`error`),M(r,!0),console.error(e)}};var a=H(),o=P(a),s=e=>{var t=Uat(),a=P(t);{let e=A(()=>iG.isSmallScreen?`small`:`medium`),t=A(()=>Y(`publish_changes`)),n=A(()=>!Vat.current);Al(a,{variant:`secondary`,get size(){return z(e)},get label(){return z(t)},get disabled(){return z(n)},onclick:()=>i()})}Xu(I(a,2),{get show(){return z(r)},set show(e){M(r,e,!0)},children:(e,t)=>{el(e,{get status(){return z(n)},children:(e,t)=>{Qr();var r=V();R(e=>W(r,e),[()=>Y(z(n)===`error`?`publishing_changes_failed`:`publishing_changes`)]),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,t)};G(o,e=>{X8.current&&e(s)}),U(e,a),k()}var Gat=B(`<header><h2> </h2> <!></header> <!>`,1),Kat=B(`<span class="count"> </span>`),qat=B(`<!> <!>`,1),Jat=B(`<nav class="primary-sidebar"><!> <!></nav>`);function Yat(e,t){O(t,!0);let n=J(t,`isSearchPage`,3,!1),r=A(()=>Sk.current?.collections?.filter(({hide:e})=>!e)??[]),i=A(()=>Sk.current?.singletons??[]),a=A(()=>z(r).some(e=>!(`divider`in e)&&TA(e)));var o=Jat(),s=N(o),c=e=>{var t=Gat(),n=P(t),r=N(n),i=F(r,!0);Wat(I(r,2),{}),D(n),B5(I(n,2),{onclick:e=>{e.preventDefault(),o$(`/search`)}}),R(e=>W(i,e),[()=>Y(`contents`)]),U(e,t)};G(s,e=>{iG.isSmallScreen&&e(c)});var l=I(s,2);{let e=A(()=>z(a)?void 0:`flat`),t=A(()=>Y(`collection_list`)),o=A(()=>n()?void 0:`collection-container`);BO(l,{get class(){return z(e)},get ariaLabel(){return z(t)},get"aria-controls"(){return z(o)},expandOnSelect:!1,children:(e,t)=>{var a=qat(),o=P(a),s=e=>{{let t=A(()=>Y(`collections`));wu(e,{get label(){return z(t)},children:(e,t)=>{var i=H();Bo(P(i),19,()=>z(r),(e,t)=>e.name??t,(e,t)=>{var r=H();Fo(P(r),pl,null,e=>{var r=H(),i=P(r),a=e=>{Iat(e,{get collection(){return z(t)},get isSearchPage(){return n()}})},o=e=>{mu(e,{})};G(i,e=>{`divider`in z(t)?z(t).divider&&e(o,1):e(a)}),U(e,r)}),U(e,r)}),U(e,i)},$$slots:{default:!0}})}};G(o,e=>{z(r).length&&e(s)});var c=I(o,2),l=e=>{var t=H(),n=P(t),a=e=>{{let t=A(()=>Y(`files`));wu(e,{get label(){return z(t)},children:(e,t)=>{var n=H();Bo(P(n),19,()=>z(i),(e,t)=>e.name??t,(e,t)=>{var n=H();Fo(P(n),pl,null,e=>{var n=H(),r=P(n),i=e=>{zat(e,{get file(){return z(t)}})},a=e=>{mu(e,{})};G(r,e=>{`divider`in z(t)?z(t).divider&&e(a,1):e(i)}),U(e,n)}),U(e,n)}),U(e,n)},$$slots:{default:!0}})}},o=e=>{let t=A(()=>z(i).filter(e=>!(`divider`in e)).length);{let n=A(()=>Y(`collections`));wu(e,{get label(){return z(n)},children:(e,n)=>{{let n=e=>{Xc(e,{name:`bookmark_manager`})},r=e=>{var n=Kat(),r=F(n,!0);R((e,t)=>{q(n,`aria-label`,`(${e??``})`),W(r,t)},[()=>Y(`x_entries`,{values:{count:z(t)}}),()=>b5.current.format(z(t))]),U(e,n)},i=A(()=>Y(`files`)),a=A(()=>sj.current?.name===`_singletons`);RO(e,{get label(){return z(i)},get selected(){return z(a)},onSelect:()=>{o$(`/collections/_singletons`,{transitionType:`forwards`})},startIcon:n,endIcon:r,$$slots:{startIcon:!0,endIcon:!0}})}},$$slots:{default:!0}})}};G(n,e=>{iG.isSmallScreen||z(r).length?e(a):e(o,-1)}),U(e,t)};G(c,e=>{z(i).length&&e(l)}),U(e,a)},$$slots:{default:!0}})}D(o),R(e=>q(o,`aria-label`,e),[()=>Y(`contents`)]),U(e,o),k()}var Xat=B(`<!> <!> <!> <!> <!> <!>`,1);function Zat(e,t){O(t,!0);let n=J(t,`canSave`,3,!0),r=J(t,`saving`,15,!1),i=J(t,`validate`,3,void 0),a=J(t,`invalidMessage`,3,``),o=J(t,`discardMessage`,3,``),s=J(t,`onExit`,3,void 0),c=J(t,`leading`,3,void 0),l=j(!1),u=j(!1),d=j(!1),f=j(void 0),p=j(void 0),m=()=>{let e=z(f);(e.disabled?z(p):e).focus()},h=()=>{t.exitMode(),s()?.()},g=async()=>{if(i()&&!i()()){M(u,!0);return}r(!0);let{ok:e,cancelled:n}=await Y4(t.commit);r(!1),e?h():(n||M(d,!0),await co(),z(f).focus())};var _={focus:m},v=Xat(),y=P(v);Go(y,()=>c()??kr);var b=I(y,2);{let e=A(()=>r()||!n());Al(b,{variant:`primary`,get label(){return t.saveLabel},get"aria-label"(){return t.saveAriaLabel},get disabled(){return z(e)},onclick:()=>{g()},get element(){return z(f)},set element(e){M(f,e,!0)}})}var x=I(b,2);{let e=A(()=>Y(`cancel`));Al(x,{variant:`secondary`,get label(){return z(e)},get"aria-label"(){return t.cancelAriaLabel},get disabled(){return r()},onclick:()=>{o()&&n()?M(l,!0):h()},get element(){return z(p)},set element(e){M(p,e,!0)}})}var S=I(x,2),C=e=>{{let n=A(()=>Y(`discard`));ru(e,{get title(){return t.cancelAriaLabel},get okLabel(){return z(n)},onOk:()=>{h()},get open(){return z(l)},set open(e){M(l,e,!0)},children:(e,t)=>{Qr();var n=V();R(()=>W(n,o())),U(e,n)},$$slots:{default:!0}})}};G(S,e=>{o()&&e(C)});var w=I(S,2),T=e=>{Xu(e,{get show(){return z(u)},set show(e){M(u,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(()=>W(n,a())),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};return G(w,e=>{a()&&e(T)}),Xu(I(w,2),{get show(){return z(d)},set show(e){M(d,e,!0)},children:(e,n)=>{el(e,{status:`error`,children:(e,n)=>{Qr();var r=V();R(()=>W(r,t.savingFailedMessage)),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,v),k(_)}var Qat=B(`<div role="status" class="count svelte-a3wcu0"> </div> <!>`,1),$at={hash:`svelte-a3wcu0`,code:`.count.svelte-a3wcu0 {font-size:var(--sui-font-size-small);opacity:0.8;white-space:nowrap;}`};function eot(e,t){O(t,!0),K(e,$at);let n=J(t,`onExit`,3,void 0),r=j(void 0),i=A(()=>Wit(W7.current)),a=()=>{z(r).focus()},o=()=>({collection:sj.current,entries:K7.current,edits:W7.current});var s={focus:a};{let t=e=>{var t=Qat(),n=P(t),r=F(n,!0);$l(I(n,2),{}),R(e=>W(r,e),[()=>Y(`bulk_edit_count`,{values:{count:z(i)}})]),U(e,t)},a=A(()=>Y(`save`)),s=A(()=>Y(`save_bulk_edits`)),c=A(()=>Y(`cancel_bulk_edits`)),l=A(()=>Y(`saving_bulk_edits_failed`)),u=A(()=>Y(`bulk_edit_invalid`)),d=A(()=>Y(`discard_bulk_edits_confirm`)),f=A(()=>!!z(i));Ds(Zat(e,{get saveLabel(){return z(a)},get saveAriaLabel(){return z(s)},get cancelAriaLabel(){return z(c)},get savingFailedMessage(){return z(l)},get invalidMessage(){return z(u)},get discardMessage(){return z(d)},get canSave(){return z(f)},validate:()=>{let e=qit(o());return!Object.keys(e).length||(q7.current=e,!1)},commit:()=>Yit(o()),exitMode:()=>t9(!1),get onExit(){return n()},get saving(){return G7.current},set saving(e){G7.current=e},leading:t,$$slots:{leading:!0}}),e=>M(r,e,!0),()=>z(r))}return k(s)}function tot(e,t){O(t,!0);let n=J(t,`onExit`,3,void 0),r=j(void 0);var i={focus:()=>{z(r).focus()}};{let t=A(()=>Y(`done`)),i=A(()=>Y(`done_reordering_entries`)),a=A(()=>Y(`cancel_reordering_entries`)),o=A(()=>Y(`saving_reorder_failed`));Ds(Zat(e,{get saveLabel(){return z(t)},get saveAriaLabel(){return z(i)},get cancelAriaLabel(){return z(a)},get savingFailedMessage(){return z(o)},get canSave(){return H7.current},commit:()=>lnt(sj.current,V7.current),exitMode:()=>e9(!1),get onExit(){return n()}}),e=>M(r,e,!0),()=>z(r))}return k(i)}var not=B(` <!>`,1),rot=B(`<!> <!>`,1);function iot(e,t){O(t,!0);let n=J(t,`open`,15,!1),r=j(!1),i=j(``),a=A(()=>ZR.current.filter(e=>`workflow`in e)),o=A(()=>ZR.current.filter(e=>!(`workflow`in e))),s=A(()=>{let e=sj.current;return n()&&e&&z(o).length?S7({collection:e,entries:z(o)}):nnt}),c=A(()=>{let e=w4({entries:z(o),collectionName:sj.current?.name});return z(o).map((t,n)=>({entry:t,assets:e[n]}))}),l=A(()=>z(c).flatMap(({assets:e})=>e)),u=async()=>{let e=sj.current,{ok:t,cancelled:n,result:o,error:s}=await Y4(()=>Ynt({drafts:z(a),items:z(c),collection:e,useWorkflow:BY(e)}));t?(o&&(K$.current={...G$,...o}),ZR.current=[]):n||(M(i,CW(s,`deleting_entry_failed`),!0),M(r,!0))};var d=rot(),f=P(d);{let e=A(()=>Y(`delete_entries`,{values:{count:ZR.current.length}})),t=A(()=>Y(`delete`)),r=A(()=>!!z(s).blockers.length);ru(f,{get title(){return z(e)},get okLabel(){return z(t)},get okDisabled(){return z(r)},onOk:async()=>{await u()},get open(){return n()},set open(e){n(e)},children:(e,t)=>{let n=A(()=>ZR.current.length>1&&ZR.current.length===X7.current.length+Z7.current.length);var r=rot(),i=P(r),c=e=>{var t=not(),r=P(t),i=I(r),s=e=>{var t=V();R(e=>W(t,e),[()=>Y(z(o).length?`workflow.deleting_unpublished_note_some`:`workflow.deleting_unpublished_note_all`,{values:{count:z(a).length}})]),U(e,t)};G(i,e=>{z(a).length&&e(s)}),R(e=>W(r,`${e??``} `),[()=>Y(z(l).length?z(n)?`confirm_deleting_all_entries_with_assets`:`confirm_deleting_selected_entries_with_assets`:z(n)?`confirm_deleting_all_entries`:`confirm_deleting_selected_entries`,{values:{count:ZR.current.length}})]),U(e,t)};G(i,e=>{z(s).blockers.length||e(c)}),x5(I(i,2),{get plan(){return z(s)},get count(){return z(o).length}}),U(e,r)},$$slots:{default:!0}})}Xu(I(f,2),{get show(){return z(r)},set show(e){M(r,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(i))),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,d),k()}var aot=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1),oot=B(`<bdi></bdi>`),sot=B(`<div role="none" class="description svelte-83jnuc"><!></div>`),cot=B(`<!> <!> <!> <!>`,1),lot=B(`<!> <h2 role="none" class="svelte-83jnuc"><bdi> </bdi></h2> <!> <!>`,1),uot=B(`<!> <!>`,1),dot={hash:`svelte-83jnuc`,code:`h2.svelte-83jnuc {flex:none !important;}.description.svelte-83jnuc {flex:auto;font-size:var(--sui-font-size-small);opacity:0.8;}`};function fot(e,t){O(t,!0),K(e,dot);let n=j(!1),r=j(void 0),i=j(void 0),a=j(void 0),o=j(void 0),s=j(void 0),c=A(()=>sj.current?.name??``),l=A(()=>Jc.current&&sj.current?pj(sj.current):z(c)),u=A(()=>sj.current?.description),d=A(()=>Q7.current),f=A(()=>z(d).isEntryCollection),p=A(()=>z(d).readonly),m=A(()=>z(d).canCreate),h=A(()=>z(d).canDelete),g=A(()=>z(d).canReorder),_=A(()=>z(d).canBulkEdit),v=A(()=>z(d).quota),y=A(()=>z(d).remaining),b=A(()=>z(d).nearingQuota),x=A(()=>z(d).creationDisabled),S=A(()=>!ZR.current.length||!z(h)),C=A(()=>!!(X7.current.length||Z7.current.length));Sa(()=>{z(S)&&document.activeElement===z(r)&&co().then(()=>xU())});var w=uot(),T=P(w),ee=e=>{var t=uot(),d=P(t),h=e=>{var t=aot(),n=P(t);Lo(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),jl(n.lastChild,{dismissible:!1,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>B1(`collection`,{collection:sj.current})]),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)},w=e=>{var t=aot(),n=P(t);Lo(n,()=>({"--sui-infobar-border-width":`0 0 1px`,"--sui-infobar-message-justify-content":`center`})),jl(n.lastChild,{dismissible:!1,children:(e,t)=>{var n=H(),r=P(n),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`creating_entries_disabled_by_admin`)]),U(e,t)},a=e=>{var t=V();R(e=>W(t,e),[()=>Y(`creating_entries_disabled_by_quota`,{values:{quota:z(v)}})]),U(e,t)},o=e=>{var t=V();R(e=>W(t,e),[()=>Y(`creating_entries_nearing_quota`,{values:{quota:z(v),remaining:z(y)}})]),U(e,t)};G(r,e=>{z(m)?z(x)?e(a,1):e(o,-1):e(i)}),U(e,n)},$$slots:{default:!0}}),D(n),U(e,t)};G(d,e=>{z(p)?e(h):z(f)&&(z(x)||z(b))&&e(w,1)});var T=I(d,2);{let e=A(()=>Y(`collection`));dO(T,{variant:`primary`,get ariaLabel(){return z(e)},children:(e,t)=>{var d=lot(),p=P(d),m=e=>{{let t=A(()=>Y(`back_to_collection_list`));C5(e,{get"aria-label"(){return z(t)},onclick:()=>{s$(`/collections`)}})}};G(p,e=>{iG.isSmallScreen&&e(m)});var h=I(p,2),v=F(N(h),!0);D(h);var y=I(h,2),b=e=>{$l(e,{flex:!0})},w=e=>{var t=sot();fl(N(t),{children:(e,t)=>{var n=oot();Wo(n,()=>bA(z(u)||``),!0),D(n),U(e,n)},$$slots:{default:!0}}),D(t),U(e,t)};G(y,e=>{iG.isSmallScreen?e(b):e(w,-1)});var T=I(y,2),ee=e=>{Ds(tot(e,{onExit:async()=>{await co(),z(i).focus()}}),e=>M(a,e,!0),()=>z(a))},te=e=>{Ds(eot(e,{onExit:async()=>{await co(),z(o).focus()}}),e=>M(s,e,!0),()=>z(s))},ne=e=>{var t=cot(),l=P(t),u=e=>{{let t=A(()=>Y(`delete`)),i=A(()=>Y(`delete_selected_entries`,{values:{count:ZR.current.length}}));Al(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(i)},get disabled(){return z(S)},onclick:()=>{M(n,!0)},get element(){return z(r)},set element(e){M(r,e,!0)}})}};G(l,e=>{!iG.isSmallScreen&&!$V.current&&e(u)});var d=I(l,2),f=e=>{{let t=A(()=>Y(`edit`)),n=A(()=>Y(`bulk_edit_entries`)),r=A(()=>!X7.current.length);Al(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(n)},get disabled(){return z(r)},onclick:async()=>{t9(!0),await co(),z(s).focus()},get element(){return z(o)},set element(e){M(o,e,!0)}})}};G(d,e=>{z(_)&&!iG.isSmallScreen&&e(f)});var p=I(d,2),m=e=>{{let t=A(()=>Y(`reorder`)),n=A(()=>Y(`reorder_entries`)),r=A(()=>!X7.current.length);Al(e,{variant:`ghost`,get label(){return z(t)},get"aria-label"(){return z(n)},get disabled(){return z(r)},onclick:async()=>{e9(!0),await co(),z(a).focus()},get element(){return z(i)},set element(e){M(i,e,!0)}})}};G(p,e=>{z(g)&&e(m)}),Ml(I(p,2),{children:(e,t)=>{var n=H(),r=P(n),i=e=>{{let t=A(()=>iG.isSmallScreen?void 0:Y(`create`));wat(e,{get collectionName(){return z(c)},get label(){return z(t)},keyShortcuts:`Accel+E`})}};G(r,e=>{(!iG.isSmallScreen||z(C)&&!z(x))&&e(i)}),U(e,n)},$$slots:{default:!0}}),U(e,t)};G(T,e=>{z(f)&&B7.current?e(ee):z(f)&&U7.current?e(te,1):z(f)&&e(ne,2)}),R(()=>W(v,z(l))),U(e,d)},$$slots:{default:!0}})}U(e,t)};G(T,e=>{sj.current&&e(ee)}),iot(I(T,2),{get open(){return z(n)},set open(e){M(n,e,!0)}}),U(e,w),k()}function pot(e,t){O(t,!0);let n=A(()=>cH({collectionName:sj.current?.name})),r=A(()=>z(n)?pH.current.filter(e=>vX(e,z(n))):[]),i=A(()=>z(n)?.internalPath),a=A(()=>!uH(z(n))||dH.current);var o=H(),s=P(o),c=e=>{{let t=A(()=>Y(`collection_assets`));HO(e,{id:`collection-assets`,class:`secondary-sidebar`,get ariaLabel(){return z(t)},children:(e,t)=>{b$(e,{get disabled(){return z(a)},multiple:!0,onDrop:({files:e})=>{vH.current={folder:z(n),files:e}},children:(e,t)=>{F1(e,{get assets(){return z(r)},onSelect:({asset:e})=>{o$(IP(`/assets/${e.path}`),{transitionType:`forwards`})}})},$$slots:{default:!0}})},$$slots:{default:!0}})}};G(s,e=>{z(i)!==void 0&&iG.isLargeScreen&&g3.current.showMedia&&e(c)}),U(e,o),k()}var mot=B(`<!> <!>`,1),hot=B(`<!> <!> <!> <!> <!> <!> <!>`,1);function got(e,t){O(t,!0);let n=A(()=>sj.current?._type===`entry`?sj.current:void 0),r=A(()=>z(n)?.name),i=A(()=>X7.current.length+Z7.current.length),a=A(()=>!!z(i)),o=A(()=>z(i)>1);var s=H(),c=P(s),l=e=>{{let t=A(()=>Y(`entry_list`));dO(e,{variant:`secondary`,get ariaLabel(){return z(t)},children:(e,t)=>{var i=hot(),s=P(i),c=e=>{{let t=A(()=>[...Z7.current,...$7.current.flatMap(({entries:e})=>e)]);s5e(e,{get allItems(){return z(t)},get selectedItems(){return ZR}})}};G(s,e=>{!(iG.isSmallScreen||iG.isMediumScreen)&&!$V.current&&e(c)});var l=I(s,2);$l(l,{flex:!0});var u=I(l,2);{let e=A(()=>!z(o)||!xB.current.length);l5e(u,{get disabled(){return z(e)},get currentView(){return g3},get sortKeys(){return xB.current},get collectionName(){return z(r)},"aria-controls":`entry-list`})}var d=I(u,2),f=e=>{{let t=A(()=>!z(o));t5e(e,{get disabled(){return z(t)},get currentView(){return g3},get filters(){return Srt.current},multiple:!0,"aria-controls":`entry-list`})}};G(d,e=>{Srt.current?.length&&e(f)});var p=I(d,2),m=e=>{{let t=A(()=>!z(o)),n=A(()=>$7.current.map(({name:e})=>e));r5e(e,{get disabled(){return z(t)},get currentView(){return g3},get groups(){return Ert.current},get groupNames(){return z(n)},"aria-controls":`entry-list`})}};G(p,e=>{Ert.current?.length&&e(m)});var h=I(p,2);{let e=A(()=>!z(a)),t=A(()=>_3(z(n)));b3(h,{get disabled(){return z(e)},get currentView(){return g3},get types(){return z(t)},"aria-controls":`entry-list`})}var g=I(h,2),_=e=>{var t=mot(),n=P(t);mu(n,{orientation:`vertical`});var i=I(n,2);{let e=e=>{Xc(e,{name:`photo_library`})},t=A(()=>!z(a)||!cH({collectionName:z(r)})),n=A(()=>!!g3.current.showMedia),o=A(()=>g3.current.showMedia?`collection-assets`:void 0),s=A(()=>Y(g3.current.showMedia?`hide_assets`:`show_assets`));Al(i,{variant:`ghost`,iconic:!0,get disabled(){return z(t)},get pressed(){return z(n)},get"aria-controls"(){return z(o)},get"aria-expanded"(){return g3.current.showMedia},get"aria-label"(){return z(s)},onclick:()=>{g3.current={...g3.current,showMedia:!g3.current.showMedia}},startIcon:e,$$slots:{startIcon:!0}})}U(e,t)};G(g,e=>{iG.isSmallScreen||iG.isMediumScreen||e(_)}),U(e,i)},$$slots:{default:!0}})}};G(c,e=>{z(n)&&!B7.current&&!U7.current&&e(l)}),U(e,s),k()}var _ot=/^\/collections(?:\/(?<_collectionName>[^/]+)(?:\/(?<routeType>new|entries|filter))?(?:\/(?<subPath>.+?))?)?$/,r9=(e,t)=>(zQ.current=!1,XQ.current=Y(t),{...e,notFoundKey:t}),i9=(e,t,n)=>(t.current=void 0,XQ.current=Y(n),e),vot=e=>iG.isSmallScreen?(sj.current=void 0,zQ.current=!1,XQ.current=Y(`viewing_collection_list`),{...e,isIndexPage:!0}):(o$(`/collections/${(sj.current||Kbe()||dj())?.name}`,{replaceState:!0}),e),yot=e=>{!e||e.hide?sj.current=void 0:sj.current?.name!==e.name&&(sj.current=e,CA.current=``)},bot=({state:e,collection:t,collectionName:n,collectionLabel:r,routeType:i,subPath:a})=>i===`filter`&&!Dbe({collection:t,entries:aX(rz(n),KY(n)),dirPath:a??``})?GY.current?r9(e,`page_not_found`):(zQ.current=!1,XQ.current=Y(`loading`),{...e,awaitingDrafts:!0}):(CA.current=i===`filter`?a??``:``,zQ.current=!1,XQ.current=Y(`viewing_x_collection`,{values:{collection:r,count:X7.current.length}}),e),xot=({state:e,entryDraft:t,collection:n,collectionName:r,collectionLabel:i,routeType:a,subPath:o,fileMap:s})=>{if(a!==`entries`||!o)return i9(e,t,`file_not_found`);let c=Object.hasOwn(s,o)?s[o]:void 0;return c?(m8({entryDraft:t,collection:n,collectionFile:c,originalEntry:JY({collectionName:r,subPath:o})??Tj(r,o)??{slug:c.name,locales:Object.fromEntries(c._i18n.initialLocales.map(e=>[e,{}]))}}),Wet(t),XQ.current=Y(`edit_${n._type}_announcement`,{values:{collection:i,file:Cj(c)}}),e):i9(e,t,`file_not_found`)},Sot=({state:e,entryDraft:t,collection:n,collectionName:r,collectionLabel:i,routeType:a,subPath:o,params:s})=>{if(a===`new`&&!o){let r=EA(n)?s.path:void 0;r!==void 0&&delete s.path;let{_slug:a}=s;return delete s._slug,m8({entryDraft:t,collection:n,dynamicValues:s,initialPath:r,initialSlug:a,isIndexFile:!!window.history.state?.index}),XQ.current=Y(`create_entry_announcement`,{values:{collection:i}}),e}if(a===`entries`&&o){let a=JY({collectionName:r,subPath:o})??rz(r).find(e=>e.subPath===o);return a?(Jc.current&&(m8({entryDraft:t,collection:n,originalEntry:a}),Wet(t),XQ.current=Y(`edit_entry_announcement`,{values:{collection:i,entry:jz(sj.current,a)}})),e):i9(e,t,`entry_not_found`)}return i9(e,t,`entry_not_found`)},Cot=({entryDraft:e})=>{let{path:t,params:n}=$Q(),r=t.match(_ot),i={isIndexPage:!1,isSearchPage:!1,notFoundKey:``,awaitingDrafts:!1,editorLocale:n._locale};if(delete n._locale,sj.current?.name===`_singletons`&&lj().length&&(sj.current=void 0),!r?.groups)return zQ.current=!1,{...i,isSearchPage:w5e(t)};let{_collectionName:a,routeType:o,subPath:s}=r.groups;if(!a)return vot(i);let c=fj(a);if(yot(c),!c||!sj.current)return r9(i,`collection_not_found`);let{name:l}=sj.current,u=pj(sj.current),d=`_fileMap`in sj.current?sj.current._fileMap:void 0;if(!o&&s)return r9(i,`page_not_found`);let f={state:i,entryDraft:e,collection:c,collectionName:l,collectionLabel:u,routeType:o,subPath:s};return!o||o===`filter`?bot(f):(zQ.current=!0,o===`entries`&&s&&!GY.current?(XQ.current=Y(`loading_entries`,{values:{count:1}}),{...i,awaitingDrafts:!0}):d?xot({...f,fileMap:d}):Sot({...f,params:n}))},wot=B(`<!> <!> <!>`,1);function Tot(e,t){O(t,!0);let n=new ZM,r=j(!1),i=j(!1),a=j(``),o=j(!1),s=j(void 0),c=A(()=>!!(X7.current.length||Z7.current.length)),l=A(()=>`files`in(sj.current??{})?Nat:Oat),u=()=>{(e=>{M(r,e.isIndexPage,!0),M(i,e.isSearchPage,!0),M(a,e.notFoundKey,!0),M(o,e.awaitingDrafts,!0),M(s,e.editorLocale,!0)})(Cot({entryDraft:n}))};js(()=>(u(),()=>{zQ.current=!1})),vk(()=>zQ.current,()=>{zQ.current||mQe(n.current)}),L(()=>{z(o)&&GY.current&&fo(()=>u())});var d=wot();yo(`hashchange`,ia,e=>{a$(e,u,_ot)});var f=P(d);{let e=e=>{var t=H(),n=P(t),a=e=>{Yat(e,{get isSearchPage(){return z(i)}})};G(n,e=>{(!iG.isSmallScreen||z(r))&&e(a)}),U(e,t)},t=e=>{var t=H(),n=P(t),o=e=>{J5(e,{})},s=e=>{{let t=e=>{{let t=A(()=>Y(z(a)));E5(e,{get message(){return z(t)}})}},n=A(()=>Y(`content_library`));A5(e,{id:`collection-container`,get"aria-label"(){return z(n)},mainContent:t,$$slots:{mainContent:!0}})}},u=e=>{{let t=e=>{fot(e,{})},n=e=>{var t=H(),n=P(t),r=e=>{got(e,{})};G(n,e=>{sj.current?._type===`entry`&&z(c)&&e(r)}),U(e,t)},r=e=>{var t=H();Ko(P(t),()=>z(l),(e,t)=>{t(e,{})}),U(e,t)},i=e=>{pot(e,{})},a=A(()=>Y(`x_collection`,{values:{collection:Jc.current&&sj.current?pj(sj.current):``}})),o=A(()=>sj.current?.description);A5(e,{id:`collection-container`,get"aria-label"(){return z(a)},get"aria-description"(){return z(o)},primaryToolbar:t,secondaryToolbar:n,mainContent:r,secondarySidebar:i,$$slots:{primaryToolbar:!0,secondaryToolbar:!0,mainContent:!0,secondarySidebar:!0}})}};G(n,e=>{z(i)?e(o):z(a)?e(s,1):iG.isSmallScreen&&z(r)||e(u,2)}),U(e,t)},n=A(()=>Y(`content_library`));W5(f,{uiSettingsKey:`contents-page`,get"aria-label"(){return z(n)},primarySidebar:e,main:t,$$slots:{primarySidebar:!0,main:!0}})}var p=I(f,2),m=e=>{Nit(e,{get entryDraft(){return n},get editorLocale(){return z(s)},get loading(){return z(o)}})};G(p,e=>{zQ.current&&e(m)}),P9e(I(p,2),{}),U(e,d),k()}function Eot(e,t){O(t,!0);{let t=A(()=>Y(`prefs.i18n.translators.default.select_service`));Hu(e,{get ariaLabel(){return z(t)},get value(){return IG.defaultTranslationService},onChange:e=>{IG.defaultTranslationService=e.detail.value},children:(e,t)=>{var n=H();Bo(P(n),17,()=>Object.entries(j6),([e,{serviceLabel:t}])=>e,(e,t)=>{var n=A(()=>Nr(z(t),2));let r=()=>z(n)[0],i=()=>z(n)[1].serviceLabel;{let t=A(()=>r()===IG.defaultTranslationService);Tu(e,{get label(){return i()},get value(){return r()},get selected(){return z(t)}})}}),U(e,n)},$$slots:{default:!0}})}k()}var Dot=B(`<!> <!> <!>`,1);function Oot(e,t){O(t,!0);let n=A(()=>M6.current),r=A(()=>z(n).serviceId),i=A(()=>z(n).apiLabel),a=A(()=>z(n).developerURL),o=A(()=>z(n).apiKeyURL),s=A(()=>z(n).apiKeyPattern),c=j(``);L(()=>{M(c,IG.apiKeys?.[z(r)]??``,!0)}),L(()=>{!zQ.current&&HQ.current.show&&(HQ.current.show=!1,HQ.current.resolve?.())});let l=()=>{let e=p$(z(r),z(c),z(s));e!==void 0&&(HQ.current.show=!1,HQ.current.resolve?.(e))};{let t=A(()=>Y(`translate_fields`,{values:{count:HQ.current.multiple?2:1}})),n=A(()=>({spellcheck:!1,monospace:!0,ariaLabel:Y(`api_key`)}));pu(e,{get title(){return z(t)},get textboxAttrs(){return z(n)},oninput:e=>{e.inputType===`insertFromPaste`&&l()},onOk:()=>l(),onCancel:()=>{HQ.current.resolve?.()},get open(){return HQ.current.show},set open(e){HQ.current.show=e},get value(){return z(c)},set value(e){M(c,e,!0)},children:(e,t)=>{var n=Dot(),r=P(n);Eot(r,{});var s=I(r,2);$l(s,{}),Wo(I(s,2),()=>d$(`prefs.i18n.translators.description`,{service:z(i),developerURL:z(a),apiKeyURL:z(o)})),U(e,n)},$$slots:{default:!0}})}k()}var kot=B(`<!> <!> <!> <!> <!>`,1);function Aot(e,t){O(t,!0);var n=kot(),r=P(n);Xu(r,{get show(){return K$.current.saved},set show(e){K$.current.saved=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(K$.current.published?`entry_saved_and_published`:`entry_saved`,{values:{count:K$.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var i=I(r,2);Xu(i,{get show(){return K$.current.deletionCancelled},set show(e){K$.current.deletionCancelled=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`workflow.deletion_cancelled`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var a=I(i,2);Xu(a,{get show(){return K$.current.discarded},set show(e){K$.current.discarded=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`workflow.changes_discarded`,{values:{count:K$.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}});var o=I(a,2);Xu(o,{get show(){return K$.current.deleted},set show(e){K$.current.deleted=e},children:(e,t)=>{el(e,{status:`success`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(K$.current.deletionPending?`workflow.deletion_pending`:`entries_deleted`,{values:{count:K$.current.count}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),Xu(I(o,2),{get show(){return K$.current.alreadyPublished},set show(e){K$.current.alreadyPublished=e},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`open_authoring.entry_already_published`)]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,n),k()}function jot(e,t){O(t,!0);let n=j(!!bj.current.length);Xu(e,{get show(){return z(n)},set show(e){M(n,e,!0)},children:(e,t)=>{el(e,{status:`error`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`entry_parse_errors`,{values:{count:bj.current.length}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}}),k()}var Mot=/^\/pages\/(?<id>[^/]+)$/,a9=pk(``),Not=hk(()=>a9.current?nk.get(a9.current):void 0),o9=hk(()=>[...nk.values()]),Pot=e=>e.match(Mot)?.groups?.id??``,Fot=({id:e})=>`/pages/${e}`,Iot=e=>{e.newTab?FV(e.url):o$(Fot(e))},Lot=B(`<!> <h2 role="none"> </h2> <!>`,1),Rot=B(`<div role="none" class="content svelte-gu8e5g"></div>`),zot=B(`<iframe class="svelte-gu8e5g"></iframe>`),Bot={hash:`svelte-gu8e5g`,code:`.content.svelte-gu8e5g {flex:auto;overflow:auto;}iframe.svelte-gu8e5g {flex:auto;border:0;width:100%;}`};function Vot(e,t){O(t,!0),K(e,Bot);let n=A(()=>Not.current),r=A(()=>z(n)&&!z(n).newTab?z(n):void 0),i=A(()=>z(r)?.label??Y(`page_not_found`)),a=A(()=>z(r)?.component),o=e=>t=>XWe(t,(0,gr.createElement)(e));L(()=>{z(r)||(XQ.current=Y(`page_not_found`))}),W5(e,{get"aria-label"(){return z(i)},main:e=>{A5(e,{get"aria-label"(){return z(i)},primaryToolbar:e=>{dO(e,{variant:`primary`,children:(e,t)=>{var n=Lot(),r=P(n),a=e=>{C5(e,{onclick:()=>s$(`/menu`)})};G(r,e=>{iG.isSmallScreen&&e(a)});var o=I(r,2),s=F(o,!0);$l(I(o,2),{flex:!0}),R(()=>W(s,z(i))),U(e,n)},$$slots:{default:!0}})},mainContent:e=>{var t=H(),n=P(t),i=e=>{{let t=A(()=>Y(`page_not_found`));E5(e,{get message(){return z(t)}})}},s=e=>{var t=Rot();es(t,()=>o(z(a))),U(e,t)},c=e=>{var t=zot();R(()=>{q(t,`src`,z(r).url),q(t,`title`,z(r).label)}),U(e,t)};G(n,e=>{z(r)?z(a)?e(s,1):e(c,-1):e(i)}),U(e,t)},$$slots:{primaryToolbar:!0,mainContent:!0}})},$$slots:{main:!0}}),k()}var Hot=[`file-cache`,`asset-thumbnails`,`asset-hashes`],Uot=RegExp(`^(?:${[...Object.keys(pY),`test-repo`].join(`|`)}):`),Wot=async()=>{try{await(await navigator.storage.getDirectory()).removeEntry(`sveltia-cms-test`,{recursive:!0})}catch{}},Got=async()=>{let e=OY.current,{databaseName:t}=e?.repository??{};t&&await Hot.reduce((e,n)=>e.then(()=>new DE(t,n).clear()),Promise.resolve()),e?.name===`test-repo`&&await Wot()},Kot=async()=>{let e=wY(OY.current),t=new Set(e?[e]:[]);try{(await globalThis.indexedDB.databases?.())?.forEach(({name:e})=>{e&&Uot.test(e)&&t.add(e)})}catch{}return[...t]},qot=async e=>new Promise(t=>{let n=()=>t(),r=globalThis.indexedDB.deleteDatabase(e);r.onsuccess=n,r.onerror=n,r.onblocked=n}),Jot=async()=>{try{let e=(await kE.keys()).filter(e=>e.startsWith(`sveltia-cms.`)||DW.includes(e));await Promise.all(e.map(e=>kE.delete(e)))}catch{}},Yot=async()=>{let e=await Kot();await Promise.all([...e.map(e=>qot(e)),Jot(),Wot()])},Xot=hk(()=>iG.isLargeScreen&&iG.hasMouse&&!iG.isLocalHost&&!!OY.current?.isGit&&!!OW.account?.token),s9=pk(!1),Zot=async e=>{let t=U5();if(t)return(await t.get(`onboarding`)??{})[e]},c9=async(e,t)=>{let n=U5();if(!n)return;let r=await n.get(`onboarding`)??{};await n.set(`onboarding`,{...r,[e]:t})},Qot={get:Zot,set:c9},l9=(e,t=Qot)=>{let n=pk(!1);return{show:n,showIfNeeded:async()=>{n.current=!await t.get(e)},hide:()=>{n.current=!1,t.set(e,!0)}}},u9=l9(`sveltia-cms.demo-welcome-seen`,{get:async e=>{try{return await kE.get(e)}catch{return}},set:async(e,t)=>{try{await kE.set(e,t)}catch{}}}),$ot=async()=>{CY(OY.current?.name)&&await u9.showIfNeeded()},est=B(`<p class="svelte-isqcpj"> </p> <p class="svelte-isqcpj"> </p>`,1),tst={hash:`svelte-isqcpj`,code:`p.svelte-isqcpj {margin:0;&:not(:first-child) {margin-top:1em;}}`};function nst(e,t){O(t,!0),K(e,tst),js(()=>{$ot()});{let t=A(()=>Y(`demo_welcome.title`)),n=A(()=>Y(`demo_welcome.button_label`));tu(e,{get title(){return z(t)},size:`small`,get okLabel(){return z(n)},showCancel:!1,onClose:()=>{u9.hide()},get open(){return u9.show.current},set open(e){u9.show.current=e},children:(e,t)=>{var n=est(),r=P(n),i=F(r,!0),a=F(I(r,2),!0);R((e,t)=>{W(i,e),W(a,t)},[()=>Y(`demo_welcome.description`),()=>Y(`demo_welcome.reset_hint`)]),U(e,n)},$$slots:{default:!0}})}k()}var rst=()=>!!document.querySelector(`script[src*="/@vite/client"]`),ist=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function ast(e,t){O(t,!0);let n=A(()=>DY.current===`local`&&rst());var r=ist(),i=P(r);Lo(i,()=>({"--sui-infobar-message-justify-content":`center`})),jl(i.lastChild,{get show(){return z(n)},status:`warning`,children:(e,t)=>{var n=H();Wo(P(n),()=>yA(Y(`live_reload_warning`),`https://sveltiacms.app/en/docs/workflows/local#troubleshooting`)),U(e,n)},$$slots:{default:!0}}),D(i),U(e,r),k()}var ost=B(` <!> <!>`,1),sst=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function cst(e,t){O(t,!0);let n=l9(`mobileCta`);L(()=>{n.showIfNeeded()});var r=sst(),i=P(r);Lo(i,()=>({"--sui-infobar-message-justify-content":`center`})),jl(i.lastChild,{get show(){return n.show.current},dismissible:!1,children:(e,t)=>{Qr();var r=ost(),i=P(r),a=I(i);{let e=A(()=>Y(`mobile_promo_button`));Al(a,{variant:`link`,get label(){return z(e)},onclick:()=>{s9.current=!0,n.hide()}})}var o=I(a,2);{let e=A(()=>Y(`later`));Al(o,{variant:`link`,get label(){return z(e)},onclick:()=>{n.hide()}})}R(e=>W(i,`${e??``} `),[()=>Y(`mobile_promo_title`)]),U(e,r)},$$slots:{default:!0}}),D(i),U(e,r),k()}var lst=B(` <!> <!>`,1),ust=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function dst(e,t){O(t,!0);let n=j(``),r=j(!1),i=!1,a=async()=>{if(await Zot(`newLanguageCta`))return;let e=Jc.current,t=navigator.language,[i]=t.split(`-`);t!==e&&i!==e&&(M(n,Ec.find(e=>e===t)??Ec.find(e=>e.split(`-`)[0]===i)??``,!0),z(n)&&z(n)!==e&&M(r,!0))},o=()=>{M(r,!1),c9(`newLanguageCta`,!0)};L(()=>{let{locale:e}=IG;fo(()=>{!i&&e&&(i=!0,e!==`auto`&&a())})});var s=ust(),c=P(s);Lo(c,()=>({"--sui-infobar-message-justify-content":`center`})),jl(c.lastChild,{get show(){return z(r)},dismissible:!1,children:(e,t)=>{Qr();var r=lst(),i=P(r),a=I(i);{let e=A(()=>Y(`change_language`,{locale:z(n)}));Al(a,{variant:`link`,get label(){return z(e)},onclick:()=>{IG.locale=z(n),o()}})}var s=I(a,2);{let e=A(()=>Y(`later`,{locale:z(n)}));Al(s,{variant:`link`,get label(){return z(e)},onclick:()=>{o()}})}R(e=>W(i,`${e??``} `),[()=>Y(`new_language_available`,{locale:z(n),values:{locale:KA(z(n),{displayLocale:z(n)})}})]),U(e,r)},$$slots:{default:!0}}),D(c),U(e,s),k()}var fst=({reason:e,detail:t=``})=>e===`operation_in_progress`?Y(`local_git_skip_reasons.operation_in_progress.${t}`):Y(`local_git_skip_reasons.${e}`,{values:{path:t,message:t}}),pst=({ready:e,reason:t,detail:n,branch:r,author:i})=>{if(!e)return Y(`prefs.developer.local_git.not_ready`,{values:{reason:fst({reason:t,detail:n})}});let{name:a,email:o}=i;return Y(`prefs.developer.local_git.ready`,{values:{branch:r.replace(/^refs\/heads\//,``),name:a,email:o}})};function mst(e,t){O(t,!0);let n=j(!1),r=VW.current;L(()=>{let e=VW.current;e&&e!==r&&(r=e,M(n,!0))});var i=H();Io(P(i),()=>VW.current,e=>{var t=H(),r=P(t),i=e=>{Xu(e,{get show(){return z(n)},set show(e){M(n,e,!0)},children:(e,t)=>{el(e,{status:`warning`,children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`local_git_not_committed`,{values:{reason:fst(VW.current)}})]),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(r,e=>{VW.current&&e(i)}),U(e,t)}),U(e,i),k()}function hst(e,t){O(t,!0),js(()=>{XQ.current=Y(`page_not_found`)});{let t=e=>{A5(e,{mainContent:e=>{{let t=A(()=>Y(`page_not_found`));E5(e,{get message(){return z(t)}})}},$$slots:{mainContent:!0}})},n=A(()=>Y(`page_not_found`));W5(e,{get"aria-label"(){return z(n)},main:t,$$slots:{main:!0}})}k()}var gst=({selectedPageName:e,searchMode:t,hasAssets:n,assetsLink:r,workflowEnabled:i,workflowLabelKey:a,customPages:o,selectedCustomPageId:s,isSmallScreen:c})=>{let l=[{key:`collections`,label:Y(`contents`),icon:`article`,link:`/collections`,selected:e===`collections`||t===`contents`}];return n&&l.push({key:`assets`,label:Y(`assets`),icon:`photo`,link:r,selected:e===`assets`||t===`assets`}),i&&l.push({key:`workflow`,label:Y(a),icon:`rebase_edit`,link:`/workflow`,selected:e===`workflow`}),o.forEach(e=>{l.push({key:`pages/${e.id}`,label:e.label,icon:e.icon,link:Fot(e),selected:s===e.id})}),c&&l.push({key:`menu`,label:Y(`menu`),icon:`menu`,link:`/menu`,selected:e===`menu`}),l},_st=B(`<div role="none" class="wrapper svelte-t2r4ty"><!> <!></div>`),vst={hash:`svelte-t2r4ty`,code:`.wrapper.svelte-t2r4ty {display:contents;.sui.select-button-group {gap:4px;
@media (width < 768px) {justify-content:space-evenly;width:100%;
}}.sui.button {border-radius:var(--sui-button-medium-border-radius) !important;}}`};function yst(e,t){O(t,!0),K(e,vst);let n=A(()=>iG.isSmallScreen?`/assets`:aQ.current?tQ(aQ.current):iH.current.length?IP(`/assets/${oH.current?.internalPath??`-/all`}`):tQ(eQ.current[0]??$Z)),r=A(()=>iG.isSmallScreen?[]:o9.current),i=A(()=>z(r).filter(({newTab:e})=>e)),a=A(()=>gst({selectedPageName:YQ.current,searchMode:j5.current,hasAssets:!!(iH.current.length||eQ.current.length||QZ.current.length),assetsLink:z(n),workflowEnabled:zY.current,workflowLabelKey:RY.current,customPages:z(r).filter(({newTab:e})=>!e),selectedCustomPageId:a9.current,isSmallScreen:iG.isSmallScreen}));var o=_st(),s=N(o);{let e=A(()=>Y(`switch_page`));Jl(s,{get ariaLabel(){return z(e)},"aria-controls":`page-container`,children:(e,t)=>{var n=H();Bo(P(n),19,()=>z(a),({key:e,label:t,icon:n,link:r,selected:i})=>e,(e,t,n)=>{let r=()=>z(t).label,i=()=>z(t).icon,a=()=>z(t).link,o=()=>z(t).selected;{let t=e=>{Xc(e,{get name(){return i()}})},s=A(()=>z(n)<9?`Alt+${z(n)+1}`:void 0);Yl(e,{variant:`ghost`,iconic:!0,get selected(){return o()},get"aria-label"(){return r()},get keyShortcuts(){return z(s)},onclick:()=>{o$(a())},startIcon:t,$$slots:{startIcon:!0}})}}),U(e,n)},$$slots:{default:!0}})}Bo(I(s,2),17,()=>z(i),e=>e.id,(e,t)=>{Al(e,{variant:`ghost`,iconic:!0,get"aria-label"(){return z(t).label},onclick:()=>{Iot(z(t))},startIcon:e=>{Xc(e,{get name(){return z(t).icon}})},$$slots:{startIcon:!0}})}),D(o),U(e,o),k()}var bst=B(`<div role="none" class="buttons"><!></div>`);function xst(e,t){O(t,!0),Nre(e,{get inert(){return JQ.current},children:(e,t)=>{{let t=A(()=>Y(`global`));dO(e,{variant:`primary`,get ariaLabel(){return z(t)},children:(e,t)=>{var n=bst();yst(N(n),{}),D(n),U(e,n)},$$slots:{default:!0}})}},$$slots:{default:!0}}),k()}var d9=pk(null),Sst=e=>{e.preventDefault(),d9.current=e},Cst=()=>{d9.current=null},wst=()=>(window.addEventListener(`beforeinstallprompt`,Sst),window.addEventListener(`appinstalled`,Cst),()=>{window.removeEventListener(`beforeinstallprompt`,Sst),window.removeEventListener(`appinstalled`,Cst)}),Tst=async()=>{let e=d9.current;e&&(d9.current=null,await e.prompt())};function Est(e,t){O(t,!0);var n=H(),r=P(n),i=e=>{{let t=A(()=>Y(`install_as_app`));Du(e,{get label(){return z(t)},onclick:async()=>{await Tst()}})}};G(r,e=>{d9.current&&e(i)}),U(e,n),k()}var Dst=B(`<kbd class="svelte-13q15u"> </kbd>`),Ost=B(`<!> <!>`,1),kst=B(`<div role="none" class="wrapper svelte-13q15u"><!></div>`),Ast={hash:`svelte-13q15u`,code:`.wrapper.svelte-13q15u {display:contents;.table-row {display:flex;align-items:center;gap:16px;padding:8px 0;border-top:1px solid var(--sui-secondary-border-color);&:last-child {border-bottom:1px solid var(--sui-secondary-border-color);}.feature {flex:auto;}.keys {display:flex;gap:8px;}}}kbd.svelte-13q15u {display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;border-color:var(--sui-primary-accent-color);border-radius:4px;padding:0 8px;height:32px;min-width:32px;background-color:var(--sui-tertiary-background-color);font-family:var(--sui-control-font-family);font-size:var(--sui-control-font-size);line-height:var(--sui-control-line-height);}`};function jst(e,t){O(t,!0),K(e,Ast);let n=J(t,`open`,15,!1),r=J(t,`onClose`,3,void 0),i=[{feature:`view_content_library`,keys:`Alt+1`},{feature:`view_asset_library`,keys:`Alt+2`},{feature:`search`,keys:`Accel+F`},{feature:`create_entry`,keys:`Accel+E`},{feature:`save_entry`,keys:`Accel+S`},{feature:`cancel_editing`,keys:`Escape`}];{let t=A(()=>Y(`keyboard_shortcuts`));tu(e,{get title(){return z(t)},size:`small`,showOk:!1,showCancel:!1,showClose:!0,style:`--sui-dialog-small-content-max-height:auto`,onClose:()=>{r()?.()},get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=kst(),r=N(n);{let e=A(()=>Y(`keyboard_shortcuts`));ise(r,{get ariaLabel(){return z(e)},children:(e,t)=>{var n=H();Bo(P(n),17,()=>i,({feature:e,keys:t})=>t,(e,t)=>{let n=()=>z(t).feature,r=()=>z(t).keys;ese(e,{children:(e,t)=>{var i=Ost(),a=P(i);Qoe(a,{class:`feature`,children:(e,t)=>{Qr();var r=V();R(e=>W(r,e),[()=>Y(`keyboard_shortcuts_.${n()}`)]),U(e,r)},$$slots:{default:!0}}),Qoe(I(a,2),{class:`keys`,children:(e,t)=>{var n=H();Bo(P(n),16,()=>r().split(`+`),e=>e,(e,t)=>{var n=Dst(),r=F(n,!0);R(e=>W(r,e),[()=>t.replace(`Accel`,iG.isMacOS?`⌘`:`Ctrl`)]),U(e,n)}),U(e,n)},$$slots:{default:!0}}),U(e,i)},$$slots:{default:!0}})}),U(e,n)},$$slots:{default:!0}})}D(n),U(e,n)},$$slots:{default:!0}})}k()}var Mst=B(`<!> <!>`,1);function Nst(e,t){O(t,!0);let n=j(!1);var r=Mst(),i=P(r),a=e=>{{let t=A(()=>Y(`keyboard_shortcuts`));Du(e,{get label(){return z(t)},onclick:()=>{M(n,!0)}})}};G(i,e=>{iG.hasMouse&&e(a)}),jst(I(i,2),{onClose:()=>{t.menuButton?.focus()},get open(){return z(n)},set open(e){M(n,e,!0)}}),U(e,r),k()}function f9(e,t){let n=J(t,`defaultValue`,3,!0),r=IG;var i=()=>!!(r[t.key]??n()),a=e=>{r[t.key]=e};Uu(e,{get checked(){return i()},set checked(e){a(e)},get label(){return t.label}})}var Pst=B(`<section><h3> </h3> <p> </p> <div role="none"><!></div></section>`);function Fst(e,t){O(t,!0);var n=Pst(),r=N(n),i=F(r,!0),a=I(r,2),o=F(a,!0),s=I(a,2),c=N(s);{let e=A(()=>Y(`prefs.accessibility.underline_links.switch_label`));f9(c,{key:`underlineLinks`,get label(){return z(e)}})}D(s),D(n),R((e,t)=>{W(i,e),W(o,t)},[()=>Y(`prefs.accessibility.underline_links.title`),()=>Y(`prefs.accessibility.underline_links.description`)]),U(e,n),k()}var Ist=B(`<section><h3> </h3> <div role="none"><!></div></section>`);function Lst(e,t){O(t,!0);var n=Ist(),r=N(n),i=F(r,!0),a=I(r,2),o=N(a);{let e=A(()=>Y(`prefs.appearance.select_theme`));Jl(o,{get ariaLabel(){return z(e)},onChange:e=>{IG.theme=e.detail.value},children:(e,t)=>{var n=H();Bo(P(n),16,()=>[`auto`,`dark`,`light`],e=>e,(e,t)=>{{let n=A(()=>Y(t===`auto`?`automatic`:`prefs.theme.${t}`)),r=A(()=>!IG.theme&&t===`auto`||IG.theme===t);Yl(e,{variant:`tertiary`,get label(){return z(n)},get value(){return t},get selected(){return z(r)}})}}),U(e,n)},$$slots:{default:!0}})}D(a),D(n),R(e=>W(i,e),[()=>Y(`prefs.appearance.theme`)]),U(e,n),k()}var Rst=B(`<section><h3> </h3> <div role="none"><!></div> <div role="none"><!></div> <div role="none"><!></div></section>`);function zst(e,t){O(t,!0);var n=Rst(),r=N(n),i=F(r,!0),a=I(r,2),o=N(a);{let e=A(()=>Y(`prefs.contents.editor.use_draft_backup.switch_label`));f9(o,{key:`useDraftBackup`,get label(){return z(e)}})}D(a);var s=I(a,2),c=N(s);{let e=A(()=>Y(`prefs.contents.editor.close_on_save.switch_label`));f9(c,{key:`closeOnSave`,get label(){return z(e)}})}D(s);var l=I(s,2),u=N(l);{let e=A(()=>Y(`prefs.contents.editor.close_with_escape.switch_label`));f9(u,{key:`closeWithEscape`,get label(){return z(e)}})}D(l),D(n),R(e=>W(i,e),[()=>Y(`prefs.contents.editor.title`)]),U(e,n),k()}var Bst=B(`<section><h3> </h3> <p> </p> <div role="none"><!></div> <p> </p> <div role="none"><!></div></section> <!> <!>`,1);function Vst(e,t){O(t,!0);let n=j(!1),r=j(!1),i=async()=>{await Got(),window.location.reload()},a=async()=>{await Yot(),window.location.reload()};var o=Bst(),s=P(o),c=N(s),l=F(c,!0),u=I(c,2),d=F(u,!0),f=I(u,2),p=N(f);{let e=A(()=>Y(`prefs.data.clear_data.file_cache.button_label`));Al(p,{variant:`tertiary`,get label(){return z(e)},onclick:()=>{M(n,!0)}})}D(f);var m=I(f,2),h=F(m,!0),g=I(m,2),_=N(g);{let e=A(()=>Y(`prefs.data.clear_data.all_data.button_label`));Al(_,{variant:`tertiary`,get label(){return z(e)},onclick:()=>{M(r,!0)}})}D(g),D(s);var v=I(s,2);{let e=A(()=>Y(`prefs.data.clear_data.file_cache.button_label`)),t=A(()=>Y(`prefs.data.clear_data.file_cache.button_label`));ru(v,{get title(){return z(e)},get okLabel(){return z(t)},onOk:i,get open(){return z(n)},set open(e){M(n,e,!0)},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`prefs.data.clear_data.file_cache.confirmation`)]),U(e,n)},$$slots:{default:!0}})}var y=I(v,2);{let e=A(()=>Y(`prefs.data.clear_data.all_data.button_label`)),t=A(()=>Y(`prefs.data.clear_data.all_data.button_label`));ru(y,{get title(){return z(e)},get okLabel(){return z(t)},onOk:a,get open(){return z(r)},set open(e){M(r,e,!0)},children:(e,t)=>{Qr();var n=V();R(e=>W(n,e),[()=>Y(`prefs.data.clear_data.all_data.confirmation`)]),U(e,n)},$$slots:{default:!0}})}R((e,t,n)=>{W(l,e),W(d,t),W(h,n)},[()=>Y(`prefs.data.clear_data.title`),()=>Y(`prefs.data.clear_data.file_cache.description`),()=>Y(`prefs.data.clear_data.all_data.description`)]),U(e,o),k()}var Hst=B(`<div role="none"><!></div>`),Ust=B(`<p> </p>`),Wst=B(`<section><h3> </h3> <p> </p> <div role="none"><!></div> <!></section>`),Gst=B(`<section><h3> </h3> <p> </p> <!> <!></section>`),Kst=B(`<section><h3> </h3> <p> </p> <div role="none"><!></div></section> <!> <!>`,1);function qst(e,t){O(t,!0);let n=(e,t=kr,n=kr,i=kr,a=kr)=>{var o=Hst();fu(N(o),{dir:`ltr`,flex:!0,get ariaLabel(){return n()},showInlineLabel:!0,onchange:()=>{r()?.({message:IG[t()]?i():a()})},get value(){return IG[t()]},set value(e){IG[t()]=e}}),D(o),U(e,o)},r=J(t,`onChange`,3,void 0),i=async()=>await KIe();var a=Kst(),o=P(a),s=N(o),c=F(s,!0),l=I(s,2),u=F(l,!0),d=I(l,2),f=N(d);{let e=A(()=>Y(`prefs.developer.developer_mode.switch_label`));f9(f,{key:`devModeEnabled`,get label(){return z(e)},defaultValue:!1})}D(d),D(o);var p=I(o,2),m=e=>{var t=Wst(),n=N(t),r=F(n,!0),a=I(n,2),o=F(a,!0),s=I(a,2),c=N(s);{let e=A(()=>Y(`prefs.developer.local_git.switch_label`));f9(c,{key:`localGitCommits`,get label(){return z(e)},defaultValue:!1})}D(s);var l=I(s,2),u=e=>{var t=Hst();Fo(N(t),i,e=>{var t=Ust(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`prefs.developer.local_git.checking`)]),U(e,t)},(e,t)=>{{let n=A(()=>z(t).ready?`success`:`warning`);el(e,{get status(){return z(n)},children:(e,n)=>{Qr();var r=V();R(e=>W(r,e),[()=>pst(z(t))]),U(e,r)},$$slots:{default:!0}})}}),D(t),U(e,t)};G(l,e=>{IG.localGitCommits&&e(u)}),D(t),R((e,t)=>{W(r,e),W(o,t)},[()=>Y(`prefs.developer.local_git.title`),()=>Y(`prefs.developer.local_git.description`)]),U(e,t)};G(p,e=>{DY.current===`local`&&e(m)});var h=I(p,2),g=e=>{var t=Gst(),r=N(t),i=F(r,!0),a=I(r,2),o=F(a,!0),s=I(a,2);{let e=A(()=>Y(`prefs.developer.deploy_hook.url.field_label`)),t=A(()=>Y(`prefs.developer.deploy_hook.url.saved`)),r=A(()=>Y(`prefs.developer.deploy_hook.url.removed`));n(s,()=>`deployHookURL`,()=>z(e),()=>z(t),()=>z(r))}var c=I(s,2);{let e=A(()=>Y(`prefs.developer.deploy_hook.auth.field_label`)),t=A(()=>Y(`prefs.developer.deploy_hook.auth.saved`)),r=A(()=>Y(`prefs.developer.deploy_hook.auth.removed`));n(c,()=>`deployHookAuthHeader`,()=>z(e),()=>z(t),()=>z(r))}D(t),R((e,t)=>{W(i,e),W(o,t)},[()=>Y(`prefs.developer.deploy_hook.title`),()=>Y(`prefs.developer.deploy_hook.description`)]),U(e,t)};G(h,e=>{X8.current&&e(g)}),R((e,t)=>{W(c,e),W(u,t)},[()=>Y(`prefs.developer.developer_mode.title`),()=>Y(`prefs.developer.developer_mode.description`)]),U(e,a),k()}function p9(e,t){O(t,!0);let n=J(t,`onChange`,3,void 0),r=A(()=>t.service.apiKeyPattern),i=j(``);js(()=>{M(i,IG.apiKeys?.[t.serviceId]??``,!0)}),LO(e,{flex:!0,autocomplete:`off`,spellcheck:`false`,get ariaLabel(){return t.ariaLabel},onchange:()=>{let e=z(i).trim(),a=!!e&&!!z(r)&&!z(r).test(e);f$(t.serviceId,a?``:e),n()?.({message:Y(a?`prefs.changes.api_key_invalid`:e?`prefs.changes.api_key_saved`:`prefs.changes.api_key_removed`),status:a?`error`:`success`})},get value(){return z(i)},set value(e){M(i,e,!0)}}),k()}var Jst=B(`<section><h4> </h4> <div role="none"><!></div></section>`),Yst=B(`<section><h3> </h3> <div role="none"><!></div></section> <section><h3> </h3> <p></p> <!></section>`,1);function Xst(e,t){O(t,!0);let n=J(t,`onChange`,3,void 0);var r=Yst(),i=P(r),a=N(i),o=F(a,!0),s=I(a,2);Eot(N(s),{}),D(s),D(i);var c=I(i,2),l=N(c),u=F(l,!0),d=I(l,2);Wo(d,()=>yA(Y(`prefs.i18n.translators.api_keys.description`),`https://sveltiacms.app/en/docs/integrations/translations`),!0),D(d),Bo(I(d,2),17,()=>Object.entries(j6),([e,t])=>e,(e,t)=>{var r=A(()=>Nr(z(t),2));let i=()=>z(r)[0],a=()=>z(r)[1],o=A(()=>a().serviceLabel);var s=Jst(),c=N(s),l=F(c,!0),u=I(c,2),d=N(u);{let e=A(()=>Y(`prefs.i18n.translators.field_label`,{values:{service:z(o)}}));p9(d,{get serviceId(){return i()},get service(){return a()},get ariaLabel(){return z(e)},get onChange(){return n()}})}D(u),D(s),R(()=>W(l,z(o))),U(e,s)}),D(c),R((e,t)=>{W(o,e),W(u,t)},[()=>Y(`prefs.i18n.translators.default.title`),()=>Y(`prefs.i18n.translators.api_keys.title`)]),U(e,r),k()}var Zst=B(`<!> <!> <!>`,1),Qst=B(`<section><h3> </h3> <div role="none"><!></div></section> <!>`,1);function $st(e,t){O(t,!0);let n=A(()=>Ec.map(e=>{let t=KA(e,{displayLocale:Jc.current})??e,n=KA(e,{displayLocale:e})??e,r=t===n?t:`${t} — ${n}`;return{value:e,searchValue:`${r} (${e})`,label:r}}).sort((e,t)=>e.label.localeCompare(t.label))),r=A(()=>IG.locale??`auto`),i=j(``),a=A(()=>KA(z(i))??z(i));L(()=>{v5.current&&M(i,v5.current,!0)});var o=Qst(),s=P(o),c=N(s),l=F(c,!0),u=I(c,2);Io(N(u),()=>Jc.current,e=>{{let t=A(()=>Y(`prefs.language.ui_language.select_language`));Hu(e,{get ariaLabel(){return z(t)},get value(){return z(r)},onChange:e=>{IG.locale=e.detail.value,c9(`newLanguageCta`,!0)},children:(e,t)=>{var i=Zst(),a=P(i);{let e=A(()=>Y(`automatic`)),t=A(()=>z(r)===`auto`);Tu(a,{get value(){return`auto`},get label(){return z(e)},get selected(){return z(t)}})}var o=I(a,2);mu(o,{}),Bo(I(o,2),17,()=>z(n),({value:e,searchValue:t,label:n})=>e,(e,t)=>{let n=()=>z(t).value,i=()=>z(t).searchValue,a=()=>z(t).label;{let t=A(()=>n()===z(r));Tu(e,{get value(){return n()},get searchValue(){return i()},get label(){return a()},get selected(){return z(t)}})}}),U(e,i)},$$slots:{default:!0}})}}),D(u),D(s);var d=I(s,2);{let e=A(()=>!!v5.current);Xu(d,{get show(){return z(e)},duration:0,children:(e,t)=>{el(e,{status:`info`,children:(e,t)=>{var n=H(),r=P(n),i=e=>{var t=V();R(e=>W(t,e),[()=>Y(`switching_language`,{values:{locale:z(a)}})]),U(e,t)};G(r,e=>{z(a)&&e(i)}),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})}R(e=>W(l,e),[()=>Y(`prefs.language.ui_language.title`)]),U(e,o),k()}var ect=B(`<section><h4> </h4> <div role="none"><!></div></section>`),tct=B(`<section><h3> </h3> <p></p> <!></section> <section><h3> </h3> <p></p> <!></section>`,1);function nct(e,t){O(t,!0);let n=J(t,`onChange`,3,void 0),r=A(()=>{let{providers:e=[]}=B$();return Object.entries(z$).filter(([t,{authType:n}])=>e.includes(t)&&n!==`none`)}),i=A(()=>Object.entries(fZ).filter(([,{isEnabled:e,authType:t}])=>(e?.()??!0)&&t!==`widget`));var a=tct(),o=P(a),s=N(o),c=F(s,!0),l=I(s,2);Wo(l,()=>yA(z(i).length?Y(`prefs.media.cloud_storage.api_keys.description`):Y(`prefs.media.cloud_storage.no_services`),`https://sveltiacms.app/en/docs/media`),!0),D(l),Bo(I(l,2),17,()=>z(i),([e,t])=>e,(e,t)=>{var r=A(()=>Nr(z(t),2));let i=()=>z(r)[0],a=()=>z(r)[1],o=A(()=>a().serviceLabel);var s=ect(),c=N(s),l=F(c,!0),u=I(c,2),d=N(u);{let e=A(()=>Y(`prefs.media.cloud_storage.field_label`,{values:{service:z(o)}}));p9(d,{get serviceId(){return i()},get service(){return a()},get ariaLabel(){return z(e)},get onChange(){return n()}})}D(u),D(s),R(()=>W(l,z(o))),U(e,s)}),D(o);var u=I(o,2),d=N(u),f=F(d,!0),p=I(d,2);Wo(p,()=>yA(z(r).length?Y(`prefs.media.stock_photos.api_keys.description`):Y(`prefs.media.stock_photos.no_services`),`https://sveltiacms.app/en/docs/integrations/stock-photos`),!0),D(p),Bo(I(p,2),17,()=>z(r),([e,t])=>e,(e,t)=>{var r=A(()=>Nr(z(t),2));let i=()=>z(r)[0],a=()=>z(r)[1],o=A(()=>a().serviceLabel);var s=ect(),c=N(s),l=F(c,!0),u=I(c,2),d=N(u);{let e=A(()=>Y(`prefs.media.stock_photos.field_label`,{values:{service:z(o)}}));p9(d,{get serviceId(){return i()},get service(){return a()},get ariaLabel(){return z(e)},get onChange(){return n()}})}D(u),D(s),R(()=>W(l,z(o))),U(e,s)}),D(u),R((e,t)=>{W(c,e),W(f,t)},[()=>Y(`prefs.media.cloud_storage.api_keys.title`),()=>Y(`prefs.media.stock_photos.api_keys.title`)]),U(e,a),k()}var m9=hk(()=>[{key:`appearance`,icon:`palette`,component:Lst},{key:`language`,icon:`language`,component:$st},{key:`contents`,icon:`library_books`,component:zst},{key:`i18n`,icon:`translate`,component:Xst,enabled:(Sk.current?.i18n?.locales?.length??0)>1},{key:`media`,icon:`photo_library`,component:nct},{key:`accessibility`,icon:`accessibility_new`,component:Fst},{key:`developer`,icon:`code_xml`,component:qst},{key:`data`,icon:`database`,component:Vst}]),rct=B(`<div class="container svelte-1attlke" role="none"><!></div> <!>`,1),ict={hash:`svelte-1attlke`,code:`.container.svelte-1attlke {display:contents;section:not(:first-child) {margin:16px 0 0;}p {margin-top:0;}h3 {font-size:inherit;& ~ div {margin:8px 0 0;}& ~ p {margin:8px 0 0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}}h4 {margin-bottom:4px;font-size:var(--sui-font-size-small);}}`};function act(e,t){K(e,ict);let n=j(``),r=j(`success`),i=j(!1);var a=rct(),o=P(a);Ko(N(o),()=>t.Panel,(e,t)=>{t(e,{onChange:({message:e,status:t})=>{M(n,e,!0),M(r,t??`success`,!0),M(i,!0)}})}),D(o),Xu(I(o,2),{get show(){return z(i)},set show(e){M(i,e,!0)},children:(e,t)=>{el(e,{get status(){return z(r)},children:(e,t)=>{Qr();var r=V();R(()=>W(r,z(n))),U(e,r)},$$slots:{default:!0}})},$$slots:{default:!0}}),U(e,a)}var oct=B(`<div role="none" class="wrapper svelte-pwxwga"><!> <!></div>`),sct={hash:`svelte-pwxwga`,code:`.wrapper.svelte-pwxwga {display:flex;.sui.tab-list {flex:none;}.sui.tab-panel {flex:auto;border-width:0;}}`};function cct(e,t){O(t,!0),K(e,sct);let n=J(t,`open`,15,!1),r=J(t,`onClose`,3,void 0),i=j(`appearance`);{let t=A(()=>Y(`settings`));tu(e,{get title(){return z(t)},size:`large`,showOk:!1,showCancel:!1,showClose:!0,onClose:()=>{r()?.()},get open(){return n()},set open(e){n(e)},children:(e,t)=>{var n=oct(),r=N(n);{let e=A(()=>Y(`categories`));lse(r,{orientation:`vertical`,get ariaLabel(){return z(e)},children:(e,t)=>{var n=H();Bo(P(n),17,()=>m9.current,({key:e,icon:t,enabled:n=!0})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).icon,a=Ei(()=>Mr(z(t).enabled,!0));var o=H(),s=P(o),c=e=>{{let t=e=>{Xc(e,{get name(){return r()}})},a=A(()=>Y(`prefs.${n()}.title`)),o=A(()=>n()===z(i));hse(e,{get label(){return z(a)},get selected(){return z(o)},get"aria-controls"(){return`prefs-tab-${n()??``}`},onSelect:()=>{M(i,n(),!0)},startIcon:t,$$slots:{startIcon:!0}})}};G(s,e=>{z(a)&&e(c)}),U(e,o)}),U(e,n)},$$slots:{default:!0}})}Bo(I(r,2),17,()=>m9.current,({key:e,component:t})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).component;pse(e,{get id(){return`prefs-tab-${n()??``}`},children:(e,t)=>{act(e,{get Panel(){return r()}})},$$slots:{default:!0}})}),D(n),U(e,n)},$$slots:{default:!0}})}k()}var lct=B(`<!> <!>`,1),uct=B(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1);function dct(e,t){O(t,!0);let n=j(!1),r=A(()=>DY.current===`local`),i=A(()=>DY.current===`test-repo`),a=A(()=>CY(DY.current));var o=lct(),s=P(o);{let e=A(()=>Y(`account`));Eu(s,{get ariaLabel(){return z(e)},children:(e,o)=>{var s=uct(),c=P(s);{let e=A(()=>z(r)?Y(`working_with_local_repo`):z(a)?Y(`working_in_demo_mode`):z(i)?Y(`working_with_test_repo`):Y(`signed_in_as_x`,{values:{name:OW.account?.login}})),t=A(()=>z(r)||z(i));Du(c,{get label(){return z(e)},get disabled(){return z(t)},onclick:()=>{FV(OW.account?.profileURL)}})}var l=I(c,2);mu(l,{});var u=I(l,2);{let e=A(()=>Y(`live_site`));Du(u,{get label(){return z(e)},onclick:()=>{c$()}})}var d=I(u,2),f=e=>{var t=lct(),n=P(t);{let e=A(()=>Y(`git_repository`)),t=A(()=>!OY.current?.repository?.treeBaseURL);Du(n,{get label(){return z(e)},get disabled(){return z(t)},onclick:()=>{FV(OY.current?.repository?.treeBaseURL)}})}var r=I(n,2);{let e=A(()=>Y(`cms_config`));Du(r,{get label(){return z(e)},onclick:()=>{o$(`/config`,{transitionType:`forwards`})}})}U(e,t)};G(d,e=>{IG.devModeEnabled&&e(f)});var p=I(d,2);mu(p,{});var m=I(p,2);{let e=A(()=>Y(`settings`));Du(m,{get label(){return z(e)},onclick:()=>{iG.isSmallScreen?o$(`/settings`,{transitionType:`forwards`}):M(n,!0)}})}var h=I(m,2),g=e=>{Nst(e,{get menuButton(){return t.menuButton}})};G(h,e=>{IG.devModeEnabled||e(g)});var _=I(h,2),v=e=>{{let t=A(()=>Y(`sign_in_with_mobile`));Du(e,{get label(){return z(t)},onclick:()=>{s9.current=!0}})}};G(_,e=>{Xot.current&&e(v)});var y=I(_,2);Est(y,{});var b=I(y,2);mu(b,{});var x=I(b,2);{let e=A(()=>Y(`sign_out`));Du(x,{get label(){return z(e)},onclick:async()=>{window.requestAnimationFrame(()=>{z4e()})}})}U(e,s)},$$slots:{default:!0}})}cct(I(s,2),{onClose:()=>{t.menuButton?.focus()},get open(){return z(n)},set open(e){M(n,e,!0)}}),U(e,o),k()}var fct=B(`<img class="avatar svelte-q0ng4j" loading="lazy" alt=""/>`),pct=B(`<div role="none" class="wrapper svelte-q0ng4j"><!></div>`),mct={hash:`svelte-q0ng4j`,code:`.wrapper.svelte-q0ng4j {display:contents;button.avatar {border-width:0;background-color:transparent;}}.avatar.svelte-q0ng4j {width:32px;height:32px;border-radius:32px;object-fit:cover;}`};function hct(e,t){O(t,!0),K(e,mct);let n=j(void 0),r=A(()=>DY.current===`local`),i=A(()=>!!OW.account?.avatarURL);var a=pct(),o=N(a);{let e=e=>{var t=H(),n=P(t),a=e=>{Xc(e,{name:`arrow_drop_down`,class:`small-arrow`})},o=e=>{var t=fct();R(()=>q(t,`src`,OW.account?.avatarURL)),U(e,t)},s=e=>{Xc(e,{name:`account_circle`})};G(n,e=>{z(r)?e(a):z(i)?e(o,1):e(s,-1)}),U(e,t)},t=e=>{dct(e,{get menuButton(){return z(n)}})},a=A(()=>!z(r)),s=A(()=>z(r)?Y(`local_workflow.indicator`):void 0),c=A(()=>z(i)?`avatar`:``),l=A(()=>Y(`show_account_menu`));Ds(Xl(o,{variant:`ghost`,get iconic(){return z(a)},get label(){return z(s)},get class(){return z(c)},popupPosition:`bottom-right`,get"aria-label"(){return z(l)},endIcon:e,popup:t,$$slots:{endIcon:!0,popup:!0}}),e=>M(n,e,!0),()=>z(n))}D(a),U(e,a),k()}var gct=B(`<!> <!>`,1);function _ct(e,t){O(t,!0);let n=A(()=>lj({visible:!0,type:`entry`})),r=A(()=>z(n).map(e=>{let{name:t,label:n,label_singular:r,create:i=!0,limit:a=1/0}=e;return{name:t,label:r||n||t,disabled:!i||R1({collection:e})||a<1/0&&C8(t)>=a}})),i=A(()=>dH.current||R1()),a=A(()=>z(i)&&z(r).every(({disabled:e})=>e));{let t=e=>{Xc(e,{name:`add`})},n=e=>{{let t=A(()=>Y(`create_entry_or_assets`));Eu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=gct(),a=P(n),o=e=>{var t=gct(),n=P(t);Bo(n,17,()=>z(r),({name:e,label:t,disabled:n})=>e,(e,t)=>{let n=()=>z(t).name,r=()=>z(t).label,i=()=>z(t).disabled;Du(e,{get label(){return r()},get disabled(){return i()},onclick:()=>{o$(`/collections/${n()}/new`,{transitionType:`forwards`})}})}),mu(I(n,2),{}),U(e,t)};G(a,e=>{z(r).length&&e(o)});var s=I(a,2);{let e=A(()=>Y(`assets`));Du(s,{get label(){return z(e)},get disabled(){return z(i)},onclick:async()=>{o$(`/assets`,{transitionType:`forwards`}),await pl(100),kQ.current=!0}})}U(e,n)},$$slots:{default:!0}})}},o=A(()=>Y(`create_entry_or_assets`));Xl(e,{variant:`ghost`,iconic:!0,get disabled(){return z(a)},popupPosition:`bottom-right`,get"aria-label"(){return z(o)},endIcon:t,popup:n,$$slots:{endIcon:!0,popup:!0}})}k()}var vct=B(`<span class="version svelte-wmw2gz"> </span>`),yct={hash:`svelte-wmw2gz`,code:`.version.svelte-wmw2gz {border-radius:4px;padding:0 6px;color:var(--sui-secondary-foreground-color);background-color:var(--sui-selected-background-color);font-size:var(--sui-font-size-small);}`};function bct(e,t){O(t,!0),K(e,yct);{let t=e=>{var t=H(),n=P(t),r=e=>{var t=vct(),n=F(t);R(e=>{q(t,`aria-label`,`(${e??``})`),W(n,`v${lk??``}`)},[()=>Y(`version_x`,{values:{version:lk}})]),U(e,t)};G(n,e=>{IG.devModeEnabled&&e(r)}),U(e,t)},n=A(()=>Y(`release_notes`));Du(e,{get label(){return z(n)},onclick:()=>{FV(`https://github.com/sveltia/sveltia-cms/releases`)},endIcon:t,$$slots:{endIcon:!0}})}k()}var h9=(e,t=kr,n=kr)=>{{let r=A(()=>Y(t()));Du(e,{get label(){return z(r)},onclick:()=>{FV(n())}})}},xct=B(`<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),Sct=B(`<!> <!>`,1);function Cct(e,t){O(t,!0);{let n=A(()=>Y(`help`));Eu(e,{get ariaLabel(){return z(n)},children:(e,n)=>{var r=Sct(),i=P(r);Nst(i,{get menuButton(){return t.menuButton}});var a=I(i,2),o=e=>{var t=xct(),n=P(t);h9(n,()=>`documentation`,()=>`https://sveltiacms.app/en/docs`);var r=I(n,2);bct(r,{});var i=I(r,2);h9(i,()=>`announcements`,()=>`https://github.com/sveltia/sveltia-cms/discussions/categories/announcements`);var a=I(i,2);mu(a,{});var o=I(a,2);h9(o,()=>`report_issue`,()=>`https://github.com/sveltia/sveltia-cms/issues`);var s=I(o,2);h9(s,()=>`share_feedback`,()=>`https://github.com/sveltia/sveltia-cms/discussions/categories/ideas`);var c=I(s,2);h9(c,()=>`get_help`,()=>`https://github.com/sveltia/sveltia-cms/discussions/categories/q-a`);var l=I(c,2);h9(l,()=>`donate`,()=>`https://github.com/sponsors/kyoshino`);var u=I(l,2);mu(u,{});var d=I(u,2);h9(d,()=>`bluesky`,()=>`https://bsky.app/profile/sveltiacms.app`),h9(I(d,2),()=>`join_discord`,()=>`https://discord.com/invite/5hwCGqup5b`),U(e,t)};G(a,e=>{IG.devModeEnabled&&e(o)}),U(e,r)},$$slots:{default:!0}})}k()}var wct=B(`<div role="none" class="wrapper svelte-bzzge3"><!></div>`),Tct={hash:`svelte-bzzge3`,code:`.wrapper.svelte-bzzge3 {display:contents;}`};function Ect(e,t){O(t,!0),K(e,Tct);let n=j(void 0);var r=wct(),i=N(r);{let e=e=>{Xc(e,{name:`help`})},t=e=>{Cct(e,{get menuButton(){return z(n)}})},r=A(()=>Y(`show_help_menu`));Ds(Xl(i,{variant:`ghost`,iconic:!0,popupPosition:`bottom-right`,get"aria-label"(){return z(r)},endIcon:e,popup:t,$$slots:{endIcon:!0,popup:!0}}),e=>M(n,e,!0),()=>z(n))}D(r),U(e,r),k()}function Dct(e,t){O(t,!0);{let t=e=>{Xc(e,{name:`notifications`})},n=A(()=>Y(`show_notifications`));Al(e,{variant:`ghost`,iconic:!0,hidden:!0,get"aria-label"(){return z(n)},onclick:()=>{},startIcon:t,$$slots:{startIcon:!0}})}k()}var Oct=B(`<img alt="" class="logo svelte-15c9hhi"/>`),kct={hash:`svelte-15c9hhi`,code:`img.svelte-15c9hhi {width:24px;height:24px;object-fit:contain;}`};function Act(e,t){O(t,!0),K(e,kct);let n=A(()=>u5.current!==Z4e&&(Sk.current?.logo?.show_in_header??!0));var r=H(),i=P(r),a=e=>{{let t=A(()=>Y(`visit_live_site`));Al(e,{variant:`ghost`,iconic:!0,get"aria-label"(){return z(t)},onclick:()=>{c$()},children:(e,t)=>{var n=Oct();R(()=>q(n,`src`,u5.current)),U(e,n)},$$slots:{default:!0}})}};G(i,e=>{z(n)&&e(a)}),U(e,r),k()}var jct=B(`<div role="none" class="buttons"><!> <!></div> <!> <div role="none" class="buttons"><!> <!> <!> <!> <!></div>`,1),Mct=B(`<div role="none" class="toolbar-wrapper svelte-1kz79fh"><!></div>`),Nct={hash:`svelte-1kz79fh`,code:`.toolbar-wrapper.svelte-1kz79fh {display:contents;&[inert] {.sui.search-bar {
/* Disable the keyboard shortcut for the search bar */display:none !important;}}& > .sui.toolbar {
@media (width < 768px) {padding:0 4px;
}.buttons {flex:auto;display:flex;align-items:center;width:50%;&:last-child {justify-content:flex-end;}}.sui.search-bar {flex:none;width:640px;max-width:50%;
@media (width < 768px) {flex:auto;width:-moz-available;width:-webkit-fill-available;width:stretch;max-width:none;
}}}}`};function Pct(e,t){O(t,!0),K(e,Nct);var n=Mct(),r=N(n);{let e=A(()=>Y(`global`));dO(r,{variant:`primary`,get ariaLabel(){return z(e)},children:(e,t)=>{var n=jct(),r=P(n),i=N(r);Act(i,{}),yst(I(i,2),{}),D(r);var a=I(r,2);B5(a,{});var o=I(a,2),s=N(o);Wat(s,{});var c=I(s,2);_ct(c,{});var l=I(c,2);Dct(l,{});var u=I(l,2),d=e=>{Ect(e,{})};G(u,e=>{IG.devModeEnabled&&e(d)}),hct(I(u,2),{}),D(o),U(e,n)},$$slots:{default:!0}})}D(n),R(()=>n.inert=JQ.current),U(e,n),k()}var Fct=B(`<h2 role="none"> </h2> <!>`,1),Ict=B(`<section><h3 class="svelte-16cq5v7"> </h3> <!></section>`),Lct=B(`<div role="none" class="wrapper svelte-16cq5v7"><!> <section><h3 class="svelte-16cq5v7"> </h3> <!></section> <!></div>`),Rct={hash:`svelte-16cq5v7`,code:`.wrapper.svelte-16cq5v7 {overflow-y:auto;height:100%;--sui-menu-border-width: 0;--sui-menu-border-radius: 0;--sui-menu-padding: 8px 0;--sui-menu-divider-margin: 4px 0;}h3.svelte-16cq5v7 {padding:8px 16px;background-color:var(--sui-tertiary-background-color);color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-normal);}`};function zct(e,t){O(t,!0),K(e,Rct);{let t=e=>{A5(e,{primaryToolbar:e=>{dO(e,{variant:`primary`,children:(e,t)=>{var n=Fct(),r=P(n),i=F(r,!0);$l(I(r,2),{flex:!0}),R(e=>W(i,e),[()=>Y(`menu`)]),U(e,n)},$$slots:{default:!0}})},mainContent:e=>{var t=Lct(),n=N(t),r=e=>{var t=Ict(),n=N(t),r=F(n,!0),i=I(n,2);{let e=A(()=>Y(`custom_pages`));Eu(i,{get ariaLabel(){return z(e)},children:(e,t)=>{var n=H();Bo(P(n),17,()=>o9.current,e=>e.id,(e,t)=>{Du(e,{get label(){return z(t).label},onclick:()=>{Iot(z(t))},startIcon:e=>{Xc(e,{get name(){return z(t).icon}})},$$slots:{startIcon:!0}})}),U(e,n)},$$slots:{default:!0}})}D(t),R(e=>W(r,e),[()=>Y(`custom_pages`)]),U(e,t)};G(n,e=>{o9.current.length&&e(r)});var i=I(n,2),a=N(i),o=F(a,!0);dct(I(a,2),{}),D(i);var s=I(i,2),c=e=>{var t=Ict(),n=N(t),r=F(n,!0);Cct(I(n,2),{}),D(t),R(e=>W(r,e),[()=>Y(`help`)]),U(e,t)};G(s,e=>{IG.devModeEnabled&&e(c)}),D(t),R(e=>W(o,e),[()=>Y(`account`)]),U(e,t)},$$slots:{primaryToolbar:!0,mainContent:!0}})},n=A(()=>Y(`menu`));W5(e,{get"aria-label"(){return z(n)},main:t,$$slots:{main:!0}})}k()}var Bct=B(`<div> </div> <canvas class="svelte-1eeac91"></canvas>`,1),Vct={hash:`svelte-1eeac91`,code:`canvas.svelte-1eeac91 {display:block;margin:32px auto 16px;width:200px !important;height:200px !important;}`};function Hct(e,t){O(t,!0),K(e,Vct);let n=j(void 0);yk(()=>{if(!z(n)||!s9.current)return;let e=z(n),{origin:t,pathname:r}=window.location,i=ni(IG),a=`${t}${r}#/signin/${b4e({token:OW.account?.token,prefs:i})}`;return IG.devModeEnabled&&console.info(`Mobile sign-in URL:`,a),BN(`qrcode`).then(({toCanvas:t})=>({toCanvas:t,target:e,url:a}))},({toCanvas:e,target:t,url:n})=>{e(t,n)},e=>{console.error(e)});{let t=A(()=>Y(`sign_in_with_mobile`));tu(e,{get title(){return z(t)},size:`small`,showOk:!1,showCancel:!1,showClose:!0,style:`--sui-dialog-small-content-max-height:auto`,get open(){return s9.current},set open(e){s9.current=e},children:(e,t)=>{var r=Bct(),i=P(r),a=F(i,!0);Ds(I(i,2),e=>M(n,e),()=>z(n)),R(e=>W(a,e),[()=>Y(`sign_in_with_mobile_instruction`)]),U(e,r)},$$slots:{default:!0}})}k()}function Uct(e,t){O(t,!0);let n=/^\/search\/(?<terms>.+)$/,r=()=>{let{path:e}=$Q(),{terms:t}=e.match(n)?.groups??{};t&&t!==M5.current&&(M5.current=t),j5.current??=`contents`};js(()=>{r(),document.querySelector(`.sui.search-bar input`)?.focus()}),yo(`hashchange`,ia,()=>{r()});{let t=e=>{J5(e,{})},n=A(()=>Y(`search_results_for_x`,{values:{terms:M5.current}}));W5(e,{get"aria-label"(){return z(n)},main:t,$$slots:{main:!0}})}k()}var g9=B(`<!> <h2 role="none"> </h2>`,1),Wct=B(`<!> <!>`,1),Gct=B(`<div role="none" class="wrapper svelte-116bna3"><!></div>`),Kct={hash:`svelte-116bna3`,code:`.wrapper.svelte-116bna3 {overflow-y:auto;height:100%;--sui-menu-border-width: 0;--sui-menu-border-radius: 0;--sui-menu-padding: 8px 0;& > .container {display:block;padding:16px;}}`};function qct(e,t){O(t,!0),K(e,Kct);let n=/^\/settings(?:\/(?<panelKey>.+))?$/,r=j(void 0),i=j(!1),a=()=>{let{path:e}=$Q(),t=e.match(n);if(!t?.groups)return;let{panelKey:a}=t.groups;M(r,a?m9.current.find(e=>e.key===a):void 0,!0),M(i,!!a&&!z(r),!0),z(i)&&(XQ.current=Y(`page_not_found`))};js(()=>{a()}),yo(`hashchange`,ia,e=>{a$(e,a,n)});{let t=e=>{A5(e,{primaryToolbar:e=>{dO(e,{variant:`primary`,children:(e,t)=>{var n=Wct(),a=P(n),o=e=>{var t=g9(),n=P(t);C5(n,{onclick:()=>s$(`/settings`)});var i=F(I(n,2),!0);R(e=>W(i,e),[()=>Y(`prefs.${z(r).key}.title`)]),U(e,t)},s=e=>{var t=g9(),n=P(t);C5(n,{onclick:()=>s$(`/settings`)});var r=F(I(n,2),!0);R(e=>W(r,e),[()=>Y(`page_not_found`)]),U(e,t)},c=e=>{var t=g9(),n=P(t);C5(n,{onclick:()=>s$(`/menu`)});var r=F(I(n,2),!0);R(e=>W(r,e),[()=>Y(`settings`)]),U(e,t)};G(a,e=>{z(r)?e(o):z(i)?e(s,1):e(c,-1)}),$l(I(a,2),{flex:!0}),U(e,n)},$$slots:{default:!0}})},mainContent:e=>{var t=Gct(),n=N(t),a=e=>{act(e,{get Panel(){return z(r).component}})},o=e=>{{let t=A(()=>Y(`page_not_found`));E5(e,{get message(){return z(t)},backPath:`/settings`})}},s=e=>{{let t=A(()=>Y(`settings`));Eu(e,{get ariaLabel(){return z(t)},children:(e,t)=>{var n=H();Bo(P(n),17,()=>m9.current,({key:e,icon:t,enabled:n=!0})=>e,(e,t)=>{let n=()=>z(t).key,r=()=>z(t).icon,i=Ei(()=>Mr(z(t).enabled,!0));var a=H(),o=P(a),s=e=>{{let t=e=>{Xc(e,{get name(){return r()}})},i=A(()=>Y(`prefs.${n()}.title`));Du(e,{get label(){return z(i)},onclick:()=>o$(`/settings/${n()}`,{transitionType:`forwards`}),startIcon:t,$$slots:{startIcon:!0}})}};G(o,e=>{z(i)&&e(s)}),U(e,a)}),U(e,n)},$$slots:{default:!0}})}};G(n,e=>{z(r)?e(a):z(i)?e(o,1):e(s,-1)}),D(t),U(e,t)},$$slots:{primaryToolbar:!0,mainContent:!0}})},n=A(()=>Y(`settings`));W5(e,{get"aria-label"(){return z(n)},main:t,$$slots:{main:!0}})}k()}var Jct=B(`<span role="none"> </span>`),Yct={hash:`svelte-1cl315w`,code:`
/*
* Filled pill following the same background/foreground/border recipe as the Alert and Infobar
* components, so the colors adapt to both the light and dark themes. The border does most of the
* work in dark mode, where the alert background is nearly the same as the row background.
*/.deploy-status-badge.svelte-1cl315w {display:inline-block;border-width:1px;border-style:solid;border-radius:12px;padding:1px 6px;font-size:var(--sui-font-size-x-small);line-height:var(--sui-line-height-compact);white-space:nowrap;&.pending {border-color:var(--sui-warning-border-color);background-color:var(--sui-warning-background-color);color:var(--sui-warning-foreground-color);}&.error {border-color:var(--sui-error-border-color);background-color:var(--sui-error-background-color);color:var(--sui-error-foreground-color);}}`};function Xct(e,t){O(t,!0),K(e,Yct);let n={pending:`deploy_preview.short.building`,error:`deploy_preview.short.failed`},r=A(()=>n[t.state]);var i=H(),a=P(i),o=e=>{var n=Jct(),i=F(n,!0);R(e=>{os(n,1,`deploy-status-badge ${t.state??``}`,`svelte-1cl315w`),W(i,e)},[()=>Y(z(r))]),U(e,n)};G(a,e=>{z(r)&&e(o)}),U(e,i),k()}var Zct={...mq,draft:`status.drafts`},Qct={info:`workflow.updating_status`,success:`workflow.status_updated`,error:`workflow.status_change_failed`},$ct={info:`workflow.refreshing`,success:`workflow.refreshed`,error:`workflow.refresh_failed`},elt={info:`workflow.deleting_entry`,success:`workflow.entry_deleted`,error:`deleting_entry_failed`},tlt={info:`workflow.cancelling_deletion`,success:`workflow.deletion_cancelled`,error:`workflow.cancelling_deletion_failed`},nlt={info:`workflow.publishing_entry`,success:`workflow.entry_published`,error:`workflow.publishing_entry_failed`},rlt=e=>e?tlt:elt,ilt=e=>e?elt:nlt,alt=(e,t)=>{let n=t=>e.find(e=>e.status===t)?.entries.length,r=n(`draft`),[i,a]=[n(`pending_review`),n(`pending_publish`)],o=t.length;return i===void 0?a===void 0?{key:`viewing_preview_workflow`,values:{draft:r,deletion:o}}:{key:`viewing_editorial_workflow_without_review`,values:{draft:r,ready:a,deletion:o}}:a===void 0?{key:`viewing_open_authoring_workflow`,values:{draft:r,review:i,deletion:o}}:{key:`viewing_editorial_workflow`,values:{draft:r,review:i,ready:a,deletion:o}}},olt=(e,t,n=e=>e.workflow.status)=>{let r=new Map(t.map(e=>[e,n(e)])),i=new Set(r.values());return{columns:dq.filter(t=>e.includes(t)||i.has(t)).map(e=>({status:e,entries:t.filter(t=>r.get(t)===e)})),pendingDeletions:t.filter(e=>r.get(e)===`pending_deletion`)}},slt=(e,t)=>{let{companions:n=[]}=e.workflow;if(!n.length)return``;let r=n.map(({collectionName:e,entry:t})=>{let n=fj(e);return n?._type===`entry`?Y(`workflow.companion_entry`,{values:{collection:pj(n,{useSingular:!0}),title:jz(n,t)}}):t.slug});return Y(`workflow.companion_entries`,{values:{entries:qA(t).format(r)}})},clt=B(`<p class="companions svelte-1nx78nt"> </p>`),llt=B(`<span role="none" class="author svelte-1nx78nt"><bdi> </bdi></span>`),ult=B(`<span role="none" class="note svelte-1nx78nt"> </span>`),dlt=B(`<div role="listitem"><button type="button" class="summary svelte-1nx78nt"><!> <span role="none" class="text svelte-1nx78nt"><span role="none" class="collection svelte-1nx78nt"><bdi> </bdi></span> <span role="none" class="title svelte-1nx78nt"><bdi> </bdi></span></span></button> <!> <footer role="none" class="svelte-1nx78nt"><div role="none" class="meta svelte-1nx78nt"><!> <span role="none" class="date svelte-1nx78nt"> </span> <!> <!></div> <div role="none" class="actions svelte-1nx78nt"><!> <!> <!></div></footer></div>`),flt={hash:`svelte-1nx78nt`,code:`.card.svelte-1nx78nt {display:flex;flex-direction:column;gap:4px;border:1px solid var(--sui-secondary-border-color);border-radius:var(--sui-control-medium-border-radius);padding:8px 12px;background-color:var(--sui-primary-background-color);cursor:grab;&.dragging {opacity:0.5;}&.static {cursor:default;}}.summary.svelte-1nx78nt {display:flex;align-items:center;gap:8px;border:0;padding:0;background:none;color:inherit;font-family:inherit;text-align:left;cursor:pointer;&:disabled {cursor:default;}
/* Let the label column shrink instead of pushing the thumbnail out of the card */.text:where(.svelte-1nx78nt) {display:flex;flex-direction:column;gap:2px;min-width:0;}}.collection.svelte-1nx78nt {color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}.title.svelte-1nx78nt {font-size:var(--sui-font-size-default);line-height:1.4;overflow-wrap:anywhere;}.companions.svelte-1nx78nt {margin:0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);overflow-wrap:anywhere;}footer.svelte-1nx78nt {display:flex;align-items:center;justify-content:space-between;gap:8px;.meta:where(.svelte-1nx78nt) {display:flex;align-items:center;gap:6px;min-width:0;color:var(--sui-secondary-foreground-color);font-size:var(--sui-font-size-small);}
/* Let a long user name truncate rather than push the date out of the card */.author:where(.svelte-1nx78nt) {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}.date:where(.svelte-1nx78nt),
.note:where(.svelte-1nx78nt) {flex:none;}.author:where(.svelte-1nx78nt) + .date:where(.svelte-1nx78nt)::before,
.date:where(.svelte-1nx78nt) + .note:where(.svelte-1nx78nt)::before {margin-inline-end:6px;content:'\\00B7'; /* middle dot */}.actions:where(.svelte-1nx78nt) {display:flex;flex:none;align-items:center;}}`};function _9(e,t){O(t,!0),K(e,flt);let n=J(t,`dragging`,3,!1),r=J(t,`busy`,3,!1),i=J(t,`deploying`,3,!1),a=J(t,`onDragStart`,3,void 0),o=J(t,`onDragEnd`,3,void 0),s=J(t,`onDelete`,3,void 0),c=J(t,`onPublish`,3,void 0),l=A(()=>t.entry.workflow),u=A(()=>z(l).collectionName),d=A(()=>z(l).fileName),f=A(()=>z(l).status),p=A(()=>z(l).pullRequest),m=A(()=>z(f)===`pending_deletion`),h=A(()=>fj(z(u))),g=A(()=>z(h)&&z(d)?xj(z(h),z(d)):void 0),_=A(()=>R1({collection:z(h),collectionFile:z(g)})),v=A(()=>!z(m)&&!i()&&!z(_)&&jY(z(h)).length>1),y=A(()=>(z(g)??z(h))?._i18n?.defaultLocale),b=A(()=>i()?VK.current:z(p).headSHA),x=A(()=>(z(b)?BK.current[z(b)]?.state:void 0)??`unknown`),S=A(()=>!Jc.current||!z(h)?t.entry.slug:z(g)?Cj(z(g)):jz(z(h),t.entry)),C=A(()=>Jc.current?slt(t.entry,Jc.current):``),w=A(()=>Jc.current&&z(h)?pj(z(h),{useSingular:!0}):``),T=A(()=>!i()&&!z(_)&&rX(t.entry,z(h))),ee=A(()=>sX(t.entry)),te=A(()=>!i()&&!z(_)&&(z(ee)||z(h)?._type!==`entry`||z(h).delete!==!1)),ne=A(()=>i()&&z(m)),re=A(()=>z(m)||z(ee)?`undo`:`delete`);var ie=dlt();let ae;var oe=N(ie),se=N(oe),ce=e=>{K5(e,{get collection(){return z(h)},get entry(){return t.entry},variant:`icon`})};G(se,e=>{z(h)?._type===`entry`&&e(ce)});var le=I(se,2),ue=N(le),de=F(N(ue),!0);D(ue);var fe=I(ue,2),pe=F(N(fe),!0);D(fe),D(le),D(oe);var me=I(oe,2),he=e=>{var t=clt(),n=F(t,!0);R(()=>W(n,z(C))),U(e,t)};G(me,e=>{z(C)&&e(he)});var ge=I(me,2),_e=N(ge),ve=N(_e),ye=e=>{var t=llt(),n=F(N(t),!0);D(t),R(()=>W(n,z(p).author.name)),U(e,t)};G(ve,e=>{z(p).author?.name&&e(ye)});var be=I(ve,2),xe=F(be,!0),Se=I(be,2),Ce=e=>{var t=ult(),n=F(t,!0);R(e=>W(n,e),[()=>Y(`workflow.deploying_deletion`)]),U(e,t)};G(Se,e=>{z(ne)&&e(Ce)}),Xct(I(Se,2),{get state(){return z(x)}}),D(_e);var we=I(_e,2),Te=N(we),Ee=e=>{{let n=A(()=>i()?void 0:z(p));Z5(e,{get entry(){return t.entry},get locale(){return z(y)},get collection(){return z(h)},get collectionFile(){return z(g)},get pullRequest(){return z(n)},size:`small`,iconic:!0})}};G(Te,e=>{z(h)&&z(y)&&!z(ne)&&e(Ee)});var De=I(Te,2),Oe=e=>{{let t=e=>{Xc(e,{get name(){return z(re)}})},n=A(()=>z(m)?Y(`workflow.cancel_deletion`):z(ee)?Y(`workflow.discard_changes`):Y(`delete_entries`,{values:{count:1}}));Al(e,{variant:`ghost`,size:`small`,iconic:!0,get disabled(){return r()},get"aria-label"(){return z(n)},onclick:()=>{s()?.()},startIcon:t,$$slots:{startIcon:!0}})}};G(De,e=>{z(te)&&e(Oe)});var ke=I(De,2),Ae=e=>{{let t=e=>{{let t=A(()=>z(m)?`delete`:`publish`);Xc(e,{get name(){return z(t)}})}},n=A(()=>z(m)?Y(`delete_entries`,{values:{count:1}}):Y(`workflow.publish_entry`));Al(e,{variant:`primary`,size:`small`,iconic:!0,get disabled(){return r()},get"aria-label"(){return z(n)},onclick:()=>{c()?.()},startIcon:t,$$slots:{startIcon:!0}})}};G(ke,e=>{z(T)&&e(Ae)}),D(we),D(ge),D(ie),R(e=>{ae=os(ie,1,`card svelte-1nx78nt`,null,ae,{dragging:n(),static:!z(v)}),q(ie,`draggable`,!r()&&z(v)),q(oe,`aria-label`,z(S)),oe.disabled=z(ne),W(de,z(w)),W(pe,z(S)),W(xe,e)},[()=>z(p).updatedDate.toLocaleDateString(Jc.current,{month:`short`,day:`numeric`})]),yo(`dragstart`,ie,e=>{e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,z(p).branch)),a()?.()}),yo(`dragend`,ie,()=>{o()?.()}),bo(`click`,oe,()=>{o$(IP(`/collections/${z(u)}/entries/${z(d)??t.entry.subPath}`),{transitionType:`forwards`})}),U(e,ie),k()}xo([`click`]);var plt=B(`<h2 role="none"> </h2> <!> <!>`,1),mlt=B(`<span role="none"> </span>`),hlt=B(`<header role="none" class="svelte-ljqw9n"><h3 role="none" class="svelte-ljqw9n"> </h3></header> <div role="list"></div>`,1),glt=B(`<header role="none" class="svelte-ljqw9n"><h3 role="none" id="deletions-title" class="svelte-ljqw9n"> </h3></header> <div role="list" class="entries svelte-ljqw9n"></div>`,1),_lt=B(`<div role="none" class="tray svelte-ljqw9n"><!></div>`),vlt=B(`<header role="none" class="svelte-ljqw9n"><h3 role="none" id="deploying-title" class="svelte-ljqw9n"> </h3></header> <div role="list" class="entries svelte-ljqw9n"></div>`,1),ylt=B(`<div role="none"><div role="none" class="columns svelte-ljqw9n"></div> <!> <!></div>`),blt=B(`<!> <!> <!> <!>`,1),xlt={hash:`svelte-ljqw9n`,code:`
/*
* Entries awaiting removal, and merged ones the site hasn’t caught up with, are listed in trays
* below the board rather than as extra columns: they have no stages to move through, and a
* column would take a share of the width for something rare
*/.board.svelte-ljqw9n {flex:auto;display:flex;flex-direction:column;overflow:hidden;}
/*
* With a single column, as with Preview Workflow, the cards would be stretched across the page,
* so they’re laid out in a grid instead, both in the column and in the trays below it
*/.board.single.svelte-ljqw9n .entries:where(.svelte-ljqw9n) {display:grid;grid-template-columns:repeat(auto-fill, minmax(320px, 1fr));align-content:start;}.tray.svelte-ljqw9n {flex:none;display:flex;flex-direction:column;max-height:33%;border-block-start:1px solid var(--sui-secondary-border-color);background-color:var(--sui-primary-background-color);.group {display:flex;flex-direction:column;overflow:hidden;}header:where(.svelte-ljqw9n) {display:flex;align-items:center;padding:0 16px;height:40px;background-color:var(--sui-tertiary-background-color);h3:where(.svelte-ljqw9n) {font-size:var(--sui-font-size-x-large);}}
/* Mirror the board’s track count, so a card here is the same size as one in a column */.entries:where(.svelte-ljqw9n) {display:grid;grid-template-columns:repeat(var(--column-count), 1fr);gap:8px;padding:8px;overflow-y:auto;
@media (width < 768px) {grid-template-columns:1fr;
}}}.columns.svelte-ljqw9n {flex:auto;display:flex;gap:4px;background-color:var(--sui-secondary-background-color); /* same as toolbar */
@media (width < 768px) {flex-direction:column;gap:0;
}.column {flex:auto;display:flex;flex-direction:column;width:calc(100% / var(--column-count));background-color:var(--sui-primary-background-color);
@media (width < 768px) {width:100%;height:calc(100% / var(--column-count));
}}header:where(.svelte-ljqw9n) {flex:none;display:flex;align-items:center;padding:0 16px;height:40px;background-color:var(--sui-tertiary-background-color);h3:where(.svelte-ljqw9n) {font-size:var(--sui-font-size-x-large);}}.entries:where(.svelte-ljqw9n) {flex:auto;display:flex;flex-direction:column;gap:8px;padding:8px;overflow-y:auto;&.drop-target {background-color:var(--sui-selected-background-color);}}}`};function Slt(e,t){O(t,!0),K(e,xlt);let n=j(void 0),r=j(void 0),i=j(void 0),a=j(!1),o=j(!1),s=j(`info`),c=j(``),l=j(!1),u=j([]),d=j(!1),f=({workflow:{pullRequest:{branch:e}}})=>z(u).includes(e)||WY.current.includes(e),p=A(()=>sX(z(i))),m=A(()=>z(i)?.workflow.status===`pending_deletion`),h=A(()=>j7({pendingDeletion:z(m),publishedVersionExists:z(p)})),g=A(()=>Xnt({deletion:z(m)})),_=A(()=>olt(LY.current,VY.current,FY)),v=A(()=>z(_).columns),y=A(()=>z(_).pendingDeletions),b=A(()=>w4e.current);L(()=>Met());let x=!1,S=(e,t)=>{M(s,e,!0),M(c,t,!0),M(l,!0)},C=async(e,t,n,r=()=>Y(t.error))=>{S(`info`,Y(t.info));try{await e,S(`success`,Y(t.success))}catch(e){S(`error`,r(e)),console.error(e)}finally{n()}},w=async(e,t,n)=>{let{branch:r}=e.workflow.pullRequest;M(u,[...z(u),r]),await C(t,n,()=>{M(u,z(u).filter(e=>e!==r))},e=>T7(e,n.error))},T=async()=>{M(d,!0),await C(G8({fresh:!0}),$ct,()=>{M(d,!1)})},ee=e=>{S(`error`,Y(e))},te=e=>{M(i,e),M(a,!0)},ne=e=>{M(i,e),M(o,!0)},re=async e=>{let t=XY(z(n)?.id);M(n,void 0),M(r,void 0),t&&FY(t)!==e&&IY(t,e)&&(art({entry:t,status:e})?await w(t,O7(t,e),Qct):ee(`workflow.status_change_blocked`))};L(()=>{if(x||!GY.current)return;x=!0;let{key:e,values:t}=alt(z(v),z(y));XQ.current=Y(e,{values:t})});var ie=blt(),ae=P(ie);{let e=e=>{{let t=e=>{dO(e,{variant:`primary`,children:(e,t)=>{var n=plt(),r=P(n),i=F(r,!0),a=I(r,2);$l(a,{flex:!0});var o=I(a,2);{let e=e=>{Xc(e,{name:`refresh`})},t=A(()=>Y(`workflow.refresh`)),n=A(()=>!GY.current||z(d));Al(o,{variant:`ghost`,iconic:!0,get"aria-label"(){return z(t)},get disabled(){return z(n)},onclick:T,startIcon:e,$$slots:{startIcon:!0}})}R(e=>W(i,e),[()=>Y(RY.current)]),U(e,n)},$$slots:{default:!0}})},i=e=>{var t=H(),i=P(t),a=e=>{VO(e,{children:(e,t)=>{var n=mlt(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`loading_entries`,{values:{count:2}})]),U(e,n)},$$slots:{default:!0}})},o=e=>{var t=ylt();let i,a;var o=N(t);Bo(o,21,()=>z(v),({status:e,entries:t})=>e,(e,t)=>{let i=()=>z(t).status,a=()=>z(t).entries;HO(e,{class:`column`,get"aria-labelledby"(){return`${i()??``}-column-title`},children:(e,t)=>{var o=hlt(),s=P(o),c=N(s),l=F(c,!0);D(s);var u=I(s,2);let d;Bo(u,21,a,e=>e.id,(e,t)=>{{let i=A(()=>f(z(t))),a=A(()=>z(n)?.id===z(t).id);_9(e,{get entry(){return z(t)},get busy(){return z(i)},get dragging(){return z(a)},onDragStart:()=>{M(n,z(t))},onDragEnd:()=>{M(n,void 0),M(r,void 0)},onDelete:()=>te(z(t)),onPublish:()=>ne(z(t))})}},e=>{VO(e,{children:(e,t)=>{var n=mlt(),r=F(n,!0);R(e=>W(r,e),[()=>Y(`workflow.no_entries`)]),U(e,n)},$$slots:{default:!0}})}),D(u),R((e,t)=>{q(c,`id`,`${i()??``}-column-title`),W(l,e),d=os(u,1,`entries svelte-ljqw9n`,null,d,{"drop-target":z(r)===i()}),q(u,`aria-label`,t)},[()=>Y(Zct[i()]),()=>Y(Zct[i()])]),yo(`dragover`,u,e=>{z(n)&&IY(z(n),i())&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),M(r,i(),!0))}),yo(`dragleave`,u,()=>{z(r)===i()&&M(r,void 0)}),yo(`drop`,u,e=>{e.preventDefault(),re(i())}),U(e,o)},$$slots:{default:!0}})}),D(o);var s=I(o,2),c=e=>{var t=_lt();HO(N(t),{class:`group`,"aria-labelledby":`deletions-title`,children:(e,t)=>{var n=glt(),r=P(n),i=F(N(r),!0);D(r);var a=I(r,2);Bo(a,21,()=>z(y),e=>e.id,(e,t)=>{{let n=A(()=>f(z(t)));_9(e,{get entry(){return z(t)},get busy(){return z(n)},onDelete:()=>te(z(t)),onPublish:()=>ne(z(t))})}}),D(a),R((e,t)=>{W(i,e),q(a,`aria-label`,t)},[()=>Y(`status.pending_deletion`),()=>Y(`status.pending_deletion`)]),U(e,n)},$$slots:{default:!0}}),D(t),U(e,t)};G(s,e=>{z(y).length&&e(c)});var l=I(s,2),u=e=>{var t=_lt();HO(N(t),{class:`group`,"aria-labelledby":`deploying-title`,children:(e,t)=>{var n=vlt(),r=P(n),i=F(N(r),!0);D(r);var a=I(r,2);Bo(a,21,()=>z(b),({entry:e})=>e.workflow.pullRequest.branch,(e,t)=>{let n=()=>z(t).entry;_9(e,{get entry(){return n()},deploying:!0})}),D(a),R((e,t)=>{W(i,e),q(a,`aria-label`,t)},[()=>Y(`status.deploying`),()=>Y(`status.deploying`)]),U(e,n)},$$slots:{default:!0}}),D(t),U(e,t)};G(l,e=>{z(b).length&&e(u)}),D(t),R(()=>{i=os(t,1,`board svelte-ljqw9n`,null,i,{single:z(v).length===1}),a=cs(t,``,a,{"--column-count":z(v).length})}),U(e,t)};G(i,e=>{GY.current?e(o,-1):e(a)}),U(e,t)},a=A(()=>Y(RY.current));A5(e,{get"aria-label"(){return z(a)},primaryToolbar:t,mainContent:i,$$slots:{primaryToolbar:!0,mainContent:!0}})}},t=A(()=>Y(RY.current));W5(ae,{get"aria-label"(){return z(t)},main:e,$$slots:{main:!0}})}var oe=I(ae,2);ru(oe,{get title(){return z(h).title},get okLabel(){return z(h).label},onOk:async()=>{let e=XY(z(i)?.id);e&&await w(e,k7(e),rlt(eX(e)))},get open(){return z(a)},set open(e){M(a,e,!0)},children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(h).message)),U(e,n)},$$slots:{default:!0}});var se=I(oe,2);ru(se,{get title(){return z(g).title},get okLabel(){return z(g).label},onOk:async()=>{let e=XY(z(i)?.id);e&&(ort({entry:e})?await w(e,Wnt(e,z(i)),ilt(eX(e))):ee(`workflow.publish_blocked`))},get open(){return z(o)},set open(e){M(o,e,!0)},children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(g).message)),U(e,n)},$$slots:{default:!0}});var ce=I(se,2),le=e=>{Xu(e,{get id(){return z(c)},get show(){return z(l)},set show(e){M(l,e,!0)},children:(e,t)=>{el(e,{get status(){return z(s)},children:(e,t)=>{Qr();var n=V();R(()=>W(n,z(c))),U(e,n)},$$slots:{default:!0}})},$$slots:{default:!0}})};G(ce,e=>{z(c)&&e(le)}),U(e,ie),k()}var Clt=B(`<!> <!>`,1),wlt=B(`<!> <!> <!> <!> <div role="none" class="page-root svelte-1a6c577"><!></div> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>`,1),Tlt={hash:`svelte-1a6c577`,code:`.page-root.svelte-1a6c577 {position:relative;flex:auto;display:flex;flex-direction:column;overflow:hidden;view-transition-name:page-root;}`};function Elt(e,t){O(t,!0),K(e,Tlt);let n=`not-found`,r=A(()=>({collections:Tot,assets:f9e,search:iG.isSmallScreen?Uct:j5.current?{contents:Tot,assets:f9e}[j5.current]:Uct,workflow:Slt,config:M9e,pages:Vot,menu:zct,settings:qct})),i=A(()=>YQ.current===n?hst:z(r)[YQ.current]),a=()=>{if(bze())return;let{path:e}=$Q(),t=Cze(e,Object.keys(z(r)));a9.current=Pot(e),`redirect`in t?window.location.replace(t.redirect):`notFound`in t?(YQ.current=n,j5.current=null):(YQ.current!==t.pageName&&(YQ.current=t.pageName),t.searchMode!==void 0&&(j5.current=t.searchMode))};js(()=>{a()});var o=wlt();yo(`hashchange`,ia,()=>{a()});var s=P(o);ast(s,{});var c=I(s,2);dst(c,{});var l=I(c,2),u=e=>{var t=Clt(),n=P(t);cst(n,{}),Hct(I(n,2),{}),U(e,t)};G(l,e=>{Xot.current&&e(u)});var d=I(l,2),f=e=>{Pct(e,{})};G(d,e=>{iG.isSmallScreen||e(f)});var p=I(d,2);Ko(N(p),()=>z(i),(e,t)=>{t(e,{})}),D(p);var m=I(p,2),h=e=>{xst(e,{})};G(m,e=>{iG.isSmallScreen&&e(h)});var g=I(m,2);k9e(g,{});var _=I(g,2);O9e(_,{});var v=I(_,2);_9e(v,{});var y=I(v,2);Aot(y,{});var b=I(y,2);Oot(b,{});var x=I(b,2);jot(x,{});var S=I(x,2);mst(S,{});var C=I(S,2);nst(C,{}),h9e(I(C,2),{}),U(e,o),k()}function Dlt(e,t){O(t,!0);let n=A(()=>rH.current),r=A(()=>!!z(n));{let t=A(()=>Y(`open_authoring.fork_repository`)),i=A(()=>Y(`open_authoring.fork`));ru(e,{get title(){return z(t)},get okLabel(){return z(i)},onOk:()=>{z(n)?.respond(!0)},onClose:()=>{z(n)?.respond(!1)},get open(){return z(r)},set open(e){M(r,e)},children:(e,t)=>{Qr();var r=V();R(e=>W(r,e),[()=>Y(`open_authoring.confirm_forking_repository`,{values:{repo:z(n).repo}})]),U(e,r)},$$slots:{default:!0}})}k()}var Olt=B(` <!>`,1),klt=B(`<svelte-css-wrapper style="display: contents"><!></svelte-css-wrapper>`,1);function Alt(e,t){O(t,!0);let n=l9(`openAuthoringNotice`),r=A(()=>QV.current),i=A(()=>nH(z(r))),a=A(()=>ZDe(OY.current?.repository,z(r)));L(()=>{z(r)&&n.showIfNeeded()});var o=H(),s=P(o),c=e=>{var t=klt(),r=P(t);Lo(r,()=>({"--sui-infobar-message-justify-content":`center`})),jl(r.lastChild,{get show(){return n.show.current},onDismiss:()=>{n.hide()},children:(e,t)=>{Qr();var r=Olt(),o=P(r),s=I(o),c=e=>{{let t=A(()=>Y(`open_authoring.view_fork`));Al(e,{variant:`link`,get label(){return z(t)},onclick:()=>{FV(z(a)),n.hide()}})}};G(s,e=>{z(a)&&e(c)}),R(e=>W(o,`${e??``} `),[()=>Y(`open_authoring.contributing_via_fork`,{values:{repo:z(i)}})]),U(e,r)},$$slots:{default:!0}}),D(r),U(e,t)};G(s,e=>{z(r)&&e(c)}),U(e,o),k()}var jlt=u(s(((e,t)=>{var n=function(e){return r(e)&&!i(e)};function r(e){return!!e&&typeof e==`object`}function i(e){var t=Object.prototype.toString.call(e);return t===`[object RegExp]`||t===`[object Date]`||o(e)}var a=typeof Symbol==`function`&&Symbol.for?Symbol.for(`react.element`):60103;function o(e){return e.$$typeof===a}function s(e){return Array.isArray(e)?[]:{}}function c(e,t){return t.clone!==!1&&t.isMergeableObject(e)?g(s(e),e,t):e}function l(e,t,n){return e.concat(t).map(function(e){return c(e,n)})}function u(e,t){if(!t.customMerge)return g;var n=t.customMerge(e);return typeof n==`function`?n:g}function d(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function f(e){return Object.keys(e).concat(d(e))}function p(e,t){try{return t in e}catch{return!1}}function m(e,t){return p(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function h(e,t,n){var r={};return n.isMergeableObject(e)&&f(e).forEach(function(t){r[t]=c(e[t],n)}),f(t).forEach(function(i){m(e,i)||(r[i]=p(e,i)&&n.isMergeableObject(t[i])?u(i,n)(e[i],t[i],n):c(t[i],n))}),r}function g(e,t,r){r||={},r.arrayMerge=r.arrayMerge||l,r.isMergeableObject=r.isMergeableObject||n,r.cloneUnlessOtherwiseSpecified=c;var i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):h(e,t,r):c(t,r)}g.all=function(e,t){if(!Array.isArray(e))throw Error(`first argument should be an array`);return e.reduce(function(e,n){return g(e,n,t)},{})},t.exports=g}))(),1),v9=e=>e.includes(`{{media_folder}}`)||e.includes(`{{public_folder}}`),Mlt=e=>e.replace(/^\/@/,`@`),Nlt=(e,{globalMediaFolder:t,globalPublicFolder:n})=>e.trim().replace(`{{media_folder}}`,`/${t}`).replace(`{{public_folder}}`,`/${n}`).replace(`//`,`/`),Plt=e=>{if(`folder`in e&&typeof e.folder==`string`)return e.folder;if(`file`in e&&typeof e.file==`string`)return Uk(e.file).dirname},Flt=({collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i=!1,mediaFolder:a,publicFolder:o,baseFolder:s,globalFolders:c,label:l,icon:u,isAssetCollection:d=!1})=>{if(v9(a)){if(!c)return;a=Nlt(a,c)}if(o===void 0)o=a;else if(v9(o)){if(!c)return;o=Mlt(Nlt(o,c))}a=a.replace(/^\.(?:\/|$)/,``);let f=!a.startsWith(`/`);return{collectionName:e,fileName:t,componentName:n,typedKeyPath:r,isIndexFile:i,internalPath:f?CE(s??``).replace(/^\.(?:\/|$)/,``):CE(a),internalSubPath:f?CE(a):void 0,publicPath:/^($|[.@])/.test(o)?o.replace(/(?<=.)\/+$/,``):`/${CE(o)}`,entryRelative:f,hasTemplateTags:gN(a),label:l,icon:u,isAssetCollection:d}},y9=(e,t)=>{if(t.mediaFolder===void 0)return;let n=Flt(t);if(!n)return;let{globalMediaFolder:r,globalPublicFolder:i}=t.globalFolders??{};(n.entryRelative||n.internalPath!==r||n.publicPath!==i)&&e.push(n)},Ilt=(e,{collectionName:t,files:n,globalFolders:r,mediaFolder:i,publicFolder:a})=>{Nk(n).forEach(n=>{let{name:o,file:s,media_folder:c,public_folder:l}=n,u=c===void 0;y9(e,{collectionName:t,fileName:o,mediaFolder:u?i:c,publicFolder:u?a:l,baseFolder:Uk(s).dirname,globalFolders:r})})},Llt=(e,{fieldMediaFolders:t,validCollections:n,globalFolders:r})=>{t.forEach(({fieldConfig:t,context:i})=>{let{collection:a,collectionFile:o,componentName:s,typedKeyPath:c,isIndexFile:l}=i;(a&&(a.name===`_singletons`||n.some(e=>e.name===a.name))||s)&&y9(e,{collectionName:a?.name,fileName:o?.name,componentName:s,typedKeyPath:c,isIndexFile:l,mediaFolder:t.media_folder,publicFolder:t.public_folder,baseFolder:o?Uk(o.file).dirname:a?Plt(a):void 0,globalFolders:r})})},Rlt=(e,{assetCollections:t,globalFolders:n})=>{t.forEach(t=>{let{name:r,label:i=r,icon:a,media_folder:o,public_folder:s}=t;o!==void 0&&y9(e,{collectionName:`assets:${r}`,mediaFolder:`/${CE(o)}`,publicFolder:s,globalFolders:n,label:i,icon:a,isAssetCollection:!0})})},zlt=({config:e,folder:t,validCollections:n})=>{let{collectionName:r,fileName:i,isAssetCollection:a}=t;if(a){let t=e.asset_collections?.find(({name:e})=>`assets:${e}`===r);return L1({config:e,collection:t})}let o=n.find(({name:e})=>e===r),s=r===`_singletons`?e.singletons:o&&`files`in o?o.files:void 0;return L1({config:e,collection:o,collectionFile:i&&s?Nk(s).find(({name:e})=>e===i):void 0})},Blt=e=>{let{media_folder:t,public_folder:n}=e;if(t===void 0)return;let r=CE(t).replace(/^\.$/,``);return{globalMediaFolder:r,globalPublicFolder:n?Mlt(`/${CE(n)}`):`/${r}`}},Vlt=(e,{validCollections:t,singletons:n,globalFolders:r})=>{let i=r!==void 0;t.forEach(t=>{let{name:n,files:a,path:o,media_folder:s,public_folder:c}=t,l=i&&s===void 0&&o!==void 0?``:s,u=`files`in t&&typeof l==`string`&&!v9(l)&&!l.startsWith(`/`);u||y9(e,{collectionName:n,mediaFolder:l,publicFolder:c,baseFolder:Plt(t),entryPath:o,globalFolders:r}),a?.length&&Ilt(e,{collectionName:n,files:a,globalFolders:r,...u?{mediaFolder:l,publicFolder:c}:{}})}),n?.length&&Ilt(e,{collectionName:`_singletons`,files:n,globalFolders:r})},Hlt=(e,t)=>new Map(t.map(t=>{let n=nj({cmsConfig:e,collection:t}),r=`folder`in t&&typeof t.folder==`string`&&zA(t.folder)||!!n?.structure&&Rbe.includes(n.structure);return[t.name,r?n?.locales??[]:[]]})),Ult=(e,t=[])=>{let n=[],{collections:r,singletons:i,asset_collections:a}=e,o=Blt(e),s={collectionName:void 0,internalPath:void 0,internalSubPath:void 0,publicPath:void 0,entryRelative:!1,hasTemplateTags:!1,label:void 0,icon:void 0,isAssetCollection:!1},c=o?{...s,internalPath:o.globalMediaFolder,publicPath:o.globalPublicFolder}:void 0,l=lj({collections:r});Vlt(n,{validCollections:l,singletons:i,globalFolders:o}),Llt(n,{fieldMediaFolders:t,validCollections:l,globalFolders:o}),n.sort((e,t)=>TE(e.internalPath,t.internalPath));let u=[];c&&u.push(c),a?.length&&Rlt(n,{assetCollections:a,globalFolders:o}),u.push(...n),u.length&&u.unshift(s);let d=Hlt(e,l);return u.map(t=>{let n=t.entryRelative?d.get(t.collectionName):void 0;return{...t,...n?.length?{localeFolderNames:n}:{},...zlt({config:e,folder:t,validCollections:l})?{readonly:!0}:{}}})},Wlt=({collection:e,file:t})=>{let n=CE(t.file);if(!n.includes(`{{locale}}`))return{_default:n};let r=oj(e,t);return Object.fromEntries(r.allLocales.map(e=>[e,JA({_i18n:r,locale:e,path:n})]))},Glt=(e,t)=>{if(Mk(t))return{collectionName:e.name,fileName:t.name,filePathMap:Wlt({collection:e,file:t})}},Klt=(e,t)=>TE(Object.values(e.filePathMap??{})[0],Object.values(t.filePathMap??{})[0]),qlt=({collections:e})=>lj({collections:e,type:`entry`}).map(e=>{let{name:t,folder:n,file:r}=e;if(typeof r==`string`)return{collectionName:t,filePathMap:{_default:CE(r)}};let i=CE(n),a=oj(e),{allLocales:o,defaultLocale:s,omitDefaultLocaleFromFilePath:c,structureMap:{i18nMultiRootFolder:l}}=a,u=e=>zA(i)?JA({_i18n:a,locale:e,path:i}):l?c&&e===s?i:`${e}/${i}`:i;return{collectionName:t,folderPath:i,folderPathMap:Object.fromEntries(o.map(e=>[e,u(e)]))}}).sort((e,t)=>TE(e.folderPath??e.filePathMap._default,t.folderPath??t.filePathMap._default)),Jlt=({collections:e})=>lj({collections:e,type:`file`}).flatMap(e=>(e.files??[]).map(t=>Glt(e,t))).filter(e=>!!e).sort(Klt),Ylt=({singletons:e})=>{let t=Array.isArray(e)?Nk(e):[];if(!t.length)return[];let n={name:`_singletons`,files:t};return t.map(e=>Glt(n,e)).filter(e=>!!e).sort(Klt)},Xlt=e=>[...qlt(e),...Jlt(e),...Ylt(e)],Zlt=`https://sveltiacms.app/en/docs/api/initialization#providing-a-full-configuration`,Qlt=`https://sveltiacms.app/en/docs/config-basics#validation-and-autocomplete`,b9=new Map,$lt=e=>{let t=new URL(e);return t.searchParams.set(`_`,Date.now().toString()),fetch(t)},eut=async({href:e,type:t=`application/yaml`},{manualInit:n=!1,showSchemaTip:r}={})=>{let i;if(!ube.includes(t))throw Error(Y(`config.error.parse_failed`),{cause:Error(Y(`config.error.parse_failed_unsupported_type`))});let a=yA(Y(n?`config.error.fetch_failed_with_manual_init`:`config.error.fetch_failed`),Zlt);try{let t=new URL(e,window.location.href),n=b9.get(t.href);b9.delete(t.href),i=await(n??$lt(t))}catch(e){throw Error(a,{cause:e})}let{ok:o,status:s}=i;if(!o)throw Error(a,{cause:Error(Y(`config.error.fetch_failed_not_ok`,{values:{status:s}}))});let c=!1,l;try{if(t===`application/json`)l=await i.json(),E(l)&&l.$schema!==`https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json`&&(c=!0);else{let e=await i.text();t===`application/toml`?(l=MR(e),e.includes(`#:schema https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json`)||(c=!0)):(l=NR(e,{merge:!0,maxAliasCount:-1}),e.includes(`# yaml-language-server: $schema=https://unpkg.com/@sveltia/cms/schema/sveltia-cms.json`)||(c=!0))}}catch(e){throw Error(Y(`config.error.parse_failed`),{cause:e})}if(!E(l))throw Error(Y(`config.error.parse_failed`),{cause:Error(Y(`config.error.parse_failed_invalid_object`))});return r&&c&&console.info(Y(`config.schema_tip`,{values:{link:Qlt}})),l},tut=e=>{if(e=e.replace(/^\/+/,`/`),e.endsWith(`/`))return`${e}config.yml`;let t=e.split(`/`);return t.pop()?.includes(`.`)?`${t.join(`/`)}/config.yml`:`${e}/config.yml`},nut=e=>{let{origin:t}=window.location;return e.every(({href:e})=>nG(e,t))},rut=()=>{let e=[...document.querySelectorAll(`link[rel="cms-config-url"]`)].map(({href:e,type:t})=>({href:e,type:t||void 0}));return e.length||e.push(uk?{href:`${uk}/admin/config.yml`}:{href:tut(window.location.pathname)}),e},iut=()=>{let e=rut();nut(e)&&e.forEach(({href:e})=>{try{let t=new URL(e,window.location.href);if(!b9.has(t.href)){let e=$lt(t);e.catch(()=>{}),b9.set(t.href,e)}}catch{}})},aut=async({manualInit:e=!1}={})=>{let t=rut();if(!nut(t))throw Error(Y(`config.error.insecure_urls`,{values:{count:t.length}}));let n=iG.isLocalHost&&!e&&t.length===1,r;try{r=await Promise.all(t.map(t=>eut(t,{manualInit:e,showSchemaTip:n})))}finally{b9.clear()}return r.length===1?r[0]:jlt.default.all(r)},out=[{type:`warning`,prop:`use_graphql`,strKey:`unsupported_ignored_option`}],sut=`https://sveltiacms.app/en/docs/migration/netlify-decap-cms#features-not-to-be-implemented`,cut=`https://sveltiacms.app/en/docs/backends#supported-backends`,lut=`https://sveltiacms.app/en/docs/backends/BACKEND_NAME#authentication`,uut={gitea:`gitea-forgejo`},dut=`https://sveltiacms.app/en/docs/workflows/open`,fut=[`api_root`,`graphql_api_root`,`base_url`],put=/^\.|\.lock$|[\x00-\x20\x7f~^:?*[\\]|@\{/,mut=e=>e.split(`/`).every(e=>!put.test(e)),hut=(e,t)=>{let{backend:n}=e,{errors:r,warnings:i}=t;if(!E(n)){r.add(Y(`config.error.missing_backend`));return}let{name:a}=n;if(!a){r.add(Y(`config.error.missing_backend_name`));return}if(!iLe.includes(a)){let e=rLe[a],t=e?e.deprecated?`deprecated`:`known`:`custom`,n=e?.label,i=yA(Y(`config.error.unsupported_${t}_backend`,{values:{name:n}}),sut),o=yA(Y(`config.error.unsupported_backend_suggestion`),cut);r.add(`${i} ${o}`);return}let{root_dir:o}=n;if(typeof o==`string`&&(o.split(`/`).includes(`..`)?r.add(Y(`config.error.invalid_root_dir`)):Yq(e)&&!mut(kU(o))&&r.add(Y(`config.error.invalid_root_dir_branch`))),a in pY){let{repo:o,automatic_deployments:s,auth_methods:c,auth_type:l,app_id:u,open_authoring:d,auth_scope:f}=n;Array.isArray(c)&&!c.length&&r.add(Y(`config.error.no_auth_methods`)),a===`github`&&Array.isArray(f)&&!f.some(e=>e===`repo`||e===`public_repo`)&&r.add(Y(`config.error.auth_scope_no_repo`));let p=!c||c.includes(`token`),m=lut.replace(`BACKEND_NAME`,uut[a]??a);o===void 0?r.add(Y(`config.error.missing_repository`)):typeof o==`string`&&/^[^/:]+(?:\/[^/:]+)+$/.test(o)||r.add(Y(`config.error.invalid_repository`)),l===`implicit`&&r.add(yA(Y(`config.error.oauth_implicit_flow`),m)),a===`github`&&l===`pkce`&&r.add(yA(Y(`config.error.github_pkce_unsupported`),m)),a===`gitlab`&&l===`pkce`&&!u&&r.add(Y(`config.error.oauth_no_app_id`)),d&&(qq(Kq({cmsConfig:e}))||r.add(yA(Y(`config.error.open_authoring_no_workflow`),dut)),a===`github`&&f===void 0&&i.add(`The \`open_authoring\` option is enabled without \`auth_scope\`, so contributors are asked for access to all their repositories, including private ones. Set \`auth_scope: public_repo\` if your repository is public, or \`auth_scope: repo\` to confirm the broader scope is needed. ${dut}`)),a===`gitea`&&!u&&(p?i.add(Y(`config.warning.oauth_no_app_id`)):r.add(Y(`config.error.oauth_no_app_id`))),fut.forEach(r=>{let i=n[r];typeof i==`string`&&!hA(i)&&E8({strKey:`invalid_url_option`,values:{option:r,url:i},context:{cmsConfig:e},collectors:t})}),s!==void 0&&eA(`automatic_deployments`),D8({UNSUPPORTED_OPTIONS:out,config:n,context:{cmsConfig:e},collectors:t})}},gut=[`code`,`markdown`,`richtext`,`text`],_ut=[`yaml`,`toml`,`json`],x9=(e,t,n=[])=>{if(!e||!t||t===`raw`||ik.has(t))return!1;let r=t.endsWith(`-frontmatter`)||t===`frontmatter`;if(r&&n.length===1){let[{name:e,widget:t=`string`}]=n;if(e===`body`&&gut.includes(t))return!1}let i=e===`yml`?`yaml`:e,a=t===`yml`?`yaml`:t;if(oA.includes(i))return!r;if(r){let e=sA[i];return e!==void 0&&e!==a.replace(`-frontmatter`,``)}return _ut.includes(a)?_ut.includes(i)&&i!==a:!1},vut=[`boolean`,`keyvalue`,`list`,`number`,`object`],yut=e=>{let{widget:t=`string`}=e;return t===`number`?!(e.value_type??``).endsWith(`/string`):t===`compute`?wP(e):vut.includes(t)||_M(e)},S9=({extension:e,format:t,bodyField:n,fields:r,context:i,collectors:a})=>{let{key:o=`body`,inline:s=!1}=n??{},c=Array.isArray(r)?r.find(({name:e})=>e===o):void 0;if(s||!c||typeof o!=`string`)return;let l=XA({extension:YA({extension:e,format:t}),format:t});(l===`frontmatter`||l.endsWith(`-frontmatter`))&&yut(c)&&E8({strKey:`front_matter_body_field_not_text`,values:{name:o,widget:c.widget},context:{...i,typedKeyPath:o},collectors:a})},C9=({cmsConfig:e,collection:t,file:n})=>{let r=nj({cmsConfig:e,collection:t,file:n});if(r?.locales?.length)return r.canonical_slug?.key??tj.key},but=/<[^>]+>$/,w9=e=>{let{field:t}=e,{fields:n}=e,{types:r,typeKey:i=`type`}=e;return t?[t]:n||(r?[...r.flatMap(({fields:e=[]})=>e),{name:i}]:[])},xut=(e,t)=>{let n=[],r=!0;return t.split(`.`).every(t=>{let i=t.replace(but,``);if(!i||i===`*`||uM(i))return!0;let a=r?e:n.flatMap(e=>w9(e));return r=!1,n=a.filter(({name:e})=>e===i),!!n.length})?n:[]},T9=(e,t)=>!!xut(e,t).length,Sut=({collection:e,collectionFile:t,isIndexFile:n})=>{if(t)return t.fields;if(!e||`files`in e)return;let{fields:r,index_file:i}=e;return n&&typeof i==`object`&&i.fields?i.fields:r},Cut=(e,{canonicalSlugKey:t,orderFieldKey:n})=>sB.includes(e)||e===`_manual`||e===t||e===n,E9=({option:e,template:t,keyPaths:n,specialTags:r=[],prefixedOnly:i=!1,type:a,strKey:o=`option_field_not_found`,fields:s,context:c,collectors:l})=>{let u=[];typeof t==`string`?[...t.matchAll(qk)].forEach(([,e])=>{let t=e.split(`|`)[0].trim();bbe.test(e)||i&&!Zk.test(t)||r.includes(t)||u.push(t)}):(Array.isArray(n)?n:[n]).forEach(e=>{typeof e==`string`&&e&&u.push(e)}),u.forEach(t=>{T9(s,_N(t))||E8({type:a,strKey:o,values:{option:e,name:t},context:c,collectors:l})})},wut=({thumbnail:e,fields:t,context:n,collectors:r})=>{if(E9({option:`thumbnail`,keyPaths:e,fields:t,context:n,collectors:r}),typeof e!=`string`||!e)return;let i=xut(t,_N(e)).map(({widget:e=`string`})=>e);i.length&&!i.some(e=>Lk.includes(e))&&E8({strKey:`thumbnail_field_not_media`,values:{name:e,widget:i[0]},context:n,collectors:r})},Tut=({pathTemplate:e,dateFieldName:t,fields:n,context:r,collectors:i})=>{Xk.test(e)&&((t?n.some(({widget:e,name:n})=>e===`datetime`&&n===t):n.some(({widget:e})=>e===`datetime`))||E8({type:`warning`,strKey:t?`preview_path_date_field_not_found`:`preview_path_no_date_field`,values:{name:t},context:r,collectors:i}))},Eut=({pathTemplate:e,dateFieldName:t,fields:n,context:r,collectors:i})=>{e&&(Tut({pathTemplate:e,dateFieldName:t,fields:n,context:r,collectors:i}),E9({option:`preview_path`,template:e,prefixedOnly:!0,type:`warning`,strKey:`preview_path_field_not_found`,fields:n,context:r,collectors:i}))},Dut=({config:e,context:t,collectors:n})=>{let{default:r,output_code_only:i=!1,keys:a={code:`code`,lang:`lang`}}=e;if(!E(r))return;if(i){E8({strKey:`code_field_invalid_default_object`,context:t,collectors:n});return}let{code:o,lang:s}=a;Object.keys(r).filter(e=>![o,s].includes(e)).forEach(e=>{E8({strKey:`code_field_invalid_default_key`,values:{key:e,code:o,lang:s},context:t,collectors:n})})},Out=({config:e,context:t,collectors:n})=>{let{value:r,value_type:i}=e,{tree:a,tags:o}=BB(r);a?o.some(({content:e})=>Object.hasOwn(Qk,sP(e).value))&&E8({strKey:`compute_field_uuid_in_expression`,values:{valueType:i},context:t,collectors:n}):E8({strKey:`compute_field_invalid_expression`,values:{valueType:i},context:t,collectors:n})},kut=(e,t)=>{if(t){let{tree:t,tags:n}=BB(e);return t?n:[]}return hN(e).tags.map(e=>({content:e,allItems:!1}))},Aut=/<[^>]*>/g,jut=/(?<=^|\.)\d+(?=\.|$)/g,D9=e=>{let{value:t,transformations:n}=sP(e),r=[];return Zk.test(t)&&r.push({tagName:t,keyPath:_N(t).replace(jut,`*`)}),fN(n,e=>(r.push(...D9(e)),``)),r},Mut=({context:e,collectors:t},n)=>{let r=(e.typedKeyPath??``).replace(Aut,``),i=r.split(`.`);n.forEach(({content:n,allItems:a})=>{let o=D9(n).find(({keyPath:e})=>e===r);if(o){E8({type:`warning`,strKey:`compute_field_self_reference`,values:{name:o.tagName},context:e,collectors:t});return}let{value:s}=sP(n);if(!Zk.test(s))return;let c=_N(s);if(a)return;let l=c.split(`.`);l.every((e,t)=>e!==`*`||l.slice(0,t+1).every((e,t)=>e===i[t]))||E8({type:`warning`,strKey:`compute_field_wildcard_without_item`,values:{name:s},context:e,collectors:t})})},O9=(e,t=``)=>(Array.isArray(e)?e:[]).flatMap(e=>Put(e,t?`${t}.${e?.name}`:`${e?.name}`)),Nut=(e,t)=>(Array.isArray(e)?e:[]).flatMap(e=>O9(e?.fields,`${t}<${e?.name}>`)),Put=(e,t)=>{let{widget:n=`string`,value:r}=e??{};if(n===`compute`){let n=new Set((typeof r==`string`?kut(r,CP(e)):[]).flatMap(({content:e})=>D9(e).map(({keyPath:e})=>e)));return[{typedKeyPath:t,keyPath:t.replace(Aut,``),references:n}]}if(n===`object`)return[...O9(e.fields,t),...Nut(e.types,t)];if(n===`list`){let n=`${t}.*`;return[...e.field?Put(e.field,n):[],...O9(e.fields,n),...Nut(e.types,n)]}return[]},Fut=new WeakMap,Iut=e=>PA(Fut,e,()=>{let t=O9(e),n=new Map(t.map(e=>[e,t.filter(t=>t.keyPath!==e.keyPath&&e.references.has(t.keyPath))])),r=new Map,i=[],a=new Set,o=new Map,s=e=>{let t={index:r.size,lowLink:r.size};if(r.set(e,t),i.push(e),a.add(e),n.get(e).forEach(e=>{r.has(e)?a.has(e)&&(t.lowLink=Math.min(t.lowLink,r.get(e).index)):(s(e),t.lowLink=Math.min(t.lowLink,r.get(e).lowLink))}),t.lowLink!==t.index)return;let c=[],l;do l=i.pop(),a.delete(l),c.push(l);while(l!==e);if(c.length>1){let[e]=c.toSorted((e,t)=>e.typedKeyPath.localeCompare(t.typedKeyPath)),t=n.get(e).find(e=>c.includes(e));o.set(e.typedKeyPath,t.keyPath)}};return t.forEach(e=>{r.has(e)||s(e)}),o}),Lut=({config:e,context:t,collectors:n})=>{let{value:r}=e,i=CP(e),a=Sut(t);if(typeof r==`string`&&(i&&Out({config:e,context:t,collectors:n}),t.componentName||Mut({config:e,context:t,collectors:n},kut(r,i))),a?.length){let e=Iut(a).get(t.typedKeyPath??``);e!==void 0&&E8({type:`warning`,strKey:`compute_field_reference_cycle`,values:{name:`fields.${e}`},context:t,collectors:n}),E9({option:`value`,template:r,prefixedOnly:!0,fields:a,context:t,collectors:n})}},Rut=[{prop:`dateFormat`,newProp:`date_format`},{prop:`timeFormat`,newProp:`time_format`},{prop:`pickerUtc`,newProp:`picker_utc`}],zut=e=>{try{return Intl.DateTimeFormat(`en-US`,{timeZone:e}),!0}catch{return!1}},But=e=>{let{config:t,context:n,collectors:r}=e,{picker_utc:i,input_timezone:a,output_utc:o}=t;i!==void 0&&(a!==void 0||o!==void 0)&&E8({type:`warning`,strKey:`conflicting_timezone_options`,context:n,collectors:r}),FN(a)&&!zut(a)&&E8({strKey:`invalid_timezone`,values:{timeZone:a},context:n,collectors:r})},Vut=e=>{let{config:t,context:n,collectors:r}=e,i=t,{localize_format:a}=i;if(!a)return;if(!IN(i).format){E8({type:`warning`,strKey:`localize_format_without_format`,context:n,collectors:r});return}if(typeof a==`string`){if(!UN(a)){E8({type:`warning`,strKey:`localize_format_unsupported_locale`,values:{locale:a},context:n,collectors:r});return}r.formatLocales.add(a);return}let{cmsConfig:o,collection:s,collectionFile:c}=n,l=s?nj({cmsConfig:o,collection:s,file:c})?.locales??[]:o?.i18n?.locales??[];l.length?l.forEach(e=>{r.formatLocales.add(e)}):E8({type:`warning`,strKey:`localize_format_without_i18n`,context:n,collectors:r})},Hut=e=>{D8({...e,UNSUPPORTED_OPTIONS:Rut}),But(e),Vut(e)},Uut=[`media_folder`,`public_folder`],Wut=[...Yk,...Object.keys(Qk),`slug`,`dirname`,`filename`,`extension`],Gut=[`{{media_folder}}`,`{{public_folder}}`],k9=({config:e,isGlobal:t=!1,context:n,collectors:r})=>{Uut.forEach(i=>{let a=e[i];typeof a==`string`&&[...a.matchAll(qk)].forEach(([e,a])=>{let o=a.split(`|`)[0].trim();(t||!Gut.includes(e)&&!Wut.includes(o))&&E8({strKey:t?`global_folder_template_tag`:`unsupported_folder_template_tag`,values:{option:i,tag:e},context:n,collectors:r})})})},Kut=({media_library:e,media_libraries:t})=>pZ.includes(e?.name??``)||Object.keys(t??{}).some(e=>pZ.includes(e)),qut=(e,t)=>{let{media_folder:n,public_folder:r,asset_collections:i}=e,{errors:a,warnings:o}=t;if(n===void 0&&!Kut(e)&&a.add(Y(`config.error.missing_media_folder`)),r===``&&n!==void 0&&o.add(Y(`config.warning.empty_public_folder`)),typeof r==`string`&&(/^\.{1,2}\//.test(r)&&a.add(Y(`config.error.public_folder_relative_path`)),/^https?:/.test(r)&&a.add(Y(`config.error.public_folder_absolute_url`))),k9({config:e,isGlobal:!0,context:{cmsConfig:e},collectors:t}),Array.isArray(i)){let n={nameCounts:{},strKeyBase:`asset_collection_name`,collectors:t};i.forEach((r,i)=>{let{name:a}=r;O8({...n,name:a,index:i,context:{cmsConfig:e}}),k9({config:r,isGlobal:!0,context:{cmsConfig:e},collectors:t})})}},Jut=[`raster_image`,...wH,...DH],Yut=({key:e,options:t,context:n,collectors:r})=>{let{quality:i}=t,a={values:{key:e},context:n,collectors:r};i!==void 0&&!(Number.isSafeInteger(i)&&i>=0&&i<=100)&&E8({...a,strKey:`invalid_transformation_quality`}),[`width`,`height`].forEach(n=>{let r=t[n];r!==void 0&&!(Number.isSafeInteger(r)&&r>0)&&E8({...a,strKey:`invalid_transformation_size`,values:{key:e,prop:n}})})},Xut=({transformations:e,context:t,collectors:n})=>{E(e)&&Object.entries(e).forEach(([e,r])=>{Jut.includes(e)?E(r)&&!DH.includes(e)&&Yut({key:e,options:r,context:t,collectors:n}):E8({strKey:`invalid_transformation_key`,values:{key:e},context:t,collectors:n})})},Zut=({config:e,context:t,collectors:n})=>{let{media_library:r,media_libraries:i}=e,a=[];E(i)&&(a.push(i.all),E(i.default)&&a.push(i.default.config)),E(r)&&(r.name??`default`)==="default"&&a.push(r.config),a.forEach(e=>{E(e)&&Xut({transformations:e.transformations,context:t,collectors:n})})},A9=({defaultValue:e,multiple:t=!1,context:n,collectors:r})=>{if(e==null)return;let i=Array.isArray(e);t&&!i&&E8({strKey:`invalid_default_multiple`,context:n,collectors:r}),!t&&i&&E8({strKey:`invalid_default_single`,context:n,collectors:r})},Qut=({value:e,fields:t,strKeyBase:n,context:r,collectors:i})=>{let a=t.map(({name:e})=>e);Object.keys(e).filter(e=>!a.includes(e)).forEach(e=>{E8({strKey:`${n}_invalid_default_key`,values:{key:e},context:r,collectors:i})})},$ut=({value:e,fields:t,types:n,typeKey:r=`type`,strKeyBase:i,context:a,collectors:o})=>{let s={value:e,strKeyBase:i,context:a,collectors:o};if(t){Qut({...s,fields:t});return}let c=e[r];if(c===void 0){E8({strKey:`${i}_default_missing_type`,values:{typeKey:r},context:a,collectors:o});return}let l=n?.find(({name:e})=>e===c);l?Qut({...s,fields:[...l.fields??[],{name:r}]}):E8({strKey:`${i}_invalid_default_type`,values:{typeKey:r,value:String(c)},context:a,collectors:o})},edt=[{prop:`allow_multiple`,newProp:`multiple`,strKey:`allow_multiple`}],tdt=e=>{let{config:t,context:n,collectors:r}=e,{media_folder:i,default:a,multiple:o,i18n:s}=t;o!==void 0&&A9({defaultValue:a,multiple:o,context:n,collectors:r}),o===!0&&s===`duplicate_if_empty`&&E8({type:`warning`,strKey:`duplicate_if_empty_multiple`,context:n,collectors:r}),i!==void 0&&r.mediaFields.add({fieldConfig:t,context:n}),k9({config:t,context:n,collectors:r}),Zut({config:t,context:n,collectors:r}),D8({...e,UNSUPPORTED_OPTIONS:edt})},ndt=e=>hN(e).tags.some(e=>{let{value:t,transformations:n}=sP(e),r=t===`locale`;return fN(n,e=>(ndt(`{{${e}}}`)&&(r=!0),``)),r}),rdt=({config:e,context:t,collectors:n})=>{let{default:r}=e,{cmsConfig:i,collection:a,collectionFile:o}=t;typeof r==`string`&&a&&ndt(r)&&(nj({cmsConfig:i,collection:a,file:o})?.locales?.length||E8({strKey:`hidden_field_locale_without_i18n`,context:t,collectors:n}))},idt=[[`min`,`max`],[`minlength`,`maxlength`]],adt=({config:e,context:t,collectors:n})=>{let{default_localized:r}=e,{cmsConfig:i,collection:a,collectionFile:o}=t;if(!E(r)||!a)return;let s=nj({cmsConfig:i,collection:a,file:o})?.locales??[];s.length?Object.keys(r).filter(e=>!s.includes(e)).forEach(e=>{E8({type:`warning`,strKey:`default_localized_unknown_locale`,values:{locale:e},context:t,collectors:n})}):E8({type:`warning`,strKey:`default_localized_without_i18n`,context:t,collectors:n})},odt=({config:e,context:t,collectors:n})=>{let{pattern:r}=e;Array.isArray(r)&&k8({option:`pattern`,pattern:r[0],context:t,collectors:n}),idt.forEach(([r,i])=>{let{[r]:a,[i]:o}=e;typeof a==`number`&&typeof o==`number`&&a>o&&E8({strKey:`invalid_range_options`,values:{min:r,max:i},context:t,collectors:n})}),adt({config:e,context:t,collectors:n})},sdt=({config:e,context:t,collectors:n})=>{let{media_folder:r}=e;r!==void 0&&n.mediaFields.add({fieldConfig:e,context:t}),k9({config:e,context:t,collectors:n})},cdt={},ldt=e=>{let{config:t,context:n}=e,{name:r,widget:i=`string`}=t,{typedKeyPath:a}=n,o={...e,context:{...n,typedKeyPath:a?`${a}.${r}`:r}},s=Pk.includes(i),c=cdt[i]??(s?void 0:sdt);odt(o),c?.(o),i===`date`&&E8({...o,strKey:`date_field_type`})},j9=(e,t,n)=>{let r={nameCounts:{},strKeyBase:`field_name`,context:t,collectors:n};e?.forEach((e,i)=>{let{name:a}=e;O8({...r,name:a,index:i})&&ldt({config:e,context:t,collectors:n})})},udt=[`string`,`relation`,`select`],ddt=(e,t,n)=>e===`object`||(E8({strKey:`invalid_list_variable_type`,context:t,values:{widget:e},collectors:n}),!1),fdt=[`keyvalue`,`object`],pdt=({config:e,context:t,collectors:n})=>{let{default:r}=e,{field:i}=e,{fields:a}=e,{types:o,typeKey:s=`type`}=e;Array.isArray(r)&&r.forEach(e=>{if(!a&&!o){let{widget:r=`string`}=i??{},a=!!i&&(fdt.includes(r)||!Pk.includes(r));E(e)&&!a&&E8({strKey:`list_field_invalid_default_object`,context:t,collectors:n})}else E(e)?$ut({value:e,fields:a,types:o,typeKey:s,strKeyBase:`list_field`,context:t,collectors:n}):E8({strKey:`list_field_invalid_default_item`,values:{value:String(e)},context:t,collectors:n})})},mdt=({config:e,context:t,collectors:n})=>{let{fields:r}=e,{types:i}=e,{map_key_field:a}=e;if(typeof a!=`string`||!a)return;if(!r&&!i){E8({strKey:`list_field_map_key_no_subfields`,context:t,collectors:n});return}let o=(e,r)=>{let i=e.find(e=>e.name===a);if(!i){E8({strKey:r?`list_field_map_key_missing_in_type`:`list_field_map_key_not_found`,values:{name:a,type:r},context:t,collectors:n});return}let{widget:o=`string`,i18n:s}=i,{required:c=!0}=i;udt.includes(o)||E8({strKey:`list_field_map_key_invalid_type`,values:{name:a,widget:o},context:t,collectors:n}),i.multiple===!0&&E8({strKey:`list_field_map_key_multiple`,values:{name:a},context:t,collectors:n});let{options:l}=i;o===`select`&&Array.isArray(l)&&l.some(e=>typeof(E(e)?e.value:e)!=`string`)&&E8({strKey:`list_field_map_key_option_not_string`,values:{name:a},context:t,collectors:n}),c!==!0&&E8({strKey:`list_field_map_key_not_required`,values:{name:a},context:t,collectors:n}),(s===!1||s===`none`)&&E8({strKey:`list_field_map_key_not_localized`,values:{name:a},context:t,collectors:n})};r?o(r):i.forEach(({name:e,fields:t=[]})=>o(t,e))},hdt=e=>{let{config:t,context:n,collectors:r}=e,{field:i}=t,{fields:a}=t,{types:o}=t,{thumbnail:s}=t,{typedKeyPath:c}=n,l={nameCounts:{},strKeyBase:`variable_type`,collectors:r};i&&a||i&&o||a&&o?E8({strKey:`invalid_list_field`,context:n,collectors:r}):a?.length===0||o?.length===0?E8({strKey:`list_field_no_subfields`,context:n,collectors:r}):(pdt(e),mdt(e),wut({thumbnail:s,fields:w9(t),context:n,collectors:r}),i&&ldt({config:i,context:{...n,typedKeyPath:`${c}.*`},collectors:r}),a&&j9(a,{...n,typedKeyPath:`${c}.*`},r),o?.forEach(({name:e,widget:t=`object`,fields:i},a)=>{let o={...n,typedKeyPath:`${c}.*<${e}>`};O8({...l,name:e,index:a,context:o})&&ddt(t,o,r)&&i&&j9(i,o,r)}))},gdt=[{prop:`valueType`,newProp:`value_type`}],_dt=[`int`,`int/string`],vdt=[`float`,`float/string`],ydt=({config:e,context:t,collectors:n})=>{let{default:r,value_type:i=`int`}=e;if(![`string`,`number`].includes(typeof r))return;let a=_dt.includes(i);if(!a&&!vdt.includes(i))return;let o=typeof r==`string`?(a?Number.parseInt:Number.parseFloat)(r):r;(a?!Number.isInteger(o):!Number.isFinite(o))&&E8({strKey:a?`number_field_default_not_integer`:`number_field_default_not_number`,values:{value:String(r),valueType:i},context:t,collectors:n})},bdt=e=>{let{config:t,context:n,collectors:r}=e,{step:i}=t;ydt(e),typeof i==`number`&&i<=0&&i!==-1&&E8({strKey:`invalid_step`,values:{step:String(i)},context:n,collectors:r}),D8({...e,UNSUPPORTED_OPTIONS:gdt})},xdt=e=>{let{config:t,context:n,collectors:r}=e,{fields:i}=t,{types:a,typeKey:o}=t,{default:s,thumbnail:c}=t,{typedKeyPath:l}=n,u={nameCounts:{},strKeyBase:`variable_type`,collectors:r};i&&a?E8({strKey:`invalid_object_field`,context:n,collectors:r}):i?.length===0||a?.length===0?E8({strKey:`object_field_no_subfields`,context:n,collectors:r}):(E(s)&&$ut({value:s,fields:i,types:a,typeKey:o,strKeyBase:`object_field`,context:n,collectors:r}),wut({thumbnail:c,fields:w9(t),context:n,collectors:r}),i&&j9(i,n,r),a?.forEach(({name:e,fields:t},i)=>{let a={...n,typedKeyPath:`${l}<${e}>`};O8({...u,name:e,index:i,context:a})&&t&&j9(t,a,r)}))},Sdt=[`extension`,`path`,`slug`,`slug_length`,`nested`,`meta`,`index_file`,`reorder`],Cdt=e=>[...e.matchAll(qk)].some(([,e])=>e.split(`|`)[0].trim()===`slug`),wdt=(e,t)=>{let{cmsConfig:n,collection:r}=e,{file:i,format:a,preview_path:o,thumbnail:s}=r;typeof i==`string`&&((Uk(i).extension!==`json`||zA(i))&&E8({strKey:`invalid_collection_data_file`,values:{file:i},context:e,collectors:t}),a!==void 0&&a!==`json`&&E8({strKey:`file_format_mismatch`,values:{extension:`json`,format:a},context:e,collectors:t}),Sdt.forEach(n=>{n in r&&E8({strKey:`unsupported_collection_data_file_option`,values:{prop:n},context:e,collectors:t})}),[[`preview_path`,o],...(Array.isArray(s)?s:[s]).map(e=>[`thumbnail`,e])].forEach(([n,r])=>{typeof r==`string`&&Cdt(r)&&E8({strKey:`collection_data_file_slug_tag`,values:{prop:n},context:e,collectors:t})}),(qq(Kq({cmsConfig:n,collection:r}))||n.backend?.open_authoring)&&E8({strKey:`collection_data_file_workflow`,context:e,collectors:t}))},Tdt=[`slug`,`locale`],Edt=[{prop:`displayFields`,newProp:`display_fields`},{prop:`searchFields`,newProp:`search_fields`},{prop:`valueField`,newProp:`value_field`},{type:`warning`,prop:`options_length`,strKey:`unsupported_ignored_option`}],Ddt=[{option:`value_field`,strKey:`relation_field_invalid_value_field`,list:!1},{option:`display_fields`,strKey:`relation_field_invalid_display_field`,list:!0},{option:`search_fields`,strKey:`relation_field_invalid_search_field`,list:!0}],Odt=({reference:e,strKey:t,fields:n,canonicalSlugKey:r,context:i,collectors:a})=>{let o=[...e.matchAll(qk)].map(([,e])=>e);(o.length?o.filter(e=>!Tdt.includes(e)):[e]).forEach(e=>{let o=_N(e);o!==r&&!T9(n,o)&&E8({strKey:t,context:i,collectors:a,values:{field:e}})})},kdt=({fieldConfig:e,fields:t,canonicalSlugKey:n,orderFieldKey:r,context:i,collectors:a})=>{let{file:o,filters:s,sort_by:c}=e;Array.isArray(s)&&s.forEach(e=>{let r=E(e)?e.field:void 0;if(typeof r==`string`&&r&&r!==`slug`){let e=_N(r);e!==n&&!T9(t,e)&&E8({strKey:`relation_field_invalid_filter_field`,context:i,collectors:a,values:{field:r}})}});let l=E(c)?c.field:void 0;!o&&typeof l==`string`&&l&&!Cut(l,{canonicalSlugKey:n,orderFieldKey:r})&&!T9(t,l)&&E8({strKey:`relation_field_invalid_sort_field`,context:i,collectors:a,values:{field:l}}),Ddt.forEach(({option:r,strKey:o,list:s})=>{let c=e[r];Array.isArray(c)===s&&(s?c:[c]).forEach(e=>{typeof e==`string`&&e&&Odt({reference:e,strKey:o,fields:t,canonicalSlugKey:n,context:i,collectors:a})})})},Adt=({fieldConfig:e,context:t,collectors:n})=>{let{collection:r,value_field:i=`{{slug}}`}=e;Cdt(i)&&E8({strKey:`relation_field_array_file_slug`,context:t,collectors:n,values:{collection:r}})},jdt=({collection:e,context:t,collectors:n})=>{let{cmsConfig:r,collection:i}=t;!i||!(`file`in i)||typeof i.file!=`string`||`divider`in e||`files`in e||!qq(Kq({cmsConfig:r,collection:e}))||E8({strKey:`relation_field_array_file_workflow`,context:t,collectors:n,values:{collection:e.name}})},Mdt=e=>{let{config:t,context:n,collectors:r}=e,i=t,{collection:a,file:o,default:s,multiple:c}=i,{cmsConfig:l}=n;A9({defaultValue:s,multiple:c,context:n,collectors:r});let u=a===`_singletons`?{name:a,files:l?.singletons}:l?.collections?.find(e=>e.name===a),d,f;if(u){let e=`files`in u&&Array.isArray(u.files);o?(e&&(d=u.files.find(e=>`file`in e&&e.name===o)),d||E8({strKey:`relation_field_invalid_collection_file`,context:n,collectors:r,values:{file:o}})):e&&E8({strKey:`relation_field_missing_file_name`,context:n,collectors:r,values:{collection:a}}),f=C9({cmsConfig:l,collection:u,file:d}),`file`in u&&typeof u.file==`string`&&(i.value_field===void 0||typeof i.value_field==`string`)&&Adt({fieldConfig:i,context:n,collectors:r}),jdt({collection:u,context:n,collectors:r})}else E8({strKey:`relation_field_invalid_collection`,context:n,collectors:r,values:{collection:a}});o&&i.sort_by!==void 0&&E8({type:`warning`,strKey:`relation_field_sort_by_file_ignored`,context:n,collectors:r});let p=o?d?.fields:u?.fields;p?.length&&kdt({fieldConfig:i,fields:p,canonicalSlugKey:f,orderFieldKey:sz(u),context:n,collectors:r}),D8({...e,UNSUPPORTED_OPTIONS:Edt}),r.relationFields.add({fieldConfig:i,context:n})},Ndt=[{prop:`editorComponents`,newProp:`editor_components`}],Pdt=e=>{D8({...e,UNSUPPORTED_OPTIONS:Ndt})};Object.assign(cdt,{code:Dut,compute:Lut,datetime:Hut,file:tdt,hidden:rdt,image:tdt,list:hdt,markdown:Pdt,number:bdt,object:xdt,relation:Mdt,richtext:Pdt,select:({config:e,context:t,collectors:n})=>{let{options:r,default:i,multiple:a}=e;if(A9({defaultValue:i,multiple:a,context:t,collectors:n}),!Array.isArray(r))return;if(!r.length){E8({strKey:`select_field_no_options`,context:t,collectors:n});return}let o=r.map(e=>E(e)?e.value:e);new Set(o.filter((e,t)=>o.indexOf(e)!==t)).forEach(e=>{E8({strKey:`select_field_duplicate_option`,values:{value:String(e)},context:t,collectors:n})}),!(i===void 0||i===null&&!o.includes(null))&&(Array.isArray(i)?i:[i]).forEach(e=>{let r=E(e)?e.value:e;o.includes(r)||E8({strKey:`select_field_invalid_default`,values:{value:String(r)},context:t,collectors:n})})}});var Fdt=[`locales`,`default_locale`,`initial_locales`],Idt=(e,t,n)=>{let{locales:r,default_locale:i,initial_locales:a}=e;Array.isArray(r)&&(r.length?(typeof i==`string`&&!r.includes(i)&&E8({strKey:`i18n_invalid_default_locale`,values:{locale:i},context:t,collectors:n}),Array.isArray(a)&&a.forEach(e=>{typeof e==`string`&&!r.includes(e)&&E8({strKey:`i18n_invalid_initial_locale`,values:{locale:e},context:t,collectors:n})})):E8({strKey:`i18n_no_locales`,context:t,collectors:n}))},M9=e=>e.some(e=>z0(e.i18n)||M9(w9(e))),N9=e=>Array.isArray(e)&&!!e.length,Ldt=(e,t)=>{let{i18n:n,collections:r,singletons:i}=e;E(n)&&(Idt(n,{cmsConfig:e},t),(N9(r)||N9(i))&&([...r??[],...i??[]].some(e=>!(`divider`in e)&&!!e.i18n)||E8({strKey:`i18n_no_collections`,context:{cmsConfig:e},collectors:t})))},Rdt=(e,t)=>{let{collection:n,collectionFile:r}=e;if(r){let{fields:n}=r;N9(n)&&!M9(n)&&E8({strKey:`collection_file_i18n_no_fields`,context:e,collectors:t});return}if(`files`in n){let{files:r}=n,i=Array.isArray(r)?r.filter(e=>!(`divider`in e)):[];i.length&&!i.some(e=>!!e.i18n)&&E8({strKey:`collection_i18n_no_files`,context:e,collectors:t});return}let{fields:i,index_file:a}=n;N9(i)&&!M9([...i,...E(a)?a.fields??[]:[]])&&E8({strKey:`collection_i18n_no_fields`,context:e,collectors:t})},zdt=(e,t)=>{let{cmsConfig:n,collection:r,collectionFile:i}=e,{i18n:a}=i??r;if(!a)return;let o=nj({cmsConfig:n,collection:r,file:i});o?(E(a)&&Fdt.some(e=>e in a)&&Idt(o,e,t),Rdt(e,t)):i&&r.i18n&&!E(n?.i18n)||E8({type:`warning`,strKey:`i18n_not_configured`,context:e,collectors:t})},Bdt=(e,t)=>{let{cmsConfig:n,collection:r,collectionFile:i}=e,{file:a,format:o=r.format,fields:s,i18n:c}=i,{preview_path:l,preview_path_date_field:u}=i,{extension:d}=Uk(a);if(x9(d,o,s)&&E8({strKey:`file_format_mismatch`,context:e,values:{extension:d,format:o},collectors:t}),s?.length||E8({strKey:`collection_file_no_fields`,context:e,collectors:t}),zA(a)&&!c&&E8({strKey:`collection_file_i18n_required`,context:e,collectors:t}),zA(a)&&!VA(a)){let o=nj({cmsConfig:n,collection:r,file:i});o?.locales?.length&&zbe(o)&&E8({type:`warning`,strKey:`locale_not_omitted_from_file_path`,values:{file:a},context:e,collectors:t})}zdt(e,t),k9({config:i,context:e,collectors:t}),j9(s,e,t),S9({extension:d,format:o,bodyField:i.body_field??r.body_field,fields:s,context:e,collectors:t}),Eut({pathTemplate:l,dateFieldName:u,fields:s??[],context:e,collectors:t})},Vdt=(e,t)=>{let{cmsConfig:n,collection:r}=e,{files:i}=r,a={nameCounts:{},strKeyBase:`collection_file_name`,collectors:t};i.forEach((e,i)=>{if(`divider`in e)return;let{name:o}=e,s={cmsConfig:n,collection:r,collectionFile:e};O8({...a,name:o,index:i,context:s})&&Bdt(s,t)})},Hdt=({bulkEdit:e,fields:t=[],context:n,collectors:r})=>{E(e)&&Array.isArray(e.fields)&&e.fields.forEach(e=>{let i=N7(t,e);i?drt(i)||E8({strKey:`unsupported_bulk_edit_field`,values:{name:String(e)},context:n,collectors:r}):E8({strKey:`invalid_bulk_edit_field`,values:{name:String(e)},context:n,collectors:r})})},Udt=({collection:e,context:t,collectors:n})=>{let{fields:r,filter:i}=e;if(!E(i))return;let{field:a,value:o,pattern:s}=i;typeof a==`string`&&a&&!sB.includes(a)&&a!==C9({cmsConfig:t.cmsConfig,collection:e})&&r?.length&&!T9(r,a)&&E8({strKey:`invalid_filter_field`,values:{name:a},context:t,collectors:n}),o===void 0&&s===void 0&&E8({strKey:`invalid_filter_no_condition`,context:t,collectors:n}),k8({option:`filter`,pattern:s,context:t,collectors:n})},Wdt=({collection:e,context:t,collectors:n})=>{let{create:r=!0,fields:i,identifier_field:a}=e;if(!i?.length)return;if(a!==void 0){typeof a==`string`&&!T9(i,a)&&E8({strKey:`invalid_identifier_field`,values:{name:a},context:t,collectors:n});return}let o=Z0(e);r&&Y0(e)===void 0&&!o.editorRequired&&!o.autoIncrement&&!T9(i,`title`)&&E8({type:`warning`,strKey:`missing_identifier_field`,values:{name:`title`},context:t,collectors:n})},Gdt=[ej.SINGLE_FILE,ej.SINGLE_FILE_DEFAULT_ROOT],Kdt=({collection:e,context:t,collectors:n})=>{let{cmsConfig:r}=t,{slug:i,folder:a}=e,o=Y0(e);if(X0(o)&&eA(`slug_editor_tag`),o?.includes(`/`)&&E8({strKey:`invalid_slug_slash`,values:{slug:o},context:t,collectors:n}),!E(i))return;let{pattern:s,i18n:c,auto_increment:l}=i;if(l===!0&&o!==void 0&&E8({type:`warning`,strKey:`slug_template_ignored`,context:t,collectors:n}),Array.isArray(s)&&k8({option:`pattern`,pattern:s[0],context:t,collectors:n}),c===!0){let i=nj({cmsConfig:r,collection:e}),o=i?.structure??ej.SINGLE_FILE;(!i?.locales?.length||Gdt.includes(o)&&!(typeof a==`string`&&zA(a)))&&E8({type:`warning`,strKey:`slug_i18n_ineffective`,context:t,collectors:n})}},qdt=[...Yk,...Object.keys(Qk),`slug`,`_slug`,`fields._slug`],Jdt=[`slug`,`locales`,`dirname`,`filename`,`extension`,`commit_date`,`commit_author`,`title`,`fields.title`],Ydt=({collection:e,context:t,collectors:n})=>{let{fields:r,path:i,summary:a,thumbnail:o}=e;if(!r?.length)return;let s={fields:r,context:t,collectors:n};E9({...s,option:`slug`,template:Y0(e),specialTags:qdt}),E9({...s,option:`path`,template:i,specialTags:qdt}),E9({...s,option:`summary`,template:a,specialTags:Jdt}),(typeof o==`string`||Array.isArray(o))&&(Array.isArray(o)?o:[o]).forEach(e=>{typeof e==`string`&&e.startsWith(`/`)?E9({...s,option:`thumbnail`,template:e,prefixedOnly:!0}):E9({...s,option:`thumbnail`,keyPaths:e})})},Xdt=({config:e,options:t,fields:n,specialKeys:r,optionType:i,context:a,collectors:o})=>{let s=E(e),c={};t.forEach((e,t)=>{let{name:l,field:u,pattern:d}=E(e)?e:{};O8({name:l,index:t,nameCounts:c,strKeyBase:`${i}_name`,context:a,collectors:o,required:s}),i===`view_filter`&&E(e)&&d===void 0&&(Wz(e)||E8({strKey:`invalid_view_filter_no_condition`,values:{count:String(t+1)},context:a,collectors:o})),typeof u==`string`&&u&&!r.includes(u)&&(T9(n,u)||E8({strKey:`invalid_${i}_field`,values:{name:u},context:a,collectors:o}))});let l=E(e)?e.default:void 0;typeof l==`string`&&l&&(t.some(e=>E(e)&&e.name===l)||E8({strKey:`invalid_${i}_default`,values:{name:l},context:a,collectors:o}))},Zdt=(e,t)=>{let{fields:n,sortable_fields:r,table_columns:i,view_groups:a,view_filters:o}=e.collection;if(!n?.length)return;let s=C9({cmsConfig:e.cmsConfig,collection:e.collection}),c=[...sB,...s?[s]:[]];if(r){let{keys:i,defaultKey:a}=oB(r),o=sz(e.collection);[...i,a].forEach(r=>{r&&r!==`_summary`&&!Cut(r,{canonicalSlugKey:s,orderFieldKey:o})&&!T9(n,r)&&E8({strKey:`invalid_sortable_field`,values:{name:r},context:e,collectors:t})})}let l=lB(e.collection);if(l){let r=Array.isArray(i)?`table_columns`:`summary_fields`;l.forEach(({key:i})=>{typeof i==`string`&&cB(i)?E9({option:r,template:i,specialTags:Jdt,fields:n,context:e,collectors:t}):typeof i==`string`&&i&&i!==`_summary`&&!c.includes(i)&&!T9(n,i)&&E8({strKey:`invalid_table_column_field`,values:{option:r,name:i},context:e,collectors:t})})}Xdt({config:a,options:iB(a,`groups`).options,fields:n,specialKeys:c,optionType:`view_group`,context:e,collectors:t}),Xdt({config:o,options:iB(o,`filters`).options,fields:n,specialKeys:c,optionType:`view_filter`,context:e,collectors:t})},Qdt=e=>e[0]===`draft`&&e.every((t,n)=>n===0||dq.indexOf(t)>dq.indexOf(e[n-1])),$dt=({value:e,context:t,collectors:n})=>{e&&typeof e==`object`&&Array.isArray(e.stages)&&(Qdt(e.stages)||E8({strKey:`invalid_publish_mode_stages`,context:t,collectors:n}),(e.type===`preview`||e.type===`simple`)&&E8({type:`warning`,strKey:`publish_mode_stages_ignored`,values:{type:e.type},context:t,collectors:n}))},eft=[{prop:`sortableFields`,newProp:`sortable_fields`}],tft=(e,t)=>{let{cmsConfig:n,collection:r}=e,{body_field:i,extension:a,fields:o,folder:s,format:c,index_file:l,preview_path:u,preview_path_date_field:d,reorder:f,bulk_edit:p,slug_length:m,view_groups:h}=r;if(x9(a,c)&&E8({strKey:`file_format_mismatch`,values:{extension:a,format:c},context:e,collectors:t}),m!==void 0&&eA(`slug_length`),D8({UNSUPPORTED_OPTIONS:eft,config:r,context:e,collectors:t}),o?.length||E8({strKey:`collection_no_fields`,context:e,collectors:t}),wdt(e,t),typeof s==`string`&&zA(s)&&(nj({cmsConfig:n,collection:r})?.locales?.length||E8({strKey:`collection_folder_i18n_required`,context:e,collectors:t}),kbe(s)||E8({strKey:`invalid_collection_folder_locale`,values:{folder:s},context:e,collectors:t})),j9(o,e,t),S9({extension:a,format:c,bodyField:i,fields:o,context:e,collectors:t}),Wdt({collection:r,context:e,collectors:t}),Kdt({collection:r,context:e,collectors:t}),Ydt({collection:r,context:e,collectors:t}),Udt({collection:r,context:e,collectors:t}),l){E(l)&&x9(l.extension,l.format)&&E8({strKey:`file_format_mismatch`,values:{extension:l.extension,format:l.format},context:{cmsConfig:n,collection:r,isIndexFile:!0},collectors:t});let e={cmsConfig:n,collection:r,isIndexFile:!0},s=l===!0?o:l.fields??o;if(j9(s,e,t),E(l)){let{extension:n,format:r,fields:o}=l,u=n!==void 0||r!==void 0;(o||u)&&S9({...u?{extension:n,format:r}:{extension:a,format:c},bodyField:i,fields:s,context:e,collectors:t})}}let g=cz({reorder:f});if(g){let{options:n}=iB(h,`groups`);n.some(({name:e})=>e===g)||E8({strKey:`invalid_reorder_group`,values:{name:g},context:e,collectors:t})}Hdt({bulkEdit:p,fields:o,context:e,collectors:t}),Eut({pathTemplate:u,dateFieldName:d,fields:[...o??[],...E(l)?l.fields??[]:[]],context:e,collectors:t}),Zdt(e,t)},nft=({cmsConfig:e,collection:t},n)=>{let r=`divider`in t,i=`files`in t,a=`folder`in t,o=`file`in t,s=[r,i,a,o].filter(Boolean).length;s?s>1?E8({strKey:`invalid_collection_multiple_options`,context:{cmsConfig:e,collection:t},collectors:n}):(zdt({cmsConfig:e,collection:t},n),k9({config:t,context:{cmsConfig:e,collection:t},collectors:n}),$dt({value:t.publish_mode,context:{cmsConfig:e,collection:t},collectors:n}),i?Vdt({cmsConfig:e,collection:t},n):(a||o)&&tft({cmsConfig:e,collection:t},n)):E8({strKey:`invalid_collection_no_options`,context:{cmsConfig:e,collection:t},collectors:n})},rft=(e,t)=>{let{collections:n,singletons:r}=e,{errors:i}=t;if(!Array.isArray(n)&&!Array.isArray(r)){i.add(Y(`config.error.no_collection`));return}n?.some(e=>!(`divider`in e)&&!e.hide)||r?.length||i.add(Y(`config.error.no_visible_collection`));let a={nameCounts:{},strKeyBase:`collection_name`,collectors:t};n?.forEach((n,r)=>{if(`divider`in n)return;let{name:i}=n,o={cmsConfig:e,collection:n};O8({...a,name:i,index:r,context:o})&&nft(o,t)}),Array.isArray(r)&&Vdt({cmsConfig:e,collection:{name:`_singletons`,label:Y(`singletons`),label_singular:Y(`singleton`),files:r}},t)},ift=(e,t)=>{let{encoding:n=`unicode`,sanitize_replacement:r}=e.slug??{};typeof r==`string`&&r&&(n===`ascii`?AN:kN).test(r.replaceAll(` `,``))&&E8({strKey:`invalid_sanitize_replacement`,values:{replacement:r},context:{cmsConfig:e},collectors:t})},aft=[{type:`warning`,prop:`local_backend`,strKey:`unsupported_ignored_option`},{type:`warning`,prop:`locale`,strKey:`unsupported_ignored_option`},{type:`warning`,prop:`search`,strKey:`unsupported_ignored_option`}],oft=[`site_url`],sft=(e,t)=>{hut(e,t),oft.forEach(n=>{let r=e[n];mA(r)&&!hA(r)&&E8({strKey:`invalid_url_option`,values:{option:n,url:r},context:{cmsConfig:e},collectors:t})}),e.logo_url!==void 0&&eA(`logo_url`),$dt({value:e.publish_mode,context:{cmsConfig:e},collectors:t}),qut(e,t),Zut({config:e,context:{cmsConfig:e},collectors:t}),ift(e,t),Ldt(e,t),rft(e,t),D8({UNSUPPORTED_OPTIONS:aft,config:e,context:{cmsConfig:e},collectors:t}),tk.forEach((n,r)=>{X$e({definition:n,componentName:r,cmsConfig:e,collectors:t}),j9(n.fields,{cmsConfig:e,componentName:r},t)})},P9=e=>{let t=0,n=0;return e.split(`/`).forEach(e=>{e===`..`?(--t,n=Math.min(n,t)):e&&e!==`.`&&(t+=1)}),-n},cft=(e,{collectionName:t,fileName:n})=>{if(n||t===`_singletons`)return 0;let r=e.collections?.find(e=>!(`divider`in e)&&`name`in e&&e.name===t);if(r&&`folder`in r&&!r.nested)return(r.path??``).split(`/`).length-1+(r.i18n||e.i18n?1:0)},lft=({config:e,entryFolders:t,assetFolders:n,collectors:r})=>{if(!AU())return;let i=new Set;t.forEach(({folderPath:e,folderPathMap:t,filePathMap:n})=>{[e,...Object.values(t??{}),...Object.values(n??{})].filter(e=>e!==void 0&&P9(e)>0).forEach(e=>i.add(e))}),n.forEach(t=>{let{internalPath:n,internalSubPath:r,entryRelative:a}=t;if(n===void 0)return;if(!a){P9(n)>0&&i.add(n);return}let o=cft(e,t),s=[n,r].filter(Boolean).join(`/`);o!==void 0&&P9(s)>o&&i.add(s)}),i.forEach(e=>{r.errors.add(Y(`config.error.path_outside_root_dir`,{values:{path:e}}))})},uft={$schema:`http://json-schema.org/draft-07/schema#`,$id:`http://json-schema.org/draft-07/schema#`,title:`Core schema meta-schema`,definitions:{schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},type:[`object`,`boolean`],properties:{$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},default:!0},F9=e=>e.replaceAll(`~1`,`/`).replaceAll(`~0`,`~`),I9=e=>e.replace(/^#/,``).split(`/`).filter(Boolean).map(F9),dft=[`widget`,`name`],fft=8,pft=(e,t)=>{let n=new Set,r=t;for(;E(r)&&typeof r.$ref==`string`;){if(n.has(r.$ref))return;n.add(r.$ref),r=I9(r.$ref).reduce((e,t)=>e?.[t],e)}return E(r)?r:void 0},L9=(e,t,n=0)=>{let r=pft(e,t);return!r||n>fft?[]:Array.isArray(r.anyOf)?r.anyOf.flatMap(t=>L9(e,t,n+1)):E(r.properties)?[r]:[]},mft=(e,t)=>{let n=e.properties?.[t];if(E(n))return n.const===void 0?Array.isArray(n.enum)?n.enum:void 0:[n.const]},hft=(e,t,n)=>{let r=L9(e,t);if(!r.length)return;let i=[],a=!1;if(r.every(e=>{let t=mft(e,n);return t?(i.push(...t),a||=!(e.required??[]).includes(n),!0):!1}))return{values:[...new Set(i)],optional:a}},gft=(e,t)=>{let n=L9(e,t);if(n.length)return n.map(e=>new Set(e.required??[])).reduce((e,t)=>e.intersection(t))},_ft=(e,t)=>new Set(L9(e,t).flatMap(e=>Object.keys(e.properties))),R9=(e,t)=>({properties:{[e]:t.length===1?{const:t[0]}:{enum:t}}}),vft=(e,t)=>e.reduceRight((e,{condition:t,branch:n})=>({if:t,then:n,else:e}),t),yft=(e,t,n)=>dft.reduce((r,i)=>{if(r)return r;let a=t.map(t=>hft(e,t,i)),o=a.filter(Boolean),s=o.flatMap(e=>e.values);return!o.length||a.length-o.length>1||s.length!==new Set(s).size?void 0:vft(n.map((e,t)=>({branch:e,tag:a[t]})).filter(e=>!!e.tag).sort((e,t)=>Number(e.tag?.optional)-Number(t.tag?.optional)).map(({branch:e,tag:t})=>({branch:e,condition:t?.optional?R9(i,t.values):{required:[i],...R9(i,t?.values)}})),n.filter((e,t)=>!a[t])[0]??{required:[i],...R9(i,s)})},void 0),bft=(e,t,n)=>{let r=t.map(t=>gft(e,t));if(r.some(e=>!e))return;let i=r,a=t.map(t=>_ft(e,t)),o=i.map((e,t)=>{let n=a.reduce((e,n,r)=>t===r?e:e.union(n),new Set);return[...e.difference(n)]});if(o.filter(e=>!e.length).length>1)return;let s=n.map((e,t)=>({branch:e,markers:o[t]})).filter(e=>e.markers.length).map(({branch:e,markers:t})=>({branch:e,condition:t.length===1?{required:[t[0]]}:{anyOf:t.map(e=>({required:[e]}))}})),c=o.findIndex(e=>!e.length);return vft(s,c>-1?n[c]:{anyOf:s.map(({condition:e})=>e)})},z9=(e,{allowUnknownProperties:t=!1}={})=>{let n=r=>{if(Array.isArray(r))return r.map(n);if(!E(r))return r;let i={};if(Object.entries(r).forEach(([e,r])=>{e!==`anyOf`&&!(t&&e===`additionalProperties`&&r===!1)&&(i[e]=n(r))}),Array.isArray(r.anyOf)){let t=r.anyOf.map(n),a=r.anyOf.length>1?yft(e,r.anyOf,t)??bft(e,r.anyOf,t):void 0;a?Object.assign(i,a):i.anyOf=t}return i};return n(e)};function B9(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(!B9(e[r],t[r]))return!1;return!0}if(n===`object`){if(!e||!t)return e===t;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!B9(e[r],t[r]))return!1;return!0}return e===t}function V9(e){return encodeURI(xft(e))}function xft(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}var Sft={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},Cft={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},wft={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},Tft=typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);function H9(e,t=Object.create(null),n=Tft,r=``){if(e&&typeof e==`object`&&!Array.isArray(e)){let i=e.$id||e.id;if(i){let a=new URL(i,n.href);a.hash.length>1?t[a.href]=e:(a.hash=``,r===``?n=a:H9(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(wft[i])continue;let a=`${r}/${V9(i)}`,o=e[i];if(Array.isArray(o)){if(Sft[i]){let e=o.length;for(let r=0;r<e;r++)H9(o[r],t,n,`${a}/${r}`)}}else if(Cft[i])for(let e in o)H9(o[e],t,n,`${a}/${V9(e)}`);else H9(o,t,n,a)}return t}var Eft=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Dft=[0,31,28,31,30,31,30,31,31,30,31,30,31],Oft=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,kft=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,Aft=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,jft=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Mft=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Nft=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Pft=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Fft=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Ift=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Lft=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},Rft=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,zft=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Bft=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function U9(e){return e.test.bind(e)}var Vft={date:Uft,time:Wft.bind(void 0,!1),"date-time":Kft,duration:Bft,uri:Yft,"uri-reference":U9(Aft),"uri-template":U9(jft),url:U9(Mft),email:Lft,hostname:U9(kft),ipv4:U9(Rft),ipv6:U9(zft),regex:Zft,uuid:U9(Nft),"json-pointer":U9(Pft),"json-pointer-uri-fragment":U9(Fft),"relative-json-pointer":U9(Ift)};function Hft(e){return e%4==0&&(e%100!=0||e%400==0)}function Uft(e){let t=e.match(Eft);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&Hft(n)?29:Dft[r])}function Wft(e,t){let n=t.match(Oft);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var Gft=/t|\s/i;function Kft(e){let t=e.split(Gft);return t.length==2&&Uft(t[0])&&Wft(!0,t[1])}var qft=/\/|:/,Jft=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function Yft(e){return qft.test(e)&&Jft.test(e)}var Xft=/[^\\]\\Z/;function Zft(e){if(Xft.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function Qft(e){let t=0,n=e.length,r=0,i;for(;r<n;)t++,i=e.charCodeAt(r++),i>=55296&&i<=56319&&r<n&&(i=e.charCodeAt(r),(i&64512)==56320&&r++);return t}function W9(e,t,n=`2019-09`,r=H9(t),i=!0,a=null,o=`#`,s=`#`,c=Object.create(null)){if(t===!0)return{valid:!0,errors:[]};if(t===!1)return{valid:!1,errors:[{instanceLocation:o,keyword:`false`,keywordLocation:o,error:`False boolean schema.`}]};let l=typeof e,u;switch(l){case`boolean`:case`number`:case`string`:u=l;break;case`object`:u=e===null?`null`:Array.isArray(e)?`array`:`object`;break;default:throw Error(`Instances of "${l}" type are not supported.`)}let{$ref:d,$recursiveRef:f,$recursiveAnchor:p,type:m,const:h,enum:g,required:_,not:v,anyOf:y,allOf:b,oneOf:x,if:S,then:C,else:w,format:T,properties:ee,patternProperties:te,additionalProperties:ne,unevaluatedProperties:re,minProperties:ie,maxProperties:ae,propertyNames:oe,dependentRequired:se,dependentSchemas:ce,dependencies:le,prefixItems:ue,items:de,additionalItems:fe,unevaluatedItems:pe,contains:me,minContains:he,maxContains:ge,minItems:_e,maxItems:ve,uniqueItems:ye,minimum:be,maximum:xe,exclusiveMinimum:Se,exclusiveMaximum:Ce,multipleOf:we,minLength:Te,maxLength:Ee,pattern:De,__absolute_ref__:Oe,__absolute_recursive_ref__:ke}=t,Ae=[];if(p===!0&&a===null&&(a=t),f===`#`){let l=a===null?r[ke]:a,u=`${s}/$recursiveRef`,d=W9(e,a===null?t:a,n,r,i,l,o,u,c);d.valid||Ae.push({instanceLocation:o,keyword:`$recursiveRef`,keywordLocation:u,error:`A subschema had errors.`},...d.errors)}if(d!==void 0){let t=r[Oe||d];if(t===void 0){let e=`Unresolved $ref "${d}".`;throw Oe&&Oe!==d&&(e+=` Absolute URI "${Oe}".`),e+=`\nKnown schemas:\n- ${Object.keys(r).join(`
- `)}`,Error(e)}let l=`${s}/$ref`,u=W9(e,t,n,r,i,a,o,l,c);if(u.valid||Ae.push({instanceLocation:o,keyword:`$ref`,keywordLocation:l,error:`A subschema had errors.`},...u.errors),n===`4`||n===`7`)return{valid:Ae.length===0,errors:Ae}}if(Array.isArray(m)){let t=m.length,n=!1;for(let r=0;r<t;r++)if(u===m[r]||m[r]===`integer`&&u===`number`&&e%1==0&&e===e){n=!0;break}n||Ae.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m.join(`", "`)}".`})}else m===`integer`?(u!==`number`||e%1||e!==e)&&Ae.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`}):m!==void 0&&u!==m&&Ae.push({instanceLocation:o,keyword:`type`,keywordLocation:`${s}/type`,error:`Instance type "${u}" is invalid. Expected "${m}".`});if(h!==void 0&&(u===`object`||u===`array`?B9(e,h)||Ae.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`}):e!==h&&Ae.push({instanceLocation:o,keyword:`const`,keywordLocation:`${s}/const`,error:`Instance does not match ${JSON.stringify(h)}.`})),g!==void 0&&(u===`object`||u===`array`?g.some(t=>B9(e,t))||Ae.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||Ae.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;W9(e,v,n,r,i,a,o,t).valid&&Ae.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let je=[];if(y!==void 0){let t=`${s}/anyOf`,l=Ae.length,u=!1;for(let s=0;s<y.length;s++){let l=y[s],d=Object.create(c),f=W9(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);Ae.push(...f.errors),u||=f.valid,f.valid&&je.push(d)}u?Ae.length=l:Ae.splice(l,0,{instanceLocation:o,keyword:`anyOf`,keywordLocation:t,error:`Instance does not match any subschemas.`})}if(b!==void 0){let t=`${s}/allOf`,l=Ae.length,u=!0;for(let s=0;s<b.length;s++){let l=b[s],d=Object.create(c),f=W9(e,l,n,r,i,p===!0?a:null,o,`${t}/${s}`,d);Ae.push(...f.errors),u&&=f.valid,f.valid&&je.push(d)}u?Ae.length=l:Ae.splice(l,0,{instanceLocation:o,keyword:`allOf`,keywordLocation:t,error:`Instance does not match every subschema.`})}if(x!==void 0){let t=`${s}/oneOf`,l=Ae.length,u=x.filter((s,l)=>{let u=Object.create(c),d=W9(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return Ae.push(...d.errors),d.valid&&je.push(u),d.valid}).length;u===1?Ae.length=l:Ae.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...je),S!==void 0){let t=`${s}/if`;if(W9(e,S,n,r,i,a,o,t,c).valid){if(C!==void 0){let l=W9(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||Ae.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(w!==void 0){let l=W9(e,w,n,r,i,a,o,`${s}/else`,c);l.valid||Ae.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)t in e||Ae.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(ie!==void 0&&t.length<ie&&Ae.push({instanceLocation:o,keyword:`minProperties`,keywordLocation:`${s}/minProperties`,error:`Instance does not have at least ${ie} properties.`}),ae!==void 0&&t.length>ae&&Ae.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${ae} properties.`}),oe!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${V9(s)}`,c=W9(s,oe,n,r,i,a,e,t);c.valid||Ae.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(se!==void 0){let t=`${s}/dependantRequired`;for(let n in se)if(n in e){let r=se[n];for(let i of r)i in e||Ae.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(ce!==void 0)for(let t in ce){let l=`${s}/dependentSchemas`;if(t in e){let s=W9(e,ce[t],n,r,i,a,o,`${l}/${V9(t)}`,c);s.valid||Ae.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:l,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(le!==void 0){let t=`${s}/dependencies`;for(let s in le)if(s in e){let c=le[s];if(Array.isArray(c))for(let n of c)n in e||Ae.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=W9(e,c,n,r,i,a,o,`${t}/${V9(s)}`);l.valid||Ae.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(ee!==void 0){let t=`${s}/properties`;for(let s in ee){if(!(s in e))continue;let d=`${o}/${V9(s)}`,f=W9(e[s],ee[s],n,r,i,a,d,`${t}/${V9(s)}`);if(f.valid)c[s]=l[s]=!0;else if(u=i,Ae.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...f.errors),u)break}}if(!u&&te!==void 0){let t=`${s}/patternProperties`;for(let s in te){let d=new RegExp(s,`u`),f=te[s];for(let p in e){if(!d.test(p))continue;let m=`${o}/${V9(p)}`,h=W9(e[p],f,n,r,i,a,m,`${t}/${V9(s)}`);h.valid?c[p]=l[p]=!0:(u=i,Ae.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&ne!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${V9(s)}`,f=W9(e[s],ne,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,Ae.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&re!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${V9(s)}`,u=W9(e[s],re,n,r,i,a,l,t);u.valid?c[s]=!0:Ae.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){ve!==void 0&&e.length>ve&&Ae.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${ve}).`}),_e!==void 0&&e.length<_e&&Ae.push({instanceLocation:o,keyword:`minItems`,keywordLocation:`${s}/minItems`,error:`Array has too few items (${e.length} < ${_e}).`});let t=e.length,l=0,u=!1;if(ue!==void 0){let d=`${s}/prefixItems`,f=Math.min(ue.length,t);for(;l<f;l++){let t=W9(e[l],ue[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,Ae.push({instanceLocation:o,keyword:`prefixItems`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}if(de!==void 0){let d=`${s}/items`;if(Array.isArray(de)){let s=Math.min(de.length,t);for(;l<s;l++){let t=W9(e[l],de[l],n,r,i,a,`${o}/${l}`,`${d}/${l}`);if(c[l]=!0,!t.valid&&(u=i,Ae.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}}else for(;l<t;l++){let t=W9(e[l],de,n,r,i,a,`${o}/${l}`,d);if(c[l]=!0,!t.valid&&(u=i,Ae.push({instanceLocation:o,keyword:`items`,keywordLocation:d,error:`Items did not match schema.`},...t.errors),u))break}if(!u&&fe!==void 0){let d=`${s}/additionalItems`;for(;l<t;l++){let t=W9(e[l],fe,n,r,i,a,`${o}/${l}`,d);c[l]=!0,t.valid||(u=i,Ae.push({instanceLocation:o,keyword:`additionalItems`,keywordLocation:d,error:`Items did not match additional items schema.`},...t.errors))}}}if(me!==void 0){if(t===0&&he===void 0)Ae.push({instanceLocation:o,keyword:`contains`,keywordLocation:`${s}/contains`,error:`Array is empty. It must contain at least one item matching the schema.`});else if(he!==void 0&&t<he)Ae.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array has less items (${t}) than minContains (${he}).`});else{let l=`${s}/contains`,u=Ae.length,d=0;for(let s=0;s<t;s++){let t=W9(e[s],me,n,r,i,a,`${o}/${s}`,l);t.valid?(c[s]=!0,d++):Ae.push(...t.errors)}d>=(he||0)&&(Ae.length=u),he===void 0&&ge===void 0&&d===0?Ae.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):he!==void 0&&d<he?Ae.push({instanceLocation:o,keyword:`minContains`,keywordLocation:`${s}/minContains`,error:`Array must contain at least ${he} items matching schema. Only ${d} items were found.`}):ge!==void 0&&d>ge&&Ae.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${ge} items matching schema. ${d} items were found.`})}}if(!u&&pe!==void 0){let u=`${s}/unevaluatedItems`;for(;l<t;l++){if(c[l])continue;let t=W9(e[l],pe,n,r,i,a,`${o}/${l}`,u);c[l]=!0,t.valid||Ae.push({instanceLocation:o,keyword:`unevaluatedItems`,keywordLocation:u,error:`Items did not match unevaluated items schema.`},...t.errors)}}if(ye)for(let n=0;n<t;n++){let r=e[n],i=typeof r==`object`&&!!r;for(let a=0;a<t;a++){if(n===a)continue;let t=e[a];(r===t||i&&typeof t==`object`&&t&&B9(r,t))&&(Ae.push({instanceLocation:o,keyword:`uniqueItems`,keywordLocation:`${s}/uniqueItems`,error:`Duplicate items at indexes ${n} and ${a}.`}),n=2**53-1,a=2**53-1)}}}else if(u===`number`){if(n===`4`?(be!==void 0&&(Se===!0&&e<=be||e<be)&&Ae.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${Se?`or equal to `:``} ${be}.`}),xe!==void 0&&(Ce===!0&&e>=xe||e>xe)&&Ae.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${Ce?`or equal to `:``} ${xe}.`})):(be!==void 0&&e<be&&Ae.push({instanceLocation:o,keyword:`minimum`,keywordLocation:`${s}/minimum`,error:`${e} is less than ${be}.`}),xe!==void 0&&e>xe&&Ae.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${xe}.`}),Se!==void 0&&e<=Se&&Ae.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${Se}.`}),Ce!==void 0&&e>=Ce&&Ae.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${Ce}.`})),we!==void 0){let t=e%we;Math.abs(0-t)>=1.1920929e-7&&Math.abs(we-t)>=1.1920929e-7&&Ae.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${we}.`})}}else if(u===`string`){let t=Te===void 0&&Ee===void 0?0:Qft(e);Te!==void 0&&t<Te&&Ae.push({instanceLocation:o,keyword:`minLength`,keywordLocation:`${s}/minLength`,error:`String is too short (${t} < ${Te}).`}),Ee!==void 0&&t>Ee&&Ae.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${Ee}).`}),De!==void 0&&!new RegExp(De,`u`).test(e)&&Ae.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),T!==void 0&&Vft[T]&&!Vft[T](e)&&Ae.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${T}".`})}return{valid:Ae.length===0,errors:Ae}}var $ft=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=H9(e)}validate(e){return W9(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),H9(e,this.lookup)}},ept=`7`,tpt=[`$ref`,`properties`,`items`,`if`,`allOf`,`oneOf`,`additionalProperties`],G9=`false`,npt={type:`type`,enum:`allowedValues`,const:`allowedValue`,minItems:`limit`,maxItems:`limit`,minLength:`limit`,maxLength:`limit`},rpt=(e,t)=>I9(t).reduce((t,n)=>n===`$ref`&&E(t)&&typeof t.$ref==`string`?I9(t.$ref).reduce((e,t)=>e?.[t],e):t?.[n],e),ipt=(e,t)=>I9(t).reduce((e,t)=>e?.[t],e),apt=({keyword:e,keywordLocation:t,instanceLocation:n},r,i)=>{let a=n.replace(/^#/,``);if(e===`required`){let o=rpt(r,t),s=ipt(i,n);return!Array.isArray(o)||!E(s)?[]:o.filter(e=>!(e in s)).map(t=>({instancePath:a,keyword:e,params:{missingProperty:t}}))}let o=npt[e];return[{instancePath:a,keyword:e,params:o?{[o]:rpt(r,t)}:{}}]},opt=e=>{let t=e.filter(({keyword:e})=>e!==G9).map(({instanceLocation:e})=>e);return e.filter(({keyword:e,instanceLocation:n})=>e===G9&&!t.some(e=>e===n||e.startsWith(`${n}/`))).map(({instanceLocation:e})=>{let t=e.replace(/^#/,``),n=t.lastIndexOf(`/`);return{instancePath:t.slice(0,n),keyword:`additionalProperties`,params:{additionalProperty:F9(t.slice(n+1))}}})},K9=e=>{let t=new $ft(structuredClone(e),ept,!1);return n=>{let{valid:r,errors:i}=t.validate(n);if(r)return[];let a=new Set;return opt(i).concat(i.filter(({keyword:e})=>e!==G9&&!tpt.includes(e)).filter(({keyword:e,instanceLocation:t,keywordLocation:n})=>{if(e!==`required`)return!0;let r=`${t}|${n}`;return!a.has(r)&&(a.add(r),!0)}).flatMap(t=>apt(t,e,n)))}},spt=()=>{let e=[],t;return rk.forEach(({schema:n},r)=>{E(n)&&(t??=K9(uft),t(n).length?console.warn(`Ignoring the invalid schema registered for the \`${r}\` field type`):e.push({if:{required:[`widget`],properties:{widget:{const:r}}},then:z9(n,{allowUnknownProperties:!0})}))}),e},cpt=e=>{let t=e.definitions?.CustomField,n=E(t)?spt():[];return n.length?{...e,definitions:{...e.definitions,CustomField:{allOf:[t,...n]}}}:e},lpt=[`string`,`number`,`integer`,`boolean`,`array`,`object`,`null`],q9=e=>qA(Jc.current,{type:`disjunction`}).format(e),upt=e=>`\`${typeof e==`string`&&e?e:JSON.stringify(e)}\``,dpt=e=>Y(`config.error.schema_value_type.${e}`),J9=e=>e.reduce((e,t)=>uM(t)?`${e}[${t}]`:e?`${e}.${t}`:t,``),fpt=(e,t,n)=>{let r=t?.widget===`list`?`${e}.*`:e;return r?`${r}.${n}`:n},ppt=(e,t)=>{let n=t.split(`/`).slice(1).map(F9),r={},i=[],a=e,o=``,s=0,c=!0;for(;s<n.length&&c;){let t=n[s],i=n[s+1],l=i!==void 0&&uM(i)?a?.[t]?.[i]:void 0;E(l)&&a===e&&(t===`collections`||t===`singletons`)?(r[t===`collections`?`collection`:`collectionFile`]=l,a=l,s+=2):E(l)&&t===`files`&&r.collection?(r.collectionFile=l,a=l,s+=2):E(l)&&t===`fields`?(o=fpt(o,a,l.name),a=l,s+=2):E(l)&&t===`types`?(o=`${o}${a?.widget===`list`?`.*`:``}<${l.name}>`,a=l,s+=2):t===`field`&&E(a?.field)?(o=fpt(o,a,a.field.name),a=a.field,s+=1):c=!1}return i.push(...n.slice(s)),o&&(r.typedKeyPath=o),{context:r,option:i}},mpt=({keyword:e,params:t},n)=>e===`enum`?{strKey:`schema_invalid_enum`,values:{option:n,values:q9(t.allowedValues.map(upt))}}:e===`const`?t.allowedValue===``?{strKey:`schema_invalid_empty_value`,values:{option:n}}:{strKey:`schema_invalid_const`,values:{option:n,value:String(t.allowedValue)}}:e===`minItems`||e===`maxItems`?{strKey:`schema_invalid_item_count`,values:{option:n,count:String(t.limit)}}:{strKey:`schema_invalid_value`,values:{option:n}},hpt=({config:e,errors:t,collectors:n})=>{t.filter(({keyword:e})=>e===`additionalProperties`).forEach(({instancePath:t,params:r})=>{let{context:i,option:a}=ppt(e,t);E8({type:`warning`,strKey:`schema_unknown_option`,values:{option:J9([...a,r.additionalProperty])},context:i,collectors:n})});let r=t.filter(({keyword:e})=>e!==`if`&&e!==`additionalProperties`),i=[...new Set(r.map(({instancePath:e})=>e))];i.filter(e=>!i.some(t=>t.startsWith(`${e}/`))).forEach(t=>{let i=r.filter(({instancePath:e})=>e===t),{context:a,option:o}=ppt(e,t),s=i.some(({keyword:e})=>e===`anyOf`),c=i.filter(({keyword:e})=>e===`required`).map(({params:e})=>J9([...o,e.missingProperty])),l=i.filter(({keyword:e})=>e!==`required`&&e!==`anyOf`),u=[...new Set(l.filter(({keyword:e,params:t})=>e===`type`&&lpt.includes(t.type)).map(({params:e})=>e.type))];c.length>1&&s?E8({strKey:`schema_missing_one_of`,values:{options:q9([...new Set(c)].map(upt))},context:a,collectors:n}):[...new Set(c)].forEach(e=>{E8({strKey:`schema_missing_option`,values:{option:e},context:a,collectors:n})}),u.length&&E8({strKey:`schema_invalid_type`,values:{option:J9(o),type:q9(u.map(dpt))},context:a,collectors:n}),l.filter(({keyword:e,params:t})=>!(e===`type`&&lpt.includes(t.type))).forEach(e=>{E8({...mpt(e,J9(o)),context:a,collectors:n})}),!c.length&&!l.length&&E8({strKey:`schema_invalid_value`,values:{option:J9(o)},context:a,collectors:n})})},Y9={$schema:`http://json-schema.org/draft-07/schema#`,$ref:`#/definitions/CmsConfig`,definitions:{CmsConfig:{type:`object`,properties:{load_config_file:{type:`boolean`},backend:{$ref:`#/definitions/Backend`},publish_mode:{anyOf:[{type:`string`,const:``},{$ref:`#/definitions/PublishModeType`},{$ref:`#/definitions/PublishModeOptions`}]},media_folder:{type:`string`},public_folder:{type:`string`},media_library:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},config:{$ref:`#/definitions/DefaultMediaLibraryConfig`}}},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},output_filename_only:{type:`boolean`},use_transformations:{type:`boolean`},config:{type:`object`}}},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},config:{type:`object`},settings:{$ref:`#/definitions/UploadcareMediaLibrarySettings`}}},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},required:[`bucket`]},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},required:[`container`]},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},providers:{type:`array`,items:{$ref:`#/definitions/StockAssetProviderName`}}}}]},media_libraries:{$ref:`#/definitions/MediaLibraries`},app_title:{type:`string`},site_url:{type:`string`},display_url:{type:`string`},logo_url:{type:`string`},logo:{$ref:`#/definitions/LogoOptions`},logout_redirect_url:{type:`string`},issue_reports:{$ref:`#/definitions/IssueReports`},show_preview_links:{type:`boolean`},slug:{$ref:`#/definitions/SlugOptions`},collections:{type:`array`,items:{anyOf:[{$ref:`#/definitions/Collection`},{$ref:`#/definitions/CollectionDivider`}]}},singletons:{type:`array`,items:{anyOf:[{$ref:`#/definitions/CollectionFile`},{$ref:`#/definitions/CollectionDivider`}]}},asset_collections:{type:`array`,items:{$ref:`#/definitions/AssetCollection`}},i18n:{$ref:`#/definitions/I18nOptions`},editor:{$ref:`#/definitions/EditorOptions`},output:{$ref:`#/definitions/OutputOptions`},field_defaults:{$ref:`#/definitions/FieldDefaults`},readonly:{type:`boolean`},$schema:{type:`string`,format:`uri`}},required:[`backend`],additionalProperties:!1,anyOf:[{required:[`collections`]},{required:[`singletons`]}]},Backend:{anyOf:[{$ref:`#/definitions/GitBackend`},{$ref:`#/definitions/TestBackend`}]},GitBackend:{anyOf:[{$ref:`#/definitions/GitHubBackend`},{$ref:`#/definitions/GitLabBackend`},{$ref:`#/definitions/GiteaBackend`}]},GitHubBackend:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`github`},repo:{type:`string`},api_root:{type:`string`},graphql_api_root:{type:`string`},base_url:{type:`string`},auth_type:{type:`string`,const:``},auth_endpoint:{type:`string`},app_id:{type:`string`},cms_label_prefix:{type:`string`},squash_merges:{type:`boolean`},preview_context:{type:`string`},open_authoring:{type:`boolean`},auth_scope:{anyOf:[{type:`string`,const:`repo`},{type:`string`,const:`public_repo`},{type:`array`,items:{type:`string`,enum:[`repo`,`public_repo`,`workflow`]}}]},branch:{type:`string`},root_dir:{type:`string`},site_domain:{type:`string`},commit_messages:{$ref:`#/definitions/CommitMessages`},automatic_deployments:{type:`boolean`},skip_ci:{type:`boolean`},prompt_commit_messages:{anyOf:[{type:`boolean`},{type:`string`,const:`prefix`},{type:`string`,const:`suffix`}]},auth_methods:{type:`array`,items:{$ref:`#/definitions/AuthMethodName`}},include_credentials:{type:`boolean`}},required:[`name`,`repo`]},CommitMessages:{type:`object`,properties:{create:{type:`string`},update:{type:`string`},delete:{type:`string`},uploadMedia:{type:`string`},deleteMedia:{type:`string`},openAuthoring:{type:`string`}},additionalProperties:!1},AuthMethodName:{type:`string`,enum:[`oauth`,`token`]},GitLabBackend:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`gitlab`},repo:{type:`string`},api_root:{type:`string`},graphql_api_root:{type:`string`},base_url:{type:`string`},auth_type:{type:`string`,enum:[``,`pkce`]},auth_endpoint:{type:`string`},app_id:{type:`string`},cms_label_prefix:{type:`string`},squash_merges:{type:`boolean`},preview_context:{type:`string`},open_authoring:{type:`boolean`},branch:{type:`string`},root_dir:{type:`string`},site_domain:{type:`string`},commit_messages:{$ref:`#/definitions/CommitMessages`},automatic_deployments:{type:`boolean`},skip_ci:{type:`boolean`},prompt_commit_messages:{anyOf:[{type:`boolean`},{type:`string`,const:`prefix`},{type:`string`,const:`suffix`}]},auth_methods:{type:`array`,items:{$ref:`#/definitions/AuthMethodName`}},include_credentials:{type:`boolean`}},required:[`name`,`repo`]},GiteaBackend:{type:`object`,additionalProperties:!1,properties:{name:{type:`string`,const:`gitea`},repo:{type:`string`},api_root:{type:`string`},base_url:{type:`string`},auth_endpoint:{type:`string`},app_id:{type:`string`},cms_label_prefix:{type:`string`},squash_merges:{type:`boolean`},preview_context:{type:`string`},open_authoring:{type:`boolean`},branch:{type:`string`},root_dir:{type:`string`},site_domain:{type:`string`},commit_messages:{$ref:`#/definitions/CommitMessages`},automatic_deployments:{type:`boolean`},skip_ci:{type:`boolean`},prompt_commit_messages:{anyOf:[{type:`boolean`},{type:`string`,const:`prefix`},{type:`string`,const:`suffix`}]},auth_methods:{type:`array`,items:{$ref:`#/definitions/AuthMethodName`}},include_credentials:{type:`boolean`}},required:[`name`,`repo`]},TestBackend:{type:`object`,properties:{name:{type:`string`,const:`test-repo`},root_dir:{type:`string`}},required:[`name`],additionalProperties:!1},PublishModeType:{type:`string`,enum:[`simple`,`preview`,`editorial_workflow`]},PublishModeOptions:{type:`object`,properties:{type:{$ref:`#/definitions/PublishModeType`},stages:{type:`array`,items:{$ref:`#/definitions/PublishModeStage`}},direct_publish:{type:`boolean`},allow_incomplete_drafts:{type:`boolean`}},additionalProperties:!1},PublishModeStage:{type:`string`,enum:[`draft`,`pending_review`,`pending_publish`]},MediaLibraryName:{anyOf:[{type:`string`,const:`default`},{$ref:`#/definitions/CloudMediaLibraryName`},{type:`string`,const:`stock_assets`}]},CloudMediaLibraryName:{type:`string`,enum:[`cloudinary`,`uploadcare`,`aws_s3`,`azure_blob_storage`,`backblaze_b2`,`bunny_storage`,`cloudflare_r2`,`digitalocean_spaces`,`scaleway_object_storage`,`supabase_storage`]},DefaultMediaLibraryConfig:{type:`object`,additionalProperties:!1,properties:{multiple:{type:`boolean`},max_file_size:{type:`number`},slugify_filename:{type:`boolean`},filename_template:{type:`string`},transformations:{$ref:`#/definitions/ImageTransformations`}}},ImageTransformations:{type:`object`,additionalProperties:!1,properties:{svg:{$ref:`#/definitions/VectorImageTransformationOptions`},raster_image:{$ref:`#/definitions/RasterImageTransformationOptions`},avif:{$ref:`#/definitions/RasterImageTransformationOptions`},gif:{$ref:`#/definitions/RasterImageTransformationOptions`},heic:{$ref:`#/definitions/RasterImageTransformationOptions`},jpeg:{$ref:`#/definitions/RasterImageTransformationOptions`},png:{$ref:`#/definitions/RasterImageTransformationOptions`},webp:{$ref:`#/definitions/RasterImageTransformationOptions`}}},VectorImageTransformationOptions:{type:`object`,properties:{optimize:{type:`boolean`}},additionalProperties:!1},RasterImageTransformationOptions:{type:`object`,properties:{format:{type:`string`,const:`webp`},quality:{type:`number`},width:{type:`number`},height:{type:`number`}},additionalProperties:!1},UploadcareMediaLibrarySettings:{type:`object`,properties:{autoFilename:{type:`boolean`},defaultOperations:{type:`string`}},additionalProperties:!1},StockAssetProviderName:{type:`string`,enum:[`pexels`,`picsum`,`pixabay`,`unsplash`]},MediaLibraries:{type:`object`,properties:{all:{$ref:`#/definitions/SharedMediaLibraryOptions`},default:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/DefaultMediaLibrary`}]},cloudinary:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/CloudinaryMediaLibrary`}]},uploadcare:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/UploadcareMediaLibrary`}]},aws_s3:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},azure_blob_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/AzureMediaLibrary`}]},cloudflare_r2:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},digitalocean_spaces:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},backblaze_b2:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},bunny_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},scaleway_object_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},supabase_storage:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/S3MediaLibrary`}]},stock_assets:{anyOf:[{type:`boolean`,const:!1},{$ref:`#/definitions/StockMediaLibrary`}]}},additionalProperties:!1},SharedMediaLibraryOptions:{type:`object`,properties:{max_file_size:{type:`number`},slugify_filename:{type:`boolean`},filename_template:{type:`string`},transformations:{$ref:`#/definitions/ImageTransformations`}},additionalProperties:!1},DefaultMediaLibrary:{type:`object`,properties:{config:{$ref:`#/definitions/DefaultMediaLibraryConfig`}},additionalProperties:!1},CloudinaryMediaLibrary:{type:`object`,properties:{output_filename_only:{type:`boolean`},use_transformations:{type:`boolean`},config:{type:`object`}},additionalProperties:!1},UploadcareMediaLibrary:{type:`object`,properties:{config:{type:`object`},settings:{$ref:`#/definitions/UploadcareMediaLibrarySettings`}},additionalProperties:!1},S3MediaLibrary:{type:`object`,properties:{access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},required:[`bucket`],additionalProperties:!1},AzureMediaLibrary:{type:`object`,properties:{account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},required:[`container`],additionalProperties:!1},StockMediaLibrary:{type:`object`,properties:{providers:{type:`array`,items:{$ref:`#/definitions/StockAssetProviderName`}}},additionalProperties:!1},LogoOptions:{type:`object`,properties:{src:{type:`string`},show_in_header:{type:`boolean`}},additionalProperties:!1},IssueReports:{type:`object`,properties:{url:{type:`string`}},additionalProperties:!1},SlugOptions:{type:`object`,properties:{encoding:{type:`string`,enum:[`unicode`,`ascii`]},clean_accents:{type:`boolean`},sanitize_replacement:{type:`string`},maxlength:{type:`number`},trim:{type:`boolean`},lowercase:{type:`boolean`},timezone:{type:`string`,enum:[`local`,`utc`]}},additionalProperties:!1},Collection:{anyOf:[{$ref:`#/definitions/EntryCollection`},{$ref:`#/definitions/FileCollection`}]},EntryCollection:{type:`object`,additionalProperties:!1,properties:{folder:{type:`string`},file:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}},path:{type:`string`},filter:{$ref:`#/definitions/CollectionFilter`},create:{type:`boolean`},delete:{type:`boolean`},duplicate:{type:`boolean`},reorder:{anyOf:[{type:`boolean`},{$ref:`#/definitions/ReorderOptions`}]},table_columns:{type:`array`,items:{anyOf:[{type:`string`},{$ref:`#/definitions/TableColumn`}]}},summary_fields:{type:`array`,items:{type:`string`}},bulk_edit:{anyOf:[{type:`boolean`},{$ref:`#/definitions/BulkEditOptions`}]},extension:{type:`string`},identifier_field:{type:`string`},slug:{anyOf:[{type:`string`},{$ref:`#/definitions/CollectionSlugOptions`}]},slug_length:{type:`number`},summary:{type:`string`},sortable_fields:{anyOf:[{type:`array`,items:{type:`string`}},{$ref:`#/definitions/SortableFields`}]},view_filters:{anyOf:[{$ref:`#/definitions/ViewFilters`},{type:`array`,items:{$ref:`#/definitions/ViewFilter`}}]},view_groups:{anyOf:[{$ref:`#/definitions/ViewGroups`},{type:`array`,items:{$ref:`#/definitions/ViewGroup`}}]},nested:{$ref:`#/definitions/NestedCollectionOptions`},meta:{$ref:`#/definitions/CollectionMetaData`},index_file:{anyOf:[{type:`boolean`},{$ref:`#/definitions/CollectionIndexFile`}]},thumbnail:{anyOf:[{type:`string`},{type:`boolean`},{type:`array`,items:{type:`string`}}]},limit:{type:`number`},aliases_field:{type:[`string`,`boolean`]},label_singular:{type:`string`},description:{type:`string`},media_folder:{type:`string`},public_folder:{type:`string`},hide:{type:`boolean`},publish_mode:{anyOf:[{$ref:`#/definitions/PublishModeType`},{$ref:`#/definitions/PublishModeOptions`}]},publish:{type:`boolean`},format:{type:`string`},frontmatter_delimiter:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},body_field:{$ref:`#/definitions/BodyFieldOptions`},i18n:{anyOf:[{type:`boolean`},{$ref:`#/definitions/I18nOptions`}]},preview_path:{type:`string`},preview_path_date_field:{type:`string`},editor:{$ref:`#/definitions/EditorOptions`},yaml_quote:{type:`boolean`},name:{type:`string`},label:{type:`string`},icon:{type:`string`},readonly:{type:`boolean`}},required:[`fields`,`name`]},Field:{anyOf:[{$ref:`#/definitions/StandardField`},{$ref:`#/definitions/CustomField`}]},StandardField:{anyOf:[{$ref:`#/definitions/VisibleField`},{$ref:`#/definitions/HiddenField`}]},VisibleField:{anyOf:[{$ref:`#/definitions/BooleanField`},{$ref:`#/definitions/CodeField`},{$ref:`#/definitions/ColorField`},{$ref:`#/definitions/ComputeField`},{$ref:`#/definitions/DateTimeField`},{$ref:`#/definitions/FileField`},{$ref:`#/definitions/ImageField`},{$ref:`#/definitions/KeyValueField`},{$ref:`#/definitions/ListField`},{$ref:`#/definitions/MapField`},{$ref:`#/definitions/MarkdownField`},{$ref:`#/definitions/NumberField`},{$ref:`#/definitions/ObjectField`},{$ref:`#/definitions/RelationField`},{$ref:`#/definitions/RichTextField`},{$ref:`#/definitions/SelectField`},{$ref:`#/definitions/StringField`},{$ref:`#/definitions/TextField`},{$ref:`#/definitions/UuidField`}]},BooleanField:{type:`object`,additionalProperties:!1,properties:{before_input:{type:`string`},after_input:{type:`string`},widget:{type:`string`,const:`boolean`},default:{type:`boolean`},default_localized:{type:`object`,additionalProperties:{type:`boolean`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},CodeField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`code`},default:{anyOf:[{type:`string`},{type:`object`,additionalProperties:{type:`string`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`string`},{type:`object`,additionalProperties:{type:`string`}}]}},default_language:{type:`string`},allow_language_selection:{type:`boolean`},output_code_only:{type:`boolean`},keys:{type:`object`,properties:{code:{type:`string`},lang:{type:`string`}},required:[`code`,`lang`],additionalProperties:!1},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ColorField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`color`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},allowInput:{type:`boolean`},enableAlpha:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ComputeField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`compute`},value:{type:`string`},value_type:{type:`string`,enum:[`string`,`float`,`int`,`int/string`,`float/string`]},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`value`,`widget`]},DateTimeField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`datetime`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},type:{$ref:`#/definitions/DateTimeInputType`},min:{type:`string`},max:{type:`string`},step:{anyOf:[{type:`number`},{type:`string`,const:`any`}]},format:{type:`string`},date_format:{type:[`string`,`boolean`]},time_format:{type:[`string`,`boolean`]},localize_format:{type:[`string`,`boolean`]},picker_utc:{type:`boolean`},input_timezone:{type:`string`},output_utc:{type:`boolean`},auto_now:{anyOf:[{type:`boolean`},{type:`array`,items:{$ref:`#/definitions/DateTimeAutoNowStage`}}]},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},DateTimeInputType:{type:`string`,enum:[`datetime-local`,`date`,`time`]},DateTimeAutoNowStage:{type:`string`,enum:[`create`,`update`]},FileField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`file`},select_folder:{type:`boolean`},default:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]}},multiple:{type:`boolean`},min:{type:`number`},max:{type:`number`},accept:{type:`string`},choose_url:{type:`boolean`},media_folder:{type:`string`},public_folder:{type:`string`},media_library:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},config:{$ref:`#/definitions/DefaultMediaLibraryConfig`}}},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},output_filename_only:{type:`boolean`},use_transformations:{type:`boolean`},config:{type:`object`}}},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},config:{type:`object`},settings:{$ref:`#/definitions/UploadcareMediaLibrarySettings`}}},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},required:[`bucket`]},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},required:[`container`]},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},providers:{type:`array`,items:{$ref:`#/definitions/StockAssetProviderName`}}}}]},media_libraries:{$ref:`#/definitions/MediaLibraries`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ImageField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`image`},default:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]}},multiple:{type:`boolean`},min:{type:`number`},max:{type:`number`},accept:{type:`string`},choose_url:{type:`boolean`},media_folder:{type:`string`},public_folder:{type:`string`},media_library:{anyOf:[{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},config:{$ref:`#/definitions/DefaultMediaLibraryConfig`}}},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},output_filename_only:{type:`boolean`},use_transformations:{type:`boolean`},config:{type:`object`}}},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},config:{type:`object`},settings:{$ref:`#/definitions/UploadcareMediaLibrarySettings`}}},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},access_key_id:{type:`string`},bucket:{type:`string`},region:{type:`string`},account_id:{type:`string`},jurisdiction:{type:`string`,enum:[`default`,`eu`,`fedramp`]},project_id:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},force_path_style:{type:`boolean`},public_url:{type:`string`}},required:[`bucket`]},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},account_name:{type:`string`},container:{type:`string`},endpoint:{type:`string`},prefix:{type:`string`},public_url:{type:`string`}},required:[`container`]},{type:`object`,additionalProperties:!1,properties:{name:{$ref:`#/definitions/MediaLibraryName`},providers:{type:`array`,items:{$ref:`#/definitions/StockAssetProviderName`}}}}]},media_libraries:{$ref:`#/definitions/MediaLibraries`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},KeyValueField:{type:`object`,additionalProperties:!1,properties:{min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`keyvalue`},default:{type:`object`,additionalProperties:{type:`string`}},default_localized:{type:`object`,additionalProperties:{type:`object`,additionalProperties:{type:`string`}}},key_label:{type:`string`},value_label:{type:`string`},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},root:{type:`boolean`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`},{type:`string`,const:`duplicate_keys`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ListField:{anyOf:[{$ref:`#/definitions/SimpleListField`},{$ref:`#/definitions/ListFieldWithSubField`},{$ref:`#/definitions/ListFieldWithSubFields`},{$ref:`#/definitions/ListFieldWithTypes`}]},SimpleListField:{type:`object`,additionalProperties:!1,properties:{pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},root:{type:`boolean`},min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`list`},default:{anyOf:[{type:`array`,items:{type:`string`}},{type:`array`,items:{type:`object`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`array`,items:{type:`string`}},{type:`array`,items:{type:`object`}}]}},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ListFieldWithSubField:{type:`object`,additionalProperties:!1,properties:{field:{$ref:`#/definitions/Field`},allow_add:{type:`boolean`},allow_remove:{type:`boolean`},allow_duplicate:{type:`boolean`},allow_reorder:{type:`boolean`},add_to_top:{type:`boolean`},summary:{type:`string`},thumbnail:{type:`string`},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},minimize_collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},root:{type:`boolean`},min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`list`},default:{anyOf:[{type:`array`,items:{type:`string`}},{type:`array`,items:{type:`object`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`array`,items:{type:`string`}},{type:`array`,items:{type:`object`}}]}},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`field`,`name`,`widget`]},ListFieldWithSubFields:{type:`object`,additionalProperties:!1,properties:{map_key_field:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}},allow_add:{type:`boolean`},allow_remove:{type:`boolean`},allow_duplicate:{type:`boolean`},allow_reorder:{type:`boolean`},add_to_top:{type:`boolean`},summary:{type:`string`},thumbnail:{type:`string`},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},minimize_collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},root:{type:`boolean`},min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`list`},default:{anyOf:[{type:`array`,items:{type:`string`}},{type:`array`,items:{type:`object`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`array`,items:{type:`string`}},{type:`array`,items:{type:`object`}}]}},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`fields`,`name`,`widget`]},ListFieldWithTypes:{type:`object`,additionalProperties:!1,properties:{map_key_field:{type:`string`},types:{type:`array`,items:{$ref:`#/definitions/VariableFieldType`}},typeKey:{type:`string`},allow_add:{type:`boolean`},allow_remove:{type:`boolean`},allow_duplicate:{type:`boolean`},allow_reorder:{type:`boolean`},add_to_top:{type:`boolean`},summary:{type:`string`},thumbnail:{type:`string`},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},minimize_collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},root:{type:`boolean`},min:{type:`number`},max:{type:`number`},widget:{type:`string`,const:`list`},default:{anyOf:[{type:`array`,items:{type:`string`}},{type:`array`,items:{type:`object`}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{type:`array`,items:{type:`string`}},{type:`array`,items:{type:`object`}}]}},label_singular:{type:`string`},label_singular_localized:{type:`object`,additionalProperties:{type:`string`}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`types`,`widget`]},VariableFieldType:{type:`object`,properties:{name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},widget:{type:`string`,const:`object`},description:{type:`string`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},summary:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}}},required:[`name`],additionalProperties:!1},MapField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`map`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},decimals:{type:`number`},type:{type:`string`,enum:[`Point`,`LineString`,`Polygon`]},center:{type:`array`,items:{type:`number`},minItems:2,maxItems:2},zoom:{type:`number`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},MarkdownField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`markdown`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},minimal:{type:`boolean`},buttons:{type:`array`,items:{$ref:`#/definitions/RichTextEditorButtonName`}},editor_components:{type:`array`,items:{type:`string`}},allow_nested_components:{anyOf:[{type:`boolean`},{type:`string`,const:`exclude_self`}]},modes:{type:`array`,items:{$ref:`#/definitions/RichTextEditorMode`}},sanitize_preview:{type:`boolean`},linked_images:{type:`boolean`},use_emoji_autocomplete:{type:`boolean`},use_markdown_shortcuts:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},RichTextEditorButtonName:{type:`string`,enum:[`bold`,`italic`,`strikethrough`,`code`,`link`,`heading-one`,`heading-two`,`heading-three`,`heading-four`,`heading-five`,`heading-six`,`quote`,`bulleted-list`,`numbered-list`,`align`]},RichTextEditorMode:{type:`string`,enum:[`rich_text`,`raw`]},NumberField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},before_input:{type:`string`},after_input:{type:`string`},widget:{type:`string`,const:`number`},default:{type:[`string`,`number`]},default_localized:{type:`object`,additionalProperties:{type:[`string`,`number`]}},value_type:{type:`string`,enum:[`float`,`int`,`int/string`,`float/string`]},min:{type:`number`},max:{type:`number`},step:{type:`number`},auto_increment:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},ObjectField:{anyOf:[{$ref:`#/definitions/ObjectFieldWithSubFields`},{$ref:`#/definitions/ObjectFieldWithTypes`}]},ObjectFieldWithSubFields:{type:`object`,additionalProperties:!1,properties:{fields:{type:`array`,items:{$ref:`#/definitions/Field`}},widget:{type:`string`,const:`object`},default:{type:`object`},default_localized:{type:`object`,additionalProperties:{type:`object`}},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},summary:{type:`string`},thumbnail:{type:`string`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`fields`,`name`,`widget`]},ObjectFieldWithTypes:{type:`object`,additionalProperties:!1,properties:{types:{type:`array`,items:{$ref:`#/definitions/VariableFieldType`}},typeKey:{type:`string`},widget:{type:`string`,const:`object`},default:{type:`object`},default_localized:{type:`object`,additionalProperties:{type:`object`}},collapsed:{anyOf:[{type:`boolean`},{type:`string`,const:`auto`}]},summary:{type:`string`},thumbnail:{type:`string`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`types`,`widget`]},RelationField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},multiple:{type:`boolean`},min:{type:`number`},max:{type:`number`},dropdown_threshold:{type:`number`},widget:{type:`string`,const:`relation`},default:{anyOf:[{},{type:`array`,items:{}}]},default_localized:{type:`object`},collection:{type:`string`},file:{type:`string`},value_field:{type:`string`},display_fields:{type:`array`,items:{type:`string`}},search_fields:{type:`array`,items:{type:`string`}},filters:{type:`array`,items:{$ref:`#/definitions/RelationFieldFilterOptions`}},sort_by:{$ref:`#/definitions/RelationFieldSortOptions`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`collection`,`name`,`widget`]},RelationFieldFilterOptions:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},values:{type:`array`,items:{}},exclude:{type:`boolean`}},required:[`field`,`values`],additionalProperties:!1},FieldKeyPath:{type:`string`},RelationFieldSortOptions:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},direction:{type:`string`,enum:[`ascending`,`descending`]}},required:[`field`],additionalProperties:!1},RichTextField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},widget:{type:`string`,const:`richtext`},format:{$ref:`#/definitions/RichTextValueFormat`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},minimal:{type:`boolean`},buttons:{type:`array`,items:{$ref:`#/definitions/RichTextEditorButtonName`}},editor_components:{type:`array`,items:{type:`string`}},allow_nested_components:{anyOf:[{type:`boolean`},{type:`string`,const:`exclude_self`}]},modes:{type:`array`,items:{$ref:`#/definitions/RichTextEditorMode`}},sanitize_preview:{type:`boolean`},linked_images:{type:`boolean`},use_emoji_autocomplete:{type:`boolean`},use_markdown_shortcuts:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},RichTextValueFormat:{type:`string`,enum:[`markdown`,`html`]},SelectField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},multiple:{type:`boolean`},min:{type:`number`},max:{type:`number`},dropdown_threshold:{type:`number`},widget:{type:`string`,const:`select`},default:{anyOf:[{$ref:`#/definitions/SelectFieldValue`},{$ref:`#/definitions/SelectFieldOption`},{type:`array`,items:{anyOf:[{$ref:`#/definitions/SelectFieldValue`},{$ref:`#/definitions/SelectFieldOption`}]}}]},default_localized:{type:`object`,additionalProperties:{anyOf:[{$ref:`#/definitions/SelectFieldValue`},{$ref:`#/definitions/SelectFieldOption`},{type:`array`,items:{anyOf:[{$ref:`#/definitions/SelectFieldValue`},{$ref:`#/definitions/SelectFieldOption`}]}}]}},options:{anyOf:[{type:`array`,items:{$ref:`#/definitions/SelectFieldValue`}},{type:`array`,items:{$ref:`#/definitions/SelectFieldOption`}}]},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`options`,`widget`]},SelectFieldValue:{type:[`string`,`number`,`boolean`,`null`]},SelectFieldOption:{type:`object`,properties:{label:{type:`string`},value:{$ref:`#/definitions/SelectFieldValue`}},required:[`label`,`value`],additionalProperties:!1},StringField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},minlength:{type:`number`},maxlength:{type:`number`},before_input:{type:`string`},after_input:{type:`string`},widget:{type:`string`,const:`string`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},type:{type:`string`,enum:[`url`,`text`,`email`]},prefix:{type:`string`},suffix:{type:`string`},use_emoji_autocomplete:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`]},TextField:{type:`object`,additionalProperties:!1,properties:{unique:{type:`boolean`},minlength:{type:`number`},maxlength:{type:`number`},widget:{type:`string`,const:`text`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},use_emoji_autocomplete:{type:`boolean`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`},{type:`string`,const:`duplicate_if_empty`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},UuidField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`uuid`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},prefix:{type:`string`},use_b32_encoding:{type:`boolean`},read_only:{type:`boolean`},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},HiddenField:{type:`object`,additionalProperties:!1,properties:{widget:{type:`string`,const:`hidden`},default:{},default_localized:{type:`object`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},CustomField:{type:`object`,properties:{widget:{type:`string`,minLength:1,not:{enum:[`boolean`,`code`,`color`,`compute`,`datetime`,`file`,`hidden`,`image`,`keyvalue`,`list`,`map`,`markdown`,`number`,`object`,`relation`,`richtext`,`select`,`string`,`text`,`uuid`]}},hint:{type:`string`},hint_localized:{type:`object`,additionalProperties:{type:`string`}},preview:{type:`boolean`},required:{anyOf:[{type:`boolean`},{type:`array`,items:{type:`string`}}]},readonly:{type:`boolean`},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`none`},{type:`string`,const:`translate`},{type:`string`,const:`duplicate`}]},name:{type:`string`},label:{type:`string`},label_localized:{type:`object`,additionalProperties:{type:`string`}},comment:{type:`string`}},required:[`name`,`widget`]},CollectionFilter:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},value:{anyOf:[{},{type:`array`,items:{}}]},pattern:{anyOf:[{type:`string`},{type:`string`,format:`regex`}]}},required:[`field`],additionalProperties:!1},ReorderOptions:{type:`object`,properties:{key:{type:`string`},group:{type:`string`}},additionalProperties:!1},TableColumn:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},label:{type:`string`}},required:[`field`],additionalProperties:!1},BulkEditOptions:{type:`object`,properties:{fields:{type:`array`,items:{type:`string`}}},additionalProperties:!1},CollectionSlugOptions:{type:`object`,properties:{template:{type:`string`},editable:{anyOf:[{type:`boolean`},{type:`array`,items:{$ref:`#/definitions/SlugEditableStage`}}]},i18n:{anyOf:[{type:`boolean`},{type:`string`,const:`duplicate`}]},auto_increment:{type:`boolean`},hint:{type:`string`},pattern:{type:`array`,minItems:2,items:[{anyOf:[{type:`string`},{type:`string`,format:`regex`}]},{type:`string`}],maxItems:2}},additionalProperties:!1},SlugEditableStage:{type:`string`,enum:[`create`,`update`]},SortableFields:{type:`object`,properties:{fields:{type:`array`,items:{$ref:`#/definitions/FieldKeyPath`}},default:{$ref:`#/definitions/SortableFieldsDefaultOptions`}},required:[`fields`],additionalProperties:!1},SortableFieldsDefaultOptions:{type:`object`,properties:{field:{$ref:`#/definitions/FieldKeyPath`},direction:{type:`string`,enum:[`ascending`,`descending`,`Ascending`,`Descending`,`None`]}},required:[`field`],additionalProperties:!1},ViewFilters:{type:`object`,properties:{filters:{type:`array`,items:{$ref:`#/definitions/ViewFilter`}},default:{type:`string`}},required:[`filters`],additionalProperties:!1},ViewFilter:{type:`object`,additionalProperties:!1,properties:{eq:{$ref:`#/definitions/ViewComparisonValue`},ne:{$ref:`#/definitions/ViewComparisonValue`},lt:{$ref:`#/definitions/ViewComparisonValue`},lte:{$ref:`#/definitions/ViewComparisonValue`},gt:{$ref:`#/definitions/ViewComparisonValue`},gte:{$ref:`#/definitions/ViewComparisonValue`},in:{type:`array`,items:{$ref:`#/definitions/ViewComparisonValue`}},not_in:{type:`array`,items:{$ref:`#/definitions/ViewComparisonValue`}},empty:{type:`boolean`},name:{type:`string`},label:{type:`string`},field:{$ref:`#/definitions/FieldKeyPath`},pattern:{anyOf:[{type:`string`},{type:`boolean`},{type:`string`,format:`regex`}]}},required:[`field`,`label`]},ViewComparisonValue:{type:[`string`,`number`,`boolean`]},ViewGroups:{type:`object`,properties:{groups:{type:`array`,items:{$ref:`#/definitions/ViewGroup`}},default:{type:`string`}},required:[`groups`],additionalProperties:!1},ViewGroup:{type:`object`,additionalProperties:!1,properties:{eq:{$ref:`#/definitions/ViewComparisonValue`},ne:{$ref:`#/definitions/ViewComparisonValue`},lt:{$ref:`#/definitions/ViewComparisonValue`},lte:{$ref:`#/definitions/ViewComparisonValue`},gt:{$ref:`#/definitions/ViewComparisonValue`},gte:{$ref:`#/definitions/ViewComparisonValue`},in:{type:`array`,items:{$ref:`#/definitions/ViewComparisonValue`}},not_in:{type:`array`,items:{$ref:`#/definitions/ViewComparisonValue`}},empty:{type:`boolean`},name:{type:`string`},label:{type:`string`},field:{$ref:`#/definitions/FieldKeyPath`},pattern:{anyOf:[{type:`string`},{type:`boolean`},{type:`string`,format:`regex`}]}},required:[`field`,`label`]},NestedCollectionOptions:{type:`object`,properties:{depth:{type:`number`},summary:{type:`string`},subfolders:{type:`boolean`}},additionalProperties:!1},CollectionMetaData:{type:`object`,properties:{path:{$ref:`#/definitions/CollectionMetaDataPath`}},additionalProperties:!1},CollectionMetaDataPath:{type:`object`,properties:{widget:{type:`string`},label:{type:`string`},index_file:{type:`string`}},additionalProperties:!1},CollectionIndexFile:{type:`object`,properties:{name:{type:`string`},extension:{type:`string`},format:{type:`string`},label:{type:`string`},icon:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}},editor:{$ref:`#/definitions/EditorOptions`}},additionalProperties:!1},EditorOptions:{type:`object`,properties:{preview:{type:`boolean`},second_pane:{type:`boolean`}},additionalProperties:!1},BodyFieldOptions:{type:`object`,properties:{key:{type:`string`},inline:{type:`boolean`}},additionalProperties:!1},I18nOptions:{type:`object`,properties:{structure:{$ref:`#/definitions/I18nFileStructure`},locales:{type:`array`,items:{type:`string`}},default_locale:{type:`string`},initial_locales:{anyOf:[{type:`array`,items:{type:`string`}},{type:`string`,const:`default`},{type:`string`,const:`all`}]},save_all_locales:{type:`boolean`},canonical_slug:{type:`object`,properties:{key:{type:`string`},value:{type:`string`}},additionalProperties:!1},omit_default_locale_from_filename:{type:`boolean`},omit_default_locale_from_file_path:{type:`boolean`},omit_default_locale_from_preview_path:{type:`boolean`}},additionalProperties:!1},I18nFileStructure:{type:`string`,enum:[`single_file`,`single_file_default_root`,`multiple_files`,`multiple_folders`,`multiple_folders_i18n_root`,`multiple_root_folders`]},FileCollection:{type:`object`,additionalProperties:!1,properties:{files:{type:`array`,items:{$ref:`#/definitions/CollectionFile`}},label_singular:{type:`string`},description:{type:`string`},media_folder:{type:`string`},public_folder:{type:`string`},hide:{type:`boolean`},publish_mode:{anyOf:[{$ref:`#/definitions/PublishModeType`},{$ref:`#/definitions/PublishModeOptions`}]},publish:{type:`boolean`},format:{type:`string`},frontmatter_delimiter:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},body_field:{$ref:`#/definitions/BodyFieldOptions`},i18n:{anyOf:[{type:`boolean`},{$ref:`#/definitions/I18nOptions`}]},preview_path:{type:`string`},preview_path_date_field:{type:`string`},editor:{$ref:`#/definitions/EditorOptions`},yaml_quote:{type:`boolean`},name:{type:`string`},label:{type:`string`},icon:{type:`string`},readonly:{type:`boolean`}},required:[`files`,`name`]},CollectionFile:{type:`object`,properties:{name:{type:`string`},label:{type:`string`},icon:{type:`string`},file:{type:`string`},fields:{type:`array`,items:{$ref:`#/definitions/Field`}},media_folder:{type:`string`},public_folder:{type:`string`},format:{type:`string`},frontmatter_delimiter:{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}]},body_field:{$ref:`#/definitions/BodyFieldOptions`},i18n:{anyOf:[{type:`boolean`},{$ref:`#/definitions/I18nOptions`}]},preview_path:{type:`string`},preview_path_date_field:{type:`string`},editor:{$ref:`#/definitions/EditorOptions`},readonly:{type:`boolean`}},required:[`name`,`file`,`fields`],additionalProperties:!1},CollectionDivider:{type:`object`,properties:{name:{type:`string`},divider:{type:`boolean`}},required:[`divider`],additionalProperties:!1},AssetCollection:{type:`object`,additionalProperties:!1,properties:{media_folder:{type:`string`},public_folder:{type:`string`},name:{type:`string`},label:{type:`string`},icon:{type:`string`},readonly:{type:`boolean`}},required:[`media_folder`,`name`]},OutputOptions:{type:`object`,properties:{omit_empty_optional_fields:{type:`boolean`},encode_file_path:{type:`boolean`},json:{$ref:`#/definitions/JsonFormatOptions`},yaml:{$ref:`#/definitions/YamlFormatOptions`}},additionalProperties:!1},JsonFormatOptions:{type:`object`,properties:{indent_style:{type:`string`,enum:[`space`,`tab`]},indent_size:{type:`number`}},additionalProperties:!1},YamlFormatOptions:{type:`object`,properties:{indent_size:{type:`number`},indent_sequences:{type:`boolean`},quote:{type:`string`,enum:[`none`,`double`,`single`]}},additionalProperties:!1},FieldDefaults:{type:`object`,properties:{richtext:{$ref:`#/definitions/RichTextFieldDefaults`}},additionalProperties:!1},RichTextFieldDefaults:{type:`object`,additionalProperties:!1,properties:{format:{$ref:`#/definitions/RichTextValueFormat`},default:{type:`string`},default_localized:{type:`object`,additionalProperties:{type:`string`}},minimal:{type:`boolean`},buttons:{type:`array`,items:{$ref:`#/definitions/RichTextEditorButtonName`}},editor_components:{type:`array`,items:{type:`string`}},allow_nested_components:{anyOf:[{type:`boolean`},{type:`string`,const:`exclude_self`}]},modes:{type:`array`,items:{$ref:`#/definitions/RichTextEditorMode`}},sanitize_preview:{type:`boolean`},linked_images:{type:`boolean`},use_emoji_autocomplete:{type:`boolean`},use_markdown_shortcuts:{type:`boolean`}}}}},gpt=void 0,_pt=()=>{if(Y9)return gpt??={strict:z9(Y9),lenient:z9(Y9,{allowUnknownProperties:!0})},gpt},X9=e=>e instanceof RegExp?e.source:Array.isArray(e)?e.map(X9):E(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,X9(t)])):e,vpt=({config:e,schemas:t,collectors:n})=>{if(t)try{let r=X9(e),i=K9(cpt(t.strict))(r);if(!i.length)return;let a=i.filter(({keyword:e})=>e===`additionalProperties`),o=a.length?K9(cpt(t.lenient))(r):i;hpt({config:e,errors:[...a,...o],collectors:n})}catch(e){console.warn(`Skipping configuration schema validation`,e)}},{DEV:ypt}={DEV:!1},bpt=e=>{let t=Xlt(e),n=Ult(e,[...Dk.mediaFields]);_j.current=t,iH.current=n,IG.devModeEnabled&&(console.info(`allEntryFolders`,t),console.info(`allAssetFolders`,n))},xpt=async e=>{Sk.current=void 0,Tk.current=[],Object.assign(Dk,{errors:new Set,warnings:new Set,mediaFields:new Set,relationFields:new Set,formatLocales:new Set});try{if(!window.isSecureContext)throw Error(Y(`config.error.no_secure_context`));let t;if(e){if(!E(e))throw Error(Y(`config.error.parse_failed`));t=e,t.load_config_file!==!1&&(t=(0,jlt.default)(await aut({manualInit:!0}),t))}else t=await aut();if(Object.assign(Ck,t),vpt({config:t,schemas:_pt(),collectors:Dk}),sft(t,Dk),Dk.errors.size)throw Dk.errors.forEach(e=>{console.error(e)}),Error(`Errors found in configuration`);Dk.warnings.size&&Dk.warnings.forEach(e=>{console.warn(e)});let n=structuredClone(t);if(n._siteURL=n.site_url?.trim()||(ypt?uk:window.location.origin),n._baseURL=wE(n._siteURL)?new URL(n._siteURL).origin:``,n.collections?.forEach(e=>{`folder`in e&&(e.folder=e.folder.replace(/^\.(?:\/|$)/,``).replace(/^\/$/,``))}),await dSe(Dk.formatLocales),Sk.current=n,bpt(n),lft({config:n,entryFolders:_j.current,assetFolders:iH.current,collectors:Dk}),Dk.errors.size)throw Sk.current=void 0,Error(`Errors found in configuration`);wk.current=await _l(UL(n)),console.debug(`CMS configuration:`,n),IG.devModeEnabled&&console.info(`collectors`,Dk)}catch(e){Tk.current=Dk.errors.size?[...Dk.errors]:[e.name===`Error`?e.message:Y(`config.error.unexpected`)],console.error(e,e.cause)}},Spt=B(`<link rel="apple-touch-icon"/>`),Cpt=B(`<link rel="manifest"/>`),wpt=B(`<link rel="icon"/> <!> <!>`,1),Tpt=B(`<link type="application/yaml" rel="cms-config-url"/>`),Ept=B(`<meta name="referrer" content="same-origin"/> <meta name="robots" content="noindex"/> <!> <!>`,1),Dpt=B(`<!> <!> <!> <!> <!> <!> <div role="none" class="main svelte-7y4msj"><!></div>`,1),Opt=B(`<div role="none" class="outer svelte-7y4msj"><!></div> <div role="status" class="svelte-7y4msj"> </div>`,1),kpt={hash:`svelte-7y4msj`,code:`
@view-transition {navigation:auto;
}
@keyframes svelte-7y4msj-slide-out-to-left {
from {
transform: translateX(0);
filter: brightness(1);
}
to {
transform: translateX(-20%);
filter: brightness(0.5);
}
}
@keyframes svelte-7y4msj-slide-out-to-right {
from {
transform: translateX(0);
opacity: 1;
}
to {
transform: translateX(100%);
opacity: 0;
}
}
@keyframes svelte-7y4msj-slide-in-from-right {
from {
transform: translateX(100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
@keyframes svelte-7y4msj-slide-in-from-left {
from {
transform: translateX(-20%);
filter: brightness(0.5);
}
to {
transform: translateX(0);
filter: brightness(1);
}
}
/* RTL-specific keyframes that mirror the depth effect */
@keyframes svelte-7y4msj-slide-out-to-left-rtl {
from {
transform: translateX(0);
opacity: 1;
}
to {
transform: translateX(-100%);
opacity: 0;
}
}
@keyframes svelte-7y4msj-slide-out-to-right-rtl {
from {
transform: translateX(0);
filter: brightness(1);
}
to {
transform: translateX(20%);
filter: brightness(0.5);
}
}
@keyframes svelte-7y4msj-slide-in-from-right-rtl {
from {
transform: translateX(20%);
filter: brightness(0.5);
}
to {
transform: translateX(0);
filter: brightness(1);
}
}
@keyframes svelte-7y4msj-slide-in-from-left-rtl {
from {
transform: translateX(-100%);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
@keyframes svelte-7y4msj-fade-out {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
@keyframes svelte-7y4msj-fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}html:active-view-transition-type(forwards) {
@media (width < 768px) {&::view-transition-old(page-root) {z-index:999;
animation: 100ms ease-in both svelte-7y4msj-slide-out-to-left;
@media (prefers-reduced-motion) {
animation: none;
}}&::view-transition-new(page-root) {
@media (width < 768px) {z-index:1000;
animation: 100ms ease-in both svelte-7y4msj-slide-in-from-right;
}
@media (prefers-reduced-motion) {
animation: none;
}}&:dir(rtl) {&::view-transition-old(page-root) {
animation: 100ms ease-in both svelte-7y4msj-slide-out-to-right-rtl;}&::view-transition-new(page-root) {
animation: 100ms ease-in both svelte-7y4msj-slide-in-from-left-rtl;}}
}}html:active-view-transition-type(backwards) {
@media (width < 768px) {&::view-transition-old(page-root) {z-index:1000;
animation: 100ms ease-in both svelte-7y4msj-slide-out-to-right;
@media (prefers-reduced-motion) {
animation: none;
}}&::view-transition-new(page-root) {z-index:999;
animation: 100ms ease-in both svelte-7y4msj-slide-in-from-left;
@media (prefers-reduced-motion) {
animation: none;
}}&:dir(rtl) {&::view-transition-old(page-root) {
animation: 100ms ease-in both svelte-7y4msj-slide-out-to-left-rtl;}&::view-transition-new(page-root) {
animation: 100ms ease-in both svelte-7y4msj-slide-in-from-right-rtl;}}
}}html:active-view-transition-type(unknown) {&::view-transition-old(page-main) {
animation: 100ms ease-in both svelte-7y4msj-fade-out;
@media (prefers-reduced-motion) {
animation: none;
}}&::view-transition-new(page-main) {
animation: 100ms ease-in both svelte-7y4msj-fade-in;
@media (prefers-reduced-motion) {
animation: none;
}}}body:not(:has(#nc-root)) {overflow:hidden;}#nc-root > .sui.app-shell {position:absolute;}.sui.app-shell {
/* A placeholder is often the only visible label of a search box, so it has to meet the 4.5:1
text contrast. Sveltia UI only renders it at full strength in the high-contrast themes; the
default themes leave it at 50% opacity, which is 2.6:1 on white. */--sui-textbox-placeholder-foreground-color: var(--sui-tertiary-foreground-color);--sui-textbox-placeholder-opacity: 1;
/* Border drawn where a primary area (page content, editor panes, asset preview) meets a
secondary one (sidebars, toolbars, the gutter between panes). The default themes tell them
apart by background alone, so the width is zero; the high-contrast themes, which set
\`--sui-modal-border-width\` to outline dialogs for the same reason, get a visible line. */--area-border: var(--sui-modal-border-width) solid var(--sui-primary-border-color);}.outer.svelte-7y4msj {display:flex;flex-direction:column;position:absolute;inset:0;overflow:hidden;}.main.svelte-7y4msj {position:relative;flex:auto;display:flex;flex-direction:column;overflow:hidden;background-color:var(--sui-secondary-background-color);}[role='status'].svelte-7y4msj {position:absolute;z-index:-1;opacity:0;pointer-events:none;-webkit-user-select:none;user-select:none;}`};function Apt(e,t){O(t,!0),K(e,kpt),R3e(),Sa(()=>{gAe()}),js(()=>{f5.current.length?console.error(`Unsupported browser. Missing features:`,f5.current):xpt(t.config)}),js(()=>wst()),js(()=>{let e=document.querySelector(`#nc-root`);e&&window.getComputedStyle(e).position===`static`&&window.requestAnimationFrame(()=>{let{top:t,height:n}=e.getBoundingClientRect();n?e.style.position=`relative`:(e.style.position=`fixed`,e.style.inset=`${t}px 0 0 0`)})});let n=j(!1),r=A(()=>[QQ.current||ZQ.current,l5.current].filter(Boolean).join(` – `));L(()=>{hj.current&&OW.account?i$(`forwards`,()=>{M(n,!0)}):i$(`backwards`,()=>{M(n,!1)})}),$o(`7y4msj`,e=>{var t=Ept(),n=I(P(t),4),i=e=>{var t=wpt(),n=P(t),i=I(n,2),a=e=>{var t=Spt();R(()=>q(t,`href`,d5.current.large)),U(e,t)};G(i,e=>{d5.current&&e(a)});var o=I(i,2),s=e=>{var t=Cpt();R(()=>q(t,`href`,e3e.current)),U(e,t)};G(o,e=>{e3e.current&&e(s)}),R(()=>{q(n,`href`,u5.current),q(n,`type`,Q4e.current)}),Xee(()=>{aa.title=z(r)??``}),U(e,t)};G(n,e=>{Ek.current&&e(i)});var a=I(n,2),o=e=>{var t=Tpt();R(()=>q(t,`href`,`${uk??``}/admin/config.yml`)),U(e,t)};G(a,e=>{uk&&e(o)}),U(e,t)}),yo(`mousedown`,aa.body,e=>{let t=e.target?.closest(`a`);if(t){let{origin:e,pathname:n}=t;(e!==window.location.origin||n!==window.location.pathname)&&(t.rel=`noopener noreferrer`,t.target=`_blank`)}}),Kye(e,{children:(e,t)=>{var r=Opt(),i=P(r);T6(N(i),{scope:`page`,children:(e,t)=>{var r=Dpt(),i=P(r);z3e(i,{});var a=I(i,2);T3e(a,{});var o=I(a,2);Dlt(o,{});var s=I(o,2);h3e(s,{});var c=I(s,2),l=e=>{v3e(e,{})};G(c,e=>{OY.current&&e(l)});var u=I(c,2),d=e=>{Alt(e,{})};G(u,e=>{OW.account&&hj.current&&e(d)});var f=I(u,2);T6(N(f),{scope:`page`,children:(e,t)=>{var r=H(),i=P(r),a=e=>{Elt(e,{})},o=e=>{d3e(e,{})};G(i,e=>{OW.account&&hj.current&&z(n)?e(a):e(o,-1)}),U(e,r)},$$slots:{default:!0}}),D(f),U(e,r)},$$slots:{default:!0}}),D(i);var a=F(I(i,2),!0);R(()=>W(a,XQ.current)),U(e,r)},$$slots:{default:!0}}),k()}var jpt=!1,Z9=async({config:e}={})=>{R8(e===void 0||E(e),`init`,`config`,`an object`),!jpt&&(jpt=!0,document.readyState===`loading`&&!document.querySelector(`#nc-root`)&&await new Promise(e=>{window.addEventListener(`DOMContentLoaded`,()=>e(void 0),{once:!0})}),e?.load_config_file!==!1&&iut(),Oo(Apt,{target:document.querySelector(`#nc-root`)??document.body,props:{config:e}}))},Mpt=(e,t,{fromFile:n,toFile:r}={})=>{if(R8(mA(e),`registerCustomFormat`,`name`,`a non-empty string`),R8(mA(t),`registerCustomFormat`,`extension`,`a non-empty string`),R8(n===void 0||typeof n==`function`,`registerCustomFormat`,`fromFile`,`a function`),R8(r===void 0||typeof r==`function`,`registerCustomFormat`,`toFile`,`a function`),typeof n!=`function`&&typeof r!=`function`)throw Error("At least one of `fromFile` or `toFile` must be provided to `CMS.registerCustomFormat()`");uA.includes(e)||(n||console.warn(`The custom “${e}” format has no \`fromFile\` method, so its entries can’t be loaded`),r||console.warn(`The custom “${e}” format has no \`toFile\` method, so its entries can’t be saved`)),ik.set(e,{extension:t,parser:n,formatter:r})},Npt=e=>{R8(E(e),`registerCustomPage`,`definition`,`an object`);let{id:t,label:n,icon:r,component:i,url:a,newTab:o}=e;z8(typeof t==`string`&&/^[\w-]+$/.test(t),`id`,`a non-empty string of alphanumeric characters, hyphens and underscores`),z8(mA(n),`label`,`a non-empty string`),z8(r===void 0||mA(r),`icon`,`a non-empty string`),L8(i===void 0!=(a===void 0),"Either `definition.component` or `definition.url` must be given"),z8(i===void 0||d6(i),`component`,`a React component`),z8(o===void 0||typeof o==`boolean`&&i===void 0,`newTab`,"a boolean given along with `url`");let s;if(a!==void 0){let e=mA(a)?B2e(a):null;z8(!!e&&[`http:`,`https:`].includes(e.protocol),`url`,"a valid `http` or `https` URL or file path"),s=e.href}nk.set(t,{id:t,label:n,icon:r??`extension`,component:i,url:s,newTab:o??!1}),i&&J3()},Ppt=e=>{R8(E(e),`registerEditorComponent`,`definition`,`an object`),z8(mA(e.id),`id`,`a non-empty string`),z8(e.label===void 0||mA(e.label),`label`,`a non-empty string`),z8(e.pattern instanceof RegExp,`pattern`,`a RegExp`),z8(typeof e.toBlock==`function`,`toBlock`,`a function`),z8(e.toPreview===void 0||typeof e.toPreview==`function`,`toPreview`,`a function`),z8(Array.isArray(e.fields),`fields`,`an array`);let{htmlSelector:t,fromBlockHTML:n,toBlockHTML:r}=e,i=[t,n,r];i.some(e=>e!==void 0)&&(L8(!i.includes(void 0),"The `definition.htmlSelector`, `definition.fromBlockHTML` and `definition.toBlockHTML` must be given together"),z8(mA(t)&&cxe(t),`htmlSelector`,`a valid CSS selector`),L8(!!Yj(t),"Each selector in the `definition.htmlSelector` must name the element type it matches"),z8(typeof n==`function`,`fromBlockHTML`,`a function`),z8(typeof r==`function`,`toBlockHTML`,`a function`)),tk.set(e.id,e),(e.toPreview?.length??0)>=3&&G1()},Fpt=e=>{if(!E(e))throw TypeError(`The event listener must be an object`);let{name:t,handler:n}=e;if(typeof t!=`string`||typeof n!=`function`)throw TypeError("The event listener must have a string `name` property and a function `handler` property");if(!T4.includes(t))throw RangeError(`Unsupported event listener name "${t}". Supported names are: ${T4.join(`, `)}`);ck.add(e),G1()},Q9=(e,t,n,r)=>{let i=E(e),a=i?e:{name:e,controlComponent:t,previewComponent:n,schema:r},[o,s]=i?[`controlComponent`,`previewComponent`]:[`control`,`preview`],{name:c,controlComponent:l,previewComponent:u,summaryComponent:d,schema:f}=a;R8(mA(c),`registerFieldType`,`name`,`a non-empty string`),z2e({name:c,reserved:Pk,subject:`field type`,builtin:`built-in field type`,custom:`custom field type`}),R8(d6(l)||typeof l==`string`,`registerFieldType`,o,`a React component or a string`),R8(u===void 0||d6(u),`registerFieldType`,s,`a React component`),R8(d===void 0||d6(d),`registerFieldType`,`summaryComponent`,`a React component`),R8(f===void 0||E(f),`registerFieldType`,`schema`,`an object`),rk.set(c,{control:l,preview:u,summary:d,schema:f}),G1(),J3()},Ipt=(e,{raw:t=!1,collection:n,file:r}={})=>{R8(mA(e),`registerPreviewStyle`,`style`,`a non-empty string`),R8(typeof t==`boolean`,`registerPreviewStyle`,`raw`,`a boolean`),R8(n===void 0||mA(n),`registerPreviewStyle`,`collection`,`a non-empty string`),R8(r===void 0||mA(r),`registerPreviewStyle`,`file`,`a non-empty string`),L8(r===void 0||n!==void 0,"The `file` option for `CMS.registerPreviewStyle()` requires the `collection` option");let i=t?null:B2e(e);R8(t||!!i,`registerPreviewStyle`,`style`,"a valid URL or file path when `raw` is false");let a=t?URL.createObjectURL(new Blob([e],{type:`text/css`})):i.href;[...ak].some(e=>e.url===a&&e.collection===n&&e.file===r)||ak.add({url:a,collection:n,file:r})},Lpt=(e,t)=>{R8(mA(e),`registerPreviewTemplate`,`name`,`a non-empty string`),R8(d6(t),`registerPreviewTemplate`,`component`,`a React component`),ok.set(e,t),G1(),J3()},Rpt=(e,t)=>{R8(typeof e==`string`&&oP.test(e),`registerStringTransformation`,`name`,`a string consisting of letters, digits and underscores, not starting with a digit`),z2e({name:e,reserved:aP,subject:`string transformation`,builtin:`built-in transformation`,custom:`custom transformation`}),R8(typeof t==`function`,`registerStringTransformation`,`transform`,`a function`),sk.set(e,t)},zpt=(e,t,{fieldConfig:n}={})=>{R8(e instanceof Element,`renderRichText`,`target`,`an element`),R8(typeof t==`string`,`renderRichText`,`value`,`a string`),R8(n===void 0||E(n),`renderRichText`,`fieldConfig`,`an object`);let r=Oo(N8,{target:e,props:{locale:``,keyPath:``,typedKeyPath:``,fieldConfig:{name:`body`,sanitize_preview:!0,...n,widget:`richtext`},currentValue:t}});return()=>{jo(r)}},Bpt=gr.default,Vpt=new Proxy({React:Bpt,getFieldType:B8,getWidget:B8,init:Z9,registerCustomFormat:Mpt,registerCustomPage:Npt,registerEditorComponent:Ppt,registerEventListener:Fpt,registerFieldType:Q9,registerPreviewStyle:Ipt,registerPreviewTemplate:Lpt,registerStringTransformation:Rpt,registerWidget:Q9,renderRichText:zpt},{get:(e,t)=>{if(t in e)return e[t];if(_r.includes(t))return console.warn(`CMS.%s() is not supported in Sveltia CMS, and we don’t have any plans to implement it. See %s for compatibility information.`,t,`https://sveltiacms.app/en/docs/migration/netlify-decap-cms#features-not-to-be-implemented`),()=>void 0}}),Hpt=function(e,t,n,r){var i;t[0]=0;for(var a=1;a<t.length;a++){var o=t[a++],s=t[a]?(t[0]|=o?1:2,n[t[a++]]):t[++a];o===3?r[0]=s:o===4?r[1]=Object.assign(r[1]||{},s):o===5?(r[1]=r[1]||{})[t[++a]]=s:o===6?r[1][t[++a]]+=s+``:o?(i=e.apply(s,Hpt(e,s,n,[``,null])),r.push(i),s[0]?t[0]|=2:(t[a-2]=0,t[a]=i)):r.push(s)}return r},Upt=new Map;function Wpt(e){var t=Upt.get(this);return t||(t=new Map,Upt.set(this,t)),(t=Hpt(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,i=``,a=``,o=[0],s=function(e){r===1&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,``)))?o.push(0,e,i):r===3&&(e||i)?(o.push(3,e,i),r=2):r===2&&i===`...`&&e?o.push(4,e,0):r===2&&i&&!e?o.push(5,0,!0,i):r>=5&&((i||!e&&r===5)&&(o.push(r,0,i,n),r=6),e&&(o.push(r,e,0,n),r=6)),i=``},c=0;c<e.length;c++){c&&(r===1&&s(),s(c));for(var l=0;l<e[c].length;l++)t=e[c][l],r===1?t===`<`?(s(),o=[o],r=3):i+=t:r===4?i===`--`&&t===`>`?(r=1,i=``):i=t+i[0]:a?t===a?a=``:i+=t:t===`"`||t===`'`?a=t:t===`>`?(s(),r=1):r&&(t===`=`?(r=5,n=i,i=``):t===`/`&&(r<5||e[c][l+1]===`>`)?(s(),r===3&&(o=o[0]),r=o,(o=o[0]).push(2,0,r),r=0):t===` `||t===` `||t===`
`||t===`\r`?(s(),r=2):i+=t),r===3&&i===`!--`&&(r=4,o=o[0])}return s(),o}(e)),t),arguments,[])).length>1?t:t[0]}var Gpt=e=>{let t={},n=``,r=0,i=``,a=()=>{let e=n.indexOf(`:`),r=n.slice(0,e).trim(),i=n.slice(e+1).replace(/!\s*important\s*$/i,``).trim();e>0&&r&&i&&(t[r.startsWith(`--`)?r:r.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=i),n=``};return[...e].forEach(e=>{if(i)i=e===i?``:i;else if(e===`"`||e===`'`)i=e;else if(e===`(`)r+=1;else if(e===`)`)--r;else if(e===`;`&&r<=0){a();return}n+=e}),a(),t},Kpt=Wpt.bind((e,t,...n)=>(0,gr.createElement)(e,typeof t?.style==`string`?{...t,style:Gpt(t.style)}:t,...n)),qpt=Vpt;window.CMS=Vpt,window.initCMS=Z9,window.createClass=h.default,window.createElement=gr.createElement,window.h=gr.createElement,window.rf=gr.Fragment,window.html=Kpt,globalThis.__SVELTIA_CMS_REACT__=gr.default,window.marked=dr,window.DOMPurify=gt,document.querySelector(`link[rel="stylesheet"][href$="/sveltia-cms.css"]`)&&console.warn("Sveltia CMS does not require a stylesheet. Remove the invalid `<link>` tag referencing `sveltia-cms.css` to avoid unnecessary network requests.");var $9=document.querySelector(`script[src$="/sveltia-cms.js"]`);return $9?.type===`module`&&console.warn('The Sveltia CMS script is not an ES module. Remove the "type="module" attribute from the `<script>` tag to avoid unexpected behavior when using the JavaScript API.'),document.querySelector(`script[src="https://identity.netlify.com/v1/netlify-identity-widget.js"]`)&&console.warn(`Netlify Identity Widget is not supported in Sveltia CMS.`),!window.CMS_MANUAL_INIT&&(document.currentScript||$9)&&Z9(),e.React=Bpt,e.default=qpt,e.getFieldType=B8,e.getWidget=B8,e.init=Z9,e.registerCustomFormat=Mpt,e.registerCustomPage=Npt,e.registerEditorComponent=Ppt,e.registerEventListener=Fpt,e.registerFieldType=Q9,e.registerWidget=Q9,e.registerPreviewStyle=Ipt,e.registerPreviewTemplate=Lpt,e.registerStringTransformation=Rpt,e.renderRichText=zpt,e})({});
//# sourceMappingURL=sveltia-cms.js.map