gcg-website/static/admin-gitea/static-cms-app.js

1021 lines
6.3 MiB
JavaScript
Raw Normal View History

2023-01-16 07:35:35 +01:00
/*! For license information please see static-cms-app.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.StaticCmsApp=t():e.StaticCmsApp=t()}(globalThis,(()=>(()=>{var __webpack_modules__={936:(e,t,n)=>{"use strict";var r=n(204),i=n(489);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,s={};function l(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(s[e]=t,e=0;e<t.length;e++)a.add(t[e])}var u=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),d=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},h={};function m(e,t,n,r,i,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new m(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new m(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new m(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new m(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new m(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new m(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new m(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new m(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new m(e,5,!1,e.toLowerCase(),null,!1,!1)}));var O=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function v(e,t,n,r){var i=g.hasOwnProperty(t)?g[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!d.call(h,e)||!d.call(p,e)&&(f.test(e)?h[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font
|| (${s} == "string" && ${i} && ${i} == +${i})`).assign(l,a._`+${i}`);case"integer":return void r.elseIf(a._`${s} === "boolean" || ${i} === null
|| (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(l,a._`+${i}`);case"boolean":return void r.elseIf(a._`${i} === "false" || ${i} === 0 || ${i} === null`).assign(l,!1).elseIf(a._`${i} === "true" || ${i} === 1`).assign(l,!0);case"null":return r.elseIf(a._`${i} === "" || ${i} === 0 || ${i} === false`),void r.assign(l,null);case"array":r.elseIf(a._`${s} === "string" || ${s} === "number"
|| ${s} === "boolean" || ${i} === null`).assign(l,a._`[${i}]`)}}r.else(),h(e),r.endIf(),r.if(a._`${l} !== undefined`,(()=>{r.assign(i,l),function({gen:e,parentData:t,parentDataProperty:n},r){e.if(a._`${t} !== undefined`,(()=>e.assign(a._`${t}[${n}]`,r)))}(e,l)}))}(e,t,s):h(e)}))}return c};const u=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,r=l.Correct){const i=r===l.Correct?a.operators.EQ:a.operators.NEQ;let o;switch(e){case"null":return a._`${t} ${i} null`;case"array":o=a._`Array.isArray(${t})`;break;case"object":o=a._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=s(a._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=s();break;default:return a._`typeof ${t} ${i} ${e}`}return r===l.Correct?o:(0,a.not)(o);function s(e=a.nil){return(0,a.and)(a._`typeof ${t} == "number"`,e,n?a._`isFinite(${t})`:a.nil)}}function f(e,t,n,r){if(1===e.length)return d(e[0],t,n,r);let i;const o=(0,s.toHash)(e);if(o.array&&o.object){const e=a._`typeof ${t} != "object"`;i=o.null?e:a._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else i=a.nil;o.number&&delete o.integer;for(const e in o)i=(0,a.and)(i,d(e,t,n,r));return i}t.checkDataType=d,t.checkDataTypes=f;const p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?a._`{type: ${e}}`:a._`{type: ${t}}`};function h(e){const t=function(e){const{gen:t,data:n,schema:r}=e,i=(0,s.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}(e);(0,o.reportError)(t,p)}t.reportTypeError=h},75495:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const r=n(50050),i=n(76281);function o(e,t,n){const{gen:o,compositeRule:a,data:s,opts:l}=e;if(void 0===n)return;const c=r._`${s}${(0,r.getProperty)(t)}`;if(a)return void(0,i.checkStrictMode)(e,`default is ignored for: ${c}`);let u=r._`${c} === undefined`;"empty"===l.useDefaults&&(u=r._`${u} || ${c} === null || ${c} === ""`),o.if(u,r._`${c} = ${(0,r.stringify)(n)}`)}t.assignDefaults=function(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const t in n)o(e,t,n[t].default);else"array"===t&&Array.isArray(r)&&r.forEach(((t,n)=>o(e,n,t.default)))}},77565:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const r=n(50131),i=n(25210),o=n(54843),a=n(25210),s=n(75495),l=n(34295),c=n(81990),u=n(50050),d=n(93290),f=n(35531),p=n(76281),h=n(60597);function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},o){i.code.es5?e.func(t,u._`${d.default.data}, ${d.default.valCxt}`,r.$async,(()=>{e.code(u._`"use strict"; ${g(n,i)}`),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,u._`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,u._`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,u._`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,u._`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`${d.default.valCxt}.${d.default.dynamicAnchors}`)}),(()=>{e.var(d.default.instancePath,u._`""`),e.var(d.default.parentData,u._`undefined`),e.var(d.default.parentDataProperty,u._`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,u._`{}`)}))}(e,i),e.code(o)})):e.func(t,u._`${d.default.data}, ${function(e){return u._`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?u._`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}(i)}`,r.$async,(()=>e.code(g(n,i)).code(o)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?u._`/*# sourceURL=${n} */`:u.nil}function O({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function y(e){return"boolean"!=typeof e.schema}function v(e){(0,p.checkUnknownRu
missingProperty: ${i},
depsCount: ${t},
deps: ${n}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e)"__proto__"!==r&&((Array.isArray(e[r])?t:n)[r]=e[r]);return[t,n]}(e);s(e,t),l(e,n)}};function s(e,t=e.schema){const{gen:n,data:i,it:a}=e;if(0===Object.keys(t).length)return;const s=n.let("missing");for(const l in t){const c=t[l];if(0===c.length)continue;const u=(0,o.propertyInData)(n,i,l,a.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),a.allErrors?n.if(u,(()=>{for(const t of c)(0,o.checkReportMissingProp)(e,t)})):(n.if(r._`${u} && (${(0,o.checkMissingProp)(e,c,s)})`),(0,o.reportMissingProp)(e,s),n.else())}}function l(e,t=e.schema){const{gen:n,data:r,keyword:a,it:s}=e,l=n.name("valid");for(const c in t)(0,i.alwaysValidSchema)(s,t[c])||(n.if((0,o.propertyInData)(n,r,c,s.opts.ownProperties),(()=>{const t=e.subschema({keyword:a,schemaProp:c},l);e.mergeValidEvaluated(t,l)}),(()=>n.var(l,!0))),e.ok(l))}t.validatePropertyDeps=s,t.validateSchemaDeps=l,t.default=a},43044:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(50050),i=n(76281),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>r.str`must match "${e.ifClause}" schema`,params:({params:e})=>r._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:o}=e;void 0===n.then&&void 0===n.else&&(0,i.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const s=a(o,"then"),l=a(o,"else");if(!s&&!l)return;const c=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),s&&l){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(u,d("then",n),d("else",n))}else s?t.if(u,d("then")):t.if((0,r.not)(u),d("else"));function d(n,i){return()=>{const o=e.subschema({keyword:n},u);t.assign(c,u),e.mergeValidEvaluated(o,c),i?t.assign(i,r._`${n}`):e.setParams({ifClause:n})}}e.pass(c,(()=>e.error(!0)))}};function a(e,t){const n=e.schema[t];return void 0!==n&&!(0,i.alwaysValidSchema)(e,n)}t.default=o},98976:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(29162),i=n(1617),o=n(55261),a=n(46066),s=n(86968),l=n(50452),c=n(93390),u=n(92150),d=n(25267),f=n(5770),p=n(39866),h=n(80010),m=n(20748),g=n(75315),O=n(43044),y=n(90290);t.default=function(e=!1){const t=[p.default,h.default,m.default,g.default,O.default,y.default,c.default,u.default,l.default,d.default,f.default];return e?t.push(i.default,a.default):t.push(r.default,o.default),t.push(s.default),t}},55261:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(50050),i=n(76281),o=n(6643),a={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return s(e,"additionalItems",t);n.items=!0,(0,i.alwaysValidSchema)(n,t)||e.ok((0,o.validateArray)(e))}};function s(e,t,n=e.schema){const{gen:o,parentSchema:a,data:s,keyword:l,it:c}=e;!function(e){const{opts:r,errSchemaPath:o}=c,a=n.length,s=a===e.minItems&&(a===e.maxItems||!1===e[t]);if(r.strictTuples&&!s){const e=`"${l}" is ${a}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,i.checkStrictMode)(c,e,r.strictTuples)}}(a),c.opts.unevaluated&&n.length&&!0!==c.items&&(c.items=i.mergeEvaluated.items(o,n.length,c.items));const u=o.name("valid"),d=o.const("len",r._`${s}.length`);n.forEach(((t,n)=>{(0,i.alwaysValidSchema)(c,t)||(o.if(r._`${d} > ${n}`,(()=>e.subschema({keyword:l,schemaProp:n,dataProp:n},u))),e.ok(u))}))}t.validateTuple=s,t.default=a},46066:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(50050),i=n(76281),o=n(6643),a=n(29162),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>r._`{limit: ${e}}`},code(e){const{schema:t
^${xs}+`.valueOf(),{exec:Ps}=ga.s`
^
(
(?:\d\d\d\d-\d\d-\d\d \d)?
[\w\-+.:]+
)
${xs}*
(.*)
$`.valueOf(),{exec:$s}=ga.s`
^
'([^']*)'
${xs}*
(.*)`.valueOf(),{exec:Cs}=ga.s`
^
(.*?)
'''('{0,2})
${xs}*
(.*)`.valueOf(),{exec:Ts}=ga.s`
^
(.*?)
'''()
${xs}*
(.*)`.valueOf();let Es=Ts;const Qs=ga.s`
^
.
${xs}*`.valueOf(),As=/[^\x00-\x1F"#'()<>[\\\]`{}\x7F]+/,{exec:Rs}=ga.s`
^
${xs}*
=
${xs}*
(?:
<(${As})>
${xs}*
)?
(.*)
$`.valueOf(),{exec:Ds}=ga.s`
^
<(${As})>
${xs}*
(.*)
$`.valueOf(),{exec:Ls}=ga.s`
^
<(${As})>
${xs}*
(.*)
$`.valueOf(),Ms=sa(/[^\\"]+|\\.?|"(?!"")"?/sy),js=e=>{let t=0;for(;Ms.test(e);)t=Ms.lastIndex;return t},Is=/[^\\\x00-\x08\x0B-\x1F\x7F]+|\\(?:[btnfr"\\]|[\t ]*\n[\t\n ]*|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/g,zs=/[^\\\x00-\x09\x0B-\x1F\x7F]+|\\(?:[btnfr"\\]|[\t ]*\n[\t\n ]*|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/g,Fs=/[^\\\x00-\x09\x0B-\x1F]+|\\(?:[btnfr"\\]|[\t ]*\n[\t\n ]*|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/g,Us=/[^\\\x00-\x09\x0B-\x1F]+|\\(?:[btnfr"\\/]|[\t ]*\n[\t\n ]*|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/g;let Ws=Is;const Ns=e=>!e.replace(Ws,""),Ys=sa(/[^\\"\x00-\x08\x0B-\x1F\x7F]+|\\(?:[btnfr"\\]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y),Xs=sa(/[^\\"\x00-\x08\x0B-\x1F\x7F]+|\\(?:[btnfr"\\]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y),Bs=sa(/[^\\"\x00-\x08\x0B-\x1F]+|\\(?:[btnfr"\\]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y),qs=sa(/[^\\"\x00-\x08\x0B-\x1F]+|\\(?:[btnfr"\\/]|u[\dA-Fa-f]{4}|U[\dA-Fa-f]{8})/y);let Zs=qs;const Vs=e=>{let t=Zs.lastIndex=1;for(;Zs.test(e);)t=Zs.lastIndex;return t!==e.length&&'"'===e[t]||bs(ko("Bad basic string"+ks(" at "))),t},{test:Hs}=sa(/^[ \t]*\./),Gs=/^[ \t]*\.[ \t]*/,{exec:Ks}=sa(/^[\w-]+/),{exec:Js}=sa(/^[^ \t#=[\]'".]+(?:[ \t]+[^ \t#=[\]'".]+)*/);let el=Js;const{exec:tl}=sa(/^'[^'\x00-\x08\x0B-\x1F\x7F]*'/),{exec:nl}=sa(/^'[^'\x00-\x08\x0B-\x1F]*'/);let rl=nl,il=!0;const ol=(e,t)=>{const n="["===e[1];n?(il||bs(ko("Array of Tables is not allowed before TOML v0.2"+ks(", which at "))),e=e.slice(2)):e=e.slice(1),e=e.replace(Ss,"");const{leadingKeys:r,finalKey:i}=({lineRest:e}=t(e));let o;return(e=e.replace(Ss,""))&&"]"===e[0]||bs(ko("Table header is not closed"+ks(", which is found at "))),(e.length>1?"]"===e[1]===n:!n)||bs(ko("Square brackets of Table definition statement not match"+ks(" at "))),(e=e.slice(n?2:1).replace(Ss,""))&&"<"===e[0]?({1:o,2:e}=Ls(e)||bs(ko("Bad tag"+ks(" at ")))):o="",{leadingKeys:r,finalKey:i,asArrayItem:n,tag:o,lineRest:e}},{test:al}=sa(/[\x00-\x08\x0B-\x1F\x7F]/),{test:sl}=sa(/[\x00-\x08\x0B-\x1F]/);let ll=al;const cl=ga`
(?:
0
(?:
b[01][_01]*
|
o[0-7][_0-7]*
|
x[\dA-Fa-f][_\dA-Fa-f]*
|
(?:\.\d[_\d]*)?(?:[Ee]-?\d[_\d]*)?
)
|
[1-9][_\d]*
(?:\.\d[_\d]*)?(?:[Ee]-?\d[_\d]*)?
|
inf
|
nan
)
`.valueOf(),{test:ul}=ga`
^(?:
-?${cl}
(?:-${cl})*
|
true
|
false
)$
`.valueOf(),{test:dl}=ga`_(?![\dA-Fa-f])`.valueOf(),fl=e=>ul(e)&&!dl(e);let pl=!0,hl="",ml=null,gl=!0,Ol=0,yl=0;const vl={test:()=>!0},bl=jo.bind(Mo(class extends To{constructor(e){super(`^${wa(e)}$`);let t=-1;for(let n=e.length;n;){const{length:r}=e[--n];r>t&&(t=r)}return this.lastIndex=t+1,this}test(e){return e.length<this.lastIndex&&super.test(e)}}.prototype));let _l,wl,kl,xl,Sl,Pl,$l,Cl,Tl,El,Ql,Al,Rl,Dl=vl;const Ll=new Eo,Ml=Qo.bind(Ll),jl=Ao.bind(Ll),Il=()=>{const e=t=>{const n=Ml(t);return n?n===e||bs(So("Types in Array must be same"+ks(". Check "))):jl(t,e),t};return e},zl={asNulls:Il(),asStrings:Il(),asTables:Il(),asArrays:Il(),asBooleans:Il(),asFloats:Il(),asIntegers:Il(),asOffsetDateTimes:Il(),asLocalDateTimes:Il(),asLocalDates:Il(),asLocalTimes:Il()},Fl=e=>e;let Ul,Wl,Nl,Yl,Xl,Bl,ql,Zl,Vl,Hl,Gl,Kl=null,Jl=null;const ec=(e,t,n,r)=>{const i=Ro(Io);i._linked=Jl,i.tag=e,n&&(i.table=n,i.key=r),t&&(i.array=t,i.index=t.length),Jl=i},tc=()=>{throw bs(ko("xOptions.tag is not enabled, but found tag syntax"+ks(" at ")))};let nc=tc;const rc=(ArrayBuffer.isView,TextDecoder,Symbol),ic=rc("previous"),oc=e=>{let t=e,n=t.next();if(!n.done)for(n.value[ic]=t,n=(t=n.value).next();;)if(n.done){if(t===e)break;t=t[ic],n=t.next(n.value)}else n.value[ic]=t,n=(t=n.value).next();return n.value},ac=rc("_literal"),sc=(e,t)=>{const n=Bo(t);return n[ac]=e,n},lc=new Pa,cc=Ca.bind(lc),uc=$a.bind(lc),dc=new Pa,fc=Ca.bind(dc),pc=$a.bind(dc),hc=e=>{const t=[];return cc(t),e&&fc(t),t},mc=Date,gc=Date.parse,Oc=Object.preventExtensions,yc=Object.getOwnPropertyDescriptors,vc=e=>(Mo(Mo(e).prototype),e),bc=/(?:0[1-9]|[12]\d|30)/,_c=/(?:0[1-9]|[12]\d|3[01])/,wc=/(?:[01]\d|2[0-3])/,kc=/[0-5]\d/,xc=ga`
\d\d\d\d-
(?:
0
(?:
[13578]-${_c}
|
[469]-${bc}
|
2-${/(?:0[1-9]|1\d|2\d)/}
)
|
1
(?:
[02]-${_c}
|
1-${bc}
)
)
`.valueOf(),Sc=ga`
${wc}:${kc}:${kc}
`.valueOf(),{exec:Pc}=sa(/(([+-])\d\d):(\d\d)$/),{exec:$c}=ga`
^
${xc}
[Tt ]
${Sc}
(?:\.\d{1,3}(\d*?)0*)?
(?:[Zz]|[+-]${wc}:${kc})
$`.valueOf(),{exec:Cc}=ga`
^
${xc}
[Tt ]
${Sc}
()
[Zz]
$`.valueOf(),{test:Tc}=ga`
^
${xc}
[Tt ]
${Sc}
(?:\.\d+)?
$`.valueOf(),{test:Ec}=ga`
^
${xc}
$`.valueOf(),{test:Qc}=ga`
^
${Sc}
(?:\.\d+)?
$`.valueOf(),Ac=/[ t]/,Rc=/[-T:.]/g,Dc=/\.?0+$/,Lc=/\.(\d*?)0+$/,Mc=(e,t)=>t,jc=(()=>{const e=function(){return this},t=Aa(null);{const e=Aa(null);for(const n of za(mc.prototype))"constructor"===n||"toJSON"===n||(t[n]=e)}return e.prototype=Oc(Ro(mc.prototype,t)),Mo(e)})(),Ic=e=>e.replace(Lc,Mc).replace(Rc,""),zc=/./gs,Fc=e=>" "[e],Uc=e=>{if(e.startsWith("02-29",5)){const t=+e.slice(0,4);return!(3&t||!(t%100)&&(t%400||!(t%3200)))}return!0},{test:Wc}=ga.s`^.....(?:06.30|12.31).23:59:59`.valueOf(),Nc=function(e,t){for(var n=Ro(Io),r=Ea(t),i=r.length,o=0;o<i;++o){var a=r[o];n[a]=ia(t[a])}if(Qa){var s=Qa(t);for(i=s.length,o=0;o<i;++o){var l=s[o];ta(t,l)&&(n[l]=ia(t[l]))}}return Da(e,n)}(new mc(0),yc(mc.prototype)),Yc=rc("OffsetDateTime_ISOString"),Xc=rc("OffsetDateTime_value"),Bc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return Nc.setTime(+e[Xc]+t),Nc},qc=vc((ho=rc.toStringTag,class extends jc{get[ho](){return"OffsetDateTime"}valueOf(){return this[Xc]}toISOString(){return this[Yc]}constructor(e){Uc(e)||bs(ko(`Invalid Offset Date-Time ${e}`+ks(" at ")));const t=e.startsWith("60",17);let n=t?e.slice(0,17)+"59"+e.slice(19):e;const{1:r=""}=(wl?Cc(n):$c(n))||bs(ko(`Invalid Offset Date-Time ${e}`+ks(" at "))),i=gc(n=n.replace(Ac,"T").replace("z","Z"));return t&&(Nc.setTime(i),Wc(Nc.toISOString())||bs(ko(`Invalid Offset Date-Time ${e}`+ks(" at ")))),super(),wo(this,Yc,void 0),wo(this,Xc,void 0),this[Yc]=n,this[Xc]=((e,t)=>e<0?(""+(e+6216730554e4)).replace(zc,Fc).padStart(14," ")+t.replace(zc,Fc)+e:t?(e+".").padStart(16,"0")+t:(""+e).padStart(15,"0"))(i,r),this}getUTCFullYear(){return Bc(this).getUTCFullYear()}getUTCMonth(){return Bc(this).getUTCMonth()}getUTCDate(){return Bc(this).getUTCDate()}getUTCHours(){return Bc(this).getUTCHours()}getUTCMinutes(){return Bc(this).getUTCMinutes()}getUTCSeconds(){return Bc(this).getUTCSeconds()}getUTCMilliseconds(){return Bc(this).getUTCMilliseconds()}getUTCDay(){return Bc(this).getUTCDay()}getTimezoneOffset(){const e=Pc(this[Yc]);return e?60*+e[1]+ +(e[2]+e[3]):0}getTime(){return qo(+this[Xc])}})),Zc=rc("LocalDateTime_ISOString"),Vc=rc("LocalDateTime_value"),Hc=(e,t,n)=>+e[Zc].slice(t,n),Gc=(e,t,n,r)=>{const i=""+r,o=n-t;if(i.length>o)throw xo();e[Vc]=Ic(e[Zc]=e[Zc].slice(0,t)+i.padStart(o,"0")+e[Zc].slice(n))},Kc=vc((mo=rc.toStringTag,class extends jc{get[mo](){return"LocalDateTime"}valueOf(){return this[Vc]}toISOString(){return this[Zc]}constructor(e){return Tc(e)&&Uc(e)||bs(ko(`Invalid Local Date-Time ${e}`+ks(" at "))),super(),wo(this,Zc,void 0),wo(this,Vc,void 0),this[Vc]=Ic(this[Zc]=e.replace(Ac,"T")),this}getFullYear(){return Hc(this,0,4)}setFullYear(e){Gc(this,0,4,e)}getMonth(){return Hc(this,5,7)-1}setMonth(e){Gc(this,5,7,e+1)}getDate(){return Hc(this,8,10)}setDate(e){Gc(this,8,10,e)}getHours(){return Hc(this,11,13)}setHours(e){Gc(this,11,13,e)}getMinutes(){return Hc(this,14,16)}setMinutes(e){Gc(this,14,16,e)}getSeconds(){return Hc(this,17,19)}setSeconds(e){Gc(this,17,19,e)}getMilliseconds(){return+this[Vc].slice(14,17).padEnd(3,"0")}setMilliseconds(e){this[Vc]=Ic(this[Zc]=this[Zc].slice(0,19)+(e?("."+(""+e).padStart(3,"0")).replace(Dc,""):""))}})),Jc=rc("LocalDate_ISOString"),eu=rc("LocalDate_value"),tu=(e,t,n)=>+e[Jc].slice(t,n),nu=(e,t,n,r)=>{const i=""+r,o=n-t;if(i.length>o)throw xo();e[eu]=Ic(e[Jc]=e[Jc].slice(0,t)+i.padStart(o,"0")+e[Jc].slice(n))},ru=vc((go=rc.toStringTag,class extends jc{get[go](){return"LocalDate"}valueOf(){return this[eu]}toISOString(){return this[Jc]}constructor(e){return Ec(e)&&Uc(e)||bs(ko(`Invalid Local Date ${e}`+ks(" at "))),super(),wo(this,Jc,void 0),wo(this,eu,void 0),this[eu]=Ic(this[Jc]=e),this}getFullYear(){return tu(this,0,4)}setFullYear(e){nu(this,0,4,e)}getMonth(){return tu(this,5,7)-1}setMonth(e){nu(this,5,7,e+1)}getDate(){return tu(this,8,10)}setDate(e){nu(this,8,10,e)}})),iu=rc("LocalTime_ISOString"),ou=rc("LocalTime_value"),au=(e,t,n)=>+e[iu].slice(t,n),su=(e,t,n,r)=>{const i=""+r,o=n-t;if(i.length>o)throw xo();e[ou]=Ic(e[iu]=e[iu].slice(0,t)+i.padStart(2,"0")+e[iu].slice(n))}
^
${mu}
(?:
\.\d[_\d]*
(?:[eE][-+]?\d[_\d]*)?
|
[eE][-+]?\d[_\d]*
)
$`.valueOf(),Cu=/_/g,{test:Tu}=sa(/^[-+]?0(?:\.0+)?(?:[eE][-+]?0+)?$/),{exec:Eu}=sa(/^[-0]?(\d*)(?:\.(\d+))?(?:e\+?(-?\d+))?$/),{exec:Qu}=sa(/^[-+]?0?(\d*)(?:\.(\d*?)0*)?(?:[eE]\+?(-?\d+))?$/),Au=e=>{if(!$u(e)||gu(e)){if($l){if("inf"===e||"+inf"===e)return Vo;if("-inf"===e)return-1/0;if("nan"===e||"+nan"===e)return NaN;if("-nan"===e)return NaN}throw bs(ko(`Invalid Float ${e}`+ks(" at ")))}const t=e.replace(Cu,""),n=+t;if(Pl){Pu(n)||bs(xo(`Float ${e} has been as big as inf`+ks(" at "))),n||Tu(t)||bs(xo(`Float ${e} has been as little as ${"-"===e[0]?"-":""}0`+ks(" at ")));const{1:r,2:i="",3:o=""}=Eu(n),{1:a,2:s="",3:l=""}=Qu(t);a+s===r+i&&l-s.length==o-i.length||bs(xo(`Float ${e} has lost its exact and been ${n}`+ks(" at ")))}return n},Ru=(e,t)=>{const{length:n}=t;let r=0;for(;r<n;){const i=t[r++];if(!(i in e)){for(e=e[i]=new Cl(cs);r<n;)e=e[t[r++]]=new Cl(cs);return e}if(e=e[i],is(e))Ga(e)&&bs(Po("Trying to define Table under Inline Table"+ks(" at ")));else{if(!uc(e))throw bs(Po("Trying to define Table under non-Table value"+ks(" at ")));pc(e)&&bs(Po("Trying to append value to Static Array"+ks(" at "))),e=e[e.length-1]}}return e},Du=(e,t,n,r)=>{let i;if(n){let n;t in e?uc(n=e[t])&&!pc(n)||bs(Po("Trying to push Table to non-ArrayOfTables value"+ks(" at "))):n=e[t]=hc(!1),r&&nc(r,n,e,t),n[n.length]=i=new Cl(ls)}else t in e?(i=e[t],fs(i)&&bs(Po("A table defined implicitly via key/value pair can not be accessed to via []"+ks(", which at "))),(e=>!!ss(e)&&(ts(e),!0))(i)||bs(Po("Duplicate Table definition"+ks(" at ")))):e[t]=i=new Cl(ls),r&&nc(r,null,e,t);return i},Lu=(e,t)=>{const{length:n}=t;let r=0;for(;r<n;){const i=t[r++];if(!(i in e)){for(e=e[i]=new Cl(cs,!0);r<n;)e=e[t[r++]]=new Cl(cs,!0);return e}e=e[i],is(e)||bs(Po("Trying to assign property through non-Table value"+ks(" at "))),Ga(e)&&bs(Po("Trying to assign property through static Inline Table"+ks(" at "))),fs(e)||bs(Po("A table defined implicitly via [] can not be accessed to via key/value pair"+ks(", which at ")))}return e},Mu=e=>(ll(e)&&bs(ko("Control characters other than Tab are not permitted in a Literal String"+ks(", which was found at "))),e),ju=(e,t,n)=>{if(!n.startsWith("'''")){const r=$s(n)||bs(ko("Bad literal string"+ks(" at "))),i=Mu(r[1]);return e[t]=_l?sc(n.slice(0,i.length+2),i):i,r[2]}const r=Es(n.slice(3));if(r){const i=Mu(r[1])+r[2];return e[t]=_l?sc(n.slice(0,i.length+6),i):i,r[3]}const i=new ws("Multi-line Literal String",n.length),o=!(n=n.slice(3));if(o){n=i.must();const r=Es(n);if(r){const i=Mu(r[1])+r[2];return e[t]=_l?sc(["'''",n.slice(0,i.length+3)],i):i,r[3]}}null===ml&&i.nowrap(hl);for(const r=[Mu(n)];;){const a=i.must(),s=Es(a);if(s){r[r.length]=Mu(s[1])+s[2];const i=r.join(ml);return _l?(r[r.length-1]+="'''",o?r.unshift("'''"):r[0]=`'''${n}`,e[t]=sc(r,i)):e[t]=i,s[3]}r[r.length]=Mu(a)}},Iu=(e,t,n)=>{if(!n.startsWith('"""')){const r=Vs(n),i=pu(n.slice(1,r));return e[t]=_l?sc(n.slice(0,r+1),i):i,n.slice(r+1).replace(Ss,"")}let r=3+js(n.slice(3));if(n.length!==r){const i=n.slice(3,r);Ns(i)||bs(ko("Bad multi-line basic string"+ks(" at ")));const o=pu(i)+(n.startsWith('"',r+=3)?n.startsWith('"',++r)?(++r,'""'):'"':"");return e[t]=_l?sc(n.slice(0,r),o):o,n.slice(r).replace(Ss,"")}const i=new ws("Multi-line Basic String",r),o=(n=n.slice(3))?0:1;if(o){n=i.must();let r=js(n);if(n.length!==r){const i=n.slice(0,r);Ns(i)||bs(ko("Bad multi-line basic string"+ks(" at ")));const a=hu(i,ml,o)+(n.startsWith('"',r+=3)?n.startsWith('"',++r)?(++r,'""'):'"':"");return e[t]=_l?sc(['"""',n.slice(0,r)],a):a,n.slice(r).replace(Ss,"")}}null===ml&&i.nowrap(hl),Ns(n+"\n")||bs(ko("Bad multi-line basic string"+ks(" at ")));for(const r=[n];;){const a=i.must();let s=js(a);if(a.length!==s){const i=a.slice(0,s);Ns(i)||bs(ko("Bad multi-line basic string"+ks(" at ")));const l=hu(r.join("\n")+"\n"+i,ml,o)+(a.startsWith('"',s+=3)?a.startsWith('"',++s)?(++s,'""'):'"':"");return _l?(o?r.unshift('"""'):r[0]=`"""${n}`,r[r.length]=`${i}"""`,e[t]=sc(r,l)):e[t]=l,a.slice(s).replace(Ss,"")}Ns(a+"\n")||bs(ko("Bad multi-line basic string"+ks(" at "))),r[r.length]=a}},zu=Aa(null),Fu
Multiple widgets registered with name "${t}". Only the last widget registered with
this name will be used.
`),!n)throw Error(`Widget "${t}" registered without \`controlComponent\`.`);iO.widgets[t]={control:n,preview:r,validator:i,getValidValue:o,getDefaultValue:a,schema:s}}else console.error("`registerWidget` failed, called with incorrect arguments.")}function cO(e){return iO.widgets[e]}function uO(){return Object.entries(iO.widgets).map((e=>{let[t,n]=e;return tO({name:t},n)}))}function dO(e){return cO(e||"string")||cO("unknown")}function fO(e){return iO.widgetValueSerializers[e]}function pO(e,t){e&&t?iO.backends[e]?console.error(`Backend [${e}] already registered. Please choose a different name.`):iO.backends[e]={init:(e,n)=>new t(e,n)}:console.error("Backend parameters invalid. example: CMS.registerBackend('myBackend', BackendClass)")}function hO(e){return iO.backends[e]}function mO(e){return iO.mediaLibraries.find((t=>t.name===e))}function gO(e){if(!rO.includes(e))throw new Error(`Invalid event name '${e}'`)}async function OO(e){let{name:t,data:n}=e;gO(t);const r=iO.eventHandlers[t];let i=tO({},n);for(const{handler:e,options:t}of r){const r=await e(i,t);if(void 0!==r){const e=tO(tO({},i.entry),{},{data:r});i=tO(tO({},n),{},{entry:e})}}return i.entry.data}function yO(e,t){e&&t?iO.locales[e]=t:console.error("Locale parameters invalid. example: CMS.registerLocale('locale', phrases)")}function vO(e){return iO.locales[e]}function bO(e){var t;return null!==(t=iO.icons[e])&&void 0!==t?t:null}function _O(){return iO.additionalLinks}function wO(e){return iO.shortcodes[e]}function kO(){return iO.shortcodes}var xO=__nested_webpack_require_2794107__(1869),SO=__nested_webpack_require_2794107__.n(xO);function PO(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i={collection:e,slug:t,path:n,partial:r.partial||!1,raw:r.raw||"",data:r.data||{},label:r.label||null,isModification:SO()(r.isModification)?r.isModification:null,mediaFiles:r.mediaFiles||[],author:r.author||"",updatedOn:r.updatedOn||"",status:r.status||"",i18n:r.i18n||{}};return i}const $O=["field"];function CO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function TO(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?CO(Object(n),!0).forEach((function(t){EO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CO(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function EO(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class QO{constructor(){EO(this,"storageKey","static-cms-user")}retrieve(){const e=window.localStorage.getItem(this.storageKey);return e&&JSON.parse(e)}store(e){window.localStorage.setItem(this.storageKey,JSON.stringify(e))}logout(){window.localStorage.removeItem(this.storageKey)}}function AO(e,t){const n="backup";return e?`${n}.${e}${t?`.${t}`:""}`:n}function RO(e,t){const n=bt()(t.data,e);if(n)return String(n);{const n=e.split(".")[0];return t[n]?String(t[n]):""}}function DO(e){return t=>e.reduce(((e,n)=>{const r=RO(n,t);return r?`${e} ${r}`:e}),"")}function LO(e,t){const n=e.reduce(((e,n)=>{const r=t.reduce(((e,t)=>{const r=mp({data:n.data,path:t});return e.push(...r),e}),[]);for(let t=0;t<r.length;t++)e.push(TO(TO({},n),{},{field:r[t]}));return e}),[]);return n}function MO(e){const t=e.map((e=>e.field)),n={},r=e.reduce(((e,t)=>{if(!e[t.slug]){const{field:r}=t,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},
0% {
transform: scale(0);
opacity: 0.1;
}
100% {
transform: scale(1);
opacity: 0.3;
}
`)),Aw=Bf($w||($w=Ew`
0% {
opacity: 1;
}
100% {
opacity: 0;
}
`)),Rw=Bf(Cw||(Cw=Ew`
0% {
transform: scale(1);
}
50% {
transform: scale(0.92);
}
100% {
transform: scale(1);
}
`)),Dw=(0,aw.ZP)("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Lw=(0,aw.ZP)((function(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:c}=e,[d,f]=u.useState(!1),p=(0,iw.Z)(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:a,height:a,top:-a/2+o,left:-a/2+i},m=(0,iw.Z)(n.child,d&&n.childLeaving,r&&n.childPulsate);return s||d||f(!0),u.useEffect((()=>{if(!s&&null!=l){const e=setTimeout(l,c);return()=>{clearTimeout(e)}}}),[l,s,c]),(0,_w.jsx)("span",{className:p,style:h,children:(0,_w.jsx)("span",{className:m})})}),{name:"MuiTouchRipple",slot:"Ripple"})(Tw||(Tw=Ew`
opacity: 0;
position: absolute;
&.${0} {
opacity: 0.3;
transform: scale(1);
animation-name: ${0};
animation-duration: ${0}ms;
animation-timing-function: ${0};
}
&.${0} {
animation-duration: ${0}ms;
}
& .${0} {
opacity: 1;
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: currentColor;
}
& .${0} {
opacity: 0;
animation-name: ${0};
animation-duration: ${0}ms;
animation-timing-function: ${0};
}
& .${0} {
position: absolute;
/* @noflip */
left: 0px;
top: 0;
animation-name: ${0};
animation-duration: 2500ms;
animation-timing-function: ${0};
animation-iteration-count: infinite;
animation-delay: 200ms;
}
`),xw.rippleVisible,Qw,550,(({theme:e})=>e.transitions.easing.easeInOut),xw.ripplePulsate,(({theme:e})=>e.transitions.duration.shorter),xw.child,xw.childLeaving,Aw,550,(({theme:e})=>e.transitions.easing.easeInOut),xw.childPulsate,Rw,(({theme:e})=>e.transitions.easing.easeInOut)),Mw=u.forwardRef((function(e,t){const n=(0,sw.Z)({props:e,name:"MuiTouchRipple"}),{center:r=!1,classes:i={},className:o}=n,a=(0,P.Z)(n,Sw),[s,l]=u.useState([]),c=u.useRef(0),d=u.useRef(null);u.useEffect((()=>{d.current&&(d.current(),d.current=null)}),[s]);const f=u.useRef(!1),p=u.useRef(null),h=u.useRef(null),m=u.useRef(null);u.useEffect((()=>()=>{clearTimeout(p.current)}),[]);const g=u.useCallback((e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:o,cb:a}=e;l((e=>[...e,(0,_w.jsx)(Lw,{classes:{ripple:(0,iw.Z)(i.ripple,xw.ripple),rippleVisible:(0,iw.Z)(i.rippleVisible,xw.rippleVisible),ripplePulsate:(0,iw.Z)(i.ripplePulsate,xw.ripplePulsate),child:(0,iw.Z)(i.child,xw.child),childLeaving:(0,iw.Z)(i.childLeaving,xw.childLeaving),childPulsate:(0,iw.Z)(i.childPulsate,xw.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o},c.current)])),c.current+=1,d.current=a}),[i]),O=u.useCallback(((e={},t={},n=(()=>{}))=>{const{pulsate:i=!1,center:o=r||t.pulsate,fakeElement:a=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&f.current)return void(f.current=!1);"touchstart"===(null==e?void 0:e.type)&&(f.current=!0);const s=a?null:m.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,u,d;if(o||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),u=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),u=Math.round(n-l.top)}if(o)d=Math.sqrt((2*l.width**2+l.height**2)/3),d%2==0&&(d+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-u),u)+2;d=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===h.current&&(h.current=()=>{g({pulsate:i,rippleX:c,rippleY:u,rippleSize:d,cb:n})},p.current=setTimeout((()=>{h.current&&(h.current(),h.current=null)}),80)):g({pulsate:i,rippleX:c,rippleY:u,rippleSize:d,cb:n})}),[r,g]),y=u.useCallback((()=>{O({},{pulsate:!0})}),[O]),v=u.useCallback(((e,t)=>{if(clearTimeout(p.current),"touchend"===(null==e?void 0:e.type)&&h.current)return h.current(),h.current=null,void(p.current=setTimeout((()=>{v(e,t)})));h.current=null,l((e=>e.length>0?e.slice(1):e)),d.current=t}),[]);return u.useImperativeHandle(t,(()=>({pulsate:y,start:O,stop:v})),[y,O,v]),(0,_w.jsx)(Dw,(0,S.Z)({className:(0,iw.Z)(xw.root,i.root,o),ref:m},a,{children:(0,_w.jsx)(bw,{component:null,exit:!0,children:s})}))})),jw=Mw;var Iw=__nested_webpack_require_2794107__(95201);function zw(e){return(0,Iw.Z)("MuiButtonBase",e)}const Fw=(0,kw.Z)("MuiButtonBase",["root","disabled","focusVisible"]),Uw=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Ww=(0,aw.ZP)("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Fw.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),Nw=u.forwardRef((function(e,t){const n=(0,sw.Z)({props:e,name:"MuiButtonBase"}),{action:r,centerRipple:i=!1,children:o,className:a,component:s="button",disabled:l=!1,disableRipple:c=!1,disableTouchRipple:d=!1,focusRipple:f=!1,
background-color: ${c$};
`,VQ=(0,aw.ZP)(pT)`
gap: 12px;
`,HQ=(0,aw.ZP)(Hk)`
${C$};
background: none;
color: #7b8290;
font-family: inherit;
font-size: 16px;
font-weight: 500;
text-transform: none;
gap: 2px;
&:hover,
&:active,
&:focus {
color: ${u$};
}
`,GQ=(0,aw.ZP)("div")`
flex-grow: 1;
`,KQ=(0,aw.ZP)("div")`
display: inline-flex;
align-items: center;
gap: 8px;
`,JQ={checkBackendStatus:function(){return async(e,t)=>{try{const n=t(),r=n.config.config;if(n.status.isFetching||!r)return;e({type:cv});const i=UO(r),o=await i.status(),a="ui.toast.onBackendDown",s=n.snackbar.messages.filter((e=>"string"!=typeof e.message&&e.message.key===a));if(!1===o.api.status)return 0===s.length&&e(c_({type:"error",message:{key:"ui.toast.onBackendDown",options:{details:o.api.statusPage}}})),e(hT(o));if(!0===o.api.status&&s.length>0&&s.forEach((t=>{e(u_(t.id))})),!1===o.auth.status){const t="ui.toast.onLoggedOut",r=n.snackbar.messages.find((e=>"string"!=typeof e.message&&e.message.key===t));r||e(c_({type:"error",message:{key:"ui.toast.onLoggedOut"}}))}e(hT(o))}catch(t){console.error(t),t instanceof Error&&e(function(e){return{type:dv,payload:{error:e}}}(t))}}},openMediaLibrary:sP,logoutUser:g_},eA=B((function(e){var t,n;const{auth:r,config:i,collections:o,mediaLibrary:a}=e,s=r.user,l=a.showMediaButton;return{user:s,collections:o,displayUrl:null===(t=i.config)||void 0===t?void 0:t.display_url,isTestRepo:"test-repo"===(null===(n=i.config)||void 0===n?void 0:n.backend.name),showMediaButton:l}}),JQ)((0,p.Iu)()((e=>{let{user:t,collections:n,logoutUser:r,openMediaLibrary:i,displayUrl:o,isTestRepo:a,t:s,showMediaButton:l,checkBackendStatus:c}=e;const[d,f]=(0,u.useState)(null),p=Boolean(d),h=(0,u.useCallback)((e=>{f(e.currentTarget)}),[]),m=(0,u.useCallback)((()=>{f(null)}),[]),g=(0,u.useCallback)((e=>{!function(e){Ck.push(Ef(e))}(e)}),[]),O=(0,u.useMemo)((()=>Object.values(n).filter((e=>{var t;return"folder"in e&&null!==(t=e.create)&&void 0!==t&&t}))),[n]);(0,u.useEffect)((()=>{const e=setInterval((()=>{c()}),3e5);return()=>{clearInterval(e)}}),[c]);const y=(0,u.useCallback)((()=>{i()}),[i]);return Nf(ZQ,{position:"sticky"},Nf(VQ,null,Nf(aC,{to:"/collections",component:WT,activeClassName:"header-link-active"},Nf(W$.Z,null),s("app.header.content")),l?Nf(HQ,{onClick:y},Nf(N$.Z,null),s("app.header.media")):null,Nf(GQ,null),Nf(KQ,null,O.length>0&&Nf("div",{key:"quick-create"},Nf(Hk,{id:"quick-create-button","aria-controls":p?"quick-create-menu":void 0,"aria-haspopup":"true","aria-expanded":p?"true":void 0,onClick:h,variant:"contained",endIcon:Nf(Y$.Z,null)},s("app.header.quickAdd")),Nf(GC,{id:"quick-create-menu",anchorEl:d,open:p,onClose:m,MenuListProps:{"aria-labelledby":"quick-create-button"}},O.map((e=>Nf(lT,{key:e.name,onClick:()=>g(e.name)},e.label_singular||e.label))))),a&&Nf(Hk,{href:"https://staticjscms.netlify.app/docs/test-backend",target:"_blank",rel:"noopener noreferrer",sx:{textTransform:"none"},endIcon:Nf(X$.Z,null)},"Test Backend"),o?Nf(Hk,{href:o,target:"_blank",rel:"noopener noreferrer",sx:{textTransform:"none"},endIcon:Nf(X$.Z,null)},function(e){const t=e.indexOf("//");return t>-1?e.slice(t+2):e}(o)):null,Nf(qQ,{displayUrl:o,isTestRepo:a,imageUrl:null==t?void 0:t.avatar_url,onLogoutClick:r}))))})));ek().config({barColors:{0:u$,"1.0":u$},shadowBlur:0,barThickness:2});const tA=(0,aw.ZP)("div")`
position: relative;
padding: 24px;
gap: 24px;
`,nA=(0,aw.ZP)("div")`
min-width: 1152px;
max-width: 1392px;
margin: 0 auto;
display: flex;
gap: 24px;
position: relative;
`,rA=e=>{let{children:t}=e;return Nf(d().Fragment,null,Nf(eA,null),Nf(tA,null,Nf(nA,null,t)))},iA=u.createContext(void 0);function oA(){return u.useContext(iA)}function aA(e){return(0,Iw.Z)("PrivateSwitchBase",e)}(0,kw.Z)("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const sA=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],lA=(0,aw.ZP)(Yw)((({ownerState:e})=>(0,S.Z)({padding:9,borderRadius:"50%"},"start"===e.edge&&{marginLeft:"small"===e.size?-3:-12},"end"===e.edge&&{marginRight:"small"===e.size?-3:-12}))),cA=(0,aw.ZP)("input")({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),uA=u.forwardRef((function(e,t){const{autoFocus:n,checked:r,checkedIcon:i,className:o,defaultChecked:a,disabled:s,disableFocusRipple:l=!1,edge:c=!1,icon:u,id:d,inputProps:f,inputRef:p,name:h,onBlur:m,onChange:g,onFocus:O,readOnly:y,required:v,tabIndex:b,type:_,value:w}=e,k=(0,P.Z)(e,sA),[x,$]=(0,DQ.Z)({controlled:r,default:Boolean(a),name:"SwitchBase",state:"checked"}),C=oA();let T=s;C&&void 0===T&&(T=C.disabled);const E="checkbox"===_||"radio"===_,Q=(0,S.Z)({},e,{checked:x,disabled:T,disableFocusRipple:l,edge:c}),A=(e=>{const{classes:t,checked:n,disabled:r,edge:i}=e,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${(0,Xw.Z)(i)}`],input:["input"]};return(0,ow.Z)(o,aA,t)})(Q);return(0,_w.jsxs)(lA,(0,S.Z)({component:"span",className:(0,iw.Z)(A.root,o),centerRipple:!0,focusRipple:!l,disabled:T,tabIndex:null,role:void 0,onFocus:e=>{O&&O(e),C&&C.onFocus&&C.onFocus(e)},onBlur:e=>{m&&m(e),C&&C.onBlur&&C.onBlur(e)},ownerState:Q,ref:t},k,{children:[(0,_w.jsx)(cA,(0,S.Z)({autoFocus:n,checked:r,defaultChecked:a,className:A.input,disabled:T,id:E&&d,name:h,onChange:e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;$(t),g&&g(e,t)},readOnly:y,ref:p,required:v,ownerState:Q,tabIndex:b,type:_},"checkbox"===_&&void 0===w?{}:{value:w},f)),x?i:u]}))})),dA=uA,fA=(0,YT.Z)((0,_w.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),pA=(0,YT.Z)((0,_w.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),hA=(0,YT.Z)((0,_w.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function mA(e){return(0,Iw.Z)("MuiCheckbox",e)}const gA=(0,kw.Z)("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary"]),OA=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],yA=(0,aw.ZP)(dA,{shouldForwardProp:e=>(0,aw.FO)(e)||"classes"===e,name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,"default"!==n.color&&t[`color${(0,Xw.Z)(n.color)}`]]}})((({theme:e,ownerState:t})=>(0,S.Z)({color:(e.vars||e).palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${"default"===t.color?e.vars.palette.action.activeChannel:e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:(0,Fk.Fq)("default"===t.color?e.palette.action.active:e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"default"!==t.color&&{[`&.${gA.checked}, &.${gA.indeterminate}`]:{color:(e.vars||e).palette[t.color].main},[`&.${gA.disabled}`]:{color:(e.vars||e).palette.action.disabled}}))),vA=(0,_w.jsx)(pA,{}),bA=(0,_w.jsx)(fA,{}),_A=(0,_w.jsx)(hA,{}),wA=u.forwardRef((function(e,t){var n,r;const i=(0,sw.Z)({props:e,name:"MuiCheckbox"}),{checkedIcon:o=vA,color:a="primary",icon:s=bA,indeterminate:l=!1,indeterminateIcon:c=_A,inputProps:d,size:f="medium",className:p}=i,h=(0,P.Z)(i,OA),m=l?c:s,g=l?c:o,O=(0,S.Z)({},i,{color:a,
width: 32px;
height: 24px;
display: flex;
align-items: center;
justify-content: flex-end;
`,LA=(0,p.Iu)()((e=>{let{viewGroups:t,group:n,t:r,onGroupClick:i}=e;const[o,a]=(0,u.useState)(null),s=Boolean(o),l=(0,u.useCallback)((e=>{a(e.currentTarget)}),[]),c=(0,u.useCallback)((()=>{a(null)}),[]),d=(0,u.useMemo)((()=>Object.values(n).find((e=>!0===e.active))),[n]);return Nf("div",null,Nf(Hk,{id:"basic-button","aria-controls":s?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":s?"true":void 0,onClick:l,variant:d?"contained":"outlined",endIcon:Nf(Y$.Z,null)},r("collection.collectionTop.groupBy")),Nf(GC,{id:"basic-menu",anchorEl:o,open:s,onClose:c,MenuListProps:{"aria-labelledby":"basic-button"}},t.map((e=>Nf(lT,{key:e.id,onClick:()=>i(e)},Nf(QA,null,e.label),Nf(DA,null,e.id===(null==d?void 0:d.id)?Nf(RA.Z,{fontSize:"small"}):null))))))})),MA=(0,aw.ZP)("div")`
width: 32px;
height: 24px;
display: flex;
align-items: center;
justify-content: flex-end;
`,jA=(0,p.Iu)()((e=>{let{t,fields:n,onSortClick:r,sort:i}=e;const[o,a]=(0,u.useState)(null),s=Boolean(o),l=(0,u.useCallback)((e=>{a(e.currentTarget)}),[]),c=(0,u.useCallback)((()=>{a(null)}),[]),d=(0,u.useMemo)((()=>{if(!i)return{key:void 0,direction:void 0};const e=Object.values(i);return Object.values(e).length<1||e[0].direction===YO?{key:void 0,direction:void 0}:e[0]}),[i]);return Nf("div",null,Nf(Hk,{id:"sort-button","aria-controls":s?"sort-menu":void 0,"aria-haspopup":"true","aria-expanded":s?"true":void 0,onClick:l,variant:d.key?"contained":"outlined",endIcon:Nf(Y$.Z,null)},t("collection.collectionTop.sortBy")),Nf(GC,{id:"sort-menu",anchorEl:o,open:s,onClose:c,MenuListProps:{"aria-labelledby":"sort-button"}},n.map((e=>{var t,n,o;const a=function(e){switch(e){case WO:return NO;case NO:return YO;default:return WO}}(null!==(t=null==i||null===(n=i[e.name])||void 0===n?void 0:n.direction)&&void 0!==t?t:YO);return Nf(lT,{key:e.name,onClick:()=>r(e.name,a),selected:e.name===d.key},Nf(QA,null,null!==(o=e.label)&&void 0!==o?o:e.name),Nf(MA,null,e.name===d.key?d.direction===WO?Nf(rw.Z,{fontSize:"small"}):Nf(Y$.Z,{fontSize:"small"}):null))}))))}));var IA=__nested_webpack_require_2794107__(36422),zA=__nested_webpack_require_2794107__(36208);const FA="VIEW_STYLE_LIST",UA="VIEW_STYLE_GRID",WA=(0,aw.ZP)("div")`
margin-left: 24px;
display: flex;
align-items: center;
justify-content: flex-end;
`,NA=e=>{let{viewStyle:t,onChangeViewStyle:n}=e;return Nf(WA,null,Nf(iE,{color:t===FA?"primary":"default","aria-label":"list view",onClick:()=>n(FA)},Nf(zA.Z,null)),Nf(iE,{color:t===UA?"primary":"default","aria-label":"grid view",onClick:()=>n(UA)},Nf(IA.Z,null)))},YA=(0,aw.ZP)("div")`
display: flex;
align-items: center;
flex-direction: row-reverse;
margin-top: 22px;
max-width: 100%;
& > div {
margin-left: 6px;
}
`,XA=e=>{let{viewStyle:t,onChangeViewStyle:n,sortableFields:r,onSortClick:i,sort:o,viewFilters:a,viewGroups:s,onFilterClick:l,onGroupClick:c,t:u,filter:d,group:f}=e;return Nf(YA,null,Nf(NA,{viewStyle:t,onChangeViewStyle:n}),s&&c&&f?s.length>0&&Nf(LA,{viewGroups:s,onGroupClick:c,t:u,group:f}):null,a&&l&&d?a.length>0&&Nf(AA,{viewFilters:a,onFilterClick:l,t:u,filter:d}):null,r&&i&&o?r.length>0&&Nf(jA,{fields:r,sort:o,onSortClick:i}):null)};function BA(e){return(0,Iw.Z)("MuiCard",e)}(0,kw.Z)("MuiCard",["root"]);const qA=["className","raised"],ZA=(0,aw.ZP)(aS,{name:"MuiCard",slot:"Root",overridesResolver:(e,t)=>t.root})((()=>({overflow:"hidden"}))),VA=u.forwardRef((function(e,t){const n=(0,sw.Z)({props:e,name:"MuiCard"}),{className:r,raised:i=!1}=n,o=(0,P.Z)(n,qA),a=(0,S.Z)({},n,{raised:i}),s=(e=>{const{classes:t}=e;return(0,ow.Z)({root:["root"]},BA,t)})(a);return(0,_w.jsx)(ZA,(0,S.Z)({className:(0,iw.Z)(s.root,r),elevation:i?8:void 0,ref:t,ownerState:a},o))})),HA=VA;function GA(e){return(0,Iw.Z)("MuiCardContent",e)}(0,kw.Z)("MuiCardContent",["root"]);const KA=["className","component"],JA=(0,aw.ZP)("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})((()=>({padding:16,"&:last-child":{paddingBottom:24}}))),eR=u.forwardRef((function(e,t){const n=(0,sw.Z)({props:e,name:"MuiCardContent"}),{className:r,component:i="div"}=n,o=(0,P.Z)(n,KA),a=(0,S.Z)({},n,{component:i}),s=(e=>{const{classes:t}=e;return(0,ow.Z)({root:["root"]},GA,t)})(a);return(0,_w.jsx)(JA,(0,S.Z)({as:i,className:(0,iw.Z)(s.root,r),ownerState:a,ref:t},o))})),tR=eR,nR=(0,aw.ZP)("div")`
display: flex;
align-items: center;
justify-content: space-between;
`,rR=(0,aw.ZP)("h1")`
${z$};
`,iR=(0,aw.ZP)("p")`
${F$};
margin-bottom: 0;
`,oR=(0,p.Iu)()((e=>{let{collection:t,newEntryUrl:n,t:r}=e;const i=Ne(),{collectionLabel:o,collectionLabelSingular:a,collectionDescription:s}=function(e){return{collectionLabel:e.label,collectionLabelSingular:e.label_singular,collectionDescription:e.description}}(t),l=(0,u.useCallback)((()=>{n&&i(n)}),[i,n]);return Nf(HA,null,Nf(tR,null,Nf(nR,null,Nf(rR,null,o),n?Nf(Hk,{onClick:l,variant:"contained"},r("collection.collectionTop.newButton",{collectionLabel:a||o})):null),s?Nf(iR,null,s):null))}));function aR(e){return(0,Iw.Z)("MuiCircularProgress",e)}(0,kw.Z)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const sR=["className","color","disableShrink","size","style","thickness","value","variant"];let lR,cR,uR,dR,fR=e=>e;const pR=Bf(lR||(lR=fR`
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
`)),hR=Bf(cR||(cR=fR`
0% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -15px;
}
100% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -125px;
}
`)),mR=(0,aw.ZP)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${(0,Xw.Z)(n.color)}`]]}})((({ownerState:e,theme:t})=>(0,S.Z)({display:"inline-block"},"determinate"===e.variant&&{transition:t.transitions.create("transform")},"inherit"!==e.color&&{color:(t.vars||t).palette[e.color].main})),(({ownerState:e})=>"indeterminate"===e.variant&&Xf(uR||(uR=fR`
animation: ${0} 1.4s linear infinite;
`),pR))),gR=(0,aw.ZP)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),OR=(0,aw.ZP)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${(0,Xw.Z)(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})((({ownerState:e,theme:t})=>(0,S.Z)({stroke:"currentColor"},"determinate"===e.variant&&{transition:t.transitions.create("stroke-dashoffset")},"indeterminate"===e.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})),(({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink&&Xf(dR||(dR=fR`
animation: ${0} 1.4s ease-in-out infinite;
`),hR))),yR=u.forwardRef((function(e,t){const n=(0,sw.Z)({props:e,name:"MuiCircularProgress"}),{className:r,color:i="primary",disableShrink:o=!1,size:a=40,style:s,thickness:l=3.6,value:c=0,variant:u="indeterminate"}=n,d=(0,P.Z)(n,sR),f=(0,S.Z)({},n,{color:i,disableShrink:o,size:a,thickness:l,value:c,variant:u}),p=(e=>{const{classes:t,variant:n,color:r,disableShrink:i}=e,o={root:["root",n,`color${(0,Xw.Z)(r)}`],svg:["svg"],circle:["circle",`circle${(0,Xw.Z)(n)}`,i&&"circleDisableShrink"]};return(0,ow.Z)(o,aR,t)})(f),h={},m={},g={};if("determinate"===u){const e=2*Math.PI*((44-l)/2);h.strokeDasharray=e.toFixed(3),g["aria-valuenow"]=Math.round(c),h.strokeDashoffset=`${((100-c)/100*e).toFixed(3)}px`,m.transform="rotate(-90deg)"}return(0,_w.jsx)(mR,(0,S.Z)({className:(0,iw.Z)(p.root,r),style:(0,S.Z)({width:a,height:a},m,s),ownerState:f,ref:t,role:"progressbar"},g,d,{children:(0,_w.jsx)(gR,{className:p.svg,ownerState:f,viewBox:"22 22 44 44",children:(0,_w.jsx)(OR,{className:p.circle,style:h,ownerState:f,cx:44,cy:44,r:(44-l)/2,fill:"none",strokeWidth:l})})}))})),vR=yR,bR=(0,aw.ZP)("div")`
position: fixed;
display: flex;
width: 100vw;
height: 100vh;
top: 0;
left: 0;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 16px;
`,_R=e=>{let{children:t}=e;const[n,r]=(0,u.useState)(0),i=(0,u.useMemo)((()=>{if(t)return"string"==typeof t?t:Array.isArray(t)&&n<t.length?t[n]:void 0}),[t,n]);return(0,u.useEffect)((()=>{if(!Array.isArray(t))return;const e=setInterval((()=>{const e=n===(null==t?void 0:t.length)-1?0:n+1;r(e)}),5e3);return()=>{clearInterval(e)}}),[t,n]),Nf(bR,null,Nf(vR,null),Nf(zS,null,i))};var wR=!("undefined"==typeof window||!window.document||!window.document.createElement),kR=void 0;function xR(e){e.handlers===e.nextHandlers&&(e.nextHandlers=e.handlers.slice())}function SR(e){this.target=e,this.events={}}SR.prototype.getEventHandlers=function(e,t){var n,r=String(e)+" "+String((n=t)?!0===n?100:(n.capture<<0)+(n.passive<<1)+(n.once<<2):0);return this.events[r]||(this.events[r]={handlers:[],handleEvent:void 0},this.events[r].nextHandlers=this.events[r].handlers),this.events[r]},SR.prototype.handleEvent=function(e,t,n){var r=this.getEventHandlers(e,t);r.handlers=r.nextHandlers,r.handlers.forEach((function(e){e&&e(n)}))},SR.prototype.add=function(e,t,n){var r=this,i=this.getEventHandlers(e,n);xR(i),0===i.nextHandlers.length&&(i.handleEvent=this.handleEvent.bind(this,e,n),this.target.addEventListener(e,i.handleEvent,n)),i.nextHandlers.push(t);var o=!0;return function(){if(o){o=!1,xR(i);var a=i.nextHandlers.indexOf(t);i.nextHandlers.splice(a,1),0===i.nextHandlers.length&&(r.target&&r.target.removeEventListener(e,i.handleEvent,n),i.handleEvent=void 0)}}};var PR="__consolidated_events_handlers__";function $R(e,t,n,r){e[PR]||(e[PR]=new SR(e));var i=function(e){if(e)return void 0===kR&&(kR=function(){if(!wR)return!1;if(!window.addEventListener||!window.removeEventListener||!Object.defineProperty)return!1;var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}}),n=function(){};window.addEventListener("testPassiveEventSupport",n,t),window.removeEventListener("testPassiveEventSupport",n,t)}catch(e){}return e}()),kR?e:!!e.capture}(r);return e[PR].add(t,n,i)}function CR(e,t){var n,r=(n=e,!isNaN(parseFloat(n))&&isFinite(n)?parseFloat(n):"px"===n.slice(-2)?parseFloat(n.slice(0,-2)):void 0);if("number"==typeof r)return r;var i=function(e){if("%"===e.slice(-1))return parseFloat(e.slice(0,-1))/100}(e);return"number"==typeof i?i*t:void 0}var TR,ER="above",QR="inside",AR="below",RR="invisible";function DR(e){return"string"==typeof e.type}var LR=[];function MR(e){LR.push(e),TR||(TR=setTimeout((function(){var e;for(TR=null;e=LR.shift();)e()}),0));var t=!0;return function(){if(t){t=!1;var n=LR.indexOf(e);-1!==n&&(LR.splice(n,1),!LR.length&&TR&&(clearTimeout(TR),TR=null))}}}var jR="undefined"!=typeof window,IR=function(e){function t(t){var n;return(n=e.call(this,t)||this).refElement=function(e){n._ref=e},n}pw(t,e);var n=t.prototype;return n.componentDidMount=function(){var e=this;jR&&(this.cancelOnNextTick=MR((function(){e.cancelOnNextTick=null;var t=e.props,n=t.children;t.debug,function(e,t){if(e&&!DR(e)&&!t)throw new Error("<Waypoint> needs a DOM element to compute boundaries. The child you passed is neither a DOM element (e.g. <div>) nor does it use the innerRef prop.\n\nSee https://goo.gl/LrBNgw for more info.")}(n,e._ref),e._handleScroll=e._handleScroll.bind(e),e.scrollableAncestor=e._findScrollableAncestor(),e.scrollEventListenerUnsubscribe=$R(e.scrollableAncestor,"scroll",e._handleScroll,{passive:!0}),e.resizeEventListenerUnsubscribe=$R(window,"resize",e._handleScroll,{passive:!0}),e._handleScroll(null)})))},n.componentDidUpdate=function(){var e=this;jR&&this.scrollableAncestor&&(this.cancelOnNextTick||(this.cancelOnNextTick=MR((function(){e.cancelOnNextTick=null,e._handleScroll(null)}))))},n.componentWillUnmount=function(){jR&&(this.scrollEventListenerUnsubscribe&&this.scrollEventListenerUnsubscribe(),this.resizeEventListenerUnsubscribe&&this.resizeEventListenerUnsubscribe(),this.cancelOnNextTick&&this.cancelOnNextTick())},n._findScrollableAncestor=function(){var e=this.props,t=e.horizontal,n=e.scrollableAncestor;if(n)return function(e){return"window"===e?__nested_webpack_require_2794107__.g.window:e}(n);for(var r=this._ref;r.parent
padding: 16px;
text-align: center;
`,uD=(0,aw.ZP)(cD)`
margin-top: 16px;
`,dD=(0,p.Iu)()((e=>{var t;let{entries:n,isFetching:r,viewStyle:i,cursor:o,handleCursorActions:a,t:s,page:l}=e,c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,lD);const u=[s("collection.entries.loadingEntries"),s("collection.entries.cachingEntries"),s("collection.entries.longerLoading")];return r&&void 0===l?Nf(_R,null,u):n&&n.length>0||(null==o||null===(t=o.actions)||void 0===t?void 0:t.has("append_next"))?Nf(d().Fragment,null,Nf(sD,"collection"in c?{collection:c.collection,entries:n,viewStyle:i,cursor:o,handleCursorActions:a,page:l}:{collections:c.collections,entries:n,viewStyle:i,cursor:o,handleCursorActions:a,page:l}),r&&void 0!==l&&n.length>0?Nf(cD,null,s("collection.entries.loadingEntries")):null):Nf(uD,null,s("collection.entries.noEntries"))}));function fD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fD(Object(n),!0).forEach((function(t){hD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fD(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hD(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mD=(0,aw.ZP)("h2")`
font-size: 23px;
font-weight: 600;
color: ${s$};
`,gD=(0,aw.ZP)("div")``;function OD(e,t){return e.filter((e=>t.has(e.path)))}const yD={loadEntries:KP,traverseCollectionCursor:function(e,t){return async(n,r)=>{var i,o,a,s;const l=r(),c=e.name;if(null!==(i=l.entries.pages)&&void 0!==i&&null!==(o=i[c])&&void 0!==o&&o.isFetching)return;const u=l.config;if(!u.config)throw new Error("Config not loaded");const d=UO(u.config),{action:f,append:p}=t in HP?HP[t]:{action:t,append:!1},h=sk(l,e.name);if(null!==(a=null===(s=h.meta)||void 0===s?void 0:s.usingOldPaginationAPI)&&void 0!==a&&a)return n(KP(e,h.data.nextPage));try{var m;n(LP(e));const{entries:t,cursor:r}=await function(e,t,n){if(!t.actions.has(n))throw new Error(`The current cursor does not support the pagination action "${n}".`);return e.traverseCursor(t,n)}(d,h,f),i=null===(m=r.meta)||void 0===m?void 0:m.page;return n(zP(e,t,i,GP(r),p))}catch(t){return console.error(t),t instanceof Error?(n(c_({type:"error",message:{key:"ui.toast.onFailToLoadEntries",options:{details:t.message}}})),Promise.reject(n(FP(e,t)))):Promise.reject()}}}},vD=B((function(e,t){var n;const{collection:r,viewStyle:i,filterTerm:o}=t,a=null===(n=e.entries.pages[r.name])||void 0===n?void 0:n.page;let s=_k(e,r);const l=function(e,t){const n=t.name,r=bk(e,n),i=function(e,t){const n=gk(e,t),r=Object.values(null!=n?n:{}).find((e=>!0===(null==e?void 0:e.active)));return r}(e,n);if(void 0===i)return[];let o={};const a=gg()(r,(e=>{const t=function(e,t){const n=t.label,r=t.field,i=bt()(e.data,r);if(void 0===i)return{id:"missing_value",label:n,value:i};const o=String(i);if(t.pattern){const e=t.pattern;let i="";try{const t=new RegExp(e),n=o.match(t);n&&(i=n[0])}catch(t){console.warn(`Invalid view group pattern '${e}' for field '${r}'`,t)}return{id:`${n}${i}`,label:n,value:i}}return{id:`${n}${i}`,label:n,value:"boolean"==typeof i?i:o}}(e,i);return o=fk(fk({},o),{},{[t.id]:t}),t.id})),s=Object.entries(a).map((e=>{let[t,n]=e;return fk(fk({},o[t]),{},{paths:new Set(n.map((e=>e.path)))})}));return s}(e,r);var c;"nested"in r&&(s=function(e,t,n){return n.filter((n=>{const r=n.path.slice(t.length+1);return!!r.startsWith(e)&&(e?2===r.slice(e.length+1).split("/").length:r.split("/").length<=2)}))}(o||"",null!==(c=r.folder)&&void 0!==c?c:"",s));const u=function(e,t){return!!e.entries.pages[t]}(e,r.name),d=wk(e,r.name),f=sk(e,r.name),p=wh.create(f).clearData();return pD(pD({},t),{},{page:a,entries:s,groups:l,entriesLoaded:u,isFetching:d,viewStyle:i,cursor:p})}),yD),bD=vD((0,p.Iu)()((e=>{let{collection:t,entries:n,groups:r,isFetching:i,viewStyle:o,cursor:a,page:s,traverseCollectionCursor:l,t:c,entriesLoaded:f,readyToLoad:p,loadEntries:h}=e;const[m,g]=(0,u.useState)(!1),[O,y]=(0,u.useState)(t);(0,u.useEffect)((()=>{!t||f||!p||m&&O===t||h(t),g(p),y(t)}),[t,f,h,O,m,p]);const v=(0,u.useCallback)((e=>{l(t,e)}),[t,l]),b=(0,u.useCallback)((e=>{let{entries:n}=e;return Nf(dD,{collection:t,entries:n,isFetching:i,collectionName:t.label,viewStyle:o,cursor:a,handleCursorActions:v,page:s})}),[t,a,v,i,s,o]);return r&&r.length>0?Nf(d().Fragment,null,function(e,t,n,r){return e.map((e=>{const i=function(e,t){const{label:n,value:r}=e;return void 0===r?t("collection.groups.other"):"boolean"==typeof r?r?n:t("collection.groups.negateLabel",{label:n}):`${n} ${r}`.trim()}(e,r);return Nf(gD,{key:e.id,id:e.id},Nf(mD,null,i),Nf(n,{entries:OD(t,e.paths)}))}))}(r,n,b,c)):Nf(b,{entries:n})})));function _D(e,t,n){return{type:nv,payload:{searchTerm:e,searchCollections:t,page:n}}}function wD(e,t){return{type:rv,payload:{entries:e,page:t}}}function kD(e){return{type:iv,payload:{error:e}}}function xD(e){return{type:sv,payload:{error:e}}}const SD={searchEntries:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return async(r,i)=>{const o=i(),{search:a}=o,s=o.config;if(!s.config)return;const l=UO(s.config),c=t||Object.keys(o.collections);if(!a.isFetching||a.term!==e||!nk()(c,a.collections)){r(_D(e,c,n));try{const t=await l.search(Object.entries(o.collections).filter((e=>{let[t,n]=e;return-1!==c.indexOf(t)})).map((e=>{let[t,n]=e;return n})),e);return r(wD(t.entries,n))}catch(e){if(cons
position: relative;
`,rj=(0,aw.ZP)("ul")`
padding: 10px 0;
margin: 0;
list-style: none;
border-radius: ${v$};
width: 240px;
`,ij=(0,aw.ZP)("li")`
padding: 0 6px 6px 32px;
font-size: 12px;
color: ${a$};
`,oj=(0,aw.ZP)("li",xm)((e=>{let{$isActive:t}=e;return`\n color: ${t?u$:i$};\n background-color: ${t?d$:"inherit"};\n padding: 6px 6px 6px 32px;\n cursor: pointer;\n position: relative;\n\n &:hover {\n color: ${u$};\n background-color: ${d$};\n }\n `})),aj=(0,aw.ZP)("div")`
width: 100%;
`,sj=(0,aw.ZP)(UC)`
margin-left: -44px;
`,lj=(0,p.Iu)()((e=>{let{collections:t,collection:n,searchTerm:r,onSubmit:i,t:o}=e;const a=(0,u.useRef)(),[s,l]=(0,u.useState)(r),[c,d]=(0,u.useState)(null),f=Boolean(c),p=(0,u.useMemo)((()=>Object.values(t)),[t]),h=(0,u.useCallback)((()=>{var e;d(null),null===(e=a.current)||void 0===e||e.blur()}),[]),m=(0,u.useCallback)((e=>{d(e.currentTarget)}),[]),g=(0,u.useCallback)((()=>{d(null)}),[]),O=(0,u.useCallback)((()=>n?p.findIndex((e=>e.name===n.name)):-1),[n,p]),[y,v]=(0,u.useState)(O()),[b,_]=(0,u.useState)(n);(0,u.useEffect)((()=>{b!==n&&v(O()),_(n)}),[n,O,b]);const w=(0,u.useCallback)((()=>{v(Math.min(y+1,p.length-1))}),[p,y]),k=(0,u.useCallback)((()=>{v(Math.max(y-1,-1))}),[y]),x=(0,u.useCallback)((()=>{v(-1)}),[]),S=(0,u.useCallback)((e=>{var t;-1!==e?i(s,null===(t=p[e])||void 0===t?void 0:t.name):i(s),h()}),[p,h,i,s]),P=(0,u.useCallback)((e=>{"Enter"===e.key&&S(y),f&&("Escape"===e.key&&h(),"ArrowDown"===e.key?(w(),e.preventDefault()):"ArrowUp"===e.key&&(k(),e.preventDefault()))}),[h,f,w,k,y,S]),$=(0,u.useCallback)((e=>{const t=e.target.value;l(t),""===t?(x(),h()):d(e.currentTarget)}),[h,x]),C=(0,u.useCallback)(((e,t)=>{e.preventDefault(),v(t),S(t)}),[S]);return Nf(nj,null,Nf(tj,{onKeyDown:P,placeholder:o("collection.sidebar.searchAll"),onBlur:g,onFocus:m,value:s,onChange:$,variant:"outlined",size:"small",fullWidth:!0,InputProps:{inputRef:a,startAdornment:Nf(tL,{position:"start"},Nf(ZD.Z,null))}}),Nf(sj,{id:"search-popover",open:f,anchorEl:c,onClose:h,disableAutoFocus:!0,disableEnforceFocus:!0,disableScrollLock:!0,hideBackdrop:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"}},Nf(rj,null,Nf(ij,null,o("collection.sidebar.searchIn")),Nf(oj,{$isActive:-1===y,onClick:e=>C(e,-1),onMouseDown:e=>e.preventDefault()},o("collection.sidebar.allCollections")),Nf(aj,null),p.map(((e,t)=>Nf(oj,{key:t,$isActive:t===y,onClick:e=>C(e,t),onMouseDown:e=>e.preventDefault()},e.label))))))}));function cj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cj(Object(n),!0).forEach((function(t){dj(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cj(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function dj(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{addFileTemplateFields:fj}=n,pj=(0,aw.ZP)("div")`
display: flex;
justify-content: center;
align-items: center;
`,hj=(0,aw.ZP)("div")`
margin-right: 4px;
`,mj=(0,aw.ZP)("div")`
position: relative;
top: 2px;
`,gj=(0,aw.ZP)(mj)`
${D$};
color: currentColor;
`,Oj=(0,aw.ZP)(mj)`
${L$};
color: currentColor;
left: 2px;
`,yj=(0,aw.ZP)(ut,xm)((e=>{let{$activeClassName:t,$depth:n}=e;return`\n display: flex;\n font-size: 14px;\n font-weight: 500;\n align-items: center;\n padding: 8px;\n padding-left: ${20*n+12}px;\n border-left: 2px solid #fff;\n\n &:hover,\n &:active,\n &.${t} {\n color: ${u$};\n background-color: ${d$};\n border-left-color: #4863c6;\n\n .MuiListItemIcon-root {\n color: ${u$};\n }\n }\n `}));function vj(e){var t;return e.isRoot?e.title:(null===(t=e.children.find((e=>!e.isDir&&e.title)))||void 0===t?void 0:t.title)||e.title}const bj=e=>{let{collection:t,treeData:n,depth:r=0,onToggle:i}=e;const o=t.name,a=Zh()(n,vj);return Nf(d().Fragment,null,a.map((e=>{var n;if(e.children.length<=1&&(null===(n=e.children[0])||void 0===n||!n.isDir)&&r>0)return null;let a=`/collections/${o}`;r>0&&(a=`${a}/filter${e.path}`);const s=vj(e),l=0===r||e.children.some((e=>e.children.some((e=>e.isDir))));return Nf(u.Fragment,{key:e.path},Nf(yj,{to:a,$activeClassName:"sidebar-active",onClick:()=>i({node:e,expanded:!e.expanded}),$depth:r,"data-testid":e.path},Nf($D.Z,null),Nf(pj,null,Nf(hj,null,s),l&&(e.expanded?Nf(gj,null):Nf(Oj,null)))),e.expanded&&Nf(bj,{collection:t,depth:r+1,treeData:e.children,onToggle:i}))})))};function _j(e,t){return function e(n){for(const r of n)t(r),e(r.children)}(e)}function wj(e,t){var n;const r="folder"in e?e.folder:"",i=t.map((e=>uj(uj({},e),{},{path:e.path.slice(r.length)}))),o=i.reduce(((e,t)=>{let n=(0,np.dirname)(t.path);for(;n&&!e[n]&&"/"!==n;){const t=n.split(np.sep);e[n]=t.pop(),n=t.length?t.join(np.sep):void 0}return e}),{});"nested"in e&&null!==(n=e.nested)&&void 0!==n&&n.summary?e=uj(uj({},e),{},{summary:e.nested.summary}):delete(e=uj({},e)).summary;const a=[{title:e.label,path:"/",isDir:!0,isRoot:!0},...Object.entries(o).map((e=>{let[t,n]=e;return{title:n,path:t,isDir:!0,isRoot:!1}})),...i.map(((n,r)=>{let i=t[r];i=uj(uj({},i),{},{data:fj(i.path,i.data)});const o=Bm(e,i);return uj(uj({},n),{},{title:o,isDir:!1,isRoot:!1})}))],s=a.reduce(((e,t)=>{const n="/"===t.path?"":(0,np.dirname)(t.path);return e[n]?e[n].push(t):e[n]=[t],e}),{}),l=s[""].reduce((function e(t,n){const r=n;let i=[];return s[r.path]&&(i=s[r.path].reduce(e,[])),t.push(uj(uj({},r),{},{children:i})),t}),[]);return l}const kj=B((function(e,t){var n;const{collection:r}=t,i=null!==(n=_k(e,r))&&void 0!==n?n:[];return uj(uj({},t),{},{entries:i})}),{})((e=>{let{collection:t,entries:n,filterTerm:r}=e;const[i,o]=(0,u.useState)(wj(t,n)),[a,s]=(0,u.useState)(null),[l,c]=(0,u.useState)(!0),[d,f]=(0,u.useState)(t),[p,h]=(0,u.useState)(n),[m,g]=(0,u.useState)(r);(0,u.useEffect)((()=>{if(t!==d||n!==p||r!==m){const e={};_j(i,(t=>{t.expanded&&(e[t.path]=!0)}));const a=wj(t,n),s=`/${r}`;_j(a,(t=>{(e[t.path]||l&&s.startsWith(t.path))&&(t.expanded=!0)})),o(a)}f(t),h(n),g(r)}),[t,n,r,d,p,m,i,l]);const O=(0,u.useCallback)((e=>{let{node:t,expanded:n}=e;!a||a.path===t.path||n?(o(function(e,t,n){let r=!1;return function e(i){if(r)return i;for(let e=0;e<i.length;e++)if(i[e].path===t.path)return i[e]=n(t),r=!0,i;return i.forEach((t=>e(t.children))),i}([...e])}(i,t,(e=>uj(uj({},e),{},{expanded:n})))),s(t),c(!1)):(s(t),c(!1))}),[a,i]);return Nf(bj,{collection:t,treeData:i,onToggle:O})})),xj=(0,aw.ZP)("div")`
position: sticky;
top: 88px;
align-self: flex-start;
`,Sj=(0,aw.ZP)($A)`
min-width: 0;
margin-right: 12px;
`,Pj=(0,p.Iu)()((e=>{let{collections:t,collection:n,isSearchEnabled:r,searchTerm:i,t:o,filterTerm:a}=e;const s=(0,u.useMemo)((()=>Object.values(t).filter((e=>!0!==e.hide)).map((e=>{const t=e.name,n=e.icon;let r=Nf($D.Z,null);if(n){const e=bO(n);e&&(r=Nf(e,null))}return"nested"in e?Nf("li",{key:`nested-${t}`},Nf(kj,{collection:e,filterTerm:a,"data-testid":t})):Nf(ND,{key:t,to:`/collections/${t}`,component:WT,disablePadding:!0,activeClassName:"sidebar-active"},Nf(qD,null,Nf(Sj,null,r),Nf(QA,{primary:e.label})))}))),[t,a]),l=(0,u.useMemo)((()=>_O()),[]),c=(0,u.useMemo)((()=>Object.values(l).map((e=>{let{id:t,title:n,data:r,options:{icon:i}={}}=e,o=Nf($D.Z,null);if(i){const e=bO(i);e&&(o=Nf(e,null))}const a=Nf(d().Fragment,null,Nf(Sj,null,o),Nf(QA,{primary:n}));return Nf(ND,"string"==typeof r?{key:n,href:r,component:"a",disablePadding:!0,target:"_blank",rel:"noopener",sx:{color:f$,"&:hover":{color:u$,".MuiListItemIcon-root":{color:u$}}}}:{key:n,to:`/page/${t}`,component:WT,disablePadding:!0,activeClassName:"sidebar-active"},Nf(qD,null,a))}))),[l]);return Nf(xj,null,Nf(HA,{sx:{minWidth:275}},Nf(tR,{sx:{paddingBottom:0}},Nf(zS,{gutterBottom:!0,variant:"h5",component:"div"},o("collection.sidebar.collections")),r&&Nf(lj,{searchTerm:i,collections:t,collection:n,onSubmit:(e,t)=>function(e,t){t?Ck.push(`/collections/${t}/search/${e}`):Ck.push(`/search/${e}`)}(e,t)})),Nf(pC,null,s,c)))})),$j=(0,aw.ZP)("main")`
width: 100%;
`,Cj=(0,aw.ZP)("div")`
${I$};
margin-bottom: 22px;
`,Tj=(0,aw.ZP)("h1")`
${z$};
`,Ej={sortByField:WP,filterByField:function(e,t){return async(n,r)=>{const i=r(),o=wk(i,e.name);if(n(function(e,t){return{type:cy,payload:{collection:e.name,filter:t}}}(e,t)),!o)try{const r=await UP(i,e);n(function(e,t,n){return{type:uy,payload:{collection:e.name,filter:t,entries:n}}}(e,t,r))}catch(r){n(function(e,t,n){return{type:dy,payload:{collection:e.name,filter:t,error:n}}}(e,t,r))}}},changeViewStyle:function(e){return{type:Ey,payload:{style:e}}},groupByField:function(e,t){return async(n,r)=>{const i=r(),o=wk(i,e.name);if(n({type:fy,payload:{collection:e.name,group:t}}),!o)try{const r=await UP(i,e);n(function(e,t,n){return{type:py,payload:{collection:e.name,group:t,entries:n}}}(e,t,r))}catch(r){n({type:hy,payload:{collection:e.name,group:t,error:r}})}}}},Qj=B((function(e,t){const{collections:n}=e,r=e.config.config&&0!=e.config.config.search,{isSearchResults:i,isSingleSearchResult:o,name:a,searchTerm:s="",filterTerm:l="",t:c}=t,u=a?n[a]:n[0],d=hk(e,u.name),f=function(e,t){var n,r;return(null!==(n=null===(r=e.sortable_fields)||void 0===r?void 0:r.fields)&&void 0!==n?n:[]).map((n=>{if(n===bf)return{key:n,field:{name:n,label:t("collection.defaultFields.updatedOn.label")}};const r=_p(e,n);return n!==vf||r?{key:n,field:r}:{key:n,field:{name:n,label:t("collection.defaultFields.author.label")}}})).filter((e=>!!e.field)).map((e=>jm(jm({},e.field),{},{key:e.key})))}(u,c),p=function(e){return e.view_filters}(u),h=function(e){return e.view_groups}(u);return{isSearchResults:i,isSingleSearchResult:o,name:a,searchTerm:s,filterTerm:l,collection:u,collections:n,collectionName:a,isSearchEnabled:r,sort:d,sortableFields:f,viewFilters:p,viewGroups:h,filter:mk(e,u.name),group:gk(e,u.name),viewStyle:e.entries.viewStyle}}),Ej),Aj=(0,p.Iu)()(Qj((e=>{let{collection:t,collections:n,collectionName:r,isSearchEnabled:i,isSearchResults:o,isSingleSearchResult:a,searchTerm:s,sortableFields:l,sortByField:c,sort:f,viewFilters:p,viewGroups:h,filterTerm:m,t:g,filterByField:O,groupByField:y,filter:v,group:b,changeViewStyle:_,viewStyle:w}=e;const[k,x]=(0,u.useState)(!1),[S,P]=(0,u.useState)();(0,u.useEffect)((()=>{P(t)}),[t]);const $=(0,u.useMemo)((()=>{let e="fields"in t&&t.create?Ef(r):"";return e&&m&&(e=Ef(r),m&&(e=`${$}?path=${m}`)),e}),[t,r,m]),C=(0,u.useMemo)((()=>"collection.collectionTop.searchResults"+(a?"InCollection":"")),[a]),T=(0,u.useMemo)((()=>{if(o){let e=n;if(a){const r=Object.values(n).filter((e=>e===t));1===r.length&&(e={[r[0].name]:r[0]})}return Nf(PD,{key:"search",collections:e,searchTerm:s,viewStyle:w})}return Nf(bD,{collection:t,viewStyle:w,filterTerm:m,readyToLoad:k&&t===S})}),[t,n,m,o,a,S,k,s,w]),E=(0,u.useCallback)((async(e,n)=>{await c(t,e,n)}),[t,c]),Q=(0,u.useCallback)((async e=>{await O(t,e)}),[t,O]),A=(0,u.useCallback)((async e=>{await y(t,e)}),[t,y]);return(0,u.useEffect)((()=>{var e,n;if(S===t)return void(k||x(!0));if(null!=f&&null!==(e=f[0])&&void 0!==e&&e.key)return void(k||x(!0));const r=null===(n=t.sortable_fields)||void 0===n?void 0:n.default;if(!r||!r.field)return void(k||x(!0));x(!1);let i=!0;return setTimeout((async()=>{var e;await E(r.field,null!==(e=r.direction)&&void 0!==e?e:WO),i&&x(!0)})),()=>{i=!1}}),[t,E,S,k,f]),Nf(d().Fragment,null,Nf(Pj,{collections:n,collection:(!o||a)&&t,isSearchEnabled:i,searchTerm:s,filterTerm:m}),Nf($j,null,Nf(d().Fragment,null,o?Nf(d().Fragment,null,Nf(Cj,null,Nf(Tj,null,g(C,{searchTerm:s,collection:t.label}))),Nf(XA,{viewStyle:w,onChangeViewStyle:_,t:g})):Nf(d().Fragment,null,Nf(oR,{collection:t,newEntryUrl:$}),Nf(XA,{viewStyle:w,onChangeViewStyle:_,sortableFields:l,onSortClick:E,sort:f,viewFilters:null!=p?p:[],viewGroups:null!=h?h:[],t:g,onFilterClick:Q,onGroupClick:A,filter:v,group:b})),T)))}))),Rj=e=>{var t;let{isSearchResults:n,isSingleSearchResult:r,collections:i}=e;const{name:o,searchTerm:a,filterTerm:s}=Ye(),l=(0,u.useMemo)((()=>!!o&&i[o]),[i,o]),c=(0,u.useMemo)((()=>function(e){const t=Object.values(e).filter((e=>!0!==e.hide))[0];if(t)return`/collections/${t.name}`;throw new Error("Could not find a non hidden collection")}(i)),[i]);return o&&l?"files"in l&&1===(null===(t=
list-style-type: none;
font-size: 12px;
color: ${m$};
position: relative;
font-weight: 600;
display: flex;
flex-direction: column;
margin: 0;
padding: 4px 8px;
`,Hj=(0,aw.ZP)("p",xm)((e=>{let{$error:t}=e;return`\n margin: 0;\n margin-left: 8px;\n padding: 0;\n font-size: 12px;\n color: ${t?m$:O$};\n transition: color ${_$};\n `})),Gj={changeDraftField:XP,openMediaLibrary:sP,clearMediaControl:function(e){return(t,n)=>{const r=n().mediaLibrary.externalLibrary;var i;r&&(null===(i=r.onClearControl)||void 0===i||i.call(r,{id:e}))}},removeMediaControl:function(e){return(t,n)=>{const r=n().mediaLibrary.externalLibrary;var i;r&&(null===(i=r.onRemoveControl)||void 0===i||i.call(r,{id:e}))}},removeInsertedMedia:cP,query:function(e,t,n,r,i,o){return async(a,s)=>{a(function(e){return{type:ov,payload:{searchTerm:e}}}(r));const l=s(),c=l.config;if(!c.config)return a(xD(new Error("Config not found")));const u=UO(c.config),d=Object.values(l.collections).find((e=>e.name===t));if(!d)return a(xD(new Error("Collection not found")));try{const t=await u.query(d,n,r,i,o);return a(function(e,t){return{type:av,payload:{namespace:e,hits:t}}}(e,t.hits))}catch(e){if(console.error(e),e instanceof Error)return a(xD(e))}}},getAsset:CP},Kj=B((function(e,t){const{collections:n,entryDraft:r}=e,i=r.entry,o=r.entry?n[r.entry.collection]:null,a=JR(e);return Bj(Bj({},t),{},{mediaPaths:e.mediaLibrary.controlMedia,config:e.config,entry:i,collection:o,isLoadingAsset:a})}),Gj),Jj=Kj((0,p.Iu)()((e=>{let{clearMediaControl:t,collection:n,config:r,entry:i,field:o,fieldsErrors:a,submitted:s,getAsset:l,isDisabled:c,isFieldDuplicate:f,isFieldHidden:p,isHidden:h=!1,locale:m,mediaPaths:g,openMediaLibrary:O,parentPath:y,query:v,removeInsertedMedia:b,removeMediaControl:_,t:w,value:k,forList:x=!1,changeDraftField:S,i18n:P,fieldName:$}=e;const C=RT(),T=Uj(),E=dO(o.widget),Q=o.hint,A=(0,u.useMemo)((()=>y.length>0?`${y}.${null!=$?$:o.name}`:null!=$?$:o.name),[o.name,$,y]),[R,D]=(0,u.useState)(!Fj()(k)),L=(0,u.useMemo)((()=>(e=>t=>{var n;return null!==(n=t.entryDraft.fieldsErrors[e])&&void 0!==n?n:[]})(A)),[A]),M=DT(L),j=(s||R)&&Boolean(M.length),I=(0,u.useMemo)((()=>(e,t)=>l(n,i,e,t)),[n]);(0,u.useEffect)((()=>{(R||s)&&(async()=>{const e=await async function(e,t,n,r){const i=n.getValidValue(t),o=[],a=[Nj,Yj,n.validator];for(const t of a){const n=await t({field:e,value:i,t:r});n&&o.push(n)}return o}(o,k,E,w);C(function(e,t){return{type:vy,payload:{path:e,errors:t}}}(A,e))})()}),[C,o,A,w,k,E,R,s]);const z=(0,u.useCallback)((e=>{D(!0),S({path:A,field:o,value:e,i18n:P})}),[S,o,P,A]),F=(0,u.useMemo)((()=>r.config),[r.config]),U=function(e,t){const n=(0,u.useRef)(e),r=n.current,i=t(r,e);return(0,u.useEffect)((()=>{i||(n.current=e)})),i?r:e}(k,nk()),[W,N]=(0,u.useState)(0);return(0,u.useEffect)((()=>{if(!co(U))return"default"in o&&co(!o.default)?(E.getDefaultValue?z(E.getDefaultValue(o.default,o)):z(o.default),void N((e=>e+1))):void(E.getDefaultValue&&(z(E.getDefaultValue(null,o)),N((e=>e+1))))}),[o,U,z,E]),(0,u.useMemo)((()=>n&&i&&F&&"hidden"!==o.widget?Nf(Zj,{$isHidden:h},Nf(d().Fragment,null,(0,u.createElement)(E.control,{key:`${T}-${W}`,collection:n,config:F,entry:i,field:o,fieldsErrors:a,submitted:s,getAsset:I,isDisabled:null!=c&&c,isFieldDuplicate:f,isFieldHidden:p,label:wp(o,w),locale:m,mediaPaths:g,onChange:z,clearMediaControl:t,openMediaLibrary:O,removeInsertedMedia:b,removeMediaControl:_,path:A,query:v,t:w,value:U,forList:x,i18n:P,hasErrors:j}),Q?Nf(Hj,{key:"hint",$error:j},Q):null,j?Nf(Vj,{key:"errors"},M.map((e=>e.message&&"string"==typeof e.message&&Nf("li",{key:e.message.trim().replace(/[^a-z0-9]+/gi,"-")},e.message)))):null)):null),[n,F,A,M,h,E.control,o,s,I,c,w,m,g,z,t,O,b,_,v,U,x,P,j,Q])})));function eI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function tI(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"sym
max-width: 1000px;
width: 100%;
font-size: 16px;
display: flex;
flex-direction: column;
gap: 16px;
`,rI=(0,aw.ZP)("div")`
display: flex;
`,iI=e=>{let{locales:t,dropdownText:n,onLocaleChange:r}=e;const[i,o]=(0,u.useState)(null),a=Boolean(i),s=(0,u.useCallback)((e=>{o(e.currentTarget)}),[]),l=(0,u.useCallback)((()=>{o(null)}),[]);return Nf("div",null,Nf(Hk,{id:"basic-button","aria-controls":a?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":a?"true":void 0,onClick:s},n),Nf(GC,{id:"basic-menu",anchorEl:i,open:a,onClose:l,MenuListProps:{"aria-labelledby":"basic-button"}},t.map((e=>Nf(lT,{key:e,onClick:()=>r(e)},e)))))};function oI(e,t,n,r){var i;if(n&&r){const n=Cg(r);return bt()(t,[...n,e.name])}return null===(i=t.data)||void 0===i?void 0:i[e.name]}const aI=B((function(e,t){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eI(Object(n),!0).forEach((function(t){tI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eI(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t)}),{changeDraftField:XP})((e=>{let{collection:t,entry:n,fields:r,fieldsErrors:i,submitted:o,changeDraftField:a,locale:s,onLocaleChange:l,t:c}=e;const d=(0,u.useMemo)((()=>{if(kg(t)){const{locales:e,defaultLocale:n}=xg(t);return{currentLocale:null!=s?s:e[0],locales:e,defaultLocale:n}}}),[t,s]),f=(0,u.useCallback)((e=>{let{targetLocale:t}=e;return async e=>{t&&await tP({title:"editor.editorControlPane.i18n.copyFromLocaleConfirmTitle",body:{key:"editor.editorControlPane.i18n.copyFromLocaleConfirmBody",options:{locale:e.toUpperCase()}}})&&r.forEach((r=>{if(Sg(r,t,e)){const t=oI(r,n,e!==(null==d?void 0:d.defaultLocale),e);a({path:r.name,field:r,value:t,i18n:d})}}))}}),[r,n,d,a]);return t&&r&&n&&!0!==n.partial?Nf(nI,null,null!=d&&d.locales&&s?Nf(rI,null,Nf(iI,{locales:d.locales,dropdownText:c("editor.editorControlPane.i18n.writingInLocale",{locale:null==s?void 0:s.toUpperCase()}),onLocaleChange:l}),Nf(iI,{locales:d.locales.filter((e=>e!==s)),dropdownText:c("editor.editorControlPane.i18n.copyFromLocale"),onLocaleChange:f({targetLocale:s})})):null,r.map((e=>{const t=Sg(e,s,null==d?void 0:d.defaultLocale),r=Pg(e,s,null==d?void 0:d.defaultLocale),a=$g(e,s,null==d?void 0:d.defaultLocale),l=d?`field-${s}_${e.name}`:`field-${e.name}`;return Nf(Jj,{key:l,field:e,value:oI(e,n,t,s),fieldsErrors:i,submitted:o,isDisabled:r,isHidden:a,isFieldDuplicate:e=>Pg(e,s,null==d?void 0:d.defaultLocale),isFieldHidden:e=>$g(e,s,null==d?void 0:d.defaultLocale),locale:s,parentPath:"",i18n:d})}))):null}));var sI=__nested_webpack_require_2794107__(15836);const lI=/\s+at.*[(\s](.*)\)?/,cI=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/;function uI(e,{pretty:t=!1,basePath:n}={}){const r=n&&new RegExp(`(file://)?${function(e){if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(n.replace(/\\/g,"/"))}/?`,"g");if("string"==typeof e)return e.replace(/\\/g,"/").split("\n").filter((e=>{const t=e.match(lI);if(null===t||!t[1])return!0;const n=t[1];return!(n.includes(".app/Contents/Resources/electron.asar")||n.includes(".app/Contents/Resources/default_app.asar")||n.includes("node_modules/electron/dist/resources/electron.asar")||n.includes("node_modules/electron/dist/resources/default_app.asar")||cI.test(n))})).filter((e=>""!==e.trim())).map((e=>(r&&(e=e.replace(r,"")),t&&(e=e.replace(lI,((e,t)=>e.replace(t,t.replace("","~"))))),e))).join("\n")}function dI(e,{target:t=document.body}={}){const n=document.createElement("textarea"),r=document.activeElement;n.value=e,n.setAttribute("readonly",""),n.style.contain="strict",n.style.position="absolute",n.style.left="-9999px",n.style.fontSize="12pt";const i=document.getSelection();let o=!1;i.rangeCount>0&&(o=i.getRangeAt(0)),t.append(n),n.select(),n.selectionStart=0,n.selectionEnd=e.length;let a=!1;try{a=document.execCommand("copy")}catch{}return n.remove(),o&&(i.removeAllRanges(),i.addRange(o)),r&&r.focus(),a}const fI="https://github.com/StaticJsCMS/stati
padding: 40px;
h1 {
font-size: 28px;
color: ${a$};
}
h2 {
font-size: 20px;
}
strong {
color: ${s$};
font-weight: 500;
}
hr {
width: 200px;
margin: 30px 0;
border: 0;
height: 1px;
background-color: ${a$};
}
a {
color: ${u$};
}
`,mI=(0,aw.ZP)("span")`
color: ${a$};
`,gI=(0,aw.ZP)("button")`
${C$};
${T$};
${E$};
display: block;
margin: 12px 0;
`,OI=e=>{let{entry:t,t:n}=e;return console.info(t),Nf(d().Fragment,null,Nf("hr",null),Nf("h2",null,n("ui.errorBoundary.recoveredEntry.heading")),Nf("strong",null,n("ui.errorBoundary.recoveredEntry.warning")),Nf(gI,{onClick:()=>dI(t)},n("ui.errorBoundary.recoveredEntry.copyButtonLabel")),Nf("pre",null,Nf("code",null,t)))};class yI extends u.Component{constructor(){super(...arguments),function(e,t,n){(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"state",{hasError:!1,errorMessage:"",errorTitle:"",backup:""})}static getDerivedStateFromError(e){return console.error(e),{hasError:!0,errorMessage:uI(e.stack,{basePath:window.location.origin||""}),errorTitle:e.toString()}}shouldComponentUpdate(e,t){return!this.props.showBackup||this.state.errorMessage!==t.errorMessage||this.state.backup!==t.backup}async componentDidUpdate(){if(this.props.showBackup){const e=await vm.getItem("backup");e&&(console.info(e),this.setState({backup:e}))}}render(){const{hasError:e,errorMessage:t,backup:n,errorTitle:r}=this.state,{showBackup:i,t:o}=this.props;return e?Nf(hI,{key:"error-boundary-container"},Nf("h1",null,o("ui.errorBoundary.title")),Nf("p",null,Nf("span",null,o("ui.errorBoundary.details")),Nf("a",{href:pI(r,this.props.config),target:"_blank",rel:"noopener noreferrer","data-testid":"issue-url"},o("ui.errorBoundary.reportIt"))),Nf("p",null,o("ui.errorBoundary.privacyWarning").split("\n").map(((e,t)=>[Nf(mI,{key:`private-warning-${t}`},e),Nf("br",{key:`break-${t}`})]))),Nf("hr",null),Nf("h2",null,o("ui.errorBoundary.detailsHeading")),Nf("p",null,t),n&&i&&Nf(OI,{key:"backup",entry:n,t:o})):this.props.children}}const vI=(0,p.Iu)()(yI);function bI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bI(Object(n),!0).forEach((function(t){wI(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bI(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wI(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const kI="types",xI="type_key",SI="type";function PI(e,t,n){var r,i;const o=CI(e),a=null!==(r=e[kI])&&void 0!==r?r:[],s=null!==(i=null==t?void 0:t[o])&&void 0!==i?i:{},l=a.find((e=>e.name===s));return l?_I(_I({},l),{},{name:`${n}`}):l}function $I(e){var t;const n=CI(e),r=null!==(t=e[kI])&&void 0!==t?t:[];return e=>{const t=e[n];return r.find((e=>e.name===t))}}function CI(e){return xI in e&&e[xI]||SI}function TI(e,t){var n;const r=CI(e),i=null!==(n=null==t?void 0:t[r])&&void 0!==n?n:{};let o;return o=i?`Error: item has illegal '${r}' property: '${i}'`:`Error: item has no '${r}' property`,o}const EI=(0,aw.ZP)("div")`
overflow-y: auto;
height: 100%;
padding: 24px;
font-family: Roboto, 'Helvetica Neue', HelveticaNeue, Helvetica, Arial, sans-serif;
`,QI=e=>{let{collection:t,fields:n,widgetFor:r}=e;return t&&n?Nf(EI,null,n.map((e=>Nf("div",{key:e.name},r(e.name))))):null},AI=(0,u.memo)((e=>{let{previewComponent:t,previewProps:n}=e;return t?(0,u.createElement)(t,n):null}));AI.displayName="EditorPreviewContent";const RI=AI,DI=["previewComponent"],LI=e=>{let{previewComponent:t}=e,n=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,DI);return t?(0,u.isValidElement)(t)?(0,u.cloneElement)(t,n):(0,u.createElement)(t,n):null};function MI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?MI(Object(n),!0).forEach((function(t){II(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MI(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function II(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const zI=(0,aw.ZP)(sI.ZP)`
width: 100%;
height: 100%;
border: none;
background: #fff;
border-radius: ${v$};
overflow: auto;
`,FI=(0,aw.ZP)("div")`
width: 100%;
height: 100%;
border: none;
background: #fff;
border-radius: ${v$};
overflow: auto;
padding: 16px;
`,UI=(0,aw.ZP)("div")`
width: calc(100% - min(864px, 50%));
top: 64px;
right: 0;
position: absolute;
height: calc(100vh - 64px);
overflow: hidden;
`;function WI(e,t,n,r,i,o,a){let s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:r,l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:i.data,c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:null;const u=s&&s.find((e=>e.name===n));if(!u)return null;const f=null==l?void 0:l[u.name];let p=u;"fields"in u&&u.fields?p=jI(jI({},p),{},{renderedFields:ZI(e,t,r,i,o,a,u.fields,f)}):"types"in u&&u.types&&(p=jI(jI({},p),{},{renderedFields:qI(e,t,u,i,o,a,f)}));const h=["string","text","number"],m=Object.entries(o).filter((e=>{let[n]=e;return _p(t,n)===p})).map((e=>{let[,t]=e;return t}))[0];let g=f;if(m)g=m.defaultPreview(String(f));else if(f&&p.widget&&-1!==h.indexOf(p.widget)&&f.toString().length<50){var O;g=Nf("div",{key:u.name},Nf(d().Fragment,null,Nf("strong",null,null!==(O=u.label)&&void 0!==O?O:u.name,":")," ",f))}return g?XI(e,p,t,g,i,a,c):null}function NI(e){return(0,u.isValidElement)(e)}function YI(e){return e.type?e.type===u.Fragment:e===u.Fragment}function XI(e,t,n,r,i,o){let a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;if(!t.widget)return null;const s=dO(t.widget),l=a?t.name+"_"+a:t.name;return"hidden"!==t.widget&&s.preview&&s.preview?Nf(LI,{previewComponent:s.preview,key:l,field:t,getAsset:o,config:e,collection:n,value:!r||"object"!=typeof r||Array.isArray(r)||!(t.name in r)||NI(r)||YI(r)?r:r[t.name],entry:i}):null}function BI(e,t,n,r,i,o,a,s){let l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:null;return a.map((c=>WI(e,t,c.name,n,r,i,o,a,s,l))).filter((e=>Boolean(e)))}function qI(e,t,n,r,i,o,a){return null==a?void 0:a.flatMap(((a,s)=>{const l=PI(n,null!=a?a:{},s);return l?BI(e,t,l.fields,r,i,o,l.fields,a,s):null})).filter(Boolean)}function ZI(e,t,n,r,i,o,a,s){return Array.isArray(s)?s.flatMap((s=>BI(e,t,n,r,i,o,a,s))):BI(e,t,n,r,i,o,a,s)}const VI=B((function(e,t){const n=JR(e);return jI(jI({},t),{},{isLoadingAsset:n,config:e.config})}),{getAsset:CP})((0,p.Iu)()((e=>{const{entry:t,collection:n,config:r,fields:i,previewInFrame:o,getAsset:a,t:s}=e,l=function(e){return(0,u.useMemo)((()=>{const t=eg(e,"title"),n=eg(e,"shortTitle"),r=eg(e,"author"),i={};return t&&(i[t]=Vf.title),n&&(i[n]=Vf.shortTitle),r&&(i[r]=Vf.author),i}),[e])}(n),c=(0,u.useCallback)(((e,r)=>a(n,t,e,r)),[n]),f=(0,u.useCallback)((e=>r.config?WI(r.config,n,e,i,t,l,c):null),[n,r,t,i,c,l]),p=(0,u.useCallback)((e=>{var o,a;const s=r.config;if(!s)return{data:null,widgets:{}};const u=i.find((t=>t.name===e));if(!u||!("fields"in u))return{data:null,widgets:{}};const d=null===(o=t.data)||void 0===o?void 0:o[u.name],f=u&&"fields"in u&&null!==(a=u.fields)&&void 0!==a?a:[];if("list"===u.widget||Array.isArray(d)){let e;return e=d&&"object"==typeof d?Array.isArray(d)?d:[d]:[],e.filter((e=>"object"==typeof e)).map((e=>{const r=f.reduce(((r,o,a)=>(r[o.name]=Nf("div",{key:a},WI(s,n,o.name,i,t,l,c,f,e,a)),r)),{});return{data:e,widgets:r}}))}return"object"!=typeof d?{data:{},widgets:{}}:{data:d,widgets:f.reduce(((e,r,o)=>(e[r.name]=Nf("div",{key:o},WI(s,n,r.name,i,t,l,c,f,d,o)),e)),{})}}),[n,r.config,t,i,c,l]),h=(0,u.useMemo)((()=>[...aO().map(((e,t)=>e.raw?Nf("style",{key:t},e.value):Nf("link",{key:t,href:e.value,type:"text/css",rel:"stylesheet"}))),Nf("style",{key:"global"},"\n body {\n margin: 0;\n }\n\n img {\n max-width: 100%;\n }\n\n .frame-content {\n padding: 16px;\n }\n")]),[]),m=(0,u.useMemo)((()=>{var e;return null!==(e=sO(function(e,t){return"fields"in e?e.name:t}(n,t.slug)))&&void 0!==e?e:QI}),[n,t.slug]),g=(0,u.useMemo)((()=>'\n <!DOCTYPE html>\n <html>\n <head>\n <base target="_blank"/>\n </head>\n <body><div></div></body>\n </html>\n '),[]),y=(0,u.useMemo)((()=>document.getElementById("cms-root")),[]),v=(0,u.useMemo)((()=>jI(jI({},e),{},{getAsset:c,widgetFor:f,widgetsFor:p})),[c,e,f,p]);return(0,u.useMemo)((()=>y?O().createPortal(Nf(UI,{className:"preview-content"},t&&t.data?Nf(vI,{config:r},o?Nf(zI,{key:"preview-frame",id:"preview-pane",head:h,initialContent:g},n?Nf(sI.Kr,null,(e=>{var t;let{document:n,window:r}=e;return Nf(Kw.ScrollSyncPane,{key:
background-color: ${c$};
z-index: ${100};
`,JI=(0,aw.ZP)(pT)`
gap: 12px;
`,ez=(0,aw.ZP)("div")`
display: flex;
margin: -32px -24px;
height: 64px;
a {
display: flex;
height: 100%;
padding: 16px;
align-items: center;
}
`,tz=(0,aw.ZP)("div")`
flex-grow: 1;
display: flex;
gap: 8px;
padding: 0 16px;
margin-left: 24px;
`,nz=(0,aw.ZP)("div")`
color: ${s$};
font-size: 14px;
`,rz=(0,aw.ZP)("div")`
margin-top: 6px;
`,iz=(0,aw.ZP)(rz)`
${M$};
`,oz=(0,aw.ZP)(rz)`
${j$};
`,az=(0,aw.ZP)("div")`
position: relative;
`,sz=(0,p.Iu)()((e=>{let{user:t,hasChanged:n,displayUrl:r,collection:i,onLogoutClick:o,onDuplicate:a,isPersisting:s,onPersist:l,onPersistAndDuplicate:c,onPersistAndNew:d,isNewEntry:f,showDelete:p,onDelete:h,t:m,editorBackLink:g}=e;const O=(0,u.useMemo)((()=>{var e;return null!==(e="folder"in i&&i.create)&&void 0!==e&&e}),[i]),y=(0,u.useMemo)((()=>Xm(i)),[i]),v=(0,u.useMemo)((()=>!f&&!n),[n,f]),[b,_]=(0,u.useState)(null),w=Boolean(b),k=(0,u.useCallback)((e=>{_(e.currentTarget)}),[]),x=(0,u.useCallback)((()=>{_(null)}),[]),S=(0,u.useCallback)((e=>()=>{x(),e()}),[x]),P=(0,u.useMemo)((()=>S(d)),[S,d]),$=(0,u.useMemo)((()=>S(c)),[S,c]),C=(0,u.useMemo)((()=>S(a)),[S,a]),T=(0,u.useMemo)((()=>S((()=>l()))),[S,l]),E=(0,u.useMemo)((()=>S(h)),[S,h]),Q=(0,u.useMemo)((()=>{const e=[];return v||(e.push(Nf(lT,{key:"publishNow",onClick:T},m("editor.editorToolbar.publishNow"))),O&&e.push(Nf(lT,{key:"publishAndCreateNew",onClick:P},m("editor.editorToolbar.publishAndCreateNew")),Nf(lT,{key:"publishAndDuplicate",onClick:$},m("editor.editorToolbar.publishAndDuplicate")))),O&&e.push(Nf(lT,{key:"duplicate",onClick:C},m("editor.editorToolbar.duplicate"))),e}),[O,C,T,$,P,v,m]),A=(0,u.useMemo)((()=>Nf(tz,null,Nf("div",null,Nf(az,null,Nf(Hk,{id:"existing-published-button","aria-controls":w?"existing-published-menu":void 0,"aria-haspopup":"true","aria-expanded":w?"true":void 0,onClick:k,variant:"contained",color:v?"success":"primary",endIcon:Nf(Y$.Z,null),disabled:0===Q.length||s},m(v?"editor.editorToolbar.published":s?"editor.editorToolbar.publishing":"editor.editorToolbar.publish")),s?Nf(vR,{size:24,sx:{color:GI.Z[500],position:"absolute",top:"50%",left:"50%",marginTop:"-12px",marginLeft:"-12px"}}):null),Nf(GC,{id:"existing-published-menu",anchorEl:b,open:w,onClose:x,MenuListProps:{"aria-labelledby":"existing-published-button"}},Q)),p&&y?Nf(Hk,{variant:"outlined",color:"error",key:"delete-button",onClick:E},m("editor.editorToolbar.deleteEntry")):null)),[b,y,k,x,E,s,v,Q,w,p,m]);return Nf(KI,{position:"relative"},Nf(JI,null,Nf(ez,null,Nf(Hk,{component:WT,to:g},Nf(HI.Z,null),Nf("div",null,Nf(nz,null,m("editor.editorToolbar.backCollection",{collectionLabel:i.label})),n?Nf(oz,{key:"back-changed"},m("editor.editorToolbar.unsavedChanges")):Nf(iz,{key:"back-unchanged"},m("editor.editorToolbar.changesSaved"))))),A,Nf(qQ,{displayUrl:r,imageUrl:null==t?void 0:t.avatar_url,onLogoutClick:o})))})),lz="cms.preview-visible",cz="cms.i18n-visible",uz=(0,aw.ZP)("div")`
display: grid;
grid-template-columns: min(864px, 50%) auto;
height: calc(100vh - 64px);
> div:nth-of-type(2)::before {
content: '';
width: 2px;
height: calc(100vh - 64px);
position: relative;
background-color: rgb(223, 223, 227);
display: block;
}
`,dz=(0,aw.ZP)("div")`
${R$};
border-radius: 0;
height: 100%;
`,fz=(0,aw.ZP)("div")`
width: 100%;
min-width: 1200px;
height: 100vh;
overflow: hidden;
`,pz=(0,aw.ZP)("div")`
height: calc(100vh - 64px);
position: relative;
background-color: ${t$};
overflow-y: auto;
`,hz=(0,aw.ZP)("div",xm)((e=>{let{$blockEntry:t,$overFlow:n}=e;return`\n height: 100%;\n pointer-events: ${t?"none":"auto"};\n overflow-y: ${n?"auto":"hidden"};\n `})),mz=(0,aw.ZP)(hz)`
padding: 24px 16px 16px;
position: relative;
overflow-x: hidden;
display: flex;
align-items: flex-start;
justify-content: center;
`,gz=(0,aw.ZP)("div")`
position: fixed;
bottom: 4px;
right: 8px;
z-index: ${299};
display: flex;
flex-direction: column;
gap: 4px;
`,Oz=e=>{let{i18nVisible:t,previewVisible:n,editor:r,editorSideBySideLocale:i,editorWithPreview:o}=e;return t?i:n?o:Nf(dz,null,r)},yz=e=>{var t;let{collection:n,entry:r,fields:i=[],fieldsErrors:o,showDelete:a,onDelete:s,onDuplicate:l,onPersist:c,user:f,hasChanged:p,displayUrl:h,isNewEntry:m,isModification:g,onLogoutClick:O,draftKey:y,editorBackLink:v,scrollSyncEnabled:b,t:_,loadScroll:w,toggleScroll:k,submitted:x}=e;const[S,P]=(0,u.useState)("false"!==localStorage.getItem(lz)),[$,C]=(0,u.useState)("false"!==localStorage.getItem(cz));(0,u.useEffect)((()=>{w()}),[w]);const{locales:T,defaultLocale:E}=null!==(t=(0,u.useMemo)((()=>xg(n)),[n]))&&void 0!==t?t:{},[Q,A]=(0,u.useState)(null==T?void 0:T[0]),R=(0,u.useCallback)((()=>{if(kg(n)){const{defaultLocale:e}=xg(n);A(e)}}),[n]),D=(0,u.useCallback)((async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createNew:t=!1,duplicate:n=!1}=e;await R(),c({createNew:t,duplicate:n})}),[c,R]),L=(0,u.useCallback)((()=>{const e=!S;P(e),localStorage.setItem(lz,`${e}`)}),[S]),M=(0,u.useCallback)((()=>{k()}),[k]),j=(0,u.useCallback)((()=>{const e=!$;C(e),localStorage.setItem(cz,`${e}`)}),[$]),I=(0,u.useCallback)((e=>{A(e)}),[]),[z,F]=(0,u.useMemo)((()=>{var e,t,i,o;let a=null===(e=null===(t=n.editor)||void 0===t?void 0:t.preview)||void 0===e||e,s=null===(i=null===(o=n.editor)||void 0===o?void 0:o.frame)||void 0===i||i;if("files"in n){var l,c;const e=Vm(n,r.slug);void 0!==(null==e||null===(l=e.editor)||void 0===l?void 0:l.preview)&&(a=e.editor.preview),void 0!==(null==e||null===(c=e.editor)||void 0===c?void 0:c.frame)&&(s=e.editor.frame)}return[a,s]}),[n,r.slug]),U=kg(n),W=Nf(mz,{id:"control-pane",$overFlow:!0},Nf(aI,{collection:n,entry:r,fields:i,fieldsErrors:o,locale:Q,onLocaleChange:I,submitted:x,t:_})),N=Nf(mz,{$overFlow:!b},Nf(aI,{collection:n,entry:r,fields:i,fieldsErrors:o,locale:null==T?void 0:T[1],onLocaleChange:I,submitted:x,t:_})),Y=U?function(e,t,n){var r,i;return t&&t!==n?(e.data=null===(r=e.i18n)||void 0===r||null===(i=r[t])||void 0===i?void 0:i.data,e):e}(r,Q,E):r,X=Nf(d().Fragment,null,Nf(uz,null,Nf(Kw.ScrollSyncPane,null,W),Nf(hz,null,Nf(VI,{collection:n,previewInFrame:F,entry:Y,fields:i})))),B=Nf(Kw.ScrollSync,{enabled:b},Nf("div",null,Nf(uz,null,Nf(Kw.ScrollSyncPane,null,W),Nf(Kw.ScrollSyncPane,null,N)))),q=U&&$,Z=z&&S,V=q||Z;return Nf(fz,null,Nf(sz,{isPersisting:r.isPersisting,isDeleting:r.isDeleting,onPersist:D,onPersistAndNew:()=>D({createNew:!0}),onPersistAndDuplicate:()=>D({createNew:!0,duplicate:!0}),onDelete:s,showDelete:a,onDuplicate:l,user:f,hasChanged:p,displayUrl:h,collection:n,isNewEntry:m,isModification:g,onLogoutClick:O,editorBackLink:v}),Nf(pz,{key:y},Nf(gz,null,U&&Nf(Gw,{size:"small",color:q?"primary":"default","aria-label":"add",onClick:j,title:_("editor.editorInterface.toggleI18n")},Nf(jj.Z,null)),z&&Nf(Gw,{size:"small",color:Z?"primary":"default","aria-label":"add",onClick:L,title:_("editor.editorInterface.togglePreview")},Nf(Ij.Z,null)),V&&Nf(Gw,{size:"small",color:b?"primary":"default","aria-label":"add",onClick:M,title:_("editor.editorInterface.toggleScrollSync")},Nf(Mj.Z,null))),Nf(Oz,{i18nVisible:q,previewVisible:Z,editor:W,editorSideBySideLocale:B,editorWithPreview:X})))};function vz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vz(Object(n),!0).forEach((function(t){_z(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vz(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _z(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String
height: 100%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
`,Rz=e=>{let{content:t}=e;return Nf(Az,null,Nf("h1",null,t))};var Dz=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Lz=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Mz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jz=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},Iz=void 0;Iz="undefined"!=typeof window?window:"undefined"!=typeof self?self:__nested_webpack_require_2794107__.g;var zz=null,Fz=null,Uz=Iz.clearTimeout,Wz=Iz.setTimeout,Nz=Iz.cancelAnimationFrame||Iz.mozCancelAnimationFrame||Iz.webkitCancelAnimationFrame,Yz=Iz.requestAnimationFrame||Iz.mozRequestAnimationFrame||Iz.webkitRequestAnimationFrame;null==Nz||null==Yz?(zz=Uz,Fz=function(e){return Wz(e,20)}):(zz=function(e){var t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),2!==n.length);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e),n=t[0],r=t[1];Nz(n),Uz(r)},Fz=function(e){var t=Yz((function(){Uz(n),e()})),n=Wz((function(){Nz(t),e()}),20);return[t,n]});var Xz=function(e){function t(){var e,n,r;Dz(this,t);for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=jz(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.state={height:r.props.defaultHeight||0,width:r.props.defaultWidth||0},r._onResize=function(){var e=r.props,t=e.disableHeight,n=e.disableWidth,i=e.onResize;if(r._parentNode){var o=r._parentNode.offsetHeight||0,a=r._parentNode.offsetWidth||0,s=window.getComputedStyle(r._parentNode)||{},l=parseInt(s.paddingLeft,10)||0,c=parseInt(s.paddingRight,10)||0,u=parseInt(s.paddingTop,10)||0,d=parseInt(s.paddingBottom,10)||0,f=o-u-d,p=a-l-c;(!t&&r.state.height!==f||!n&&r.state.width!==p)&&(r.setState({height:o-u-d,width:a-l-c}),i({height:o,width:a}))}},r._setRef=function(e){r._autoSizer=e},jz(r,n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),Lz(t,[{key:"componentDidMount",value:function(){var e=this.props.nonce;this._autoSizer&&this._autoSizer.parentNode&&this._autoSizer.parentNode.ownerDocument&&this._autoSizer.parentNode.ownerDocument.defaultView&&this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement&&(this._parentNode=this._autoSizer.parentNode,this._detectElementResize=function(e){var t=void 0,n=void 0,r=void 0,i=void 0,o=void 0,a=void 0,s=void 0,l="undefined"!=typeof document&&document.attachEvent;if(!l){a=function(e){var t=e.__resizeTriggers__,n=t.firstElementChild,r=t.lastElementChild,i=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,i.style.width=n.offsetWidth+1+"px",i.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight},o=function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height},s=function(e){if(!(e.target.className&&"function"==typeof e.target.className.indexOf&&e.target.className.indexOf("contract-trigger")<0&&e.target.className.indexOf("expand-trigger")<0)){var t=this;a(this),this.__resizeRAF__&&zz(this.__resizeRAF__),this.__resizeRAF__=Fz((function(){o(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.
height: ${162}px;
${S$};
${k$};
border-bottom: solid ${"2px"} ${g$};
position: relative;
`,oF=(0,aw.ZP)("img")`
width: 100%;
height: ${160}px;
object-fit: contain;
border-radius: 2px 2px 0 0;
`,aF=(0,aw.ZP)("div")`
width: 100%;
height: 160px;
object-fit: cover;
border-radius: 2px 2px 0 0;
padding: 1em;
font-size: 3em;
`,sF=(0,aw.ZP)("p")`
color: ${a$};
padding: 8px;
margin-top: 20px;
overflow-wrap: break-word;
line-height: 1.3;
`,lF=(0,aw.ZP)("p")`
color: ${"#70399f"};
background-color: ${"#f6d8ff"};
position: absolute;
padding: 8px;
border-radius: ${v$} 0 ${v$} 0;
`,cF=e=>{let{isSelected:t=!1,displayURL:n,text:r,onClick:i,draftText:o,width:a,height:s,margin:l,type:c,isViewableImage:d,isDraft:f,loadDisplayURL:p}=e;const h=MT(n.url);return(0,u.useEffect)((()=>{n.url||p()}),[n.url,p]),Nf(rF,{$isSelected:t,$width:a,$height:s,$margin:l,onClick:i,tabIndex:-1},Nf(iF,null,f?Nf(lF,{"data-testid":"draft-text"},o):null,h&&d?Nf(oF,{src:h}):Nf(aF,{"data-testid":"card-file-icon"},c)),Nf(sF,null,r))};function uF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function dF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?uF(Object(n),!0).forEach((function(t){fF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fF(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const pF=e=>{var t,n,r;let{rowIndex:i,columnIndex:o,style:a,data:{mediaItems:s,isSelectedFile:l,onAssetClick:c,cardDraftText:u,cardWidth:d,cardHeight:f,displayURLs:p,loadDisplayURL:h,columnCount:m,gutter:g}}=e;const O=i*m+o;if(O>=s.length)return null;const y=s[O];return Nf("div",{style:dF(dF({},a),{},{left:"number"==typeof a.left?null!==(t=a.left)&&void 0!==t?t:g*o:a.left,top:a.top,width:"number"==typeof a.width?a.width-g:a.width,height:"number"==typeof a.height?a.height-g:a.height})},Nf(cF,{key:y.key,isSelected:l(y),text:y.name,onClick:()=>c(y),isDraft:y.draft,draftText:u,width:d,height:f,margin:"0px",displayURL:null!==(n=p[y.id])&&void 0!==n?n:y.url?{url:y.url}:{},loadDisplayURL:()=>h(y),type:y.type,isViewableImage:null!==(r=y.isViewableImage)&&void 0!==r&&r}))},hF=(0,aw.ZP)("div")((e=>{let{$width:t,$height:n}=e;return`\n overflow-y: auto;\n overflow-x: hidden;\n width: ${t?`${t}px`:"100%"};\n height: ${n?`${n}px`:"100%"};ƒ\n `})),mF=(0,aw.ZP)("div")`
display: flex;
flex-wrap: wrap;
margin-left: -10px;
margin-right: -10px;
`,gF=e=>{const{cardWidth:t,cardHeight:n,cardMargin:r,mediaItems:i,setScrollContainerRef:o}=e;return Nf(Bz,null,(a=>{let{height:s,width:l}=a;const c=parseInt(t,10),u=parseInt(n,10),d=parseInt(r,10),f=c+d,p=u+d,h=Math.floor(l/f),m=Math.ceil(i.length/h);return Nf(hF,{$width:l,$height:s,ref:o},Nf(nF,{columnCount:h,columnWidth:f,rowCount:m,rowHeight:p,width:l,height:s,itemData:dF(dF({},e),{},{gutter:d,columnCount:h}),style:{overflow:"hidden",overflowY:"scroll"}},pF))}))},OF=e=>{let{setScrollContainerRef:t,mediaItems:n,isSelectedFile:r,onAssetClick:i,cardDraftText:o,cardWidth:a,cardHeight:s,cardMargin:l,displayURLs:c,loadDisplayURL:u,canLoadMore:d,onLoadMore:f,isPaginating:p,paginatingMessage:h}=e;return Nf(hF,{ref:t},Nf(mF,null,n.map((e=>{var t,n;return Nf(cF,{key:e.key,isSelected:r(e),text:e.name,onClick:()=>i(e),isDraft:e.draft,draftText:o,width:a,height:s,margin:l,displayURL:null!==(t=c[e.id])&&void 0!==t?t:e.url?{url:e.url}:{},loadDisplayURL:()=>u(e),type:e.type,isViewableImage:null!==(n=e.isViewableImage)&&void 0!==n&&n})})),d?Nf(IR,{onEnter:f}):null),p?Nf("h1",null,h):null)},yF=function(e){const{canLoadMore:t,isPaginating:n}=e;return Nf(t||n?OF:gF,e)},vF=e=>{let{disabled:t,draft:n,path:r,name:i,t:o}=e;const[a,s]=(0,u.useState)(!1);(0,u.useEffect)((()=>{let e=!0;const t=setTimeout((()=>{e&&s(!1)}),1500);return()=>{e=!1,clearTimeout(t)}}),[]);const l=(0,u.useCallback)((()=>{r&&i&&(dI(Jh(r)||!n?r:i),s(!0))}),[n,i,r]),c=(0,u.useCallback)((()=>a?o("mediaLibrary.mediaLibraryCard.copied"):r?Jh(r)?o("mediaLibrary.mediaLibraryCard.copyUrl"):o(n?"mediaLibrary.mediaLibraryCard.copyName":"mediaLibrary.mediaLibraryCard.copyPath"):o("mediaLibrary.mediaLibraryCard.copy")),[a,n,r,o]);return Nf(Hk,{color:"inherit",variant:"contained",onClick:l,disabled:t},c())},bF=e=>{let{value:t="",onChange:n,onKeyDown:r,placeholder:i,disabled:o}=e;return Nf(tj,{onKeyDown:r,placeholder:i,value:t,onChange:n,variant:"outlined",size:"small",disabled:o,InputProps:{startAdornment:Nf(tL,{position:"start"},Nf(ZD.Z,null))}})},_F=(0,aw.ZP)("div")`
position: relative;
display: flex;
flex-direction: column;
`,wF=(0,aw.ZP)("div")`
flex-shrink: 0;
display: flex;
gap: 8px;
`,kF=(0,aw.ZP)(ZS)`
display: flex;
justify-content: space-between;
align-items: center;
`,xF=(0,aw.ZP)((e=>{let{label:t,imagesOnly:n,onChange:r,disabled:i}=e;return Nf(Hk,{variant:"contained",component:"label"},t,Nf("input",{hidden:!0,multiple:!0,type:"file",accept:n?"image/*":"*/*",onChange:r,disabled:i}))}))`
${C$};
${T$};
display: inline-block;
margin-left: 15px;
margin-right: 2px;
&[disabled] {
${Q$};
cursor: default;
}
${E$};
${w$};
margin-bottom: 0;
span {
font-size: 14px;
font-weight: 500;
display: flex;
justify-content: center;
align-items: center;
}
input {
height: 0.1px;
width: 0.1px;
margin: 0;
padding: 0;
opacity: 0;
overflow: hidden;
position: absolute;
z-index: ${0};
outline: none;
}
`,SF=e=>{let{t,forImage:n,onDownload:r,onUpload:i,query:o,onSearchChange:a,onSearchKeyDown:s,searchDisabled:l,onDelete:c,canInsert:u,onInsert:d,hasSelection:f,isPersisting:p,isDeleting:h,selectedFile:m}=e;const g=p||h,O=!g,y=!g&&f,v=t(p?"mediaLibrary.mediaLibraryModal.uploading":"mediaLibrary.mediaLibraryModal.upload"),b=t(h?"mediaLibrary.mediaLibraryModal.deleting":"mediaLibrary.mediaLibraryModal.deleteSelected"),_=t("mediaLibrary.mediaLibraryModal.download"),w=t("mediaLibrary.mediaLibraryModal.chooseSelected");return Nf(_F,null,Nf(kF,null,t(n?"mediaLibrary.mediaLibraryModal.images":"mediaLibrary.mediaLibraryModal.mediaAssets"),Nf(wF,null,Nf(vF,{disabled:!f,path:null==m?void 0:m.path,name:null==m?void 0:m.name,draft:null==m?void 0:m.draft,t}),Nf(Hk,{color:"inherit",variant:"contained",onClick:r,disabled:!f},_),Nf(xF,{label:v,imagesOnly:n,onChange:i,disabled:!O}))),Nf(kF,null,Nf(bF,{value:o,onChange:a,onKeyDown:s,placeholder:t("mediaLibrary.mediaLibraryModal.search"),disabled:l}),Nf(wF,null,Nf(Hk,{color:"error",variant:"outlined",onClick:c,disabled:!y},b),u?Nf(Hk,{color:"success",variant:"contained",onClick:d,disabled:!f},w):null)))},PF=(0,aw.ZP)(Gw)`
position: absolute;
top: -20px;
left: -20px;
`,$F="300px",CF=(0,aw.ZP)(gS)`
.MuiDialog-paper {
display: flex;
flex-direction: column;
overflow: visible;
height: 80%;
width: calc(${$F} + 20px);
max-width: calc(${$F} + 20px);
@media (min-width: 800px) {
width: calc(${$F} * 2 + 20px);
max-width: calc(${$F} * 2 + 20px);
}
@media (min-width: 1120px) {
width: calc(${$F} * 3 + 20px);
max-width: calc(${$F} * 3 + 20px);
}
@media (min-width: 1440px) {
width: calc(${$F} * 4 + 20px);
max-width: calc(${$F} * 4 + 20px);
}
@media (min-width: 1760px) {
width: calc(${$F} * 5 + 20px);
max-width: calc(${$F} * 5 + 20px);
}
@media (min-width: 2080px) {
width: calc(${$F} * 6 + 20px);
max-width: calc(${$F} * 6 + 20px);
}
}
`,TF=(0,p.Iu)()((e=>{let{isVisible:t=!1,canInsert:n,files:r,dynamicSearch:i,dynamicSearchActive:o,forImage:a,isLoading:s,isPersisting:l,isDeleting:c,hasNextPage:u,isPaginating:d,query:f,selectedFile:p,handleFilter:h,handleQuery:m,toTableData:g,handleClose:O,handleSearchChange:y,handleSearchKeyDown:v,handlePersist:b,handleDelete:_,handleInsert:w,handleDownload:k,setScrollContainerRef:x,handleAssetClick:S,handleLoadMore:P,loadDisplayURL:$,displayURLs:C,t:T}=e;const E=a?h(r):r,Q=!i&&f?m(f,E):E,A=g(Q),R=r&&!!r.length,D=E&&!!E.length,L=Q&&!!Q.length,M=L,j=!M,I=s&&!M&&T("mediaLibrary.mediaLibraryModal.loading")||o&&T("mediaLibrary.mediaLibraryModal.noResults")||!R&&T("mediaLibrary.mediaLibraryModal.noAssetsFound")||!D&&T("mediaLibrary.mediaLibraryModal.noImagesFound")||!L&&T("mediaLibrary.mediaLibraryModal.noResults")||"",z=M&&!Fj()(p);return Nf(CF,{open:t,onClose:O},Nf(PF,{color:"default","aria-label":"add",onClick:O,size:"small"},Nf(Qz.Z,null)),Nf(SF,{t:T,onClose:O,forImage:a,onDownload:k,onUpload:b,query:f,onSearchChange:y,onSearchKeyDown:v,searchDisabled:!o&&!D,onDelete:_,canInsert:n,onInsert:w,hasSelection:z,isPersisting:l,isDeleting:c,selectedFile:p}),Nf(CS,null,j?Nf(Rz,{content:I}):null,Nf(yF,{setScrollContainerRef:x,mediaItems:A,isSelectedFile:e=>(null==p?void 0:p.key)===e.key,onAssetClick:S,canLoadMore:u,onLoadMore:P,isPaginating:d,paginatingMessage:T("mediaLibrary.mediaLibraryModal.loading"),cardDraftText:T("mediaLibrary.mediaLibraryCard.draft"),cardWidth:"278px",cardHeight:"240px",cardMargin:"10px",loadDisplayURL:$,displayURLs:C})))}));function EF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function QF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EF(Object(n),!0).forEach((function(t){AF(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function AF(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const RF=["jpg","jpeg","webp","gif","png","bmp","tiff","svg","avif"],DF=[...RF],LF={loadMedia:uP,persistMedia:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{field:n}=t;return async(t,r)=>{const i=r(),o=i.config.config;if(!o)return;const a=UO(o),s=jk(i,n),l=If(e.name.toLowerCase(),o.slug),c=s.find((e=>e.name.toLowerCase()===l)),u=Dk(i);if(c){if(!await tP({title:"mediaLibrary.mediaLibrary.alreadyExistsTitle",body:{key:"mediaLibrary.mediaLibrary.alreadyExistsBody",options:{filename:c.name}},color:"error"}))return;await t(fP(c))}u||t(yP());try{const r=i.entryDraft.entry,s=Lm(o,null!=r&&r.collection?i.collections[r.collection]:null,r,l,n),c=Rk({file:e,path:s,field:n});let d;return t(xP(c)),u?(d=dP({id:await Sh(e),file:e,assetProxy:c,draft:Boolean(u)}),t(BP(d))):(d=await a.persistMedia(o,c),t(vP(d)))}catch(e){return console.error(e),t(c_({type:"error",message:{key:"ui.toast.onFailToPersistMedia",options:{details:e}}})),t(bP())}}},deleteMedia:fP,insertMedia:lP,loadMediaDisplayURL:pP,closeMediaLibrary:function(){return(e,t)=>{const n=t().mediaLibrary.externalLibrary;var r;n&&(null===(r=n.hide)||void 0===r||r.call(n)),e({type:Iy})}}},MF=B((function(e){const{mediaLibrary:t}=e,n=t.field;return QF({},{isVisible:t.isVisible,canInsert:t.canInsert,files:jk(e,n),displayURLs:t.displayURLs,dynamicSearch:t.dynamicSearch,dynamicSearchActive:t.dynamicSearchActive,dynamicSearchQuery:t.dynamicSearchQuery,forImage:t.forImage,isLoading:t.isLoading,isPersisting:t.isPersisting,isDeleting:t.is
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
`,IF=B((function(e){const{collections:t}=e;return{collections:t,isSearchEnabled:e.config.config&&0!=e.config.config.search,searchTerm:"",filterTerm:""}}),{})((0,p.Iu)()((e=>{let{collections:t,isSearchEnabled:n,searchTerm:r,filterTerm:i}=e;const{id:o}=Ye(),a=(0,u.useMemo)((()=>{if(!o)return"";const e=function(e){return iO.additionalLinks[e]}(o);return e?e.data:""}),[o]),s=(0,u.useMemo)((()=>Nf(jF,null,a?Nf(a,null):"Page not found")),[a]);return Nf(rA,null,Nf(Pj,{collections:t,collection:!1,isSearchEnabled:n,searchTerm:r,filterTerm:i}),s)})));function zF(e){return(0,Iw.Z)("MuiAlert",e)}const FF=(0,kw.Z)("MuiAlert",["root","action","icon","message","filled","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),UF=(0,YT.Z)((0,_w.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),WF=(0,YT.Z)((0,_w.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),NF=(0,YT.Z)((0,_w.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),YF=(0,YT.Z)((0,_w.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),XF=(0,YT.Z)((0,_w.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),BF=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],qF=(0,aw.ZP)(aS,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${(0,Xw.Z)(n.color||n.severity)}`]]}})((({theme:e,ownerState:t})=>{const n="light"===e.palette.mode?Fk._j:Fk.$n,r="light"===e.palette.mode?Fk.$n:Fk._j,i=t.color||t.severity;return(0,S.Z)({},e.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px"},i&&"standard"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${i}Color`]:n(e.palette[i].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${i}StandardBg`]:r(e.palette[i].light,.9),[`& .${FF.icon}`]:e.vars?{color:e.vars.palette.Alert[`${i}IconColor`]}:{color:e.palette[i].main}},i&&"outlined"===t.variant&&{color:e.vars?e.vars.palette.Alert[`${i}Color`]:n(e.palette[i].light,.6),border:`1px solid ${(e.vars||e).palette[i].light}`,[`& .${FF.icon}`]:e.vars?{color:e.vars.palette.Alert[`${i}IconColor`]}:{color:e.palette[i].main}},i&&"filled"===t.variant&&(0,S.Z)({fontWeight:e.typography.fontWeightMedium},e.vars?{color:e.vars.palette.Alert[`${i}FilledColor`],backgroundColor:e.vars.palette.Alert[`${i}FilledBg`]}:{backgroundColor:"dark"===e.palette.mode?e.palette[i].dark:e.palette[i].main,color:e.palette.getContrastText(e.palette[i].main)}))})),ZF=(0,aw.ZP)("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),VF=(0,aw.ZP)("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),HF=(0,aw.ZP)("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),GF={success:(0,_w.jsx)(UF,{fontSize:"inherit"}),warning:(0,_w.jsx)(WF,{fontSize:"inherit"}),error:(0,_w.jsx)(NF,{fontSize:"inherit"}),info:(0,_w.jsx)(YF,{fontSize:"inherit"})},KF=u.forwardRef((function(e,t){var n,r,i,o,a,s;const l=(0,sw.Z)({props:e,name:"Mu
position: fixed;
bottom: 16px;
right: 16px;
`,wU=e=>{let{children:t}=e;const n=function(e={}){const{getTrigger:t=vU,target:n=bU}=e,r=(0,P.Z)(e,yU),i=u.useRef(),[o,a]=u.useState((()=>t(i,r)));return u.useEffect((()=>{const e=()=>{a(t(i,(0,S.Z)({target:n},r)))};return e(),n.addEventListener("scroll",e,{passive:!0}),()=>{n.removeEventListener("scroll",e,{passive:!0})}}),[n,t,JSON.stringify(r)]),o}({disableHysteresis:!0,threshold:100}),r=(0,u.useCallback)((e=>{const t=(e.target.ownerDocument||document).querySelector("#back-to-top-anchor");t&&t.scrollIntoView({block:"center"})}),[]);return Nf(Yx,{in:n},Nf(_U,{onClick:r,role:"presentation"},t))},kU=(0,aw.ZP)("div")`
margin: ${"24px"};
`,xU=(0,p.Iu)()((e=>{let{t}=e;return Nf(kU,null,Nf("h2",null,t("app.notFoundPage.header")))}));ek().config({barColors:{0:u$,"1.0":u$},shadowBlur:0,barThickness:2});const SU=(0,aw.ZP)("div")`
width: 100%;
min-width: 1200px;
height: 100vh;
position: relative;
`,PU=(0,aw.ZP)("div")`
width: 100%;
min-width: 1200px;
min-height: 100vh;
`,$U=(0,aw.ZP)("div")`
margin: 20px;
`,CU=(0,aw.ZP)("pre")`
margin-left: 20px;
font-size: 15px;
line-height: 1.5;
`;function TU(){const{name:e}=Ye();return Nf(Ke,{to:`/collections/${e}`})}function EU(){const{name:e,entryName:t}=Ye();return Nf(Ke,{to:`/collections/${e}/entries/${t}`})}const QU={loginUser:function(e){return(t,n)=>{const r=n();if(!r.config.config)return;const i=UO(r.config.config);return t(p_()),i.authenticate(e).then((e=>{t(h_(e))})).catch((e=>{console.error(e),e instanceof Error&&(t(c_({type:"warning",message:{key:"ui.toast.onFailToAuth",options:{details:e.message}}})),t(m_(e)))}))}},discardDraft:YP},AU=B((function(e){const{auth:t,config:n,collections:r,globalUI:i,mediaLibrary:o,scroll:a}=e;return{auth:t,config:n,collections:r,user:t.user,isFetching:i.isFetching,useMediaLibrary:!o.externalLibrary,scrollSyncEnabled:a.isScrolling}}),QU)((0,p.Iu)()((e=>{let{auth:t,user:n,config:r,collections:i,loginUser:o,isFetching:a,useMediaLibrary:s,t:l,scrollSyncEnabled:c,discardDraft:f}=e;const p=(0,u.useCallback)((e=>Nf($U,null,Nf("h1",null,l("app.app.errorHeader")),Nf("div",null,Nf("strong",null,l("app.app.configErrors"),":"),Nf(CU,null,null!=e?e:r.error),Nf("span",null,l("app.app.checkConfigYml"))))),[r.error,l]),h=(0,u.useCallback)((e=>{o(e)}),[o]),m=(0,u.useMemo)((()=>{if(!r.config)return null;const e=UO(r.config);return null==e?void 0:e.authComponent()}),[r.config]),g=(0,u.useMemo)((()=>r.config?null==m?Nf("div",null,Nf("h1",null,l("app.app.waitingBackend"))):Nf("div",{key:"auth-page-wrapper"},Nf(m,{key:"auth-page",onLogin:h,error:t.error,inProgress:t.isFetching,siteId:r.config.backend.site_domain,base_url:r.config.backend.base_url,authEndpoint:r.config.backend.auth_endpoint,config:r.config,clearHash:()=>Ck.replace("/"),t:l})):null),[m,t.error,t.isFetching,r.config,h,l]),O=(0,u.useMemo)((()=>function(e){const t=Object.values(e).filter((e=>{var t,n;return!0!==e.hide&&(!("files"in e)||(null!==(t=null===(n=e.files)||void 0===n?void 0:n.length)&&void 0!==t?t:0)>1)}));if(t.length>0)return`/collections/${t[0].name}`;throw new Error("Could not find a non hidden collection")}(i)),[i]),{pathname:y}=We();(0,u.useEffect)((()=>{/\/collections\/[a-zA-Z0-9_-]+\/entries\/[a-zA-Z0-9_-]+/g.test(y)||f()}),[y]);const v=(0,u.useMemo)((()=>n?Nf(d().Fragment,null,a&&Nf(ek(),null),Nf(tt,null,Nf(Je,{path:"/",element:Nf(Ke,{to:O})}),Nf(Je,{path:"/search",element:Nf(Ke,{to:O})}),Nf(Je,{path:"/collections/:name/search/",element:Nf(TU,null)}),Nf(Je,{path:"/error=access_denied&error_description=Signups+not+allowed+for+this+instance",element:Nf(Ke,{to:O})}),Nf(Je,{path:"/collections",element:Nf(Rj,{collections:i})}),Nf(Je,{path:"/collections/:name",element:Nf(Rj,{collections:i})}),Nf(Je,{path:"/collections/:name/new",element:Nf(Sz,{collections:i,newRecord:!0})}),Nf(Je,{path:"/collections/:name/entries/:slug",element:Nf(Sz,{collections:i})}),Nf(Je,{path:"/collections/:name/search/:searchTerm",element:Nf(Rj,{collections:i,isSearchResults:!0,isSingleSearchResult:!0})}),Nf(Je,{path:"/collections/:name/filter/:filterTerm",element:Nf(Rj,{collections:i})}),Nf(Je,{path:"/search/:searchTerm",element:Nf(Rj,{collections:i,isSearchResults:!0})}),Nf(Je,{path:"/edit/:name/:entryName",element:Nf(EU,null)}),Nf(Je,{path:"/page/:id",element:Nf(IF,null)}),Nf(Je,{element:Nf(xU,null)})),s?Nf(MF,null):null):g),[g,i,O,a,s,n]);return r.config?r.error?p():r.isFetching?Nf(_R,null,l("app.app.loadingConfig")):Nf(d().Fragment,null,Nf(U$,{key:"global-styles"}),Nf(Kw.ScrollSync,{key:"scroll-sync",enabled:c},Nf(d().Fragment,null,Nf("div",{key:"back-to-top-anchor",id:"back-to-top-anchor"}),Nf(SU,{key:"cms-root",id:"cms-root"},Nf(PU,{key:"cms-wrapper",className:"cms-wrapper"},Nf(OU,{key:"snackbars"}),v,Nf(Ez,{key:"alert"}),Nf(eP,{key:"confirm"}))),Nf(wU,{key:"scroll-to-top"},Nf(Gw,{size:"small","aria-label":"scroll back to top"},Nf(rw.Z,null)))))):p(l("app.app.configNotFound"))}))),RU=(0,p.Iu)()((e=>{let{field:t,t:n}=e;return Nf("div",null,n("editor.editorWidgets.unknownControl.noControl",{widget:t.widget}))})),DU=(0,p.Iu)()((e=>{let{field:t,t:n}=e;return Nf("div",{className:"nc-widgetPreview"},n("editor.editorWidgets.unknownPreview.noPreview",{widget:t.widget}))}));lO("unknown",RU,DU);v
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
`,aW=(0,aw.ZP)("span")`
width: 300px;
height: 150px;
margin-top: -150px;
`,sW=(0,aw.ZP)(iW)`
color: #c4c6d2;
`,lW=(0,aw.ZP)(iW)`
color: #c4c6d2;
`,cW=e=>{let{url:t}=e;return Nf(aW,null,Nf("img",{src:t,alt:"Logo"}))},uW=e=>{let{onLogin:t,loginDisabled:n,loginErrorMessage:r,icon:i,buttonContent:o,pageContent:a,logoUrl:s,siteUrl:l,t:c}=e;return Nf(oW,null,(e=>e?Nf(cW,{url:e}):Nf(sW,{width:300,height:150,type:"static-cms"}))(s),r?Nf("p",null,r):null,null!=a?a:null,o?Nf(Hk,{variant:"contained",disabled:n,onClick:t,startIcon:i},o):null,l?Nf(UU,{href:l,t:c}):null,s?Nf(lW,{width:100,height:100,type:"static-cms"}):null)},dW=(0,aw.ZP)(iW)`
margin-right: 18px;
`,fW=e=>{let{inProgress:t=!1,config:n,base_url:r,siteId:i,authEndpoint:o,clearHash:a,onLogin:s,t:l}=e;const[c,d]=(0,u.useState)(null),[f,p]=(0,u.useMemo)((()=>{const{auth_type:e=""}=n.backend;if("implicit"===e){const{base_url:e="https://bitbucket.org",auth_endpoint:t="site/oauth2/authorize",app_id:r=""}=n.backend,i=new ST({base_url:e,auth_endpoint:t,app_id:r,clearHash:a});return i.completeAuth(((e,t)=>{e?d(e.toString()):t&&s(t)})),[i,{scope:"repository:write"}]}return[new yT({base_url:r,site_id:"localhost"===document.location.host.split(":")[0]?"cms.netlify.com":i,auth_endpoint:o}),{provider:"bitbucket",scope:"repo"}]}),[o,r,a,n.backend,s,i]),h=(0,u.useCallback)((e=>{e.preventDefault(),f.authenticate(p,((e,t)=>{e?d(e.toString()):t&&s(t)}))}),[f,p,s]);return Nf(uW,{onLogin:h,loginDisabled:t,loginErrorMessage:c,logoUrl:n.logo_url,siteUrl:n.site_url,icon:Nf(dW,{type:"bitbucket"}),buttonContent:l(t?"auth.loggingIn":"auth.loginWithBitbucket"),t:l})};var pW=__nested_webpack_require_2794107__(78038),hW=__nested_webpack_require_2794107__(48494);const mW=(e,t,n={})=>(CW(t),!(!n.nocomment&&"#"===t.charAt(0))&&new QW(t,n).match(e)),gW=mW,OW="win32"===("object"==typeof hW&&hW?"object"==typeof hW.env&&hW.env&&hW.env.__MINIMATCH_TESTING_PLATFORM__||hW.platform:"posix")?{sep:"\\"}:{sep:"/"};mW.sep=OW.sep;const yW=Symbol("globstar **");mW.GLOBSTAR=yW;const vW={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},bW="[^/]",_W=bW+"*?",wW=e=>e.split("").reduce(((e,t)=>(e[t]=!0,e)),{}),kW=wW("().*{}+?[]^$\\!"),xW=wW("[.("),SW=/\/+/;mW.filter=(e,t={})=>n=>mW(n,e,t);const PW=(e,t={})=>Object.assign({},e,t);mW.defaults=e=>{if(!e||"object"!=typeof e||!Object.keys(e).length)return mW;const t=mW;return Object.assign(((n,r,i={})=>t(n,r,PW(e,i))),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,PW(e,n))}static defaults(n){return t.defaults(PW(e,n)).Minimatch}},filter:(n,r={})=>t.filter(n,PW(e,r)),defaults:n=>t.defaults(PW(e,n)),makeRe:(n,r={})=>t.makeRe(n,PW(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,PW(e,r)),match:(n,r,i={})=>t.match(n,r,PW(e,i)),sep:t.sep,GLOBSTAR:yW})};const $W=(e,t={})=>(CW(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:pW(e));mW.braceExpand=$W;const CW=e=>{if("string"!=typeof e)throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},TW=Symbol("subparse");mW.makeRe=(e,t={})=>new QW(e,t).makeRe(),mW.match=(e,t,n={})=>{const r=new QW(t,n);return e=e.filter((e=>r.match(e))),r.options.nonull&&!e.length&&e.push(t),e};const EW=e=>e.replace(/[[\]\\]/g,"\\$&");class QW{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;partial;globSet;globParts;regexp;constructor(e,t={}){CW(e),t=t||{},this.options=t,this.set=[],this.pattern=e,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||!1===t.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.make()}debug(...e){}make(){const e=this.pattern,t=this.options;if(!t.nocomment&&"#"===e.charAt(0))return void(this.comment=!0);if(!e)return void(this.empty=!0);this.parseNegate();const n=this.globSet=this.braceExpand();t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,n);const r=this.globParts=n.map((e=>e.split(SW)));this.debug(this.pattern,r);let i=r.map(((e,t,n)=>e.map((e=>this.parse(e)))));this.debug(this.pattern,i),this.set=i.filter((e=>-1===e.indexOf(!1))),this.debug(this.pattern,this.set)}parseNegate(){if(this.nonegate)return;const e=this.pattern;let t=!1,n=0;for(let r=0;r<e.length&&"!"===e.charAt(r);r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){var r=this.options;this.debug("matchOne",{this:this,file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var i=0,o=0,a=e.length,s=t.length;i<a&&o<s;i++,o++){this.debug("matchOne loop");var l=t[o],c=e[i];if(this.debug(t,l,c),!1===l)return!1;if(l===yW){this.debu
Repo "${this.repo}" not found.
Please ensure the repo information is spelled correctly.
If the repo is private, make sure you're logged into a Bitbucket account with access.
`,e})))throw new Error("Your BitBucket user account does not have access to this repo.");const t=await this.api.user();return IW(IW({},t),{},{name:t.display_name,login:t.username,token:e.token,avatar_url:t.links.avatar.href,refresh_token:e.refresh_token})}getRefreshedAccessToken(){var e;if("implicit"===this.authType)throw new Sp("Can't refresh access token when using implicit auth");if(this.refreshedTokenPromise)return this.refreshedTokenPromise;if(!this.authenticator){const e={base_url:this.baseUrl,site_id:this.siteId};this.authenticator=new yT(e)}return this.refreshedTokenPromise=null===(e=this.authenticator.refresh({provider:"bitbucket",refresh_token:this.refreshToken}))||void 0===e?void 0:e.then((e=>{let{token:t,refresh_token:n}=e;return this.token=t,this.refreshToken=n,this.refreshedTokenPromise=void 0,this.updateUserCredentials({token:t,refresh_token:n}),t})),this.refreshedTokenPromise}logout(){this.token=null}getToken(){return this.refreshedTokenPromise?this.refreshedTokenPromise:Promise.resolve(this.token)}async entriesByFolder(e,t,n){let r;const i=await this.api.defaultBranchCommitSha(),o=await sm((()=>this.api.listFiles(e,n,20,this.branch).then((e=>{let{entries:n,cursor:i}=e;return r=i.mergeMeta({extension:t}),n.filter((e=>ch(e,t)))}))),((e,t)=>this.api.readFile(e,t,{head:i})),this.api.readFileMetadata.bind(this.api),IU);return o[kh]=r,o}async listAllFiles(e,t,n){return(await this.api.listAllFiles(e,n,this.branch)).filter((e=>ch(e,t)))}async allEntriesByFolder(e,t,n){const r=await this.api.defaultBranchCommitSha(),i=await mm({listAllFiles:()=>this.listAllFiles(e,t,n),readFile:(e,t)=>this.api.readFile(e,t,{head:r}),readFileMetadata:this.api.readFileMetadata.bind(this.api),apiName:IU,branch:this.branch,localForage:vm,folder:e,extension:t,depth:n,getDefaultBranch:()=>Promise.resolve({name:this.branch,sha:r}),isShaExistsInBranch:this.api.isShaExistsInBranch.bind(this.api),getDifferences:(e,t)=>this.api.getDifferences(e,t),getFileId:e=>Promise.resolve(this.api.getFileId(r,e)),filterFile:e=>ch(e,t)});return i}async entriesByFiles(e){const t=await this.api.defaultBranchCommitSha();return lm(e,((e,n)=>this.api.readFile(e,n,{head:t})),this.api.readFileMetadata.bind(this.api),IU)}getEntry(e){return this.api.readFile(e).then((t=>({file:{path:e,id:null},data:t})))}async getMedia(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.mediaFolder;return e?this.api.listAllFiles(e,1,this.branch).then((e=>e.map((e=>{let{id:t,name:n,path:r}=e;return{id:t,name:n,path:r,displayURL:{id:t,path:r}}})))):[]}getLargeMediaClient(){return this._largeMediaClientPromise||(this._largeMediaClientPromise=(async()=>{const e=await this.api.readFile(".gitattributes").then((e=>Nh(e))).catch((e=>(404===e.status?console.info("This 404 was expected and handled appropriately."):console.error(e),[])));return new MW(!!(this.largeMediaURL&&e.length>0),this.largeMediaURL,e,this.requestFunction)})()),this._largeMediaClientPromise}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||$p()(10),dm(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}async getMediaFile(e){const t=em(e),n=cm(t,await um(e,null,this.api.readFile.bind(this.api))),r=URL.createObjectURL(n);return{id:await Sh(n),displayURL:r,path:e,name:t,size:n.size,file:n,url:r}}async persistEntry(e,t){const n=await this.getLargeMediaClient();return fm(this.lock,(async()=>this.api.persistFiles(e.dataFiles,n.enabled?await Bh(n,e.assets):e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){const{fileObj:n,path:r}=e,i=URL.createObjectURL(n),o=await this.getLargeMediaClient(),a=r.startsWith("/")?r.slice(1):r;if(!o.enabled||!o.matchPath(a))return this._persistMedia(e,t);const s=await Xh(o,n,r);return IW(IW({},await this._persistMedia(s,t)),{},{displayURL:i})}async _persistMedia(e,t){const n=e.fileObj,[r]=await Promise.all([Sh(n),this.api.persistFiles([],[e],t)]),i=URL.createObjectURL(n);return{displayURL:i,path:b_()(e.path,"/k"),name:n.name,size:n.size,id:r,file:n,url:i}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}trave
margin-right: 18px;
`,KN=e=>{let{inProgress:t=!1,config:n,base_url:r,siteId:i,authEndpoint:o,onLogin:a,t:s}=e;const[l,c]=(0,u.useState)(null),d=(0,u.useCallback)((e=>{e.preventDefault();const t={base_url:r,site_id:"localhost"===document.location.host.split(":")[0]?"cms.netlify.com":i,auth_endpoint:o},s=new yT(t),{auth_scope:l=""}=n.backend,u=l||"repo";s.authenticate({provider:"github",scope:u},((e,t)=>{e?c(e.toString()):t&&a(t)}))}),[o,r,n.backend,a,i]);return Nf(uW,{onLogin:d,loginDisabled:t,loginErrorMessage:l,logoUrl:n.logo_url,siteUrl:n.site_url,icon:Nf(GN,{type:"github"}),buttonContent:s("auth.loginWithGitHub"),t:s})};function JN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function eY(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?JN(Object(n),!0).forEach((function(t){tY(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tY(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{fetchWithTimeout:nY}=qp,rY="https://www.githubstatus.com",iY=`${rY}/api/v2/components.json`,oY=["API Requests","Issues, Pull Requests, Projects"];class aY{constructor(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(tY(this,"lock",void 0),tY(this,"api",void 0),tY(this,"options",void 0),tY(this,"originRepo",void 0),tY(this,"repo",void 0),tY(this,"branch",void 0),tY(this,"apiRoot",void 0),tY(this,"mediaFolder",void 0),tY(this,"token",void 0),tY(this,"_currentUserPromise",void 0),tY(this,"_userIsOriginMaintainerPromises",void 0),tY(this,"_mediaDisplayURLSem",void 0),tY(this,"getCursorAndFiles",((e,t)=>{const n=e.length,r=Math.ceil(e.length/20),i=[];return t>1&&(i.push("prev"),i.push("first")),t<r&&(i.push("next"),i.push("last")),{cursor:wh.create({actions:i,meta:{page:t,count:n,pageSize:20,pageCount:r},data:{files:e}}),files:e.slice(20*(t-1),20*t)}})),this.options=eY({proxied:!1,API:null},n),!this.options.proxied&&(null===e.backend.repo||void 0===e.backend.repo))throw new Error('The GitHub backend needs a "repo" in the backend configuration.');this.api=this.options.API||null,this.repo=this.originRepo=e.backend.repo||"",this.branch=(null===(t=e.backend.branch)||void 0===t?void 0:t.trim())||"main",this.apiRoot=e.backend.api_root||"https://api.github.com",this.token="",this.mediaFolder=e.media_folder,this.lock=Cp()}isGitBackend(){return!0}async status(){const e=await nY(iY).then((e=>e.json())).then((e=>e.components.filter((e=>oY.includes(e.name))).every((e=>"operational"===e.status)))).catch((e=>(console.warn("Failed getting GitHub status",e),!0)));let t=!1;var n;return e&&(t=await(null===(n=this.api)||void 0===n?void 0:n.getUser().then((e=>!!e)).catch((e=>(console.warn("Failed getting GitHub user",e),!1))))||!1),{auth:{status:t},api:{status:e,statusPage:rY}}}authComponent(){return KN}restoreUser(e){return this.authenticate(e)}async currentUser(e){let{token:t}=e;return this._currentUserPromise||(this._currentUserPromise=nY(`${this.apiRoot}/user`,{headers:{Authorization:`token ${t}`}}).then((e=>e.json()))),this._currentUserPromise}async userIsOriginMaintainer(e){let{username:t,token:n}=e;const r=t||(await this.currentUser({token:n})).login;return this._userIsOriginMaintainerPromises=this._userIsOriginMaintainerPromises||{},this._userIsOriginMaintainerPromises[r]||(this._userIsOriginMaintainerPromises[r]=nY(`${this.apiRoot}/repos/${this.originRepo}/collaborators/${r}/permission`,{headers:{Authorization:`token ${n
Repo "${this.repo}" not found.
Please ensure the repo information is spelled correctly.
If the repo is private, make sure you're logged into a GitHub account with access.
If your repo is under an organization, ensure the organization has granted access to Netlify
CMS.
`,e})))throw new Error("Your GitHub user account does not have access to this repo.");return eY(eY({},n),{},{token:e.token})}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}async entriesByFolder(e,t,n){const r=this.api.originRepoURL;let i;const o=await sm((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>{const n=e.filter((e=>ch(e,t))),r=this.getCursorAndFiles(n,1);return i=r.cursor,r.files}))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),VN);return o[kh]=i,o}async allEntriesByFolder(e,t,n){const r=this.api.originRepoURL,i=await sm((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>e.filter((e=>ch(e,t)))))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),VN);return i}entriesByFiles(e){const t=this.api.repoURL;return lm(e,((e,n)=>this.api.readFile(e,n,{repoURL:t}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),VN)}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then((t=>({file:{path:e,id:null},data:t}))).catch((()=>({file:{path:e,id:null},data:""})))}async getMedia(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.mediaFolder;return e?this.api.listFiles(e).then((e=>e.map((e=>{let{id:t,name:n,size:r,path:i}=e;return{id:t,name:n,size:r,displayURL:{id:t,path:i},path:i}})))):[]}async getMediaFile(e){const t=await um(e,null,this.api.readFile.bind(this.api)),n=em(e),r=cm(n,t),i=URL.createObjectURL(r);return{id:await Sh(t),displayURL:i,path:e,name:n,size:r.size,file:r,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||$p()(10),dm(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return fm(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:n,path:r,fileObj:i}=e,o=URL.createObjectURL(i);return{id:n,name:i.name,size:i.size,displayURL:o,path:b_()(r,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){var n,r;const i=e.meta,o=null!==(n=null===(r=e.data)||void 0===r?void 0:r.files)&&void 0!==n?n:[];let a;switch(t){case"first":default:a=this.getCursorAndFiles(o,1);break;case"last":var s;a=this.getCursorAndFiles(o,null!==(s=null==i?void 0:i.pageCount)&&void 0!==s?s:1);break;case"next":var l;a=this.getCursorAndFiles(o,null!==(l=(null==i?void 0:i.page)+1)&&void 0!==l?l:1);break;case"prev":var c;a=this.getCursorAndFiles(o,null!==(c=(null==i?void 0:i.page)-1)&&void 0!==c?c:1)}const u=await lm(a.files,((e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),VN);return{entries:u,cursor:a.cursor}}}function sY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lY(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sY(Object(n),!0).forEach((function(t){cY(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sY(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function cY(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const uY="GitLab";var dY;!function(e){e.CREATE="create",e.DELETE="delete",e.MOVE="move",e.UPDATE="update"}(dY||(dY={}));class fY{constructor(e){var t=this;cY(this,"apiRoot",void 0),c
margin-right: 18px;
`,hY={pkce:e=>new TT(e)},mY=e=>{let{inProgress:t=!1,config:n,siteId:r,authEndpoint:i,clearHash:o,onLogin:a,t:s}=e;const[l,c]=(0,u.useState)(null),d=(0,u.useMemo)((()=>{const{auth_type:e="",base_url:t="https://gitlab.com",auth_endpoint:s="oauth/authorize",app_id:l=""}=n.backend;if(Xd(e)&&e in hY){const n=hY[e]({base_url:t,auth_endpoint:s,app_id:l,auth_token_endpoint:"oauth/token",clearHash:o});return n.completeAuth(((e,t)=>{e?c(e.toString()):t&&a(t)})),n}return new yT({base_url:t,site_id:"localhost"===document.location.host.split(":")[0]?"cms.netlify.com":r,auth_endpoint:i})}),[i,o,n.backend,a,r]),f=(0,u.useCallback)((e=>{e.preventDefault(),d.authenticate({provider:"gitlab",scope:"api"},(e=>{e&&c(e.toString())}))}),[d]);return Nf(uW,{onLogin:f,loginDisabled:t,loginErrorMessage:l,logoUrl:n.logo_url,siteUrl:n.site_url,icon:Nf(pY,{type:"gitlab"}),buttonContent:s(t?"auth.loggingIn":"auth.loginWithGitLab"),t:s})};function gY(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function OY(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gY(Object(n),!0).forEach((function(t){yY(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gY(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yY(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class vY{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(yY(this,"lock",void 0),yY(this,"api",void 0),yY(this,"options",void 0),yY(this,"repo",void 0),yY(this,"branch",void 0),yY(this,"apiRoot",void 0),yY(this,"token",void 0),yY(this,"mediaFolder",void 0),yY(this,"_mediaDisplayURLSem",void 0),this.options=OY({proxied:!1,API:null},t),!this.options.proxied&&(null===e.backend.repo||void 0===e.backend.repo))throw new Error('The GitLab backend needs a "repo" in the backend configuration.');this.api=this.options.API||null,this.repo=e.backend.repo||"",this.branch=e.backend.branch||"main",this.apiRoot=e.backend.api_root||"https://gitlab.com/api/v4",this.token="",this.mediaFolder=e.media_folder,this.lock=Cp()}isGitBackend(){return!0}async status(){var e;return{auth:{status:await(null===(e=this.api)||void 0===e?void 0:e.user().then((e=>!!e)).catch((e=>(console.warn("Failed getting GitLab user",e),!1))))||!1},api:{status:!0,statusPage:""}}}authComponent(){return mY}restoreUser(e){return this.authenticate(e)}async authenticate(e){this.token=e.token,this.api=new fY({token:this.token,branch:this.branch,repo:this.repo,apiRoot:this.apiRoot});const t=await this.api.user();if(!await this.api.hasWriteAccess().catch((e=>{throw e.message=Jg`
Repo "${this.repo}" not found.
Please ensure the repo information is spelled correctly.
If the repo is private, make sure you're logged into a GitLab account with access.
`,e})))throw new Error("Your GitLab user account does not have access to this repo.");return OY(OY({},t),{},{login:t.username,token:e.token})}async logout(){this.token=null}getToken(){return Promise.resolve(this.token)}filterFile(e,t,n,r){const i=xp()(t.path.split(e)[1]||"/","/");return ch(t,n)&&i.split("/").length<=r}async entriesByFolder(e,t,n){let r;const i=await sm((()=>this.api.listFiles(e,n>1).then((i=>{let{files:o,cursor:a}=i;return r=a.mergeMeta({folder:e,extension:t,depth:n}),o.filter((r=>this.filterFile(e,r,t,n)))}))),this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),uY);return i[kh]=r,i}async listAllFiles(e,t,n){return(await this.api.listAllFiles(e,n>1)).filter((r=>this.filterFile(e,r,t,n)))}async allEntriesByFolder(e,t,n){return await mm({listAllFiles:()=>this.listAllFiles(e,t,n),readFile:this.api.readFile.bind(this.api),readFileMetadata:this.api.readFileMetadata.bind(this.api),apiName:uY,branch:this.branch,localForage:vm,folder:e,extension:t,depth:n,getDefaultBranch:()=>this.api.getDefaultBranch().then((e=>({name:e.name,sha:e.commit.id}))),isShaExistsInBranch:this.api.isShaExistsInBranch.bind(this.api),getDifferences:(e,t)=>this.api.getDifferences(e,t),getFileId:e=>this.api.getFileId(e,this.branch),filterFile:r=>this.filterFile(e,r,t,n),customFetch:void 0})}entriesByFiles(e){return lm(e,this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),uY)}getEntry(e){return this.api.readFile(e).then((t=>({file:{path:e,id:null},data:t})))}async getMedia(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.mediaFolder;return e?this.api.listAllFiles(e).then((e=>e.map((e=>{let{id:t,name:n,path:r}=e;return{id:t,name:n,path:r,displayURL:{id:t,name:n,path:r}}})))):[]}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||$p()(10),dm(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}async getMediaFile(e){const t=em(e),n=await um(e,null,this.api.readFile.bind(this.api)),r=cm(t,n),i=URL.createObjectURL(r);return{id:await Sh(n),displayURL:i,path:e,name:t,size:r.size,file:r,url:i}}async persistEntry(e,t){return fm(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){const n=e.fileObj,[r]=await Promise.all([Sh(n),this.api.persistFiles([],[e],t)]),{path:i}=e,o=URL.createObjectURL(n);return{displayURL:o,path:b_()(i,"/"),name:n.name,size:n.size,file:n,url:o,id:r}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}traverseCursor(e,t){return this.api.traverseCursor(e,t).then((async t=>{var n,r,i;let{entries:o,cursor:a}=t;const[s,l,c]=[null===(n=e.meta)||void 0===n?void 0:n.folder,null===(r=e.meta)||void 0===r?void 0:r.depth,null===(i=e.meta)||void 0===i?void 0:i.extension];return s&&l&&c&&(o=o.filter((e=>this.filterFile(s,e,c,l))),a=a.mergeMeta({folder:s,extension:c,depth:l})),{entries:await lm(o,this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),uY),cursor:a}}))}}function bY(e,t){(0,u.useEffect)((()=>{var n;null===(n=window.netlifyIdentity)||void 0===n||n.on(e,t)}),[t,e])}const _Y=e=>{let{config:t,onLogin:n,t:r}=e;const[i,o]=(0,u.useState)(!1),[a,s]=(0,u.useState)(!1),[l,c]=(0,u.useState)({});(0,u.useEffect)((()=>{!a&&window.netlifyIdentity&&window.netlifyIdentity.currentUser()&&(o(!0),setTimeout((()=>{window.netlifyIdentity?(n(window.netlifyIdentity.currentUser()),s(!0),window.netlifyIdentity.close()):o(!1)})))}),[]),bY("login",(0,u.useCallback)((e=>{o(!0),setTimeout((()=>{var t;n(e),s(!0),null===(t=window.netlifyIdentity)||void 0===t||t.close()}))}),[n])),bY("logout",(0,u.useCallback)((()=>{var e;null===(e=window.netlifyIdentity)||void 0===e||e.open()}),[])),bY("error",(0,u.useCallback)((e=>{var t,n;null!=e&&null!==(t=e.message)&&void 0!==t&&t.match(/^Failed to load settings from.+\.netlify\/identity$/)&&(null===(n=window.netlifyIdentity)||void 0===n||n.close(),c({identity:r("auth.errors.identitySettings")}))}),[r]));const d=(0,u.useCallback)((()=>{var e;const t=null===(e=window.netlifyIdentity)||void 0===e?void 0:e.currentUser();var r;t?(o(
margin-right: 18px;
`,rX=e=>{let{inProgress:t=!1,config:n,base_url:r,siteId:i,authEndpoint:o,onLogin:a,t:s}=e;const[l,c]=(0,u.useState)(null),d=(0,u.useCallback)((e=>{e.preventDefault();const t={base_url:r,site_id:"localhost"===document.location.host.split(":")[0]?"cms.netlify.com":i,auth_endpoint:o},s=new yT(t),{auth_scope:l=""}=n.backend,u=l||"repo";s.authenticate({provider:"gitea",scope:u},((e,t)=>{e?c(e.toString()):t&&a(t)}))}),[o,r,n.backend,a,i]);return Nf(uW,{onLogin:d,loginDisabled:t,loginErrorMessage:l,logoUrl:n.logo_url,siteUrl:n.site_url,icon:Nf(nX,{type:"gitea"}),buttonContent:s("auth.loginWithGitea"),t:s})};function iX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?iX(Object(n),!0).forEach((function(t){aX(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function aX(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{fetchWithTimeout:sX}=qp;class lX{constructor(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(aX(this,"lock",void 0),aX(this,"api",void 0),aX(this,"options",void 0),aX(this,"originRepo",void 0),aX(this,"repo",void 0),aX(this,"branch",void 0),aX(this,"apiRoot",void 0),aX(this,"mediaFolder",void 0),aX(this,"token",void 0),aX(this,"_currentUserPromise",void 0),aX(this,"_userIsOriginMaintainerPromises",void 0),aX(this,"_mediaDisplayURLSem",void 0),aX(this,"getCursorAndFiles",((e,t)=>{const n=e.length,r=Math.ceil(e.length/20),i=[];return t>1&&(i.push("prev"),i.push("first")),t<r&&(i.push("next"),i.push("last")),{cursor:wh.create({actions:i,meta:{page:t,count:n,pageSize:20,pageCount:r},data:{files:e}}),files:e.slice(20*(t-1),20*t)}})),this.options=oX({proxied:!1,API:null},n),!this.options.proxied&&(null===e.backend.repo||void 0===e.backend.repo))throw new Error('The Gitea backend needs a "repo" in the backend configuration.');this.api=this.options.API||null,this.repo=this.originRepo=e.backend.repo||"",this.branch=(null===(t=e.backend.branch)||void 0===t?void 0:t.trim())||"main",this.apiRoot=e.backend.api_root||"https://gitea.com/api/v1",this.token="",this.mediaFolder=e.media_folder,this.lock=Cp()}isGitBackend(){return!0}async status(){var e;return{auth:{status:await(null===(e=this.api)||void 0===e?void 0:e.user().then((e=>!!e)).catch((e=>(console.warn("Failed getting Gitea user",e),!1))))||!1},api:{status:!0,statusPage:""}}}authComponent(){return rX}restoreUser(e){return this.authenticate(e)}async currentUser(e){let{token:t}=e;return this._currentUserPromise||(this._currentUserPromise=sX(`${this.apiRoot}/user`,{headers:{Authorization:`token ${t}`}}).then((e=>e.json()))),this._currentUserPromise}async userIsOriginMaintainer(e){let{username:t,token:n}=e;const r=t||(await this.currentUser({token:n})).login;return this._userIsOriginMaintainerPromises=this._userIsOriginMaintainerPromises||{},this._userIsOriginMaintainerPromises[r]||(this._userIsOriginMaintainerPromises[r]=sX(`${this.apiRoot}/repos/${this.originRepo}/collaborators/${r}/permission`,{headers:{Authorization:`token ${n}`}}).then((e=>e.json())).then((e=>{let{permission:t}=e;return"admin"===t||"write"===t}))),this._userIsOriginMaintainerPromises[r]}async authenticate(e){this.token=e.token;const t=tX;this.api=new t({token:this.token,branch:this.branch,repo:this.repo,originRepo:this.originRepo,apiRoot:this.apiRoot});const n=await this.api.user();if(!await this.
Repo "${this.repo}" not found.
Please ensure the repo information is spelled correctly.
If the repo is private, make sure you're logged into a Gitea account with access.
If your repo is under an organization, ensure the organization has granted access to Static
CMS.
`,e})))throw new Error("Your Gitea user account does not have access to this repo.");return oX(oX({},n),{},{token:e.token})}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}async entriesByFolder(e,t,n){const r=this.api.originRepoURL;let i;const o=await sm((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>{const n=e.filter((e=>ch(e,t))),r=this.getCursorAndFiles(n,1);return i=r.cursor,r.files}))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),eX);return o[kh]=i,o}async allEntriesByFolder(e,t,n){const r=this.api.originRepoURL,i=await sm((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>e.filter((e=>ch(e,t)))))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),eX);return i}entriesByFiles(e){const t=this.api.repoURL;return lm(e,((e,n)=>this.api.readFile(e,n,{repoURL:t}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),eX)}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then((t=>({file:{path:e,id:null},data:t}))).catch((()=>({file:{path:e,id:null},data:""})))}async getMedia(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.mediaFolder;return e?this.api.listFiles(e).then((e=>e.map((e=>{let{id:t,name:n,size:r,path:i}=e;return{id:t,name:n,size:r,displayURL:{id:t,path:i},path:i}})))):[]}async getMediaFile(e){const t=await um(e,null,this.api.readFile.bind(this.api)),n=em(e),r=cm(n,t),i=URL.createObjectURL(r);return{id:await Sh(t),displayURL:i,path:e,name:n,size:r.size,file:r,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||$p()(10),dm(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return fm(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:n,path:r,fileObj:i}=e,o=URL.createObjectURL(i);return{id:n,name:i.name,size:i.size,displayURL:o,path:b_()(r,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){var n,r;const i=e.meta,o=null!==(n=null===(r=e.data)||void 0===r?void 0:r.files)&&void 0!==n?n:[];let a;switch(t){case"first":default:a=this.getCursorAndFiles(o,1);break;case"last":var s;a=this.getCursorAndFiles(o,null!==(s=null==i?void 0:i.pageCount)&&void 0!==s?s:1);break;case"next":var l;a=this.getCursorAndFiles(o,null!==(l=(null==i?void 0:i.page)+1)&&void 0!==l?l:1);break;case"prev":var c;a=this.getCursorAndFiles(o,null!==(c=(null==i?void 0:i.page)-1)&&void 0!==c?c:1)}const u=await lm(a.files,((e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),eX);return{entries:u,cursor:a.cursor}}}const cX=(0,aw.ZP)("section")`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
`,uX=(0,aw.ZP)(iW)`
color: #c4c6d2;
`,dX=e=>{let{inProgress:t=!1,config:n,onLogin:r,t:i}=e;const o=(0,u.useCallback)((e=>{e.preventDefault(),r({token:"fake_token"})}),[r]);return Nf(cX,null,Nf(uX,{width:300,height:150,type:"static-cms"}),Nf(Hk,{variant:"contained",disabled:t,onClick:o},i(t?"auth.loggingIn":"auth.login")),n.site_url&&Nf(UU,{href:n.site_url,t:i}))};function fX(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fX(Object(n),!0).forEach((function(t){hX(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fX(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hX(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}async function mX(e){const t=await e.toBase64();return{path:e.path,content:t,encoding:"base64"}}function gX(e){let{id:t,content:n,encoding:r,path:i,name:o}=e,a=new Uint8Array(0);if("base64"!==r)console.error(`Unsupported encoding '${r}' for file '${i}'`);else{const e=atob(n);a=new Uint8Array(e.length);for(let t=0;t<e.length;t++)a[t]=e.charCodeAt(t)}const s=cm(o,new Blob([a])),l=URL.createObjectURL(s);return{id:t,name:o,path:i,file:s,size:s.size,url:l,displayURL:l}}class OX{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(hX(this,"proxyUrl",void 0),hX(this,"mediaFolder",void 0),hX(this,"publicFolder",void 0),hX(this,"options",void 0),hX(this,"branch",void 0),!e.backend.proxy_url)throw new Error('The Proxy backend needs a "proxy_url" in the backend configuration.');this.branch=e.backend.branch||"main",this.proxyUrl=e.backend.proxy_url,this.mediaFolder=e.media_folder,this.publicFolder=e.public_folder,this.options=t}isGitBackend(){return!1}status(){return Promise.resolve({auth:{status:!0},api:{status:!0,statusPage:""}})}authComponent(){return dX}restoreUser(){return this.authenticate()}authenticate(){return Promise.resolve()}logout(){return null}getToken(){return Promise.resolve("")}async request(e){const t=await qp.fetchWithTimeout(this.proxyUrl,{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(pX({branch:this.branch},e))}),n=await t.json();if(t.ok)return n;throw new Vp(n.error,t.status,"Proxy")}entriesByFolder(e,t,n){return this.request({action:"entriesByFolder",params:{branch:this.branch,folder:e,extension:t,depth:n}})}entriesByFiles(e){return this.request({action:"entriesByFiles",params:{branch:this.branch,files:e}})}getEntry(e){return this.request({action:"getEntry",params:{branch:this.branch,path:e}})}async persistEntry(e,t){const n=await Promise.all(e.assets.map(mX));return this.request({action:"persistEntry",params:{branch:this.branch,dataFiles:e.dataFiles,assets:n,options:pX({},t)}})}async getMedia(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.mediaFolder,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.publicFolder;return(await this.request({action:"getMedia",params:{branch:this.branch,mediaFolder:e,publicFolder:t}})).map((e=>{let{url:t,path:n}=e;const r=t;return{id:r,name:em(n),displayURL:{id:r,path:t},path:n}}))}async getMediaFile(e){return gX(await this.request({action:"getMediaFile",params:{branch:this.branch,path:e}}))}getMediaDisplayURL(e){return"string"==typeof e?Promise.resolve(e):Promise.resolve(e.path)}async persistMedia(e,t){const n=await mX(e);return gX(await this.request({action:"persistMedia",params:{branch:this.branch,asset:n,options:{commitMessage:t.commitMessage}}}))}deleteFiles(e
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
`,kX=(0,aw.ZP)(iW)`
color: #c4c6d2;
`,xX=e=>{let{inProgress:t=!1,config:n,onLogin:r,t:i}=e;(0,u.useEffect)((()=>{!1===n.backend.login&&r({token:"fake_token"})}),[n.backend.login,r]);const o=(0,u.useCallback)((e=>{e.preventDefault(),r({token:"fake_token"})}),[r]);return Nf(wX,null,Nf(kX,{width:300,height:150,type:"static-cms"}),Nf(Hk,{disabled:t,onClick:o,variant:"contained",sx:{marginBottom:"32px"}},i(t?"auth.loggingIn":"auth.login")),n.site_url&&Nf(UU,{href:n.site_url,t:i}))};function SX(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PX(e,t){const n=e.split("/");let r=t;for(;r&&n.length;)r=r[n.shift()];return r||{}}function $X(e,t,n){const r=e.split("/");let i=n;for(;r.length>1;){const e=r.shift();i[e]=i[e]||{},i=i[e]}i[r.shift()]={content:t,path:e}}window.repoFiles=window.repoFiles||{};const CX=10;function TX(e,t,n,r,i){const o=n.length,a=Math.floor(o/CX);return wh.create({actions:[...r<a?["next","last"]:[],...r>0?["prev","first"]:[]],meta:{index:r,count:o,pageSize:CX,pageCount:a},data:{folder:e,extension:t,index:r,pageCount:a,depth:i}})}function EX(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t;return r<=0||Object.keys(e[t]||{}).forEach((a=>{if(!(0,np.extname)(a))return EX(e[t],a,n,r-1,i,`${o}/${a}`);{const r=e[t][a];n&&!a.endsWith(`.${n}`)||i.unshift({content:r.content,path:`${o}/${a}`})}})),i}class QX{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};SX(this,"mediaFolder",void 0),SX(this,"options",void 0),this.options=t,this.mediaFolder=e.media_folder}isGitBackend(){return!1}status(){return Promise.resolve({auth:{status:!0},api:{status:!0,statusPage:""}})}authComponent(){return xX}restoreUser(){return this.authenticate()}authenticate(){return Promise.resolve()}logout(){return null}getToken(){return Promise.resolve("")}traverseCursor(e,t){const{folder:n,extension:r,index:i,pageCount:o,depth:a}=e.data,s="next"===t?i+1:"prev"===t?i-1:"first"===t?0:"last"===t?o:0,l=EX(window.repoFiles,n,r,a).map((e=>({data:e.content,file:{path:e.path,id:e.path}}))),c=l.slice(s*CX,s*CX+CX),u=TX(n,r,l,s,a);return Promise.resolve({entries:c,cursor:u})}entriesByFolder(e,t,n){const r=(e?EX(window.repoFiles,e,t,n):[]).map((e=>({data:e.content,file:{path:e.path,id:e.path}}))),i=TX(e,t,r,0,n),o=vX()(r,CX);return o[kh]=i,Promise.resolve(o)}entriesByFiles(e){return Promise.all(e.map((e=>({file:e,data:PX(e.path,window.repoFiles).content}))))}getEntry(e){return Promise.resolve({file:{path:e,id:null},data:PX(e,window.repoFiles).content})}async persistEntry(e){return e.dataFiles.forEach((e=>{const{path:t,raw:n}=e;$X(t,n,window.repoFiles)})),e.assets.forEach((e=>{$X(e.path,e,window.repoFiles)})),Promise.resolve()}async getMedia(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.mediaFolder;return e?EX(window.repoFiles,e.split("/")[0],"",100).filter((t=>t.path.startsWith(e))).map((e=>this.normalizeAsset(e.content))):[]}async getMediaFile(e){var t;const n=PX(e,window.repoFiles).content,r=null!==(t=null==n?void 0:n.toString())&&void 0!==t?t:"",i=em(e),o=await fetch(r).then((e=>e.blob())),a=new File([o],i);return{id:r,displayURL:r,path:e,name:i,size:a.size,file:a,url:r}}normalizeAsset(e){const t=e.fileObj,{name:n,size:r}=t,i=gt()(window.URL.createObjectURL,t),o=wt()(i)?"":i;return{id:o_(),name:n,size:r,path:e.path,url:o,displayURL:o,fileObj:t}}persistMedia(e){const t=this.normalizeAsset(e);return $X(e.path,e,window.repoFiles),Promise.resolve(t)}deleteFiles(e){return e.forEach((e=>{!function(e,t){_X()(t,e.split("/"))}(e,window.repoFiles)})),Promise.resolve()}async allEntriesByFolder(e,t,n){const r=(e?EX(window.repoFiles,e,t,n):[]).map((e=>({data:e.content,file:{path:e.path,id:e.path}})));return P
position: relative;
align-items: center;
background-color: ${g$};
display: flex;
justify-content: space-between;
padding: 2px 8px;
`,TG=(0,aw.ZP)("div",xm)((e=>{let{$hasError:t}=e;return`\n display: flex;\n align-items: center;\n color: rgba(0, 0, 0, 0.6);\n font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;\n font-weight: 400;\n font-size: 1rem;\n line-height: 1.4375em;\n letter-spacing: 0.00938em;\n ${t?`color: ${o$}`:""}\n `})),EG=e=>{let{allowAdd:t,types:n,onAdd:r,onAddType:i,onCollapseToggle:o,collapsed:a,heading:s,label:l,hasError:c=!1,t:d,testId:f}=e;const[p,h]=(0,u.useState)(null),m=Boolean(p),g=(0,u.useCallback)((e=>{h(e.currentTarget)}),[]),O=(0,u.useCallback)((()=>{h(null)}),[]),y=(0,u.useCallback)((e=>()=>{O(),null==i||i(e.name)}),[O,i]),v=(0,u.useCallback)((e=>Nf("div",null,Nf(Hk,{id:"types-button","aria-controls":m?"types-menu":void 0,"aria-haspopup":"true","aria-expanded":m?"true":void 0,onClick:g,variant:"outlined",size:"small",endIcon:Nf(PG.Z,{fontSize:"small"})},d("editor.editorWidgets.list.addType",{item:l})),Nf(GC,{id:"types-menu",anchorEl:p,open:m,onClose:O,MenuListProps:{"aria-labelledby":"types-button"}},e.map(((e,t)=>{var n;return e?Nf(lT,{key:t,onClick:y(e)},null!==(n=e.label)&&void 0!==n?n:e.name):null}))))),[m,g,d,l,p,O,y]),b=(0,u.useCallback)((()=>Nf(Hk,{onClick:r,endIcon:Nf(PG.Z,{fontSize:"small"}),size:"small",variant:"outlined","data-testid":"add-button"},d("editor.editorWidgets.list.add",{item:l}))),[d,l,r]),_=(0,u.useCallback)((()=>t?n&&n.length>0?v(n):b():null),[t,n,v,b]);return Nf(CG,{"data-testid":f},Nf(TG,{$hasError:c},Nf(iE,{onClick:o,"data-testid":"expand-button"},Nf($G.Z,{sx:{transform:`rotateZ(${a?"-90deg":"0deg"})`,transition:`transform ${_$};`,color:c?o$:void 0}})),s),_())},QG=(0,aw.ZP)("div",xm)((e=>{let{$active:t,$hasError:n,$hasLabel:r}=e;return`\n position: absolute;\n bottom: 0;\n right: 0;\n top: ${r?22:0}px;\n left: 0;\n margin: 0;\n padding: 0 8px;\n pointer-events: none;\n border-radius: 4px;\n border-style: solid;\n border-width: 1px;\n overflow: hidden;\n min-width: 0%;\n border-color: rgba(0, 0, 0, 0.23);\n ${t?"\n border-color: #1976d2;\n border-width: 2px;\n ":""}\n ${n?"\n border-color: #d32f2f;\n border-width: 2px;\n ":""}\n `})),AG=e=>{let{active:t=!1,hasError:n=!1,hasLabel:r=!1}=e;return Nf(QG,{$active:t,$hasError:n,$hasLabel:r})},RG=[{label:"AGS Script",identifiers:["ags","asc","ash"],codemirror_mode:"c",codemirror_mime_type:"text/x-c++src"},{label:"APL",identifiers:["apl","dyalog"],codemirror_mode:"apl",codemirror_mime_type:"text/apl"},{label:"ASP",identifiers:["asp","aspx","asax","ascx","ashx","asmx","axd"],codemirror_mode:"html",codemirror_mime_type:"application/x-aspx"},{label:"Alpine Abuild",identifiers:["abuild","apkbuild"],codemirror_mode:"shell",codemirror_mime_type:"text/x-sh"},{label:"AngelScript",identifiers:["angelscript","as"],codemirror_mode:"c",codemirror_mime_type:"text/x-c++src"},{label:"Ant Build System",identifiers:[],codemirror_mode:"xml",codemirror_mime_type:"application/xml"},{label:"Apex",identifiers:["apex","cls"],codemirror_mode:"c",codemirror_mime_type:"text/x-java"},{label:"Asymptote",identifiers:["asymptote","asy"],codemirror_mode:"c",codemirror_mime_type:"text/x-kotlin"},{label:"BibTeX",identifiers:["bibtex","bib"],codemirror_mode:"stex",codemirror_mime_type:"text/x-stex"},{label:"Brainfuck",identifiers:["brainfuck","b","bf"],codemirror_mode:"brainfuck",codemirror_mime_type:"text/x-brainfuck"},{label:"C",identifiers:["c","cats","h","idc"],codemirror_mode:"c",codemirror_mime_type:"text/x-csrc"},{label:"C#",identifiers:["csharp","cs","cake","csx"],codemirror_mode:"csharp",codemirror_mime_type:"text/x-csharp"},{label:"C++",identifiers:["cpp","cc","cp","cxx","h","hh","hpp","hxx","inc","inl","ino","ipp","re","tcc","tpp"],codemirror_mode:"cpp",codemirror_mime_type:"text/x-c++src"},{label:"C2hs Haskell",identifiers:["chs"],codemirror_mode:"haskell",codemirror_mime_type:"text/x-haskell"},{label:"CMake",identifiers:["cmake"],codemirror_mode:"cmake",codemirror_mime_type:"text/x-cmake"},{label:"COBOL",identifiers:["cobol","cob","cbl","ccp"
position: absolute;
z-index: ${100};
right: 8px;
top: 8px;
opacity: 0.8;
padding: 2px 4px;
line-height: 1;
height: auto;
color: #000;
`,MG=e=>{let{showClose:t=!1,onClick:n}=e;return Nf(LG,{onClick:n},Nf(t?Qz.Z:DG.Z,null))};var jG=__nested_webpack_require_2794107__(84111);const IG=(0,aw.ZP)("div")`
position: absolute;
top: 1px;
bottom: 1px;
right: 1px;
width: 200px;
z-index: ${10};
background-color: #fff;
overflow: hidden;
padding: 12px;
border-radius: 0 3px 3px 0;
${"\n && {\n box-shadow: 0 2px 4px 0 rgba(19, 39, 48, 0.12);\n }\n "};
display: flex;
flex-direction: column;
gap: 16px;
`,zG=(0,aw.ZP)("h3")`
font-size: 14px;
margin-top: 14px;
margin-bottom: 0;
&:first-of-type {
margin-top: 4px;
}
`,FG=e=>{let{value:t,label:n,options:r,onChange:i,uniqueId:o,type:a}=e;return Nf(fM,{fullWidth:!0,size:"small"},Nf(sM,{id:`${o}-select-${a}-label`},n),Nf(VM,{labelId:`${o}-select-${a}-label`,id:`${o}-select-${a}`,value:t.value,label:n,onChange:e=>{i(e.target.value)}},r.map((e=>{let{label:t,value:n}=e;return n?Nf(lT,{key:`${o}-select-${a}-option-${n}`,value:n},t):null}))))},UG=e=>{let{hideSettings:t,uniqueId:n,languages:r,language:i,onChangeLanguage:o}=e;return Nf(IG,{onKeyDown:e=>(0,jG.ZP)("esc",e)&&t()},Nf(MG,{onClick:t,showClose:!0}),Nf(d().Fragment,null,Nf(zG,null,"Field Settings"),Nf(FG,{type:"language",label:"Language",uniqueId:n,value:i,options:r,onChange:o})))};function WG(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function NG(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?WG(Object(n),!0).forEach((function(t){YG(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WG(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function YG(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const XG=(0,aw.ZP)("div")`
display: flex;
flex-direction: column;
position: relative;
width: 100%;
`,BG=(0,aw.ZP)("div",xm)((e=>{let{$collapsed:t}=e;return`\n display: block;\n width: 100%;\n ${t?"\n display: none;\n ":""}\n `}));function qG(e){return"string"==typeof e?{value:e,label:e}:{value:e.name,label:e.label||e.name}}const ZG=e=>{var t,n;let{field:r,onChange:i,hasErrors:o,value:a,t:s}=e;const l=(0,u.useMemo)((()=>{var e;const t=null!==(e=r.keys)&&void 0!==e?e:{};return NG(NG({},{code:"code",lang:"lang"}),t)}),[r]),c=(0,u.useMemo)((()=>Boolean(!r.output_code_only)),[r.output_code_only]),[d,f]=(0,u.useState)(null!=a?a:""),[p,h]=(0,u.useState)(null),[m,g]=(0,u.useState)(!1),[O,y]=(0,u.useState)(!1),v=(0,u.useCallback)((()=>{y(!0)}),[]),b=(0,u.useCallback)((()=>{y(!1)}),[]),_=(0,u.useCallback)((()=>{g(!m)}),[m]),w=(0,u.useCallback)((e=>{f(null!=e?e:""),i(null!=e?e:"")}),[i]),k=(0,u.useCallback)((e=>{var t;c&&w({lang:null!==(t=null==p?void 0:p.label)&&void 0!==t?t:"",code:e}),w(e)}),[w,null==p?void 0:p.label,c]),x=(0,u.useMemo)((()=>p?oZ(p.codemirror_mode):null),[p]),S=(0,u.useMemo)((()=>x?[x]:[]),[x]),P=(0,u.useMemo)((()=>"string"==typeof d?d:d[l.code]),[d,l.code]),[$,C]=(0,u.useState)(!1),T=(0,u.useCallback)((()=>{C(!0)}),[]),E=(0,u.useCallback)((()=>{C(!1)}),[]),Q=Uj(),A=(0,u.useMemo)((()=>Boolean(r.allow_language_selection)),[r.allow_language_selection]),R=RG.map((e=>qG(e.label))),D=(0,u.useCallback)((e=>{const t=RG.find((t=>t.identifiers.includes(e)));t&&h(t)}),[]);return(0,u.useEffect)((()=>{let e;e="string"!=typeof d?d[l.lang]:d,Yd(e)||D(e)}),[r.default_language,D,d,l.lang,c]),Nf(XG,null,A?$?Nf(UG,{hideSettings:E,uniqueId:Q,languages:R,language:qG(null!==(t=null==p?void 0:p.label)&&void 0!==t?t:""),allowLanguageSelection:A,onChangeLanguage:D}):Nf(MG,{onClick:T}):null,Nf(EG,{key:"file-control-top-bar",collapsed:m,onCollapseToggle:_,heading:null!==(n=r.label)&&void 0!==n?n:r.name,hasError:o,t:s}),Nf(BG,{$collapsed:m},Nf(SG,{value:P,height:"auto",minHeight:"120px",width:"100%",editable:!0,onFocus:v,onBlur:b,onChange:k,extensions:S})),Nf(AG,{active:O,hasError:o}))},VG=(0,aw.ZP)("div")`
margin: 15px 2px;
`,HG=e=>{let{children:t}=e;return Nf(VG,null,t)},GG=e=>{let{value:t,field:n}=e;return Nf(HG,null,Nf("pre",null,Nf("code",null,function(e,t){return $f()(e)?e:e&&null!==(n=e[null!==(r=null===(i=t.keys)||void 0===i?void 0:i.code)&&void 0!==r?r:"code"])&&void 0!==n?n:"";var n,r,i}(t,n))))},KG={properties:{default_language:{type:"string"},allow_language_selection:{type:"boolean"},output_code_only:{type:"boolean"},keys:{type:"object",properties:{code:{type:"string"},lang:{type:"string"}}},default:{oneOf:[{type:"string"},{type:"object"}]}}},JG=()=>({name:"code",controlComponent:ZG,previewComponent:GG,options:{schema:KG,getDefaultValue:(e,t)=>{var n,r,i,o,a,s,l;if(t.output_code_only)return String(e);const c=null!==(n=null===(r=t.keys)||void 0===r?void 0:r.lang)&&void 0!==n?n:"lang",u=null!==(i=null===(o=t.keys)||void 0===o?void 0:o.code)&&void 0!==i?i:"code";var d;return"string"==typeof e?{[c]:null!==(d=t.default_language)&&void 0!==d?d:"",[u]:e}:{[c]:null!==(a=null!==(s=t.default_language)&&void 0!==s?s:null==e?void 0:e[c])&&void 0!==a?a:"",[u]:null!==(l=null==e?void 0:e[u])&&void 0!==l?l:""}}}});var eK=__nested_webpack_require_2794107__(37980),tK=function(e,t,n,r,i){var o,a,s=i.clientWidth,l=i.clientHeight,c="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,u="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,d=c-(i.getBoundingClientRect().left+window.pageXOffset),f=u-(i.getBoundingClientRect().top+window.pageYOffset);if("vertical"===n){if(o=f<0?0:f>l?1:Math.round(100*f/l)/100,t.a!==o)return{h:t.h,s:t.s,l:t.l,a:o,source:"rgb"}}else if(r!==(a=d<0?0:d>s?1:Math.round(100*d/s)/100))return{h:t.h,s:t.s,l:t.l,a,source:"rgb"};return null},nK={},rK=function(e,t,n,r){var i=e+"-"+t+"-"+n+(r?"-server":"");if(nK[i])return nK[i];var o=function(e,t,n,r){if("undefined"==typeof document&&!r)return null;var i=r?new r:document.createElement("canvas");i.width=2*n,i.height=2*n;var o=i.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,i.width,i.height),o.fillStyle=t,o.fillRect(0,0,n,n),o.translate(n,n),o.fillRect(0,0,n,n),i.toDataURL()):null}(e,t,n,r);return nK[i]=o,o},iK=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},oK=function(e){var t=e.white,n=e.grey,r=e.size,i=e.renderers,o=e.borderRadius,a=e.boxShadow,s=e.children,l=(0,eK.ZP)({default:{grid:{borderRadius:o,boxShadow:a,absolute:"0px 0px 0px 0px",background:"url("+rK(t,n,r,i.canvas)+") center left"}}});return(0,u.isValidElement)(s)?d().cloneElement(s,iK({},s.props,{style:iK({},s.props.style,l.grid)})):d().createElement("div",{style:l.grid})};oK.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};const aK=oK;var sK=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lK=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function cK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uK(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var dK=function(e){function t(){var e,n,r;cK(this,t);for(var i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=uK(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.handleChange=function(e){var t=tK(e,r.props.hsl,r.props.direction,r.props.a,r.container);t&&"function"==typeof r.props.onChange&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleChange),window.removeEventListener("
display: flex;
flex-direction: column;
position: relative;
width: 100%;
`,a4=(0,aw.ZP)("div",xm)((e=>{let{$collapsed:t}=e;return`\n display: flex;\n ${t?"\n display: none;\n ":"\n padding: 16px;\n "}\n `})),s4=(0,aw.ZP)("div")`
position: absolute;
z-index: ${1};
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/nYDCgBDAm9BGDWAAJyRCgLaBCAAgXwixzAS0pgAAAABJRU5ErkJggg==');
height: 38px;
width: 48px;
margin-top: 10px;
margin-left: 10px;
border-radius: 5px;
`,l4=(0,aw.ZP)("div",xm)((e=>{let{$background:t,$color:n}=e;return`\n position: absolute;\n z-index: 2;\n background: ${t};\n cursor: pointer;\n height: 38px;\n width: 48px;\n margin-top: 10px;\n margin-left: 10px;\n border-radius: 5px;\n border: 2px solid rgb(223, 223, 227);\n text-align: center;\n font-size: 27px;\n line-height: 1;\n padding-top: 4px;\n user-select: none;\n color: ${n};\n `})),c4=(0,aw.ZP)("div")`
position: absolute;
z-index: ${1e3};
margin-top: 48px;
margin-left: 12px;
`,u4=(0,aw.ZP)("div")`
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
`,d4=e=>{var t,n,r;let{field:i,onChange:o,value:a,hasErrors:s,t:l}=e;const[c,d]=(0,u.useState)(!1),f=(0,u.useCallback)((()=>{d(!c)}),[c]),[p,h]=(0,u.useState)(!1),[m,g]=(0,u.useState)(null!=a?a:""),O=(0,u.useCallback)((()=>{h(!p)}),[p]),y=(0,u.useCallback)((e=>{e.stopPropagation(),g(""),o("")}),[o]),v=(0,u.useCallback)((()=>{h(!1)}),[]),b=(0,u.useCallback)((e=>{var t,n;const r=(null!==(t=null===(n=e.rgb)||void 0===n?void 0:n.a)&&void 0!==t?t:1)<1?`rgba(${e.rgb.r}, ${e.rgb.g}, ${e.rgb.b}, ${e.rgb.a})`:e.hex;g(r),o(r)}),[o]),_=(0,u.useCallback)((e=>{g(e.target.value),o(e.target.value)}),[o]),w=null!==(t=i.allow_input)&&void 0!==t&&t,k=!w&&m;return Nf(o4,null,Nf(EG,{key:"file-control-top-bar",collapsed:c,onCollapseToggle:f,heading:null!==(n=i.label)&&void 0!==n?n:i.name,hasError:s,t:l}),Nf(a4,{$collapsed:c},Nf(s4,null),Nf(l4,{key:"color-swatch",$background:i4()(m)?m:"#fff",$color:i4()(m)?"rgba(255, 255, 255, 0)":"rgb(223, 223, 227)",onClick:O},"?"),p&&Nf(c4,{key:"color-swatch-wrapper"},Nf(u4,{key:"click-outside",onClick:v}),Nf(w3,{key:"color-picker",color:m,onChange:b,disableAlpha:!(null!==(r=i.enable_alpha)&&void 0!==r&&r)})),Nf(tj,{key:"color-picker-input",value:m,onChange:_,sx:{color:w?void 0:"#bbb",".MuiInputBase-input":{paddingLeft:"75px"}},onClick:w?void 0:O,disabled:!w,fullWidth:!0,InputProps:{endAdornment:k?Nf(tL,{position:"start"},Nf(iE,{onClick:y,"aria-label":"clear"},Nf(Qz.Z,null))):void 0}})),Nf(AG,{hasError:s}))},f4=e=>{let{value:t}=e;return Nf(HG,null,t)},p4={properties:{default:{type:"string"}}},h4=()=>({name:"color",controlComponent:d4,previewComponent:f4,options:{schema:p4}});function m4(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function g4(e){return g4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g4(e)}function O4(e){return m4(1,arguments),e instanceof Date||"object"===g4(e)&&"[object Date]"===Object.prototype.toString.call(e)}function y4(e){return y4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y4(e)}function v4(e){m4(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===y4(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function b4(e){if(m4(1,arguments),!O4(e)&&"number"!=typeof e)return!1;var t=v4(e);return!isNaN(Number(t))}function _4(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function w4(e,t){m4(2,arguments);var n=v4(e).getTime(),r=_4(t);return new Date(n+r)}function k4(e,t){m4(2,arguments);var n=_4(t);return w4(e,-n)}var x4=864e5;function S4(e){m4(1,arguments);var t=1,n=v4(e),r=n.getUTCDay(),i=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function P4(e){m4(1,arguments);var t=v4(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=S4(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=S4(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function $4(e){m4(1,arguments);var t=P4(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=S4(n);return r}var C4=6048e5;function T4(e){m4(1,arguments);var t=v4(e),n=S4(t).getTime()-$4(t).getTime();return Math.round(n/C4)+1}var E4={};function Q4(){return E4}function A4(e,t){var n,r,i,o,a,s,l,c;m4(1,arguments);var u=Q4(),d=_4(null!==(n=null!==(r=null!==(i=null!==(o=null==t?void 0
width: fit-content;
`,hse=e=>{let{t,handleChange:n,disabled:r}=e;const i=(0,u.useCallback)((e=>{e.stopPropagation(),n(new Date)}),[n]);return Nf(pse,{key:"now-button-wrapper"},Nf(Hk,{key:"now-button",onClick:i,disabled:r,startIcon:Nf(v5.Z,{key:"today-icon"}),variant:"outlined"},t("editor.editorWidgets.datetime.now")))},mse=e=>{let{field:t,label:n,value:r,t:i,isDisabled:o,onChange:a,hasErrors:s}=e;const{format:l,dateFormat:c,timeFormat:d}=(0,u.useMemo)((()=>{var e,n;return{format:t.format,dateFormat:null===(e=t.date_format)||void 0===e||e,timeFormat:null===(n=t.time_format)||void 0===n||n}}),[t.date_format,t.format,t.time_format]),f=(0,u.useMemo)((()=>6e4*(new Date).getTimezoneOffset()),[]),p=(0,u.useMemo)((()=>{if("string"==typeof c||"string"==typeof d){const e=[];if("string"==typeof c&&Xd(c)&&e.push(c),"string"==typeof d&&Xd(d)&&e.push(d),e.length>0)return e.join(" ")}return!1===d?"yyyy-MM-dd":!1===c?"HH:mm:ss.SSSXXX":"yyyy-MM-dd'T'HH:mm:ss.SSSXXX"}),[c,d]),h=(0,u.useMemo)((()=>{const e=t.picker_utc?fse(new Date,f):new Date;return void 0===t.default?O5(e,l||p):t.default}),[t.default,t.picker_utc,l,p,f]),[m,g]=(0,u.useState)(r),O=(0,u.useMemo)((()=>{let e=m;return e||(e=h),l?Dte(e,l,new Date):zte(e)}),[h,l,m]),y=(0,u.useMemo)((()=>{var e;const t=new Date(O);return null!==(e=new Date(t.getTime()+f))&&void 0!==e?e:h}),[O,h,f]),v=(0,u.useCallback)((e=>{if(null===e)return g(h),void a(h);const n=t.picker_utc?fse(e,f):e;let r;r=l?O5(n,l):Jte(n),g(r),a(r)}),[h,t.picker_utc,l,a,f]),b=(0,u.useMemo)((()=>{const e=t.picker_utc?y:O;return c&&!d?Nf(Toe,{key:"mobile-date-picker",inputFormat:p,label:n,value:e,onChange:v,renderInput:e=>Nf(tj,dse({key:"mobile-date-input"},e,{error:s,fullWidth:!0,InputProps:{endAdornment:Nf(hse,{key:"mobile-date-now",t:i,handleChange:e=>v(e),disabled:o})}}))}):!c&&d?Nf(use,{key:"time-picker",label:n,inputFormat:p,value:e,onChange:v,renderInput:e=>Nf(tj,dse({key:"time-input"},e,{error:s,fullWidth:!0,InputProps:{endAdornment:Nf(hse,{key:"time-now",t:i,handleChange:e=>v(e),disabled:o})}}))}):Nf(Iae,{key:"mobile-date-time-picker",inputFormat:p,label:n,value:e,onChange:v,renderInput:e=>Nf(tj,dse({key:"mobile-date-time-input"},e,{error:s,fullWidth:!0,InputProps:{endAdornment:Nf(hse,{key:"mobile-date-time-now",t:i,handleChange:e=>v(e),disabled:o})}}))})}),[c,O,t.picker_utc,v,s,p,o,n,i,d,y]);return Nf(une,{key:"localization-provider",dateAdapter:one},b)},gse=e=>{let{value:t}=e;return Nf(HG,null,t?t.toString():null)},Ose={properties:{format:{type:"string"},date_format:{oneOf:[{type:"string"},{type:"boolean"}]},time_format:{oneOf:[{type:"string"},{type:"boolean"}]},picker_utc:{type:"boolean"},default:{type:"string"}}},yse=()=>({name:"datetime",controlComponent:mse,previewComponent:gse,options:{schema:Ose,getDefaultValue:(e,t)=>{var n,r;if(co(e))return e;const i=6e4*(new Date).getTimezoneOffset(),o=t.format,a=null===(n=t.date_format)||void 0===n||n,s=null===(r=t.time_format)||void 0===r||r;let l="yyyy-MM-dd'T'HH:mm:ss.SSSXXX";if("string"==typeof a||"string"==typeof s){const e=[];"string"==typeof a&&Xd(a)&&e.push(a),"string"==typeof s&&Xd(s)&&e.push(s),e.length>0&&(l=e.join(" "))}return O5(t.picker_utc?fse(new Date,i):new Date,o||l)}}}),vse=e=>{let{value:t,collection:n,field:r,entry:i}=e;const o=MT(t,n,r,i);return Nf("a",{href:o,rel:"noopener noreferrer",target:"_blank"},t)},bse=e=>{let{value:t,collection:n,field:r,entry:i}=e;return t?Array.isArray(t)?Nf("div",null,t.map((e=>Nf(vse,{key:e,value:e,collection:n,field:r,entry:i})))):Nf(vse,{key:t,value:t,collection:n,field:r,entry:i}):null},_se=e=>Nf(HG,null,e.value?Nf(bse,e):null),wse={properties:{allow_multiple:{type:"boolean"},default:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}};var kse=__nested_webpack_require_2794107__(74856);const xse=(0,aw.ZP)("div")`
display: flex;
flex-direction: column;
position: relative;
width: 100%;
`,Sse=(0,aw.ZP)("div",xm)((e=>{let{$collapsed:t}=e;return`\n display: flex;\n flex-direction: column;\n gap: 16px;\n ${t?"\n display: none;\n ":"\n padding: 16px;\n "}\n `})),Pse=(0,aw.ZP)("div")`
display: flex;
flex-direction: column;
`,$se=(0,aw.ZP)("div")`
display: flex;
gap: 16px;
`,Cse=(0,aw.ZP)("div",xm)((e=>{let{$sortable:t}=e;return`\n flex-basis: 155px;\n width: 155px;\n height: 100px;\n margin-right: 20px;\n margin-bottom: 20px;\n border: ${b$};\n border-radius: ${v$};\n overflow: hidden;\n ${S$};\n ${k$};\n cursor: ${t?"pointer":"auto"};\n `})),Tse=(0,aw.ZP)("div")`
display: flex;
justify-content: center;
column-gap: 10px;
margin-right: 20px;
margin-top: -10px;
margin-bottom: 10px;
`,Ese=(0,aw.ZP)("img")`
width: 100%;
height: 100%;
object-fit: contain;
`,Qse=e=>{let{value:t,collection:n,field:r,entry:i}=e;const o=MT(t,n,r,i);return Nf(Ese,{key:"image",role:"presentation",src:o})},Ase=e=>{let{onRemove:t,onReplace:n}=e;return Nf(Tse,{key:"image-buttons-wrapper"},Nf(iE,{key:"image-replace",onClick:n},Nf(kse.Z,{key:"image-replace-icon"})),Nf(iE,{key:"image-remove",onClick:t},Nf(Qz.Z,{key:"image-remove-icon"})))},Rse=e=>{let{itemValue:t,collection:n,field:r,entry:i,onRemove:o,onReplace:a}=e;return Nf("div",null,Nf(Cse,{key:"image-wrapper",$sortable:!0},Nf(Qse,{key:"image",value:t,collection:n,field:r,entry:i})),Nf(Ase,{key:"image-buttons",onRemove:o,onReplace:a}))},Dse=(0,aw.ZP)("div")`
display: flex;
flex-wrap: wrap;
`,Lse=(0,aw.ZP)("a")`
margin-bottom: 20px;
font-weight: normal;
color: inherit;
&:hover,
&:active,
&:focus {
text-decoration: underline;
}
`,Mse=(0,aw.ZP)("div")`
margin-bottom: 12px;
`,jse=(0,aw.ZP)("ul")`
list-style-type: none;
`;function Ise(e){return Array.isArray(e)}function zse(e){return e?Ise(e)?e.map((e=>em(e))):em(e):e}const Fse=function(){let{forImage:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,u.memo)((t=>{let{value:n,collection:r,field:i,entry:o,onChange:a,openMediaLibrary:s,clearMediaControl:l,removeMediaControl:c,hasErrors:d,t:f}=t;const p=Uj(),[h,m]=(0,u.useState)(!1),[g,O]=(0,u.useState)(null!=n?n:""),y=(0,u.useCallback)((e=>{e!==g&&(O(e),setTimeout((()=>{a(e)})))}),[g,a]),v=jT(g,{field:i,controlID:p},y),b=(0,u.useCallback)((()=>{m(!h)}),[h]);(0,u.useEffect)((()=>()=>{c(p)}),[]);const _=(0,u.useMemo)((()=>{var e;return null!==(e=i.media_library)&&void 0!==e?e:{}}),[i.media_library]),w=(0,u.useMemo)((()=>"config"in _?_.config:void 0),[_]),k=(0,u.useMemo)((()=>{var e;return null!==(e=null==w?void 0:w.multiple)&&void 0!==e&&e}),[null==w?void 0:w.multiple]),x=(0,u.useMemo)((()=>{var e;return"choose_url"in _&&(null===(e=_.choose_url)||void 0===e||e)}),[_]),S=(0,u.useCallback)((e=>t=>{t.preventDefault();const n=window.prompt(f(`editor.editorWidgets.${e}.promptUrl`));y(null!=n?n:"")}),[y,f]),P=(0,u.useCallback)((e=>{e.preventDefault(),l(p),y("")}),[l,p,y]),$=(0,u.useCallback)((e=>()=>{if(Array.isArray(g)){const t=[...g];t.splice(e,1),y(t)}}),[y,g]),C=(0,u.useCallback)((t=>()=>s({controlID:p,forImage:e,value:g,replaceIndex:t,allowMultiple:!1,config:w,field:i})),[w,p,i,s,g]),T=(0,u.useCallback)((e=>{if(!e||e.length<=50)return e;const t=`${e.slice(0,25)}${e.slice(-24)}`;return Nf(Lse,{key:`file-link-${t}`,href:e,rel:"noopener",target:"_blank"},t)}),[]),E=(0,u.useMemo)((()=>e?g?Ise(g)?Nf(Dse,{key:"multi-image-wrapper"},g.map(((e,t)=>Nf(Rse,{key:`item-${e}`,itemValue:e,collection:r,field:i,entry:o,onRemove:$(t),onReplace:C(t)})))):Nf(Cse,{key:"single-image-wrapper"},Nf(Qse,{key:"single-image",value:g,collection:r,field:i,entry:o})):null:Ise(g)?Nf(Mse,{key:"mulitple-file-links"},Nf(jse,{key:"file-links-list"},g.map((e=>Nf("li",{key:e},T(e)))))):Nf(Mse,{key:"single-file-links"},T(g))),[r,o,i,g,$,C,T]),Q=(0,u.useMemo)((()=>{const t=e?"image":"file";return(Array.isArray(g)?0===g.length:Yd(g))?Nf($se,null,Nf(Hk,{color:"primary",variant:"outlined",key:"upload",onClick:v},f(`editor.editorWidgets.${t}.choose${k?"Multiple":""}`)),x?Nf(Hk,{color:"primary",variant:"outlined",key:"choose-url",onClick:S(t)},f(`editor.editorWidgets.${t}.chooseUrl`)):null):Nf(Pse,{key:"selection"},E,Nf($se,{key:"controls"},Nf(Hk,{color:"primary",variant:"outlined",key:"add-replace",onClick:v},f(`editor.editorWidgets.${t}.${k?"addMore":"chooseDifferent"}`)),x&&!k?Nf(Hk,{color:"primary",variant:"outlined",key:"replace-url",onClick:S(t)},f(`editor.editorWidgets.${t}.replaceUrl`)):null,Nf(Hk,{color:"error",variant:"outlined",key:"remove",onClick:P},f(`editor.editorWidgets.${t}.remove${k?"All":""}`))))}),[g,E,v,f,k,x,S,P]);return(0,u.useMemo)((()=>{var e;return Nf(xse,{key:"file-control-wrapper"},Nf(EG,{key:"file-control-top-bar",collapsed:h,onCollapseToggle:b,heading:null!==(e=i.label)&&void 0!==e?e:i.name,hasError:d,t:f}),Nf(Sse,{$collapsed:h},Q),Nf(AG,{hasError:d}))}),[h,Q,i.label,i.name,b,d,f])}));return t.displayName="FileControl",t},Use=Fse(),Wse=()=>({name:"file",controlComponent:Use,previewComponent:_se,options:{schema:wse,getValidValue:zse}}),Nse=(0,aw.ZP)((e=>{let{src:t}=e;return Nf("img",{src:t||"",role:"presentation"})}))`
display: block;
max-width: 100%;
height: auto;
`,Yse=e=>{let{value:t,collection:n,field:r,entry:i}=e;const o=MT(t,n,r,i);return Nf(Nse,{src:o})},Xse=e=>{let{value:t,collection:n,field:r,entry:i}=e;return t?Array.isArray(t)?Nf(d().Fragment,null,t.map((e=>Nf(Yse,{key:e,value:e,collection:n,field:r,entry:i})))):Nf(Yse,{value:t,collection:n,field:r,entry:i}):null},Bse=e=>Nf(HG,null,e.value?Nf(Xse,e):null),qse={properties:{allow_multiple:{type:"boolean"},default:{oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}},Zse=Fse({forImage:!0}),Vse=function(){return{name:"image",controlComponent:Zse,previewComponent:Bse,options:{schema:qse,getValidValue:zse}}},Hse="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function Gse(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function Kse(e){return"nodeType"in e}function Jse(e){var t,n;return e?Gse(e)?e:Kse(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function ele(e){const{Document:t}=Jse(e);return e instanceof t}function tle(e){return!Gse(e)&&e instanceof Jse(e).HTMLElement}function nle(e){return e?Gse(e)?e.document:Kse(e)?ele(e)?e:tle(e)?e.ownerDocument:document:document:document}const rle=Hse?u.useLayoutEffect:u.useEffect;function ile(e){const t=(0,u.useRef)(e);return rle((()=>{t.current=e})),(0,u.useCallback)((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}function ole(e,t){void 0===t&&(t=[e]);const n=(0,u.useRef)(e);return rle((()=>{n.current!==e&&(n.current=e)}),t),n}function ale(e,t){const n=(0,u.useRef)();return(0,u.useMemo)((()=>{const t=e(n.current);return n.current=t,t}),[...t])}function sle(e){const t=ile(e),n=(0,u.useRef)(null),r=(0,u.useCallback)((e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e}),[]);return[n,r]}function lle(e){const t=(0,u.useRef)();return(0,u.useEffect)((()=>{t.current=e}),[e]),t.current}let cle={};function ule(e,t){return(0,u.useMemo)((()=>{if(t)return t;const n=null==cle[e]?0:cle[e]+1;return cle[e]=n,e+"-"+n}),[e,t])}function dle(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce(((t,n)=>{const r=Object.entries(n);for(const[n,i]of r){const r=t[n];null!=r&&(t[n]=r+e*i)}return t}),{...t})}}const fle=dle(1),ple=dle(-1);function hle(e){if(!e)return!1;const{KeyboardEvent:t}=Jse(e.target);return t&&e instanceof t}function mle(e){if(function(e){if(!e)return!1;const{TouchEvent:t}=Jse(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const gle=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[gle.Translate.toString(e),gle.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Ole="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function yle(e){return e.matches(Ole)?e:e.querySelector(Ole)}const vle={display:"none"};function ble(e){let{id:t,value:n}=e;return d().createElement("div",{id:t,style:vle},n)}const _le={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function wle(e){let{id:t,announcement:n}=e;return d().createElement("div",{id:t,style:_le,role:"status","aria-live":"assertive","aria-atomic":!0},n)}const kle=(0,u.createContext)(null),xle={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n
${C$};
color: ${O$};
background: transparent;
font-size: 16px;
line-height: 1;
padding: 0;
width: 32px;
text-align: center;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
position: relative;
`,mue=(0,aw.ZP)("div")`
position: absolute;
top: 0;
left: 48px;
line-height: 40px;
white-space: nowrap;
cursor: pointer;
display: flex;
align-items: center;
z-index: 1;
`,gue=hue.withComponent("span",{target:"ehkudph0",label:"TopBarButtonSpan"}),Oue=(0,aw.ZP)(gue)`
width: 100%;
cursor: move;
`,yue=e=>{let{listeners:t}=e;return Nf(Oue,t,Nf(fue.Z,null))};function vue(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vue(Object(n),!0).forEach((function(t){_ue(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vue(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _ue(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const wue=(0,aw.ZP)("div")`
position: relative;
`,kue=(0,aw.ZP)((e=>{let{className:t,title:n,collapsed:r=!1,onCollapseToggle:i,onRemove:o,isVariableTypesList:a=!1,listeners:s}=e;return Nf(pue,{className:t,$collapsed:r,$isVariableTypesList:a},i?Nf(iE,{onClick:i,"data-testid":"expand-button"},Nf($G.Z,{sx:{transform:`rotateZ(${r?"-90deg":"0deg"})`,transition:`transform ${_$};`}})):null,Nf(mue,{key:"title",onClick:i,"data-testid":"list-item-title"},n),s?Nf(yue,{listeners:s}):null,o?Nf(hue,{"data-testid":"remove-button",onClick:o},Nf(Qz.Z,null)):null)}))`
background-color: ${g$};
`,xue=(0,aw.ZP)("div",xm)((e=>{let{$collapsed:t}=e;return`\n display: flex;\n flex-direction: column;\n gap: 16px;\n ${t?"\n display: none;\n ":""}\n `}));function Sue(e,t,n,r){if("object"==typeof r&&!Array.isArray(r)){const i=bue(bue({},r),{},{fields:{label:n}});return yp(e,null,"",bp(t.path,i))}return r}function Pue(e,t){return!(!e.fields||1!==e.fields.length)||"object"==typeof t||(console.warn(`'${e.name}' field item value value should be an object but is a '${typeof t}'`),!1)}const $ue=e=>{let{id:t,index:n,entry:r,field:i,fieldsErrors:o,submitted:a,isFieldDuplicate:s,isFieldHidden:l,locale:c,path:f,valueType:p,handleRemove:h,value:m,i18n:g,listeners:O}=e;const[y,v]=(0,u.useMemo)((()=>{var e;const t={name:`${n}`,label:i.label,summary:i.summary,widget:"object",fields:[]},o=null!==(e=i.label)&&void 0!==e?e:i.name;if(null===p)return[o,t];const a=null!=m?m:{};switch(p){case Aue.MIXED:{var s,l;if(!Pue(i,a))return[o,t];const e=a,c=PI(i,e,n);if(!c)return[o,t];const u=null!==(s=c.label)&&void 0!==s?s:c.name,d=null!==(l="summary"in c&&c.summary)&&void 0!==l?l:i.summary;return[d?`${u} - ${Sue(d,r,u,e)}`:u,c]}case Aue.MULTIPLE:{var c;if(t.fields=null!==(c=i.fields)&&void 0!==c?c:[],!Pue(i,a))return[o,t];const e=i.fields,n=e&&e[0];if(!n)return[o,t];const s="object"!=typeof a||Array.isArray(a)?a:a[n.name],l=i.summary;return[((l?Sue(l,r,String(s),a):s)||`No ${n.name}`).toString(),t]}}}),[r,i,n,m,p]),[b,_]=(0,u.useState)(!1),w=(0,u.useCallback)((e=>{e.stopPropagation(),_(!b)}),[b]),k=s&&s(i),x=l&&l(i),S=(0,u.useMemo)((()=>i.fields&&1===i.fields.length?{[i.fields[0].name]:m}:m),[i.fields,m]);return Nf(wue,{key:"sortable-list-item"},Nf(d().Fragment,null,Nf(kue,{key:"list-item-top-bar",collapsed:b,onCollapseToggle:w,onRemove:NN()(h,n),"data-testid":`list-item-top-bar-${t}`,title:y,isVariableTypesList:p===Aue.MIXED,listeners:O}),Nf(xue,{$collapsed:b},Nf(Jj,{key:`control-${t}`,field:v,value:S,fieldsErrors:o,submitted:a,parentPath:f,isDisabled:k,isHidden:x,isFieldDuplicate:s,isFieldHidden:l,locale:c,i18n:g,forList:!0})),Nf(AG,{key:"outline"})))};function Cue(){return Cue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cue.apply(this,arguments)}const Tue=(0,aw.ZP)("div")`
position: relative;
width: 100%;
`,Eue=(0,aw.ZP)("div",xm)((e=>{let{$collapsed:t}=e;return`\n display: flex;\n flex-direction: column;\n gap: 16px;\n width: 100%;\n ${t?"\n display: none;\n ":"\n padding: 16px;\n "}\n `})),Que=e=>{let{id:t,item:n,index:r,valueType:i,handleRemove:o,entry:a,field:s,fieldsErrors:l,submitted:c,isFieldDuplicate:u,isFieldHidden:d,locale:f,path:p,i18n:h}=e;const{attributes:m,listeners:g,setNodeRef:O,transform:y,transition:v}=sue({id:t}),b={transform:gle.Transform.toString(y),transition:v};return null===i?Nf("div",{key:t}):Nf("div",Cue({ref:O,"data-testid":`object-control-${r}`,style:b},m),Nf($ue,{index:r,id:t,key:`sortable-item-${t}`,valueType:i,handleRemove:o,"data-testid":`object-control-${r}`,entry:a,field:s,fieldsErrors:l,submitted:c,isFieldDuplicate:u,isFieldHidden:d,locale:f,path:p,value:n,i18n:h,listeners:g}))};let Aue;function Rue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(1===e.length){if("default"in e[0]&&e[0].default)return e[0].default;switch(e[0].widget){case"string":case"text":return"";case"boolean":return!1;case"number":return 0}return null}return e.reduce(((e,t)=>{const n="fields"in t&&t.fields,r=t.name,i="default"in t&&t.default?t.default:null;if(Array.isArray(n)){const t=Rue(n);return Fj()(t)||(e[r]=t),e}if("object"==typeof n){const t=Rue([n]);return!Fj()(t)&&(e[r]=t),e}return null!==i&&(e[r]=i),e}),t)}!function(e){e[e.MULTIPLE=0]="MULTIPLE",e[e.MIXED=1]="MIXED"}(Aue||(Aue={}));const Due=e=>{var t,n,r,i,o;let{entry:a,field:s,fieldsErrors:l,submitted:c,isFieldDuplicate:d,isFieldHidden:f,locale:p,onChange:h,path:m,t:g,value:O,i18n:y,hasErrors:v}=e;const b=(0,u.useMemo)((()=>null!=O?O:[]),[O]),[_,w]=(0,u.useState)(null===(t=s.collapsed)||void 0===t||t),[k,x]=(0,u.useState)(Array.from({length:b.length},(()=>o_()))),S=(0,u.useMemo)((()=>"fields"in s?Aue.MULTIPLE:"types"in s?Aue.MIXED:null),[s]),P=(0,u.useCallback)((e=>Rue(e)),[]),$=(0,u.useCallback)(((e,t)=>{var n,r;const i="types"in s&&(null===(n=s.types)||void 0===n?void 0:n.find((e=>e.name===t)));return i?Rue(null!==(r=i.fields)&&void 0!==r?r:[],{[e]:t}):{}}),[s]),C=(0,u.useCallback)((e=>{var t;const n=null!==(t=s.add_to_top)&&void 0!==t&&t,r=[...k],i=[...b];n?(r.unshift(o_()),i.unshift(e)):(r.push(o_()),i.push(e)),x(r),h(i),w(!1)}),[s.add_to_top,h,b,k]),T=(0,u.useCallback)((e=>{var t;e.preventDefault();const n=P(null!==(t=s.fields)&&void 0!==t?t:[]);C(n)}),[C,s,P]),E=(0,u.useCallback)(((e,t)=>{const n=$(t,e);C(n)}),[C,$]),Q=(0,u.useCallback)(((e,t)=>{t.preventDefault();const n=[...k],r=[...b];n.splice(e,1),r.splice(e,1),x(n),h(r)}),[h,b,k]),A=(0,u.useCallback)((e=>{e.preventDefault(),w(!_)}),[_]),R=(0,u.useCallback)((e=>{let{active:t,over:n}=e;if(!n||t.id===n.id)return;const r=k.indexOf(t.id),i=k.indexOf(n.id);x(lue(k,r,i)),h(lue(b,r,i))}),[h,b,k]);if(null===S)return null;const D=null!==(n=s.label)&&void 0!==n?n:s.name,L=s.label_singular?s.label_singular:null!==(r=s.label)&&void 0!==r?r:s.name,M=1===b.length?L:D;return Nf(Tue,{key:"list-widget"},Nf(due,{key:"label"},D),Nf(EG,{key:"header",allowAdd:null===(i=s.allow_add)||void 0===i||i,onAdd:T,types:null!==(o=s[kI])&&void 0!==o?o:[],onAddType:e=>E(e,CI(s)),heading:`${b.length} ${M}`,label:L,onCollapseToggle:A,collapsed:_,hasError:v,t:g,testId:"list-header"}),b.length>0?Nf(Yce,{key:"dnd-context",onDragEnd:R},Nf(eue,{items:k},Nf(Eue,{$collapsed:_},b.map(((e,t)=>{const n=k[t];return n?Nf(Que,{index:t,key:n,id:n,item:e,valueType:S,handleRemove:Q,entry:a,field:s,fieldsErrors:l,submitted:c,isFieldDuplicate:d,isFieldHidden:f,locale:p,path:m,value:e,i18n:y}):null}))))):null,Nf(AG,{key:"outline",hasLabel:!0,hasError:v}))},Lue=e=>{var t;let{field:n,value:r}=e;return n.fields&&1===n.fields.length?Nf(HG,null,Nf("label",null,Nf("strong",null,n.name,":")),Nf("ul",{style:{marginTop:0}},null==r?void 0:r.map((e=>Nf("li",{key:String(e)},String(e)))))):Nf(HG,null,null!==(t=n.renderedFields)&&void 0!==t?t:null)},Mue={properties:{allow_add:{type:"boolean"},collapsed:{type:"boolean"},summary:{type:"string"},label_singular:{type:"string"},i18n:{type:"boolean"
display: flex;
flex-direction: column;
position: relative;
width: 100%;
`,Eve=(0,aw.ZP)("div",xm)((e=>{let{$collapsed:t,$height:n}=e;return`\n display: flex;\n postion: relative;\n height: ${n}\n ${t?"\n display: none;\n ":""}\n `})),Qve=(0,aw.ZP)("div")`
width: 100%;
position: relative;
${Xf`
${cve}
`}
`,Ave={dataProjection:"EPSG:4326",featureProjection:"EPSG:3857"};function Rve(){return new bhe(Ave)}function Dve(e,t){return new Zye({target:e,layers:[new KOe({source:new Cve}),t],view:new Tye({center:[0,0],zoom:2})})}const Lve=function(){let{getFormat:e,getMap:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=n=>{let{path:r,value:i,field:o,onChange:a,hasErrors:s,label:l,t:c}=n;const[d,f]=(0,u.useState)(!1),p=(0,u.useCallback)((()=>{f(!d)}),[d]),{height:h="400px"}=o,m=(0,u.useRef)(null);return(0,u.useLayoutEffect)((()=>{var n,r;const s=e?e(o):Rve(),l=i?[s.readFeature(i)]:[],c=new fOe({features:l,wrapX:!1}),u=new Kge({source:c}),d=m.current;if(!d)return;const f=t?t(d,u):Dve(d,u);l.length>0&&f.getView().fit(c.getExtent(),{maxZoom:16,padding:[80,80,80,80]});const p=new MOe({source:c,type:null!==(n=o.type)&&void 0!==n?n:"Point"});f.addInteraction(p);const h={decimals:null!==(r=o.decimals)&&void 0!==r?r:7};p.on("drawend",(e=>{let{feature:t}=e;c.clear();const n=t.getGeometry();n&&a(s.writeGeometry(n,h))}))}),[o,m,a,r,i]),Nf(Tve,null,Nf(EG,{key:"file-control-top-bar",collapsed:d,onCollapseToggle:p,heading:l,hasError:s,t:c}),Nf(Eve,{$collapsed:d,$height:h},Nf(Qve,{ref:m})),Nf(AG,{hasError:s}))};return n.displayName="MapControl",n},Mve=Lve(),jve=()=>({name:"map",controlComponent:Mve,previewComponent:Iue,options:{schema:zue}});function Ive(e,t){const[n,r]=(0,u.useState)(e);return(0,u.useEffect)((()=>{if(0===t)return void r(e);const n=setTimeout((()=>{r(e)}),t);return()=>{clearTimeout(n)}}),[e,t]),0===t?e:n}let zve=0;const Fve=Symbol(),Uve=e=>!!e[Fve],Wve=e=>!e[Fve].c,Nve=e=>{var t;const{b:n,c:r}=e[Fve];r&&(r(),null==(t=Bve.get(n))||t())},Yve=(e,t)=>{const n=e[Fve].o,r=t[Fve].o;return n===r||e===r||Uve(n)&&Yve(n,t)},Xve=(e,t)=>{const n={b:e,o:t,c:null},r=new Promise((e=>{n.c=()=>{n.c=null,e()},t.finally(n.c)}));return r[Fve]=n,r},Bve=new WeakMap,qve=e=>"init"in e,Zve="c",Vve=e=>{const t=new WeakMap,n=new WeakMap,r=new Map;let i,o;if(i=new Set,o=new Set,e)for(const[n,r]of e){const e={v:r,r:0,y:!0,d:new Map};Object.freeze(e),qve(n)||console.warn("Found initial value for derived atom which can cause unexpected behavior",n),t.set(n,e)}const a=new WeakMap,s=new WeakMap,l=e=>{let t=s.get(e);return t||(t=new Map,s.set(e,t)),t},c=(e,n)=>{if(e){const t=l(e);let r=t.get(n);return r||(r=c(e.p,n),r&&"p"in r&&Wve(r.p)&&(r=void 0),r&&t.set(n,r)),r}return t.get(n)},u=(e,n,i)=>{if(Object.freeze(i),e)l(e).set(n,i);else{const e=t.get(n);t.set(n,i),r.has(n)||r.set(n,e)}},d=(e,t=new Map,n)=>{if(!n)return t;const r=new Map;let i=!1;return n.forEach((n=>{var o;const a=(null==(o=c(e,n))?void 0:o.r)||0;r.set(n,a),t.get(n)!==a&&(i=!0)})),t.size!==r.size||i?r:t},f=(e,t,n,r,i)=>{const o=c(e,t);if(o){if(i&&(!("p"in o)||!Yve(o.p,i)))return o;"p"in o&&Nve(o.p)}const a={v:n,r:(null==o?void 0:o.r)||0,y:!0,d:d(e,null==o?void 0:o.d,r)};let s=!(null==o?void 0:o.y);return o&&"v"in o&&Object.is(o.v,n)?a.d===o.d||a.d.size===o.d.size&&Array.from(a.d.keys()).every((e=>o.d.has(e)))||(s=!0,Promise.resolve().then((()=>{x(e)}))):(s=!0,++a.r,a.d.has(t)&&(a.d=new Map(a.d).set(t,a.r))),o&&!s?o:(u(e,t,a),a)},p=(e,t,n,r,i)=>{const o=c(e,t);if(o){if(i&&(!("p"in o)||!Yve(o.p,i)))return o;"p"in o&&Nve(o.p)}const a={e:n,r:((null==o?void 0:o.r)||0)+1,y:!0,d:d(e,null==o?void 0:o.d,r)};return u(e,t,a),a},h=(e,t,n,r)=>{const i=c(e,t);if(i&&"p"in i){if(Yve(i.p,n)&&!Wve(i.p))return i.y?i:{...i,y:!0};Nve(i.p)}((e,t,n)=>{let r=a.get(t);r||(r=new Map,a.set(t,r)),n.then((()=>{r.get(e)===n&&(r.delete(e),r.size||a.delete(t))})),r.set(e,n)})(e,t,n);const o={p:n,r:((null==i?void 0:i.r)||0)+1,y:!0,d:d(e,null==i?void 0:i.d,r)};return u(e,t,o),o},m=(e,t,n,r)=>{if(n instanceof Promise){const i=Xve(n,n.then((n=>{f(e,t,n,r,i)})).catch((n=>{if(n instanceof Promise)return Uve(n)?n.then((()=>{g(e,t,!0)})):n;p(e,t,n,r,i)})));return h(e,t,i,r)}return f(e,t,n,r)},g=(e,t,r)=>{if(!r){const r=c(e,t);if(r){if(r.y&&"p"in r&&!Wve(r.p))return r;if(r.d.forEach(((r,i)=>{if(i!==t)if(n.has(i)){const t=c(e,i);t&&!t.y&&g(e,i)}else g(e,i)})),Array.from(r.d).every((([t,n])=>{const r=c(e,t);return r&&!("p
padding: 0;
& .MuiSelect-select {
padding: 4px 7px;
}
`,Htt=[{type:ALe,label:"Heading 1"},{type:RLe,label:"Heading 2"},{type:DLe,label:"Heading 3"},{type:LLe,label:"Heading 4"},{type:MLe,label:"Heading 5"},{type:jLe,label:"Heading 6"},{type:FLe,label:"Paragraph"}],Gtt=e=>{var t;let{disabled:n=!1}=e;const r=A8e(),[i,o]=(0,u.useState)(0),a=Ive(null==r?void 0:r.selection,100),s=(0,u.useMemo)((()=>a&&Htt.find((e=>YAe(r,{match:{type:e.type},at:null==a?void 0:a.anchor})))),[r,a,i]),l=(0,u.useCallback)((e=>{e.preventDefault(),(null==s?void 0:s.type)!==e.target.value&&(eRe(r,{activeType:e.target.value}),o((e=>e+1)),setTimeout((()=>{fQe(r)})))}),[r,null==s?void 0:s.type]);return Nf(fM,{sx:{width:120}},Nf(Vtt,{labelId:"font-type-select-label",id:"font-type-select","data-testid":"font-type-select",value:null!==(t=null==s?void 0:s.type)&&void 0!==t?t:FLe,onChange:l,size:"small",disabled:n},Htt.map((e=>Nf(lT,{key:e.type,value:e.type},e.label)))))},Ktt=e=>{let{hideFontTypeSelect:t=!1,disableFontTypeSelect:n=!1,hideCodeBlock:r=!1}=e;return Nf(d().Fragment,null,t?null:Nf(Gtt,{disabled:n}),Nf(Ztt,{tooltip:"Blockquote",type:gLe,icon:Nf(Ytt.Z,null)}),r?null:Nf(Ztt,{tooltip:"Code Block",type:vLe,icon:Nf(Ntt.Z,null),onClick:e=>ELe(e,{insertNodesOptions:{select:!0}})}))};var Jtt=__nested_webpack_require_2794107__(41096),ent=__nested_webpack_require_2794107__(73689),tnt=__nested_webpack_require_2794107__(25914),nnt=__nested_webpack_require_2794107__(97015),rnt=__nested_webpack_require_2794107__(73965),int=__nested_webpack_require_2794107__(85977);const ont=["type","clear"];function ant(){return ant=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ant.apply(this,arguments)}const snt=e=>{let{type:t,clear:n}=e,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,ont);const i=A8e(),o=(0,u.useCallback)((e=>{rRe(e,{key:t,clear:n})}),[n,t]);return Nf(Xtt,ant({active:!(null==i||!i.selection)&&IAe(i,t),onClick:o},r))},lnt=e=>{let{extended:t=!1,useMdx:n}=e;return Nf(d().Fragment,null,Nf(snt,{tooltip:"Bold",type:WLe,icon:Nf(Jtt.Z,null)}),Nf(snt,{tooltip:"Italic",type:BLe,icon:Nf(ent.Z,null)}),n?Nf(snt,{key:"underline-button",tooltip:"Underline",type:eMe,icon:Nf(nnt.Z,null)}):null,Nf(snt,{tooltip:"Strikethrough",type:ZLe,icon:Nf(tnt.Z,null)}),Nf(snt,{tooltip:"Code",type:YLe,icon:Nf(Ntt.Z,null)}),n&&t?Nf(d().Fragment,null,Nf(snt,{key:"superscript-button",tooltip:"Superscript",type:KLe,clear:HLe,icon:Nf(int.Z,null)}),Nf(snt,{key:"subscript-button",tooltip:"Subscript",type:HLe,clear:KLe,icon:Nf(rnt.Z,null)})):null)};var cnt=__nested_webpack_require_2794107__(16106),unt=__nested_webpack_require_2794107__(42537);const dnt=(0,aw.ZP)("div")((e=>{let{theme:t}=e;return`\n display: flex;\n gap: 4px;\n background: ${t.palette.background.paper};\n box-shadow: ${t.shadows[8]};\n margin: 10px 0;\n padding: 6px;\n border-radius: 4px;\n align-items: center;\n position: relative;\n `})),fnt=(0,aw.ZP)(dnt)`
display: flex;
align-items: center;
padding: 4px 8px;
gap: 2px;
`,pnt=(0,aw.ZP)(dnt)`
display: flex;
flex-direction: column;
align-items: center;
padding: 16px;
gap: 16px;
width: 300px;
`,hnt=(0,aw.ZP)("div")`
width: 1px;
height: 20px;
background-color: rgba(229, 231, 235, 1);
margin: 0 4px;
`,mnt=e=>{let{containerRef:t,anchorEl:n,url:r,text:i,textLabel:o="Text",inserting:a=!1,forImage:s=!1,collection:l,field:c,entry:d,onUrlChange:f,onTextChange:p,onClose:h,mediaOpen:m,onMediaToggle:g,onMediaChange:O,onRemove:y,onFocus:v,onBlur:b}=e;const _=Ix(),w=(0,u.useRef)(null),k=(0,u.useRef)(null),x=(0,u.useRef)(null),[S,P]=(0,u.useState)(a),$=nxe(),[C,T]=(0,u.useState)(!1),E=Ive(C,150),Q=(0,u.useCallback)((e=>{h(e),a||P(!1)}),[a,h]),A=LT(r,l,c,d),R=(0,u.useMemo)((()=>{var e;return null!==(e=c.media_library)&&void 0!==e?e:{}}),[c.media_library]),D=(0,u.useMemo)((()=>{var e;return"choose_url"in R&&(null===(e=R.choose_url)||void 0===e||e)}),[R]),L=(0,u.useMemo)((()=>!D&&A&&s),[D,s,A]);(0,u.useEffect)((()=>{if(n){if(!S)return;return L?void setTimeout((()=>{var e;null===(e=x.current)||void 0===e||e.focus()})):void setTimeout((()=>{var e;null===(e=k.current)||void 0===e||e.focus()}))}a||P(!1)}),[n,S,a,L]);const[{prevAnchorEl:M,prevHasEditorFocus:j,prevHasFocus:I,prevDebouncedHasFocus:z},F]=(0,u.useState)({prevAnchorEl:n,prevHasEditorFocus:$,prevHasFocus:C,prevDebouncedHasFocus:E});(0,u.useEffect)((()=>{m||(n&&!j&&$&&Q(!1),!n||!I&&!z||C||E||Q(!1),F({prevAnchorEl:n,prevHasEditorFocus:$,prevHasFocus:C,prevDebouncedHasFocus:E}))}),[n,E,Q,$,C,m,M,z,j,I]);const U=(0,u.useCallback)((()=>{T(!0),null==v||v()}),[v]),W=(0,u.useCallback)((()=>{T(!1),null==b||b()}),[b]),N=(0,u.useCallback)((e=>{O(e),null==g||g(!1)}),[O,g]),Y=jT(r,{field:c,forImage:s},N),X=(0,u.useCallback)((()=>{null==g||g(!0),Y()}),[Y,g]),B=(0,u.useCallback)((e=>{f(e.target.value)}),[f]),q=(0,u.useCallback)((e=>{null==p||p(e.target.value)}),[p]),Z=(0,u.useCallback)((()=>{P(!0)}),[]),V=(0,u.useCallback)((e=>{"Enter"===e.key&&(e.stopPropagation(),e.preventDefault(),Q(!0),a||setTimeout((()=>{P(!1)})))}),[a,Q]),H=Boolean(n);return Nf(AQ,{id:H?"edit-popover":void 0,open:H,anchorEl:n,placeholder:"bottom",container:t,sx:{zIndex:100},onFocus:U,onBlur:W,tabIndex:0},S?Nf(pnt,{key:"editing-content",contentEditable:!1},Nf(tj,{key:"url-input",inputRef:k,id:"url",label:"Source",variant:"outlined",value:r,onKeyDown:V,onChange:B,fullWidth:!0,size:"small",disabled:L}),a&&s?null:Nf(tj,{key:"text-input",inputRef:x,id:"text",label:o,variant:"outlined",value:i,onKeyDown:V,onChange:q,fullWidth:!0,size:"small"}),Nf(Hk,{fullWidth:!0,onClick:X},"Open Media Library")):Nf(fnt,{key:"edit-content",contentEditable:!1},Nf(Hk,{ref:w,size:"small",color:"inherit",sx:{padding:"4px 8px",textTransform:"none",color:_.palette.text.secondary},onClick:Z},s?"Edit Image":"Edit Link"),Nf(hnt,null),s?null:Nf(Hk,{size:"small",color:"inherit",sx:{padding:"4px",minWidth:"unset",color:_.palette.text.secondary},href:r,target:"_blank"},Nf(X$.Z,null)),Nf(Hk,{size:"small",color:"inherit",sx:{padding:"4px",minWidth:"unset",color:_.palette.text.secondary},onClick:y},Nf(unt.Z,null))))},gnt=["containerRef","collection","field","entry","inserting","forImage","textLabel","mediaOpen","onMediaToggle","onChange","onFocus","onBlur"];function Ont(){return Ont=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ont.apply(this,arguments)}const ynt=e=>{let{containerRef:t,collection:n,field:r,entry:i,inserting:o,forImage:a,textLabel:s,mediaOpen:l,onMediaToggle:c,onChange:f,onFocus:p,onBlur:h}=e,m=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,gnt);const g=A8e(),[O,y]=(0,u.useState)(null),[v,b]=(0,u.useState)(""),[_,w]=(0,u.useState)(""),k=(0,u.useCallback)(((e,t)=>{var n;y(null),b(""),w(""),t&&fQe(g,null!==(n=g.selection)&&void 0!==n?n:g.prevSelection);const r=null!=e?e:v;r&&f(r,_)}),[g,f,v,_]),x=(0,u.useCallback)(((e,t)=>{O?k(void 0,!0):y(t.currentTarget)}),[O,k]),S=(0,u.useCallback)((e
display: grid;
grid-template-columns: repeat(10, 1fr);
gap: 0.25rem;
`,trt=e=>{let{color:t,colors:n,updateColor:r}=e;return Nf(ert,null,n.map((e=>{let{name:n,value:i,isBrightColor:o}=e;return Nf(Jnt,{key:null!=n?n:i,name:n,value:i,isBrightColor:o,isSelected:t===i,updateColor:r})})))},nrt=(0,aw.ZP)("input")`
visibility: hidden;
position: absolute;
`,rrt=e=>{let{value:t="#000000",onChange:n}=e;const r=(0,u.useRef)(null);return Nf("div",null,Nf(Hk,{onClick:function(){var e;null===(e=r.current)||void 0===e||e.click()},fullWidth:!0},"CUSTOM"),Nf(nrt,{ref:r,type:"color",onChange:function(e){null==n||n(e)},value:t}))},irt=(0,aw.ZP)("div")`
display: flex;
flex-direction: column;
gap: 8px;
`,ort=e=>{let{color:t,colors:n,customColors:r,updateColor:i,updateCustomColor:o}=e;const[a,s]=(0,u.useState)(),l=(0,u.useCallback)(Lj()(o,100),[o]),[c,d]=(0,u.useState)(t||"#000000");(0,u.useEffect)((()=>{!t||r.some((e=>e.value===t))||n.some((e=>e.value===t))||s(t)}),[t,n,r]);const f=(0,u.useMemo)((()=>a?[...r,{name:"",value:a,isBrightColor:!1}]:r),[a,r]),p=(0,u.useCallback)((e=>{d(e.target.value),l(e.target.value)}),[l]);return Nf(irt,null,Nf(rrt,{value:c,onChange:p}),Nf(trt,{color:t,colors:f,updateColor:i}))},art=(0,aw.ZP)("div")`
display: flex;
flex-direction: column;
gap: 16px;
`,srt=(0,aw.ZP)("div")((e=>{let{theme:t}=e;return`\n height: 1px;\n width: 100%;\n background: ${t.palette.text.secondary};\n opacity: 0.1;\n `})),lrt=(0,u.memo)((e=>{let{color:t,colors:n,customColors:r,updateColor:i,updateCustomColor:o,clearColor:a}=e;return Nf(art,null,Nf(ort,{color:t,colors:n,customColors:r,updateColor:i,updateCustomColor:o}),Nf(srt,null),Nf(trt,{color:t,colors:n,updateColor:i}),Nf(Hk,{onClick:a,disabled:!t},"Clear"))}),((e,t)=>e.color===t.color&&e.colors===t.colors&&e.customColors===t.customColors&&e.open===t.open)),crt=["children","onClose"];function urt(){return urt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},urt.apply(this,arguments)}const drt=(0,aw.ZP)("div")`
display: flex;
gap: 4px;
padding: 16px;
border-radius: 4px;
align-items: center;
`,frt=e=>{let{children:t,onClose:n}=e,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,crt);const[i,o]=(0,u.useState)(null),[a,s]=(0,u.useState)(!1),l=(0,u.useCallback)((()=>{null==n||n(),s(!1)}),[n]),c=(0,u.useCallback)((()=>{a?l():s(!a)}),[l,a]);return Nf(d().Fragment,null,Nf("div",{ref:o},Nf(Xtt,urt({},r,{onClick:c}))),Nf(UC,{open:a,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:l,disablePortal:!0},Nf(drt,null,t)))},prt=["pluginKey","colors","customColors","closeOnSelect"];function hrt(){return hrt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hrt.apply(this,arguments)}const mrt=e=>{let{pluginKey:t,colors:n=ZJe,customColors:r=VJe,closeOnSelect:i=!0}=e,o=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,prt);const[a,s]=(0,u.useState)(!1),l=A8e(),c=fDe(),d=ETe(c,t),f=c&&wEe(c,d),[p,h]=(0,u.useState)(),m=(0,u.useCallback)((()=>{s(!a)}),[a,s]),g=(0,u.useCallback)((e=>{c&&l&&l.selection&&(h(e),K_e.select(c,l.selection),Jwe.focus(c),((e,t,n=[])=>{e.selection&&bTe(e,(()=>{const r=eEe(n);nRe(e,{key:r}),nRe(e,{key:Object.keys(t)}),Object.keys(t).forEach((n=>{e.addMark(n,t[n])}))}))})(l,{[d]:e}))}),[l,c,d]),O=(0,u.useCallback)((e=>{g(e),i&&m()}),[i,m,g]),y=(0,u.useCallback)((()=>{c&&l&&l.selection&&(K_e.select(c,l.selection),Jwe.focus(c),p&&nRe(l,{key:d}),i&&m())}),[i,l,c,m,p,d]);return(0,u.useEffect)((()=>{null!=l&&l.selection&&h(f)}),[f,null==l?void 0:l.selection]),Nf(frt,hrt({active:Boolean(f),activeColor:f},o),Nf(lrt,{color:p||f,colors:n,customColors:r,updateColor:O,updateCustomColor:g,clearColor:y,open:a}))},grt=()=>Nf(d().Fragment,null,Nf(mrt,{key:"color-picker-button",pluginKey:TIe,icon:Nf(Knt.Z,null),tooltip:"Color"}),Nf(mrt,{key:"background-color-picker-button",pluginKey:$Ie,icon:Nf(Gnt.Z,null),tooltip:"Background Color"})),Ort=["type"];function yrt(){return yrt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yrt.apply(this,arguments)}const vrt=e=>{let{type:t}=e,n=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Ort);const r=A8e(),i=(0,u.useCallback)((e=>{ZFe(e,{type:t})}),[t]),o=!(null==r||!r.selection)&&IFe(r);return Nf(Xtt,yrt({active:!!o&&o.list[0].type===t,onClick:i},n))};var brt=__nested_webpack_require_2794107__(20183),_rt=__nested_webpack_require_2794107__(75767),wrt=__nested_webpack_require_2794107__(45946),krt=__nested_webpack_require_2794107__(1965);const xrt=()=>{const e=Q8e(),t=(0,u.useCallback)((e=>{IIe(e)}),[]),n=(0,u.useCallback)((e=>{jIe(e)}),[]);return Nf(d().Fragment,null,Nf(vrt,{tooltip:"List",type:nUe,icon:Nf(wrt.Z,null)}),Nf(vrt,{tooltip:"Numbered List",type:ETe(e,rUe),icon:Nf(krt.Z,null)}),Nf(Xtt,{tooltip:"Outdent",onClick:t,icon:Nf(brt.Z,null)}),Nf(Xtt,{tooltip:"Indent",onClick:n,icon:Nf(_rt.Z,null)}))},Srt=Ftt(),Prt=e=>{let{children:t}=e;return Nf(Srt,{component:"blockquote",sx:{borderLeft:"2px solid r
position: relative;
margin: 12px 0;
overflow: hidden;
display: flex;
flex-direction: column;
`,Qrt=(0,aw.ZP)("input")`
flex-grow: 1;
outline: none;
padding: 8px;
border: 1px solid rgba(0, 0, 0, 0.35);
border-radius: 4px 4px 0 0;
width: 100%;
height: 34px;
`,Art=(0,aw.ZP)("div")`
position: relative;
display: flex;
& div {
outline: none;
}
`,Rrt=(0,aw.ZP)("div")`
height: 0;
position: absolute;
`,Drt=e=>{var t;const[n,r]=(0,u.useState)(!1),[i,o]=(0,u.useState)(!1),{attributes:a,nodeProps:s,element:l,editor:c,children:f}=e,p=Uj(),h="lang"in l?l.lang:"",m="code"in l&&null!==(t=l.code)&&void 0!==t?t:"",g=(0,u.useCallback)((e=>{const t=eQe(c,l);t&&aQe(c,{code:e},{at:t})}),[c,l]);HS("message",(0,u.useCallback)((e=>{switch(e.data.message){case`code_block_${p}_onChange`:g(e.data.value);break;case`code_block_${p}_onFocus`:o(!0);break;case`code_block_${p}_onBlur`:o(!1)}}),[g,p]));const O=(0,u.useMemo)((()=>'\n <!DOCTYPE html>\n <html>\n <head>\n <base target="_blank"/>\n <style>\n body {\n margin: 0;\n overflow: hidden;\n position: fixed;\n top: 0;\n width: 100%;\n }\n </style>\n </head>\n <body><div></div></body>\n </html>\n '),[]),[y,v]=(0,u.useState)(24),b=(0,u.useRef)(),_=(0,u.useCallback)((e=>{var t,n,r,i;const o=null!==(t=null===(n=e.current)||void 0===n||null===(r=n.contentDocument)||void 0===r||null===(i=r.body)||void 0===i?void 0:i.scrollHeight)&&void 0!==t?t:0;0!==o&&v(o)}),[]);return(0,u.useEffect)((()=>_(b)),[_,b,m]),(0,u.useEffect)((()=>{setTimeout((()=>_(b)),500)}),[]),Nf(d().Fragment,null,Nf(Ert,Trt({},a,s,{contentEditable:!1}),Nf(Qrt,{id:p,value:h,onFocus:()=>r(!0),onBlur:()=>r(!1),onChange:e=>{const t=e.target.value,n=eQe(c,l);n&&aQe(c,{lang:t},{at:n})}}),Nf(Art,null,Nf(sI.ZP,{key:`code-frame-${p}`,id:p,ref:b,style:{border:"none",width:"100%",height:y,overflow:"hidden"},initialContent:O},Nf(Crt,{id:p,code:m,lang:h}))),Nf(AG,{active:n||i}),Nf(Rrt,null,f)))};function Lrt(){return Lrt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lrt.apply(this,arguments)}const Mrt=e=>{let{attributes:t,children:n,nodeProps:r}=e;return Nf("h1",Lrt({},t,r),n)};function jrt(){return jrt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jrt.apply(this,arguments)}const Irt=e=>{let{attributes:t,children:n,nodeProps:r}=e;return Nf("h2",jrt({},t,r),n)};function zrt(){return zrt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zrt.apply(this,arguments)}const Frt=e=>{let{attributes:t,children:n,nodeProps:r}=e;return Nf("h3",zrt({},t,r),n)};function Urt(){return Urt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Urt.apply(this,arguments)}const Wrt=e=>{let{attributes:t,children:n,nodeProps:r}=e;return Nf("h4",Urt({},t,r),n)};function Nrt(){return Nrt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nrt.apply(this,arguments)}const Yrt=e=>{let{attributes:t,children:n,nodeProps:r}=e;return Nf("h5",Nrt({},t,r),n)};function Xrt(){return Xrt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xrt.apply(this,arguments)}const Brt=e=>{let{attributes:t,children:n,nodeProps:r}=e;return Nf("h6",Xrt({},t,r),n)};function qrt(){return qrt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qrt.apply(this,arguments)}const Zrt=e=>{const{attributes:t,children:n,nodeProps:r}=e;return Nf("div",qrt({},t,r),Nf("hr",qrt({contentEditable:!1},r)),n)},Vrt=e=>{let{containerRef:t,collection:n,entry:r,field:i}=e;return e=>{let{element:o,editor:a,children:s}=e;const{url:l,alt:c}=o,[d,f]=(0,u.useState)(
position: relative;
padding: 1.25rem;
padding-bottom: 0;
margin-bottom: 1.25rem;
`,uot={container:{position:"relative"}},dot=e=>{let{initialValue:t,collection:n,entry:r,field:i,useMdx:o,controlProps:a,onChange:s,onFocus:l,onBlur:c}=e;const d=(0,u.useRef)(null),f=(0,u.useRef)(null),p=(0,u.useRef)(null),h=(0,u.useMemo)((()=>sot(sot({},{[ALe]:Mrt,[RLe]:Irt,[DLe]:Frt,[LLe]:Wrt,[MLe]:Yrt,[jLe]:Brt,[FLe]:nit,[bqe]:uit,[wqe]:fit,[_qe]:lit,[kqe]:ait,[gLe]:Prt,[vLe]:Drt,[kFe]:Grt({containerRef:p.current,collection:n,entry:r,field:i}),[eWe]:Vrt({containerRef:p.current,collection:n,entry:r,field:i}),[rUe]:eit,[nUe]:tit,[iUe]:Jrt,[oUe]:Krt,[$8e]:iit({controlProps:a}),[WLe]:EDe(SHe,{as:"strong"}),[BLe]:EDe(SHe,{as:"em"}),[ZLe]:EDe(SHe,{as:"s"})}),{},o?{[HLe]:EDe(SHe,{as:"sub"}),[KLe]:EDe(SHe,{as:"sup"}),[eMe]:EDe(SHe,{as:"u"})}:{[$8e]:iit({controlProps:a})})),[n,a,r,i,o]),m=(0,u.useMemo)((()=>{const e=[ULe(),OLe(),sUe(),zLe(),tWe(),xFe(),Vit(),iot(),Cit(),NLe(),XLe(),qLe(),VLe(),mLe(Pit),TFe(eot),oMe(not),iMe(Iit),GZe(oot)];return z8e(o?[...e,EIe(),CIe(),GLe(),JLe(),tMe(),oLe(Oit)]:[...e,tot()],{components:h})}),[h,o]),g=Uj();return(0,u.useMemo)((()=>Nf(cot,null,Nf(mtt,{backend:Mtt},Nf(ZDe,{id:g,key:"plate-provider",initialValue:t,plugins:m,onChange:s},Nf("div",{key:"editor-outer_wrapper",ref:d,style:uot.container},Nf(mit,{key:"toolbar",useMdx:o,containerRef:d.current,collection:n,field:i,entry:r}),Nf("div",{key:"editor-wrapper",ref:f,style:uot.container},Nf(HDe,{key:"editor",id:g,editableProps:sot(sot({},git),{},{onFocus:l,onBlur:c})},Nf("div",{key:"editor-inner-wrapper",ref:p,style:uot.container},Nf(Nnt,{key:"balloon-toolbar",useMdx:o,containerRef:p.current,collection:n,field:i,entry:r}),Nf(Lit,{containerRef:f}))))))))),[n,i,c,l,t,s,m])};function fot(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fot(Object(n),!0).forEach((function(t){hot(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fot(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function hot(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mot=e=>"string"==typeof e.text,got=["thematic_break","image","code_block","shortcode","tableCell","tableHeaderCell"],Oot=[Y8e.code_block];function yot(e,t){var n,r;const{ignoreParagraphNewline:i=!1,listDepth:o=0,isInTable:a=!1,isInCode:s=!1,blockquoteDepth:l=0,useMdx:c,shortcodeConfigs:u}=t,d=e.text||"";let f=e.type||"";const p="type"in e&&"blockquote"===e.type;let h=d;if(!mot(e)){let t="";f===Y8e.tableRow&&(t="|"),h=e.children.map(((t,n)=>{const r=f===Y8e.table,d=!mot(t)&&X8e.includes(t.type||""),h=X8e.includes(e.type||""),m=Oot.includes(e.type||"");let g=!1;return!mot(e)&&Array.isArray(e.children)&&(g=e.children.some((e=>!mot(e)&&e.type===Y8e.link))),yot(pot(pot({},t),{},{parentType:f}),{ignoreParagraphNewline:(i||d||h||g||a)&&!t.break,listDepth:h?o+1:o,isInTable:r||a,isInCode:m||s,blockquoteDepth:p?l+1:l,useMdx:c,index:n,shortcodeConfigs:u})})).join(t)}if(i||""!==d&&"\n"!==d||e.parentType!==Y8e.paragraph||f===Y8e.image||f===Y8e.shortcode||f===Y8e.tableCell||f===Y8e.tableHeaderCell||(f=Y8e.paragraph,h="\n"),""!==h||got.find((e=>Y8e[e]===f))){if("\n"!==h&&mot(e))if(e.strikethrough&&e.bold&&e.italic)h=bot(h,"~~***");else if(e.bold&&e.italic)h=bot(h,"***");else if(e.bold&&(h=bot(h,"**")),e.italic&&(h=bot(h,"_")),e.strikethrough&&(h=bot(h,"~~")),e.code&&(h=bot(h,"`")),e.subscript&&(h=bot(h,"<sub>","</sub>")),e.superscript&&(h=bot(h,"<sup>","</sup>")),e.underline&&(h=bot(h,"<u>","</u>
position: relative;
width: 100%;
.toastui-editor-main .toastui-editor-md-vertical-style .toastui-editor {
width: 100%;
}
.toastui-editor-main .toastui-editor-md-splitter {
display: none;
}
.toastui-editor-md-preview {
display: none;
}
.toastui-editor-defaultUI {
border: none;
}
`,kot=e=>{let{useMdx:t}=e;return e=>{const{label:n,value:r,onChange:i,hasErrors:o,collection:a,entry:s,field:l}=e,[c,d]=(0,u.useState)(null!=r?r:""),[f,p]=(0,u.useState)(!1),h=Ive(f,150),m=(0,u.useCallback)((()=>{p(!0)}),[]),g=(0,u.useCallback)((()=>{p(!1)}),[]),O=(0,u.useCallback)((e=>{const n=_ot(e,{useMdx:t});n!==c&&(d(n),i(n))}),[c,i]),y=(0,u.useCallback)((()=>{}),[]),[v,b]=aet(c,{useMdx:t});return(0,u.useMemo)((()=>Nf(wot,{key:"markdown-control-wrapper"},Nf(due,{key:"markdown-control-label",isActive:f,hasErrors:o,onClick:y},n),b?Nf(dot,{initialValue:v,collection:a,entry:s,field:l,useMdx:t,controlProps:e,onChange:O,onFocus:m,onBlur:g}):null,Nf(AG,{key:"markdown-control-outline",hasLabel:!0,hasError:o,active:f||h}))),[a,e,h,l,y,g,O,m,o,f,n,b,v])}},xot=u.createContext({});function Sot(e){return function(t){const n=Pot(t.components);return u.createElement(e,{...t,allComponents:n})}}function Pot(e){const t=u.useContext(xot);return u.useMemo((()=>"function"==typeof e?e(t):{...t,...e}),[t,e])}const $ot={};function Cot({components:e,children:t,disableParentContext:n}){let r=Pot(e);return n&&(r=e||$ot),u.createElement(xot.Provider,{value:r},t)}function Tot(){return Tot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tot.apply(this,arguments)}const Eot=e=>{let{previewProps:t}=e;return e=>{let{shortcode:n,args:r}=e;const i=(0,u.useMemo)((()=>wO(n)),[n]),[o,a]=(0,u.useMemo)((()=>{if(!i)return[null,{}];const e=i.toProps?i.toProps(r):{};return[i.preview,e]}),[i,r]);return o?Nf(o,Tot({previewProps:t},a)):null}};var Qot=function(e,t,n){var r={type:String(e)};return null!=n||"string"!=typeof t&&!Array.isArray(t)?Object.assign(r,t):n=t,Array.isArray(n)?r.children=n:null!=n&&(r.value=String(n)),r};const Aot=function(e,t,n,r){"function"==typeof t&&"function"!=typeof n&&(r=n,n=t,t=null),m4e(e,t,(function(e,t){const r=t[t.length-1];return n(e,r?r.children.indexOf(e):null,r)}),r)},Rot=Lot("start"),Dot=Lot("end");function Lot(e){return function(t){const n=t&&t.position&&t.position[e]||{};return{line:n.line||null,column:n.column||null,offset:n.offset>-1?n.offset:null}}}const Mot={}.hasOwnProperty;function jot(e){return String(e||"").toUpperCase()}const Iot={}.hasOwnProperty;function zot(e,t){const n=t.data||{};return"value"in t&&!(Iot.call(n,"hName")||Iot.call(n,"hProperties")||Iot.call(n,"hChildren"))?e.augment(t,Qot("text",t.value)):e(t,"div",Wot(e,t))}function Fot(e,t,n){const r=t&&t.type;let i;if(!r)throw new Error("Expected node, got `"+t+"`");return i=Iot.call(e.handlers,r)?e.handlers[r]:e.passThrough&&e.passThrough.includes(r)?Uot:e.unknownHandler,("function"==typeof i?i:zot)(e,t,n)}function Uot(e,t){return"children"in t?{...t,children:Wot(e,t)}:t}function Wot(e,t){const n=[];if("children"in t){const r=t.children;let i=-1;for(;++i<r.length;){const o=Fot(e,r[i],t);if(o){if(i&&"break"===r[i-1].type&&(Array.isArray(o)||"text"!==o.type||(o.value=o.value.replace(/^\s+/,"")),!Array.isArray(o)&&"element"===o.type)){const e=o.children[0];e&&"text"===e.type&&(e.value=e.value.replace(/^\s+/,""))}Array.isArray(o)?n.push(...o):n.push(o)}}}return n}function Not(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(37===o&&v3e(e.charCodeAt(n+1))&&v3e(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const t=e.charCodeAt(n+1);o<56320&&t>56319&&t<57344?(a=String.fromCharCode(o,t),i=1):a="<22>"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Yot(e,t){const n=[];let r=-1;for(t&&n.push(Qot("text","\n"));++r<e.length;)r&&n.push(Qot("text","\n")),n.push(e[r]);return t&&e.length>0&&n.push(Qot("text","\n")),n}function Xot(e,t){const n=String(t.identifier),r=Not(n.toLowerCase()),i=e.footnoteOrder.indexOf(n);let o;-1===i?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,o=e.footnoteOrder.length):(e.footnoteCounts[n]
position: relative;
background: white;
width: 100%;
`,Ilt=(0,aw.ZP)("div",xm)((e=>{let{$collapsed:t}=e;return`\n display: flex;\n flex-direction: column;\n gap: 16px;\n width: 100%;\n ${t?"\n display: none;\n ":"\n padding: 16px;\n "}\n `})),zlt=(0,aw.ZP)("div")`
display: flex;
padding: 16px;
width: 100%;
`,Flt=e=>{let{field:t,fieldsErrors:n,submitted:r,forList:i,isFieldDuplicate:o,isFieldHidden:a,locale:s,path:l,t:c,i18n:d,hasErrors:f,value:p={}}=e;const[h,m]=(0,u.useState)(!1),g=(0,u.useCallback)((()=>{m(!h)}),[h]),O=(0,u.useMemo)((()=>{var e;const n=null!==(e=t.label)&&void 0!==e?e:t.name,r=t.summary;return r?`${n} - ${yp(r,null,"",p)}`:n}),[t.label,t.name,t.summary,p]),y=(0,u.useMemo)((()=>t.fields),[t.fields]),v=(0,u.useMemo)((()=>{var e;return null!==(e=null==y?void 0:y.map(((e,t)=>{let c=e.name,u=l;const f=p&&p[c];if(i&&1===y.length){var h;const t=l.split(".");c=null!==(h=t.pop())&&void 0!==h?h:e.name,u=t.join(".")}const m=o&&o(e),g=a&&a(e);return Nf(Jj,{key:t,field:e,fieldName:c,value:f,fieldsErrors:n,submitted:r,parentPath:u,isDisabled:m,isHidden:g,isFieldDuplicate:o,isFieldHidden:a,locale:s,i18n:d})})))&&void 0!==e?e:null}),[n,i,d,o,a,s,y,l,r,p]);return y?Nf(jlt,{key:"object-control-wrapper"},i?null:Nf(EG,{key:"object-control-top-bar",collapsed:h,onCollapseToggle:g,heading:O,hasError:f,t:c,testId:"object-title"}),Nf(Ilt,{$collapsed:h,key:"object-control-fields"},v),i?null:Nf(AG,{key:"object-control-outline",hasError:f})):Nf(zlt,{key:"no-fields-found"},"No field(s) defined for this widget")},Ult=e=>{var t;let{field:n}=e;return Nf(HG,null,null!==(t=n.renderedFields)&&void 0!==t?t:null)},Wlt={properties:{collapsed:{type:"boolean"},i18n:{type:"boolean"}}},Nlt=()=>({name:"object",controlComponent:Flt,previewComponent:Ult,options:{schema:Wlt}});function Ylt(e){return void 0!==e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function Xlt(e,t){for(let n=0;n<e.length;n+=1)if(t(e[n]))return n;return-1}const Blt=function(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:i="any",stringify:o,trim:a=!1}=e;return(e,{inputValue:s,getOptionLabel:l})=>{let c=a?s.trim():s;n&&(c=c.toLowerCase()),t&&(c=Ylt(c));const u=c?e.filter((e=>{let r=(o||l)(e);return n&&(r=r.toLowerCase()),t&&(r=Ylt(r)),"start"===i?0===r.indexOf(c):r.indexOf(c)>-1})):e;return"number"==typeof r?u.slice(0,r):u}}(),qlt=e=>{var t;return null!==e.current&&(null==(t=e.current.parentElement)?void 0:t.contains(document.activeElement))};function Zlt(e){return(0,Iw.Z)("MuiListSubheader",e)}(0,kw.Z)("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const Vlt=["className","color","component","disableGutters","disableSticky","inset"],Hlt=(0,aw.ZP)("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${(0,Xw.Z)(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})((({theme:e,ownerState:t})=>(0,S.Z)({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},"primary"===t.color&&{color:(e.vars||e).palette.primary.main},"inherit"===t.color&&{color:"inherit"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.inset&&{paddingLeft:72},!t.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}))),Glt=u.forwardRef((function(e,t){const n=(0,sw.Z)({props:e,name:"MuiListSubheader"}),{className:r,color:i="default",component:o="li",disableGutters:a=!1,disableSticky:s=!1,inset:l=!1}=n,c=(0,P.Z)(n,Vlt),u=(0,S.Z)({},n,{color:i,component:o,disableGutters:a,disableSticky:s,inset:l}),d=(e=>{const{classes:t,color:n,disableGutters:r,inset:i,disableSticky:o}=e,a={root:["root","default"!==n&&`color${(0,Xw.Z)(n)}`,!r&&"gutters",i&&"inset",!o&&"sticky"]};return(0,ow.Z)(a,Zlt,t)})(u);return(0,_w.jsx)(Hlt,(0,S.Z)({as:o,className:(0,iw.Z)(d.root,r),ref:t,ownerState:u},c))})),Klt=Glt,Jlt=(0,YT.Z)((0,_w.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function ect(e){return(0,Iw.Z)("MuiChip",e)}const tct=(0,kw.Z)("MuiChip",["root","sizeSmall","sizeMedium","colorError","colo