module.exports=[115551,a=>{"use strict";var b,c,d=a.i(572131);a.i(935112);var e=a.i(826088),f=a.i(187924);function g(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function h(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function i(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?h(Object(c),!0).forEach(function(b){var d;d=c[b],b in a?Object.defineProperty(a,b,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[b]=d}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):h(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}function j(a){return function b(){for(var c=this,d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return e.length>=a.length?a.apply(this,e):function(){for(var a=arguments.length,d=Array(a),f=0;f<a;f++)d[f]=arguments[f];return b.apply(c,[].concat(e,d))}}}function k(a){return({}).toString.call(a).includes("Object")}function l(a){return"function"==typeof a}var m=j(function(a,b){throw Error(a[b]||a.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),n=function(a,b){return k(b)||m("changeType"),Object.keys(b).some(function(b){return!Object.prototype.hasOwnProperty.call(a,b)})&&m("changeField"),b},o=function(a){l(a)||m("selectorType")},p=function(a){l(a)||k(a)||m("handlerType"),k(a)&&Object.values(a).some(function(a){return!l(a)})&&m("handlersType")},q=function(a){a||m("initialIsRequired"),k(a)||m("initialType"),Object.keys(a).length||m("initialContent")};function r(a,b){return l(b)?b(a.current):b}function s(a,b){return a.current=i(i({},a.current),b),b}function t(a,b,c){return l(b)?b(a.current):Object.keys(c).forEach(function(c){var d;return null==(d=b[c])?void 0:d.call(b,a.current[c])}),c}var u={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
    You are using deprecated way of configuration.

    Instead of using
      monaco.config({ urls: { monacoBase: '...' } })
    use
      monaco.config({ paths: { vs: '...' } })

    For more please check the link https://github.com/suren-atoyan/monaco-loader#config
  `},v=(b=function(a,b){throw Error(a[b]||a.default)},function a(){for(var c=this,d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return e.length>=b.length?b.apply(this,e):function(){for(var b=arguments.length,d=Array(b),f=0;f<b;f++)d[f]=arguments[f];return a.apply(c,[].concat(e,d))}})(u),w=function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return function(a){return b.reduceRight(function(a,b){return b(a)},a)}},x={type:"cancelation",msg:"operation is manually canceled"};function y(a){var b=!1,c=new Promise(function(c,d){a.then(function(a){return b?d(x):c(a)}),a.catch(d)});return c.cancel=function(){return b=!0},c}var z=function(a){if(Array.isArray(a))return a}(c=({create:function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};q(a),p(b);var c={current:a},d=j(t)(c,b),e=j(s)(c),f=j(n)(a),g=j(r)(c);return[function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(a){return a};return o(a),a(c.current)},function(a){(function(){for(var a=arguments.length,b=Array(a),c=0;c<a;c++)b[c]=arguments[c];return function(a){return b.reduceRight(function(a,b){return b(a)},a)}})(d,e,f,g)(a)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(a){var b=null==a?null:"u">typeof Symbol&&a[Symbol.iterator]||a["@@iterator"];if(null!=b){var c,d,e,f,g=[],h=!0,i=!1;try{e=(b=b.call(a)).next,!0;for(;!(h=(c=e.call(b)).done)&&(g.push(c.value),2!==g.length);h=!0);}catch(a){i=!0,d=a}finally{try{if(!h&&null!=b.return&&(f=b.return(),Object(f)!==f))return}finally{if(i)throw d}}return g}}(c)||function(a){if(a){if("string"==typeof a)return g(a,2);var b=({}).toString.call(a).slice(8,-1);return"Object"===b&&a.constructor&&(b=a.constructor.name),"Map"===b||"Set"===b?Array.from(a):"Arguments"===b||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b)?g(a,2):void 0}}(c)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}(),A=z[0],B=z[1];function C(a){return document.body.appendChild(a)}function D(a){var b,c,d=A(function(a){return{config:a.config,reject:a.reject}}),e=(b="".concat(d.config.paths.vs,"/loader.js"),c=document.createElement("script"),b&&(c.src=b),c);return e.onload=function(){return a()},e.onerror=d.reject,e}function E(){var a=A(function(a){return{config:a.config,resolve:a.resolve,reject:a.reject}}),b=window.require;b.config(a.config),b(["vs/editor/editor.main"],function(b){var c=b.m||b;F(c),a.resolve(c)},function(b){a.reject(b)})}function F(a){A().monaco||B({monaco:a})}var G=new Promise(function(a,b){return B({resolve:a,reject:b})}),H=function(){var a=A(function(a){return{monaco:a.monaco,isInitialized:a.isInitialized,resolve:a.resolve}});if(!a.isInitialized){if(B({isInitialized:!0}),a.monaco)return a.resolve(a.monaco),y(G);if(window.monaco&&window.monaco.editor)return F(window.monaco),a.resolve(window.monaco),y(G);w(C,D)(E)}return y(G)},I={display:"flex",position:"relative",textAlign:"initial"},J={width:"100%"},K={display:"none"},L={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},M=function({children:a}){return d.default.createElement("div",{style:L},a)},N=(0,d.memo)(function({width:a,height:b,isEditorReady:c,loading:e,_ref:f,className:g,wrapperProps:h}){return d.default.createElement("section",{style:{...I,width:a,height:b},...h},!c&&d.default.createElement(M,null,e),d.default.createElement("div",{ref:f,style:{...J,...!c&&K},className:g}))}),O=function(a){(0,d.useEffect)(a,[])},P=function(a,b,c=!0){let e=(0,d.useRef)(!0);(0,d.useEffect)(e.current||!c?()=>{e.current=!1}:a,b)};function Q(){}function R(a,b,c,d){var e,f,g,h,i,j;return e=a,f=d,e.editor.getModel(S(e,f))||(g=a,h=b,i=c,j=d,g.editor.createModel(h,i,j?S(g,j):void 0))}function S(a,b){return a.Uri.parse(b)}(0,d.memo)(function({original:a,modified:b,language:c,originalLanguage:e,modifiedLanguage:f,originalModelPath:g,modifiedModelPath:h,keepCurrentOriginalModel:i=!1,keepCurrentModifiedModel:j=!1,theme:k="light",loading:l="Loading...",options:m={},height:n="100%",width:o="100%",className:p,wrapperProps:q={},beforeMount:r=Q,onMount:s=Q}){let[t,u]=(0,d.useState)(!1),[v,w]=(0,d.useState)(!0),x=(0,d.useRef)(null),y=(0,d.useRef)(null),z=(0,d.useRef)(null),A=(0,d.useRef)(s),B=(0,d.useRef)(r),C=(0,d.useRef)(!1);O(()=>{let a=H();return a.then(a=>(y.current=a)&&w(!1)).catch(a=>a?.type!=="cancelation"&&console.error("Monaco initialization: error:",a)),()=>{let b;return x.current?(b=x.current?.getModel(),void(i||b?.original?.dispose(),j||b?.modified?.dispose(),x.current?.dispose())):a.cancel()}}),P(()=>{if(x.current&&y.current){let b=x.current.getOriginalEditor(),d=R(y.current,a||"",e||c||"text",g||"");d!==b.getModel()&&b.setModel(d)}},[g],t),P(()=>{if(x.current&&y.current){let a=x.current.getModifiedEditor(),d=R(y.current,b||"",f||c||"text",h||"");d!==a.getModel()&&a.setModel(d)}},[h],t),P(()=>{let a=x.current.getModifiedEditor();a.getOption(y.current.editor.EditorOption.readOnly)?a.setValue(b||""):b!==a.getValue()&&(a.executeEdits("",[{range:a.getModel().getFullModelRange(),text:b||"",forceMoveMarkers:!0}]),a.pushUndoStop())},[b],t),P(()=>{x.current?.getModel()?.original.setValue(a||"")},[a],t),P(()=>{let{original:a,modified:b}=x.current.getModel();y.current.editor.setModelLanguage(a,e||c||"text"),y.current.editor.setModelLanguage(b,f||c||"text")},[c,e,f],t),P(()=>{y.current?.editor.setTheme(k)},[k],t),P(()=>{x.current?.updateOptions(m)},[m],t);let D=(0,d.useCallback)(()=>{if(!y.current)return;B.current(y.current);let d=R(y.current,a||"",e||c||"text",g||""),i=R(y.current,b||"",f||c||"text",h||"");x.current?.setModel({original:d,modified:i})},[c,b,f,a,e,g,h]),E=(0,d.useCallback)(()=>{!C.current&&z.current&&(x.current=y.current.editor.createDiffEditor(z.current,{automaticLayout:!0,...m}),D(),y.current?.editor.setTheme(k),u(!0),C.current=!0)},[m,k,D]);return(0,d.useEffect)(()=>{t&&A.current(x.current,y.current)},[t]),(0,d.useEffect)(()=>{v||t||E()},[v,t,E]),d.default.createElement(N,{width:o,height:n,isEditorReady:t,loading:l,_ref:z,className:p,wrapperProps:q})});var T=function(a){let b=(0,d.useRef)();return(0,d.useEffect)(()=>{b.current=a},[a]),b.current},U=new Map,V=(0,d.memo)(function({defaultValue:a,defaultLanguage:b,defaultPath:c,value:e,language:f,path:g,theme:h="light",line:i,loading:j="Loading...",options:k={},overrideServices:l={},saveViewState:m=!0,keepCurrentModel:n=!1,width:o="100%",height:p="100%",className:q,wrapperProps:r={},beforeMount:s=Q,onMount:t=Q,onChange:u,onValidate:v=Q}){let[w,x]=(0,d.useState)(!1),[y,z]=(0,d.useState)(!0),A=(0,d.useRef)(null),B=(0,d.useRef)(null),C=(0,d.useRef)(null),D=(0,d.useRef)(t),E=(0,d.useRef)(s),F=(0,d.useRef)(),G=(0,d.useRef)(e),I=T(g),J=(0,d.useRef)(!1),K=(0,d.useRef)(!1);O(()=>{let a=H();return a.then(a=>(A.current=a)&&z(!1)).catch(a=>a?.type!=="cancelation"&&console.error("Monaco initialization: error:",a)),()=>B.current?void(F.current?.dispose(),n?m&&U.set(g,B.current.saveViewState()):B.current.getModel()?.dispose(),B.current.dispose()):a.cancel()}),P(()=>{let d=R(A.current,a||e||"",b||f||"",g||c||"");d!==B.current?.getModel()&&(m&&U.set(I,B.current?.saveViewState()),B.current?.setModel(d),m&&B.current?.restoreViewState(U.get(g)))},[g],w),P(()=>{B.current?.updateOptions(k)},[k],w),P(()=>{B.current&&void 0!==e&&(B.current.getOption(A.current.editor.EditorOption.readOnly)?B.current.setValue(e):e!==B.current.getValue()&&(K.current=!0,B.current.executeEdits("",[{range:B.current.getModel().getFullModelRange(),text:e,forceMoveMarkers:!0}]),B.current.pushUndoStop(),K.current=!1))},[e],w),P(()=>{let a=B.current?.getModel();a&&f&&A.current?.editor.setModelLanguage(a,f)},[f],w),P(()=>{void 0!==i&&B.current?.revealLine(i)},[i],w),P(()=>{A.current?.editor.setTheme(h)},[h],w);let L=(0,d.useCallback)(()=>{if(!(!C.current||!A.current)&&!J.current){E.current(A.current);let d=g||c,j=R(A.current,e||a||"",b||f||"",d||"");B.current=A.current?.editor.create(C.current,{model:j,automaticLayout:!0,...k},l),m&&B.current.restoreViewState(U.get(d)),A.current.editor.setTheme(h),void 0!==i&&B.current.revealLine(i),x(!0),J.current=!0}},[a,b,c,e,f,g,k,l,m,h,i]);return(0,d.useEffect)(()=>{w&&D.current(B.current,A.current)},[w]),(0,d.useEffect)(()=>{y||w||L()},[y,w,L]),G.current=e,(0,d.useEffect)(()=>{w&&u&&(F.current?.dispose(),F.current=B.current?.onDidChangeModelContent(a=>{K.current||u(B.current.getValue(),a)}))},[w,u]),(0,d.useEffect)(()=>{if(w){let a=A.current.editor.onDidChangeMarkers(a=>{let b=B.current.getModel()?.uri;if(b&&a.find(a=>a.path===b.path)){let a=A.current.editor.getModelMarkers({resource:b});v?.(a)}});return()=>{a?.dispose()}}return()=>{}},[w,v]),d.default.createElement(N,{width:o,height:p,isEditorReady:w,loading:j,_ref:C,className:q,wrapperProps:r})});function W(a,b){let c=(0,e.c)(5),[f,g]=(0,d.useState)(a),h=(0,d.useRef)(!0),i,j;c[0]!==a?(i=()=>{if(h.current){h.current=!1;return}g(a)},j=[a],c[0]=a,c[1]=i,c[2]=j):(i=c[1],j=c[2]),(0,d.useEffect)(i,j);let k=f??b,l;return c[3]!==k?(l=[k,g],c[3]=k,c[4]=l):l=c[4],l}var X=(0,d.createContext)(void 0),Y=({children:a,config:b})=>{let[c,e]=W(b),{collectionsBySlug:g,globalsBySlug:h}=(0,d.useMemo)(()=>{let a={},b={};for(let b of c.collections)a[b.slug]=b;for(let a of c.globals)b[a.slug]=a;return{collectionsBySlug:a,globalsBySlug:b}},[c]),i=(0,d.useCallback)(a=>"collectionSlug"in a&&a.collectionSlug?g[a.collectionSlug]??null:"globalSlug"in a&&a.globalSlug?h[a.globalSlug]??null:null,[g,h]),j=(0,d.useMemo)(()=>({config:c,getEntityConfig:i,setConfig:e}),[c,i,e]);return(0,f.jsx)(X,{value:j,children:a})},Z=()=>(0,d.use)(X),$=(0,d.createContext)({autoMode:!0,setTheme:()=>null,theme:"light"});function _(a,b,c){let d=new Date;d.setTime(d.getTime()+24*c*36e5);let e="expires="+d.toUTCString();document.cookie=a+"="+b+";"+e+";path=/"}var aa="light",ab=()=>(0,d.use)($),ac=(a,b)=>{let c,f=(0,e.c)(9),g=void 0!==b&&b,[h,i]=d.useState(!1),j=d.useRef(void 0),k;f[0]!==a?(k=()=>(i(!1),clearTimeout(j.current),j.current=setTimeout(()=>{i(!0)},a),()=>{clearTimeout(j.current)}),f[0]=a,f[1]=k):k=f[1];let l=k,m,n;return f[2]!==l||f[3]!==g?(m=()=>{g&&l()},n=[l,g],f[2]=l,f[3]=g,f[4]=m,f[5]=n):(m=f[4],n=f[5]),d.useEffect(m,n),f[6]!==h||f[7]!==l?(c=[h,l],f[6]=h,f[7]=l,f[8]=c):c=f[8],c},ad="shimmer-effect",ae=({animationDelay:a="0ms",className:b,disableInlineStyles:c=!1,height:d="60px",transparent:e,width:g="100%",...h})=>(0,f.jsx)("div",{...h,className:[ad,e&&`${ad}--transparent`,b].filter(Boolean).join(" "),style:{...h?.style||{},height:!c&&("number"==typeof d?`${d}px`:d),width:!c&&("number"==typeof g?`${g}px`:g)},children:(0,f.jsx)("div",{className:"shimmer-effect__shine",style:{animationDelay:a}})}),af={insertSpaces:!1,tabSize:4,trimAutoWhitespace:!1},ag={hideCursorInOverviewRuler:!0,minimap:{enabled:!1},overviewRulerBorder:!1,readOnly:!1,scrollbar:{alwaysConsumeMouseWheel:!1},scrollBeyondLastLine:!1,wordWrap:"on"},ah="default"in V?V.default:V;a.s(["a",0,W,"b",0,Y,"c",0,Z,"d",0,a=>{let b=(0,e.c)(7),{children:c,config:g}=a,{config:h,setConfig:i}=Z(),j,k;if(b[0]!==g||b[1]!==i?(j=()=>{i(g)},k=[g,i],b[0]=g,b[1]=i,b[2]=j,b[3]=k):(j=b[2],k=b[3]),(0,d.useEffect)(j,k),h!==g&&h.unauthenticated!==g.unauthenticated){let a;return b[4]!==c||b[5]!==g?(a=(0,f.jsx)(Y,{config:g,children:c}),b[4]=c,b[5]=g,b[6]=a):a=b[6],a}return c},"e",0,ac,"f",0,ae,"g",0,a=>{let b,c,d=(0,e.c)(9),{className:g,count:h,height:i,renderDelay:j,shimmerDelay:k,shimmerItemClassName:l,width:m}=a,n=void 0===k?25:k,o="number"==typeof n?`${n}ms`:n,[p]=ac(void 0===j?500:j,!0);return p?(d[0]!==h?(b=[...Array(h)],d[0]=h,d[1]=b):b=d[1],d[2]!==g||d[3]!==i||d[4]!==o||d[5]!==l||d[6]!==b||d[7]!==m?(c=(0,f.jsx)("div",{className:g,children:b.map((a,b)=>(0,f.jsx)("div",{className:l,children:(0,f.jsx)(ae,{animationDelay:`calc(${b} * ${o})`,height:i,width:m})},b))}),d[2]=g,d[3]=i,d[4]=o,d[5]=l,d[6]=b,d[7]=m,d[8]=c):c=d[8],c):null},"h",0,aa,"i",0,a=>{let b,c=(0,e.c)(11),{children:g,theme:h}=a,{config:i}=Z(),j=i.admin.theme,k=`${i.cookiePrefix||"payload"}-theme`,[l,m]=(0,d.useState)(h||aa),[n,o]=(0,d.useState)(),p,q;c[0]!==k||c[1]!==j?(p=()=>{let a,b;if("all"!==j)return;let{theme:c,themeFromCookies:d}=(a="light"===(b=window.document.cookie.split("; ").find(a=>a.startsWith(`${k}=`))?.split("=")[1])||"dark"===b?b:window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",a),{theme:a,themeFromCookies:b});m(c),o(!d)},q=[j,k],c[0]=k,c[1]=j,c[2]=p,c[3]=q):(p=c[2],q=c[3]),(0,d.useEffect)(p,q),c[4]!==k?(b=a=>{if("light"===a||"dark"===a)m(a),o(!1),_(k,a,365),document.documentElement.setAttribute("data-theme",a);else if("auto"===a){_(k,a,-1);let b=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";document.documentElement.setAttribute("data-theme",b),o(!0),m(b)}},c[4]=k,c[5]=b):b=c[5];let r=b,s;return c[6]!==n||c[7]!==g||c[8]!==r||c[9]!==l?(s=(0,f.jsx)($,{value:{autoMode:n,setTheme:r,theme:l},children:g}),c[6]=n,c[7]=g,c[8]=r,c[9]=l,c[10]=s):s=c[10],s},"j",0,ab,"k",0,af,"l",0,a=>{let b=(0,e.c)(10),{className:c,maxHeight:g,minHeight:h,options:i,readOnly:j,recalculatedHeightAt:k,value:l,...m}=a,n=h??56,o=d.default.useRef(k),{insertSpaces:p,tabSize:q,trimAutoWhitespace:r,...s}=i||{},t=i?.padding?(i.padding.top||0)+(i.padding?.bottom||0):0,[u,v]=(0,d.useState)(n),{theme:w}=ab(),x=m?.defaultLanguage?`language--${m.defaultLanguage}`:"",y=j&&"read-only",z;b[0]!==c||b[1]!==x||b[2]!==y?(z=["code-editor",c,x,y].filter(Boolean),b[0]=c,b[1]=x,b[2]=y,b[3]=z):z=b[3];let A=z.join(" "),B,C;return b[4]!==n||b[5]!==t||b[6]!==k||b[7]!==l?(B=()=>{k&&k>o.current&&(v(l?Math.max(n,18*l.split(`
`).length+2+t):n),o.current=k)},C=[l,n,t,k],b[4]=n,b[5]=t,b[6]=k,b[7]=l,b[8]=B,b[9]=C):(B=b[8],C=b[9]),d.default.useEffect(B,C),(0,f.jsx)(ah,{className:A,height:g?Math.min(u,g):u,loading:(0,f.jsx)(ae,{height:u}),options:{...ag,...s,readOnly:!!j,detectIndentation:!1,insertSpaces:void 0,tabSize:void 0,trimAutoWhitespace:void 0},theme:"dark"===w?"vs-dark":"vs",value:l,...m,onChange:(a,b)=>{m.onChange?.(a,b),v(a?Math.max(n,18*a.split(`
`).length+2+t):n)},onMount:(a,b)=>{m.onMount?.(a,b);let c=a.getModel();c&&c.updateOptions({insertSpaces:p??af.insertSpaces,tabSize:q??af.tabSize,trimAutoWhitespace:r??af.trimAutoWhitespace}),v(Math.max(n,18*a.getValue().split(`
`).length+2+t))}})}])}];

//# sourceMappingURL=node_modules_%40payloadcms_ui_dist_exports_client_chunk-2GZJJKQF_0fueams.js.map