"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8155],{8818:(e,t,n)=>{let a,o;n.d(t,{$nd:()=>to,At5:()=>pa,FUZ:()=>dQ,HyU:()=>eS,Jtr:()=>nN,Lay:()=>ej,MtT:()=>aA,Mw1:()=>tB,Nt8:()=>a5,OcR:()=>aK,Q0O:()=>pc,Q55:()=>sx,QtH:()=>nx,VIm:()=>cl,VRv:()=>pb,V_H:()=>dJ,Vzr:()=>sT,Ymp:()=>nI,_s:()=>nC,_xt:()=>oy,abF:()=>oe,b5E:()=>px,bgj:()=>tU,dhY:()=>nA,fNN:()=>pu,gL$:()=>sn,hPP:()=>uI,hSE:()=>ne,j1G:()=>nB,kV6:()=>eN,lLQ:()=>tq,lUE:()=>tW,lVW:()=>cq,nde:()=>el,oRP:()=>eF,pTT:()=>pd,qUP:()=>eW,rLj:()=>aE,rym:()=>tz});var l=n(42292),r=n(15541),i=n(4382),s=n(27708),c=n(43618),u=n(76792),d=n(32395),p=n(83357),f=n(55198),h=n(24080),m=n(8737),g=n(32908),v=n(86701),b=n(34483),y=n(22352),x=n(16636),w=n(27707),C=n(85432),j=n(90128),S=n(82212),_=n(39499),k=n(44468),E=n(31323),N=n(52484),D=n(89707),P=n(48653),O=n(95065),T=n(5877),R=n(56238),I=n(50917),F=n(82188),A=n(87396),M=n(88138),L=n(80718),B=n(27186),V=n(79951),z=n(15724),U=n(38441);n(23067);var H=n(56846),q=n(59072),W=n(63263),K=n(37811),Y=n(528).hp,G=(0,c.c)(e=>{function t(e,t){var n=e.length;for(e.push(t);0>>1,l=e[a];if(0>>1;ao(s,n))co(u,s)?(e[a]=u,e[c]=n,a=c):(e[a]=s,e[i]=n,a=i);else if(co(u,n))e[a]=u,e[c]=n,a=c;else break}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now?(s=performance,e.unstable_now=function(){return s.now()}):(u=(c=Date).now(),e.unstable_now=function(){return c.now()-u});var l,r,i,s,c,u,d=[],p=[],f=1,h=null,m=3,g=!1,v=!1,b=!1,y="function"==typeof setTimeout?setTimeout:null,x="function"==typeof clearTimeout?clearTimeout:null,w="u">typeof setImmediate?setImmediate:null;function C(e){for(var o=n(p);null!==o;){if(null===o.callback)a(p);else if(o.startTimet&&N());){var i=h.callback;if("function"==typeof i){h.callback=null,m=h.priorityLevel;var s=i(h.expirationTimetypeof MessageChannel?(i=(r=new MessageChannel).port2,r.port1.onmessage=D,l=function(){i.postMessage(null)}):l=function(){y(D,0)},e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){v||g||(v=!0,P())},e.unstable_forceFrameRate=function(e){0>e||125r?(a.sortIndex=l,t(p,a),null===n(d)&&a===n(p)&&(b?(x(_),_=-1):b=!0,O(j,l-r))):(a.sortIndex=i,t(d,a),v||g||(v=!0,P())),a},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}}}),$=(0,c.c)((e,t)=>{t.exports=G()}),X=(0,c.c)(e=>{var t="function"==typeof Symbol&&Symbol.for,n=t?Symbol.for("react.element"):60103,a=t?Symbol.for("react.portal"):60106,o=t?Symbol.for("react.fragment"):60107,l=t?Symbol.for("react.strict_mode"):60108,r=t?Symbol.for("react.profiler"):60114,i=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,p=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,h=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,v=t?Symbol.for("react.fundamental"):60117,b=t?Symbol.for("react.responder"):60118,y=t?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case c:case u:case o:case r:case l:case p:return e;default:switch(e=e&&e.$$typeof){case s:case d:case m:case h:case i:return e;default:return t}}case a:return t}}}function w(e){return x(e)===u}e.AsyncMode=c,e.ConcurrentMode=u,e.ContextConsumer=s,e.ContextProvider=i,e.Element=n,e.ForwardRef=d,e.Fragment=o,e.Lazy=m,e.Memo=h,e.Portal=a,e.Profiler=r,e.StrictMode=l,e.Suspense=p,e.isAsyncMode=function(e){return w(e)||x(e)===c},e.isConcurrentMode=w,e.isContextConsumer=function(e){return x(e)===s},e.isContextProvider=function(e){return x(e)===i},e.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},e.isForwardRef=function(e){return x(e)===d},e.isFragment=function(e){return x(e)===o},e.isLazy=function(e){return x(e)===m},e.isMemo=function(e){return x(e)===h},e.isPortal=function(e){return x(e)===a},e.isProfiler=function(e){return x(e)===r},e.isStrictMode=function(e){return x(e)===l},e.isSuspense=function(e){return x(e)===p},e.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===u||e===r||e===l||e===p||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===i||e.$$typeof===s||e.$$typeof===d||e.$$typeof===v||e.$$typeof===b||e.$$typeof===y||e.$$typeof===g)},e.typeOf=x}),Z=(0,c.c)((e,t)=>{t.exports=X()}),Q=(0,c.c)((e,t)=>{var n=Z(),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},l={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},r={};function i(e){return n.isMemo(e)?l:r[e.$$typeof]||a}r[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},r[n.Memo]=l;var s=Object.defineProperty,c=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;t.exports=function e(t,n,a){if("string"!=typeof n){if(f){var l=p(n);l&&l!==f&&e(t,l,a)}var r=c(n);u&&(r=r.concat(u(n)));for(var h=i(t),m=i(n),g=0;g{var n=Math.floor(0xffffff*Math.random()),a=d.index=parseInt(0xffffff*Math.random(),10),o=(typeof K>"u"||"number"!=typeof K.pid?Math.floor(1e5*Math.random()):K.pid)%65535,l=(()=>{try{return _Buffer}catch(e){try{return Y}catch(e){return null}}})(),r=function(e){return!!(null!=e&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))},i=[];for(s=0;s"u"||null!=e&&24!==e.length)throw Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var t="",n=0;n>24&255,e>>16&255,e>>8&255,255&e,n>>16&255,n>>8&255,255&n,o>>8&255,255&o,t>>16&255,t>>8&255,255&t)}};var p=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";d.prototype[p]=function(){return"ObjectID("+this+")"},d.prototype.toJSON=d.prototype.toHexString,d.prototype.toString=d.prototype.toHexString}),ee=(0,c.c)((e,t)=>{function n(e){return void 0===e}function a(e){return e===Object(e)}function o(e){return Array.isArray(e)}function l(e,t){return t?a(e)&&!n(e.uri):a(e)&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.slice}function r(e){return!n(e)&&e}t.exports={serialize:function e(t,i,s,c){i=i||{},s=s||new FormData,i.indices=r(i.indices),i.nullsAsUndefineds=r(i.nullsAsUndefineds),i.booleansAsIntegers=r(i.booleansAsIntegers),i.allowEmptyArrays=r(i.allowEmptyArrays),i.noAttributesWithArrayNotation=r(i.noAttributesWithArrayNotation),i.noFilesWithArrayNotation=r(i.noFilesWithArrayNotation),i.dotsForObjectNotation=r(i.dotsForObjectNotation);let u="function"==typeof s.getParts;return n(t)||(null===t?i.nullsAsUndefineds||s.append(c,""):"boolean"==typeof t?i.booleansAsIntegers?s.append(c,+!!t):s.append(c,t):o(t)?t.length?t.forEach((t,n)=>{var o;let r=c+"["+(i.indices?n:"")+"]";(i.noAttributesWithArrayNotation||i.noFilesWithArrayNotation&&l(o=t,u)&&"string"==typeof o.name&&(a(o.lastModifiedDate)||"number"==typeof o.lastModified))&&(r=c),e(t,i,s,r)}):i.allowEmptyArrays&&s.append(i.noAttributesWithArrayNotation?c:c+"[]",""):t instanceof Date?s.append(c,t.toISOString()):a(t)&&!l(t,u)?Object.keys(t).forEach(n=>{let a=t[n];if(o(a))for(;n.length>2&&n.lastIndexOf("[]")===n.length-2;)n=n.substring(0,n.length-2);let l=c?i.dotsForObjectNotation?c+"."+n:c+"["+n+"]":n;e(a,i,s,l)}):s.append(c,t)),s}}}),et=(0,c.c)((e,t)=>{!function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e>>32-t},rotr:function(e,t){return e>>t},endian:function(e){if(e.constructor==Number)return 0xff00ff&n.rotl(e,8)|0xff00ff00&n.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,a=0;n>>5]|=e[n]>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n>>6*(3-l)&63)):n.push("=");return n.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/ig,"");for(var n=[],a=0,o=0;a>>6-2*o);return n}};t.exports=n}()}),en=(0,c.c)((e,t)=>{var n={utf8:{stringToBytes:function(e){return n.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(n.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n{function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){var t;return null!=e&&(n(e)||"function"==typeof(t=e).readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))||!!e._isBuffer)}}),eo=(0,c.c)((e,t)=>{!function(){var e=et(),n=en().utf8,a=ea(),o=en().bin,l=function(t,r){t.constructor==String?t=r&&"binary"===r.encoding?o.stringToBytes(t):n.stringToBytes(t):a(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||t.constructor===Uint8Array||(t=t.toString());for(var i=e.bytesToWords(t),s=8*t.length,c=0x67452301,u=-0x10325477,d=-0x67452302,p=0x10325476,f=0;f>>24)&0xff00ff|(i[f]>>8)&0xff00ff00;i[s>>>5]|=128>>9>>0,u=u+y>>>0,d=d+x>>>0,p=p+w>>>0}return e.endian([c,u,d,p])};l._ff=function(e,t,n,a,o,l,r){var i=e+(t&n|~t&a)+(o>>>0)+r;return(i>>32-l)+t},l._gg=function(e,t,n,a,o,l,r){var i=e+(t&a|n&~a)+(o>>>0)+r;return(i>>32-l)+t},l._hh=function(e,t,n,a,o,l,r){var i=e+(t^n^a)+(o>>>0)+r;return(i>>32-l)+t},l._ii=function(e,t,n,a,o,l,r){var i=e+(n^(t|~a))+(o>>>0)+r;return(i>>32-l)+t},l._blocksize=16,l._digestsize=16,t.exports=function(t,n){if(null==t)throw Error("Illegal argument "+t);var a=e.wordsToBytes(l(t,n));return n&&n.asBytes?a:n&&n.asString?o.bytesToString(a):e.bytesToHex(a)}}()});function el(e){let{CustomComponent:t,Fallback:n}=e;return void 0!==t?t:n}var er=(0,c.e)($(),1),ei=Symbol(),es=Symbol(),ec=typeof window>"u"||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent)?l.useEffect:l.useLayoutEffect,eu=er.unstable_runWithPriority?e=>{try{(0,er.unstable_runWithPriority)(er.unstable_NormalPriority,e)}catch(t){if("Not implemented."===t.message)e();else throw t}}:e=>e(),ed=e=>e;function ep(e,t){let{v:{current:n},n:{current:a},l:o}=(0,l.useContext)(e)[ei],r=t(n),[i,s]=(0,l.useReducer)((e,o)=>{if(!o)return[n,r];if("p"in o)throw o.p;if(o.n===a)return Object.is(e[1],r)?e:[n,r];try{if("v"in o){if(Object.is(e[0],o.v))return e;let n=t(o.v);return Object.is(e[1],n)?e:[o.v,n]}}catch(e){}return[...e]},[n,r]);return Object.is(i[1],r)||s(),ec(()=>(o.add(s),()=>{o.delete(s)}),[o]),i[1]}var ef=(0,l.createContext)({}),eh=(0,l.createContext)({}),em=(0,l.createContext)({}),eg=(0,l.createContext)(!1),ev=(0,l.createContext)(!1),eb=(0,l.createContext)(!1),ey=(0,l.createContext)(!1),ex=(0,l.createContext)(!1),ew=function(e){let t,n=(0,l.createContext)({[ei]:{v:{current:e},n:{current:-1},l:new Set,u:e=>e()}});return n[es]=n.Provider,t=n.Provider,n.Provider=e=>{let{value:n,children:a}=e,o=(0,l.useRef)(n),r=(0,l.useRef)(0),[i,s]=(0,l.useState)(null);i&&(i(n),s(null));let c=(0,l.useRef)();if(!c.current){let e=new Set;c.current={[ei]:{v:o,n:r,l:e,u:(t,n)=>{r.current+=1;let a={n:r.current};(null==n?void 0:n.suspense)&&(a.n*=-1,a.p=new Promise(e=>{s(()=>t=>{a.v=t,delete a.p,e(t)})})),e.forEach(e=>e(a)),t()}}}}return ec(()=>{o.current=n,r.current+=1,eu(()=>{c.current[ei].l.forEach(e=>{e({n:r.current,v:n})})})},[n]),(0,l.createElement)(t,{value:c.current},a)},delete n.Consumer,n}([{},()=>null]),eC=()=>(0,l.use)(ef),ej=()=>(0,l.use)(eh),eS=()=>(0,l.use)(eg),e_=()=>(0,l.use)(ev),ek=()=>(0,l.use)(ex),eE=e=>ep(ew,e),eN=()=>ep(ew,ed),eD=l.createContext({data:{},path:"",rowNumber:void 0}),eP=e=>{let{children:t,path:n,rowNumber:a}=e,{getDataByPath:o,getSiblingData:r}=(0,l.use)(em),i=r(n),s=o(n)||i,c=l.useMemo(()=>({data:s,path:n,rowNumber:a}),[s,n,a]);return(0,u.jsx)(eD,{value:c,children:t})},eO=e=>{let{className:t,CustomComponent:n,label:a,path:o,rowNumber:l}=e;return(0,u.jsx)(eP,{path:o,rowNumber:l,children:(0,u.jsx)(el,{CustomComponent:n,Fallback:"string"==typeof a?(0,u.jsx)("span",{className:["row-label",t].filter(Boolean).join(" "),style:{pointerEvents:"none"},children:a}):a})})};Array(12).fill(0);var eT=1,eR=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...a}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:eT++,l=this.toasts.find(e=>e.id===o),r=void 0===e.dismissible||e.dismissible;return l?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:n}),{...t,...e,id:o,dismissible:r,title:n}):t):this.addToast({title:n,...a,dismissible:r,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let n;if(!t)return;void 0!==t.loading&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let a=e instanceof Promise?e:e(),o=void 0!==n,r,i=a.then(async e=>{if(r=["resolve",e],l.isValidElement(e))o=!1,this.create({id:n,type:"default",message:e});else if(eI(e)&&!e.ok){o=!1;let a="function"==typeof t.error?await t.error("HTTP error! status: ".concat(e.status)):t.error,l="function"==typeof t.description?await t.description("HTTP error! status: ".concat(e.status)):t.description;this.create({id:n,type:"error",message:a,description:l})}else if(void 0!==t.success){o=!1;let a="function"==typeof t.success?await t.success(e):t.success,l="function"==typeof t.description?await t.description(e):t.description;this.create({id:n,type:"success",message:a,description:l})}}).catch(async e=>{if(r=["reject",e],void 0!==t.error){o=!1;let a="function"==typeof t.error?await t.error(e):t.error,l="function"==typeof t.description?await t.description(e):t.description;this.create({id:n,type:"error",message:a,description:l})}}).finally(()=>{var e;o&&(this.dismiss(n),n=void 0),null==(e=t.finally)||e.call(t)}),s=()=>new Promise((e,t)=>i.then(()=>"reject"===r[0]?t(r[1]):e(r[1])).catch(t));return"string"!=typeof n&&"number"!=typeof n?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=(null==t?void 0:t.id)||eT++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},eI=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,eF=Object.assign((e,t)=>{let n=(null==t?void 0:t.id)||eT++;return eR.addToast({title:e,...t,id:n}),n},{success:eR.success,info:eR.info,warning:eR.warning,error:eR.error,custom:eR.custom,message:eR.message,promise:eR.promise,dismiss:eR.dismiss,loading:eR.loading},{getHistory:()=>eR.toasts});!function(e){let{insertAt:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===t&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var eA=l.createContext({isTransitioning:!1,startRouteTransition:()=>{},transitionProgress:0}),eM=()=>l.use(eA),eL=/https?|ftp|gopher|file/;function eB(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}var eV="default"in p?p.default:p,ez=e=>{let{children:t,href:n,onClick:a,preventDefault:o=!0,ref:l,replace:r,scroll:i,...s}=e,c=(0,f.useRouter)(),{startRouteTransition:d}=eM();return(0,u.jsx)(eV,{href:n,onClick:e=>{(function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which})(e)||(a&&a(e),o&&e.preventDefault(),d(()=>{let e="string"==typeof n?n:function(e){var t;let n,{auth:a}=e,{hostname:o}=e,l=e.protocol||"",r=e.pathname||"",i=e.hash||"",s=e.query||"",c=!1;a=a?encodeURIComponent(a).replace(/%3A/i,":")+"@":"",e.host?c=a+e.host:o&&(c=a+(~o.indexOf(":")?"[".concat(o,"]"):o),e.port&&(c+=":"+e.port)),s&&"object"==typeof s&&(s=String((t=s,n=new URLSearchParams,Object.entries(t).forEach(e=>{let[t,a]=e;Array.isArray(a)?a.forEach(e=>n.append(t,eB(e))):n.set(t,eB(a))}),n)));let u=e.search||s&&"?".concat(s)||"";return l&&!l.endsWith(":")&&(l+=":"),e.slashes||(!l||eL.test(l))&&!1!==c?(c="//"+(c||""),r&&"/"!==r[0]&&(r="/"+r)):c||(c=""),i&&"#"!==i[0]&&(i="#"+i),u&&"?"!==u[0]&&(u="?"+u),r=r.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),"".concat(l).concat(c).concat(r).concat(u).concat(i)}(n);r?c.replace(e,{scroll:i}):c.push(e,{scroll:i})}))},ref:l,...s,children:t})},eU="banner",eH=e=>{let{type:t="default",alignIcon:n="right",children:a,className:o,icon:r,onClick:i,to:s}=e,c=[eU,"".concat(eU,"--type-").concat(t),o&&o,s&&"".concat(eU,"--has-link"),(s||i)&&"".concat(eU,"--has-action"),r&&"".concat(eU,"--has-icon"),r&&"".concat(eU,"--align-icon-").concat(n)].filter(Boolean).join(" "),d="div";return i&&!s&&(d="button"),s&&(d=ez),(0,u.jsxs)(d,{className:c,href:s||null,onClick:i,children:[r&&"left"===n&&(0,u.jsx)(l.Fragment,{children:r}),(0,u.jsx)("span",{className:"".concat(eU,"__content"),children:a}),r&&"right"===n&&(0,u.jsx)(l.Fragment,{children:r})]})},eq=e=>{let{ariaLabel:t,className:n,direction:a,size:o}=e;return(0,u.jsx)("svg",{"aria-label":t,className:["icon icon--chevron",n,o&&"icon--size-".concat(o)].filter(Boolean).join(" "),height:"100%",style:{transform:"left"===a?"rotate(90deg)":"right"===a?"rotate(-90deg)":"up"===a?"rotate(180deg)":void 0},viewBox:"0 0 20 20",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{className:"stroke",d:"M14 8L10 12L6 8",strokeLinecap:"square"})})},eW=e=>{let{className:t}=e;return(0,u.jsx)("svg",{className:[t,"icon icon--edit"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{className:"stroke",d:"M9.68531 4.62938H5.2634C4.92833 4.62938 4.60698 4.76248 4.37004 4.99942C4.13311 5.23635 4 5.5577 4 5.89278V14.7366C4 15.0717 4.13311 15.393 4.37004 15.63C4.60698 15.8669 4.92833 16 5.2634 16H14.1072C14.4423 16 14.7636 15.8669 15.0006 15.63C15.2375 15.393 15.3706 15.0717 15.3706 14.7366V10.3147M13.7124 4.39249C13.9637 4.14118 14.3046 4 14.66 4C15.0154 4 15.3562 4.14118 15.6075 4.39249C15.8588 4.6438 16 4.98464 16 5.34004C16 5.69544 15.8588 6.03629 15.6075 6.28759L9.91399 11.9817C9.76399 12.1316 9.57868 12.2413 9.37515 12.3008L7.56027 12.8314C7.50591 12.8472 7.44829 12.8482 7.39344 12.8341C7.33859 12.8201 7.28853 12.7915 7.24849 12.7515C7.20845 12.7115 7.17991 12.6614 7.16586 12.6066C7.15181 12.5517 7.15276 12.4941 7.16861 12.4397L7.69924 10.6249C7.75896 10.4215 7.86888 10.2364 8.01888 10.0866L13.7124 4.39249Z",strokeLinecap:"square"})})},eK=()=>(0,u.jsx)("svg",{className:"icon icon--plus",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{className:"stroke",d:"M5.33333 9.99998H14.6667M9.99999 5.33331V14.6666",strokeLinecap:"square"})}),eY={};(0,c.d)(eY,{Button:()=>eQ,ButtonGroup:()=>eZ,Divider:()=>eG,GroupLabel:()=>e$});var eG=()=>(0,u.jsx)("hr",{className:"popup-divider"}),e$=e=>{let{label:t}=e;return(0,u.jsx)("p",{className:"popup-list-group-label",children:t})},eX="popup-button-list",eZ=e=>{let{buttonSize:t="default",children:n,className:a,textAlign:o="left"}=e,l=[eX,a,"".concat(eX,"__text-align--").concat(o),"".concat(eX,"__button-size--").concat(t)].filter(Boolean).join(" ");return(0,u.jsx)("div",{className:l,children:n})},eQ=e=>{let{id:t,active:n,children:a,className:o,disabled:l,href:r,onClick:i}=e,s=["".concat(eX,"__button"),l&&"".concat(eX,"__disabled"),n&&"".concat(eX,"__button--selected"),o].filter(Boolean).join(" ");if(!l){if(r)return(0,u.jsx)(ez,{className:s,href:r,id:t,onClick:e=>{i&&i(e)},prefetch:!1,children:a});if(i)return(0,u.jsx)("button",{className:s,id:t,onClick:e=>{i&&i(e)},type:"button",children:a})}return(0,u.jsx)("div",{className:s,id:t,children:a})},eJ={};(0,c.d)(eJ,{WindowInfo:()=>e3,WindowInfoContext:()=>e0,WindowInfoProvider:()=>e6,useWindowInfo:()=>e1,withWindowInfo:()=>e5});var e0=(0,l.createContext)({}),e1=()=>(0,l.useContext)(e0),e3=e=>{let{children:t}=e,n=e1();return t?"function"==typeof t?l.createElement(l.Fragment,null,t(n)):l.createElement(l.Fragment,null,t):null},e2=(e,t)=>{let{payload:{breakpoints:n,animationRef:a}}=t;a.current=null;let{eventsFired:o}=e,{documentElement:{style:l,clientWidth:r,clientHeight:i}}=document,{innerWidth:s,innerHeight:c}=window,u="".concat(r/100,"px"),d="".concat(i/100,"px"),p=n?Object.keys(n).reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:window.matchMedia(n[t]).matches}),{}):{};return l.setProperty("--vw",u),l.setProperty("--vh",d),{width:s,height:c,"--vw":u,"--vh":d,breakpoints:p,eventsFired:o+1}},e6=e=>{let{breakpoints:t,children:n}=e,a=(0,l.useRef)(null),[o,r]=(0,l.useReducer)(e2,{width:void 0,height:void 0,"--vw":"","--vh":"",breakpoints:{},eventsFired:0}),i=(0,l.useCallback)(()=>{a.current&&cancelAnimationFrame(a.current),a.current=requestAnimationFrame(()=>r({type:"UPDATE",payload:{breakpoints:t,animationRef:a}}))},[t]),s=(0,l.useCallback)(()=>{setTimeout(()=>{i()},500)},[i]);return(0,l.useEffect)(()=>(window.addEventListener("resize",i),window.addEventListener("orientationchange",s),()=>{window.removeEventListener("resize",i),window.removeEventListener("orientationchange",s)}),[i,s]),(0,l.useEffect)(()=>{0===o.eventsFired&&r({type:"UPDATE",payload:{breakpoints:t,animationRef:a}})},[t,o]),l.createElement(e0.Provider,{value:Object.assign({},o)},n&&n)},e5=e=>t=>{let n=e1();return l.createElement(e,Object.assign({},t,{windowInfo:n}))},e4=(e,t)=>{let n,a=(0,h.c)(8),{root:o,rootMargin:r,threshold:i}=void 0===e?{}:e,[s,c]=(0,l.useState)(),[u,d]=(0,l.useState)(null),p=(0,l.useRef)("u">typeof window&&"IntersectionObserver"in window&&!t?new window.IntersectionObserver(e=>{let[t]=e;return c(t)},{root:void 0===o?null:o,rootMargin:void 0===r?"0px":r,threshold:void 0===i?0:i}):null),f,m;return a[0]!==t||a[1]!==u?(f=()=>{if(t)return;let{current:e}=p;return e.disconnect(),u&&e.observe(u),()=>e.disconnect()},m=[u,t],a[0]=t,a[1]=u,a[2]=f,a[3]=m):(f=a[2],m=a[3]),(0,l.useEffect)(f,m),a[4]!==s||a[5]!==u||a[6]!==d?(n=[d,s,u],a[4]=s,a[5]=u,a[6]=d,a[7]=n):n=a[7],n},e9="popup-button",e8=e=>{let t,n,a=(0,h.c)(24),{active:o,button:l,buttonType:r,className:i,disabled:s,noBackground:c,setActive:d,size:p}=e,f="".concat(e9,"--").concat(r),m=!c&&"".concat(e9,"--background"),g=p&&"".concat(e9,"--size-").concat(p),v=s&&"".concat(e9,"--disabled"),b;a[0]!==i||a[1]!==f||a[2]!==m||a[3]!==g||a[4]!==v?(b=[e9,i,f,m,g,v].filter(Boolean),a[0]=i,a[1]=f,a[2]=m,a[3]=g,a[4]=v,a[5]=b):b=a[5];let y=b.join(" "),x;a[6]!==o||a[7]!==d?(x=()=>{d(!o)},a[6]=o,a[7]=d,a[8]=x):x=a[8];let w=x;if("none"===r)return null;if("custom"===r){let e,t;return a[9]!==w?(e=e=>{"Enter"===e.key&&w()},a[9]=w,a[10]=e):e=a[10],a[11]!==l||a[12]!==y||a[13]!==w||a[14]!==e?(t=(0,u.jsx)("div",{className:y,onClick:w,onKeyDown:e,role:"button",tabIndex:0,children:l}),a[11]=l,a[12]=y,a[13]=w,a[14]=e,a[15]=t):t=a[15],t}return a[16]!==w?(t=e=>{"Enter"===e.key&&w()},a[16]=w,a[17]=t):t=a[17],a[18]!==l||a[19]!==y||a[20]!==s||a[21]!==w||a[22]!==t?(n=(0,u.jsx)("button",{className:y,disabled:s,onClick:w,onKeyDown:t,tabIndex:0,type:"button",children:l}),a[18]=l,a[19]=y,a[20]=s,a[21]=w,a[22]=t,a[23]=n):n=a[23],n},e7="popup",te=e=>{let{id:t,boundingRef:n,button:a,buttonClassName:o,buttonSize:r,buttonType:i="default",caret:s=!0,children:c,className:d,disabled:p,forceOpen:f,horizontalAlign:h="left",initActive:m=!1,noBackground:g,onToggleClose:v,onToggleOpen:b,render:y,showOnHover:x=!1,showScrollbar:w=!1,size:C="medium",verticalAlign:j="top"}=e,{height:S,width:_}=e1(),[k,E]=e4({root:(null==n?void 0:n.current)||null,rootMargin:"-100px 0px 0px 0px",threshold:1}),N=(0,l.useRef)(null),D=(0,l.useRef)(null),[P,O]=(0,l.useState)(m),[T,R]=(0,l.useState)(j),[I,F]=(0,l.useState)(h),A=l.useCallback(e=>{e&&"function"==typeof b&&b(!0),e||"function"!=typeof v||v(),O(e)},[v,b]),M=(0,l.useCallback)(e=>{let{horizontal:t=!1,vertical:a=!1}=e;if(N.current){let{bottom:e,left:o,right:l,top:r}=N.current.getBoundingClientRect(),i=100,s=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=0;(null==n?void 0:n.current)&&({bottom:c,left:u,right:s,top:i}=n.current.getBoundingClientRect()),t&&(l>s&&o>u?F("right"):oc&&r>i&&R("top"))}},[n]),L=(0,l.useCallback)(e=>{N.current.contains(e.target)||D.current.contains(e.target)||A(!1)},[N,A]);(0,l.useEffect)(()=>{M({horizontal:!0})},[E,M,_]),(0,l.useEffect)(()=>{M({vertical:!0})},[E,M,S]),(0,l.useEffect)(()=>(P?document.addEventListener("mousedown",L):document.removeEventListener("mousedown",L),()=>{document.removeEventListener("mousedown",L)}),[P,L,b]),(0,l.useEffect)(()=>{A(f)},[f,A]);let B=[e7,d,"".concat(e7,"--size-").concat(C),r&&"".concat(e7,"--button-size-").concat(r),"".concat(e7,"--v-align-").concat(T),"".concat(e7,"--h-align-").concat(I),P&&"".concat(e7,"--active"),w&&"".concat(e7,"--show-scrollbar")].filter(Boolean).join(" ");return(0,u.jsxs)("div",{className:B,id:t,children:[(0,u.jsx)("div",{className:"".concat(e7,"__trigger-wrap"),ref:D,children:x?(0,u.jsx)("div",{className:"".concat(e7,"__on-hover-watch"),onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),role:"button",tabIndex:0,children:(0,u.jsx)(e8,{active:P,button:a,buttonType:i,className:o,disabled:p,noBackground:g,setActive:A,size:r})}):(0,u.jsx)(e8,{active:P,button:a,buttonType:i,className:o,disabled:p,noBackground:g,setActive:A,size:r})}),(0,u.jsxs)("div",{className:"".concat(e7,"__content"),ref:N,children:[(0,u.jsx)("div",{className:"".concat(e7,"__hide-scrollbar"),ref:k,children:(0,u.jsx)("div",{className:"".concat(e7,"__scroll-container"),children:(0,u.jsxs)("div",{className:"".concat(e7,"__scroll-content"),children:[y&&y({close:()=>A(!1)}),c]})})}),s&&(0,u.jsx)("div",{className:"".concat(e7,"__caret")})]})]})},tt=e=>{let{alignCaret:t="center",boundingRef:n,children:a,className:o,delay:r=350,position:i,show:s=!0,staticPositioning:c=!1}=e,[d,p]=l.useState(s),[f,h]=l.useState("top"),[m,g]=e4({root:(null==n?void 0:n.current)||null,rootMargin:"-145px 0px 0px 100px",threshold:0},c);return(0,l.useEffect)(()=>{let e;return r&&s?e=setTimeout(()=>{p(s)},r):p(s),()=>{e&&clearTimeout(e)}},[s,r]),(0,l.useEffect)(()=>{c||h((null==g?void 0:g.isIntersecting)?"top":"bottom")},[g,c]),(0,u.jsxs)(l.Fragment,{children:[!c&&(0,u.jsx)("aside",{"aria-hidden":"true",className:["tooltip",o,"tooltip--caret-".concat(t),"tooltip--position-top"].filter(Boolean).join(" "),ref:m,style:{opacity:"0"},children:(0,u.jsx)("div",{className:"tooltip-content",children:a})}),(0,u.jsx)("aside",{className:["tooltip",o,d&&"tooltip--show","tooltip--caret-".concat(t),"tooltip--position-".concat(i||f)].filter(Boolean).join(" "),title:(e=>"string"==typeof e?e:"")(a),children:(0,u.jsx)("div",{className:"tooltip-content",children:a})})]})},tn={chevron:eq,edit:eW,link:()=>(0,u.jsx)("svg",{"aria-hidden":"true",className:"graphic link icon icon--link",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{className:"stroke",d:"M7.99999 13.3333H6.66666C5.78261 13.3333 4.93476 12.9821 4.30964 12.357C3.68452 11.7319 3.33333 10.884 3.33333 9.99999C3.33333 9.11593 3.68452 8.26809 4.30964 7.64297C4.93476 7.01785 5.78261 6.66666 6.66666 6.66666H7.99999M12 6.66666H13.3333C14.2174 6.66666 15.0652 7.01785 15.6904 7.64297C16.3155 8.26809 16.6667 9.11593 16.6667 9.99999C16.6667 10.884 16.3155 11.7319 15.6904 12.357C15.0652 12.9821 14.2174 13.3333 13.3333 13.3333H12M7.33333 9.99999H12.6667",strokeLinecap:"square"})}),plus:eK,swap:()=>(0,u.jsx)("svg",{className:"icon icon--swap",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{className:"stroke",d:"M7.33334 4L4.66667 6.66667M4.66667 6.66667L7.33334 9.33333M4.66667 6.66667H15.3333M12.6667 16L15.3333 13.3333M15.3333 13.3333L12.6667 10.6667M15.3333 13.3333H4.66667",strokeLinecap:"square"})}),x:s.a},ta=e=>{let{children:t,icon:n,showTooltip:a,tooltip:o}=e,r=tn[n];return(0,u.jsxs)(l.Fragment,{children:[o&&(0,u.jsx)(tt,{className:"".concat("btn","__tooltip"),show:a,children:o}),(0,u.jsxs)("span",{className:"".concat("btn","__content"),children:[t&&(0,u.jsx)("span",{className:"".concat("btn","__label"),children:t}),n&&(0,u.jsxs)("span",{className:"".concat("btn","__icon"),children:[(0,l.isValidElement)(n)&&n,r&&(0,u.jsx)(r,{})]})]})]})},to=e=>{let{id:t,type:n="button","aria-label":a,buttonStyle:o="primary",children:r,className:i,disabled:s,el:c="button",enableSubMenu:d,extraButtonProps:p={},icon:f,iconPosition:h="right",iconStyle:m="without-border",margin:g=!0,newTab:v,onClick:b,onMouseDown:y,ref:x,round:w,size:C="medium",SubMenuPopupContent:j,to:S,tooltip:_,url:k}=e,[E,N]=l.useState(!1),D=["btn",i&&i,f&&"".concat("btn","--icon"),m&&"".concat("btn","--icon-style-").concat(m),f&&!r&&"".concat("btn","--icon-only"),C&&"".concat("btn","--size-").concat(C),f&&h&&"".concat("btn","--icon-position-").concat(h),_&&"".concat("btn","--has-tooltip"),!j&&"".concat("btn","--withoutPopup"),!g&&"".concat("btn","--no-margin")].filter(Boolean).join(" "),P=[o&&"".concat("btn","--style-").concat(o),s&&"".concat("btn","--disabled"),w&&"".concat("btn","--round"),j?"".concat("btn","--withPopup"):"".concat("btn","--withoutPopup")].filter(Boolean).join(" "),O={id:t,type:n,"aria-disabled":s,"aria-label":a,className:j?D:[D,P].join(" "),disabled:s,onClick:s?void 0:function(e){N(!1),"submit"!==n&&b&&e.preventDefault(),b&&b(e)},onMouseDown:s?void 0:y,onPointerEnter:_?()=>N(!0):void 0,onPointerLeave:_?()=>N(!1):void 0,rel:v?"noopener noreferrer":void 0,target:v?"_blank":void 0,title:a,...p},T;switch(c){case"anchor":T=(0,u.jsx)("a",{...O,href:s?void 0:k,ref:x,children:(0,u.jsx)(ta,{icon:f,showTooltip:E,tooltip:_,children:r})});break;case"link":s&&(T=(0,u.jsx)("div",{...O,children:(0,u.jsx)(ta,{icon:f,showTooltip:E,tooltip:_,children:r})})),T=(0,u.jsx)(ez,{...O,href:S||k,prefetch:!1,children:(0,u.jsx)(ta,{icon:f,showTooltip:E,tooltip:_,children:r})});break;default:T=(0,u.jsx)(c,{ref:x,...O,children:(0,u.jsx)(ta,{icon:f,showTooltip:E,tooltip:_,children:r})})}return j?(0,u.jsxs)("div",{className:P,children:[T,(0,u.jsx)(te,{button:(0,u.jsx)(eq,{}),buttonSize:C,className:s&&!d?"".concat("btn","--popup-disabled"):"",disabled:s&&!d,horizontalAlign:"right",id:"".concat(t,"-popup"),noBackground:!0,render:e=>{let{close:t}=e;return j({close:()=>t()})},size:"large",verticalAlign:"bottom"})]}):T};function tl(e){let{fieldsFromClipboard:t,fieldsFromConfig:n}=e;return!!n&&t.length===(null==n?void 0:n.length)&&t.every((e,t)=>{let a=n[t];if(e.type!==a.type||(0,m.Z7)(e)&&(0,m.Z7)(a)&&e.name!==a.name)return!1;let o=(0,m.sd)(a),l=(0,m.sd)(e);return l===o&&(!l||!o||tl({fieldsFromClipboard:e.fields,fieldsFromConfig:a.fields}))})}var tr="_payloadClipboard";function ti(e){let{getDataToCopy:t,t:n,...a}=e,o={data:t(),...a};try{return localStorage.setItem(tr,JSON.stringify(o)),!0}catch(e){return n("error:unableToCopy")}}function ts(e){let t,{onPaste:n,path:a,t:o,...l}=e;try{let e=localStorage.getItem(tr);if(!e)return o("error:invalidClipboardData");t=JSON.parse(e)}catch(e){return o("error:invalidClipboardData")}return!function(e){let{data:t,path:n,...a}=e;return!(typeof t>"u")&&!!n&&!!a.type&&("blocks"===a.type?function(e){let{blocksFromClipboard:t,blocksFromConfig:n}=e,a=new Map(null==n?void 0:n.map(e=>[e.slug,e]));if(!a.size)return!1;let o=new Set;for(let e of t){let t=e.slug;if(!o.has(t)){let n=a.get(t);if(!n||!tl({fieldsFromClipboard:e.fields,fieldsFromConfig:n.fields}))return!1;o.add(t)}}return!0}({blocksFromClipboard:a.blocks,blocksFromConfig:a.schemaBlocks}):tl({fieldsFromClipboard:a.fields,fieldsFromConfig:a.schemaFields}))}({...t,...l,fieldPath:a})?o("error:invalidClipboardData"):(n(t),!0)}var tc=e=>{let{className:t}=e;return(0,u.jsxs)("svg",{className:["icon icon--more",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[(0,u.jsx)("path",{className:"fill",d:"M10 10.6666C10.3682 10.6666 10.6667 10.3682 10.6667 9.99998C10.6667 9.63179 10.3682 9.33331 10 9.33331C9.63182 9.33331 9.33334 9.63179 9.33334 9.99998C9.33334 10.3682 9.63182 10.6666 10 10.6666Z",strokeLinecap:"square"}),(0,u.jsx)("path",{className:"fill",d:"M14.6667 10.6666C15.0349 10.6666 15.3333 10.3682 15.3333 9.99998C15.3333 9.63179 15.0349 9.33331 14.6667 9.33331C14.2985 9.33331 14 9.63179 14 9.99998C14 10.3682 14.2985 10.6666 14.6667 10.6666Z",strokeLinecap:"square"}),(0,u.jsx)("path",{className:"fill",d:"M5.33334 10.6666C5.70153 10.6666 6.00001 10.3682 6.00001 9.99998C6.00001 9.63179 5.70153 9.33331 5.33334 9.33331C4.96515 9.33331 4.66667 9.63179 4.66667 9.99998C4.66667 10.3682 4.96515 10.6666 5.33334 10.6666Z",strokeLinecap:"square"})]})},tu=()=>(0,u.jsx)("svg",{className:"icon icon--copy",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{className:"stroke",d:"M4.66666 12.6667C3.93333 12.6667 3.33333 12.0667 3.33333 11.3333V4.66668C3.33333 3.93334 3.93333 3.33334 4.66666 3.33334H11.3333C12.0667 3.33334 12.6667 3.93334 12.6667 4.66668M8.66666 7.33334H15.3333C16.0697 7.33334 16.6667 7.9303 16.6667 8.66668V15.3333C16.6667 16.0697 16.0697 16.6667 15.3333 16.6667H8.66666C7.93028 16.6667 7.33333 16.0697 7.33333 15.3333V8.66668C7.33333 7.9303 7.93028 7.33334 8.66666 7.33334Z",strokeLinecap:"square"})}),td=e=>{let t=(0,h.c)(4),{isPaste:n,isRow:a}=e,{t:o}=(0,s.d)(),r;if(t[0]!==n||t[1]!==a||t[2]!==o){let e=o("general:copyField");!a&&n?e=o("general:pasteField"):a&&!n?e=o("general:copyRow"):a&&n&&(e=o("general:pasteRow")),r=(0,u.jsxs)(l.Fragment,{children:[n?(0,u.jsx)(eW,{}):(0,u.jsx)(tu,{})," ",e]}),t[0]=n,t[1]=a,t[2]=o,t[3]=r}else r=t[3];return r},tp=e=>{let{allowCopy:t,allowPaste:n,className:a,copyClassName:o,disabled:r,isRow:i,onPaste:c,pasteClassName:d,path:p,...f}=e,{t:h}=(0,s.d)(),m=["".concat("clipboard-action","__popup"),a].filter(Boolean).join(" "),g=(0,l.useCallback)(()=>{let e=ti({path:p,t:h,...f});"string"==typeof e?eF.error(e):eF.success(h("general:copied"))},[h,f,p]),v=(0,l.useCallback)(()=>{let e=ts("array"===f.type?{onPaste:c,path:p,schemaFields:f.fields,t:h}:{onPaste:c,path:p,schemaBlocks:f.blocks,t:h});"string"==typeof e&&eF.error(e)},[c,f,p,h]);return n||t?(0,u.jsx)(te,{button:(0,u.jsx)(tc,{}),className:m,disabled:r,horizontalAlign:"center",render:e=>{let{close:a}=e;return(0,u.jsxs)(eY.ButtonGroup,{children:[(0,u.jsx)(eY.Button,{className:o,disabled:!t,onClick:()=>{g(),a()},children:(0,u.jsx)(td,{isRow:i})}),(0,u.jsx)(eY.Button,{className:d,disabled:!n,onClick:()=>{v(),a()},children:(0,u.jsx)(td,{isPaste:!0,isRow:i})})]})},size:"large",verticalAlign:"bottom"}):null};function tf(e){let{formState:t,path:n,rowIndex:a}=e,o={},l="number"!=typeof a?n:"".concat(n,".").concat(a);for(let e in t){if(!e.startsWith(l))continue;let{customComponents:n,validate:a,...r}=t[e];Array.isArray(r.rows)&&(r.rows=r.rows.map(e=>{if(!e||"object"!=typeof e)return e;let{customComponents:t,...n}=e;return n})),o[e]=r}return o}function th(e){var t,n,a;let o,{dataFromClipboard:l,formState:r,path:i,rowIndex:s}=e,{type:c,data:u,path:d,rowIndex:p}=l,f="number"!=typeof p,h="number"!=typeof s,m=!f&&h,g="array"===c,v;if(v=f&&h?d:f?"".concat(d,".").concat(s):"".concat(d,".").concat(p),o=h?m?"".concat(i,".0"):i:"".concat(i,".").concat(s),m){let e="".concat(i,".0"),n=u["".concat(v,".id")].value,a=null==(t=r[i].rows)?void 0:t.length;for(let t in r[i].rows=[{...a&&g?r[i].rows[0]:{},id:n,isLoading:!1,lastRenderedPath:e}],r[i].value=1,r[i].initialValue=1,r[i].disableFormData=!0,r)t!==i&&!t.startsWith(e)&&t.startsWith(i)&&delete r[t]}for(let e in u){if(!h&&e.endsWith(".id")||!e.startsWith(v))continue;let t=e.replace(v,o),l=g?null==(n=r[t])?void 0:n.customComponents:void 0,i=g?null==(a=r[t])?void 0:a.validate:void 0;r[t]={customComponents:l,validate:i,...u[e]}}return r}var tm="u">typeof window&&"u">typeof window.document&&"u">typeof window.document.createElement?l.useLayoutEffect:l.useEffect,tg={},tv=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a{for(let[n,a]of Object.entries(t)){let t=e[n];null!=t&&(e[n]=t+-1*a)}return e},{...e})},tb=Object.freeze({Translate:{toString(e){if(!e)return;let{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;let{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[tb.Translate.toString(e),tb.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:a}=e;return t+" "+n+"ms "+a}}});function ty(e,t,n){let a=e.slice();return a.splice(n=0}var tw=e=>{let{rects:t,activeIndex:n,overIndex:a,index:o}=e,l=ty(t,a,n),r=t[o],i=l[o];return i&&r?{x:i.left-r.left,y:i.top-r.top,scaleX:i.width/r.width,scaleY:i.height/r.height}:null},tC="Sortable",tj=l.createContext({activeIndex:-1,containerId:tC,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:tw,disabled:{draggable:!1,droppable:!1}});function tS(e){let{children:t,id:n,items:a,strategy:o=tw,disabled:r=!1}=e,{active:i,dragOverlay:s,droppableRects:c,over:u,measureDroppableContainers:d}=(0,g.fF)(),p=(0,l.useMemo)(()=>{if(n)return n;let e=null==tg[tC]?0:tg[tC]+1;return tg[tC]=e,tC+"-"+e},[tC,n]),f=null!==s.rect,h=(0,l.useMemo)(()=>a.map(e=>"object"==typeof e&&"id"in e?e.id:e),[a]),m=null!=i,v=i?h.indexOf(i.id):-1,b=u?h.indexOf(u.id):-1,y=(0,l.useRef)(h),x=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{x&&m&&d(h)},[x,h,m,d]),(0,l.useEffect)(()=>{y.current=h},[h]);let j=(0,l.useMemo)(()=>({activeIndex:v,containerId:p,disabled:C,disableTransforms:w,items:h,overIndex:b,useDragOverlay:f,sortedRects:h.reduce((e,t,n)=>{let a=c.get(t);return a&&(e[n]=a),e},Array(h.length)),strategy:o}),[v,p,C.draggable,C.droppable,w,h,b,c,f,o]);return l.createElement(tj.Provider,{value:j},t)}var t_=e=>{let{id:t,items:n,activeIndex:a,overIndex:o}=e;return ty(n,a,o).indexOf(t)},tk=e=>{let{containerId:t,isSorting:n,wasDragging:a,index:o,items:l,newIndex:r,previousItems:i,previousContainerId:s,transition:c}=e;return!!c&&!!a&&(i===l||o!==r)&&(!!n||r!==o&&t===s)},tE={duration:200,easing:"ease"},tN="transform",tD=tb.Transition.toString({property:tN,duration:0,easing:"linear"}),tP={roleDescription:"sortable"};function tO(e){if(!e)return!1;let t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}var tT=[g.vL.Down,g.vL.Right,g.vL.Up,g.vL.Left],tR=(e,t)=>{let{context:{active:n,collisionRect:a,droppableRects:o,droppableContainers:l,over:r,scrollableAncestors:i}}=t;if(tT.includes(e.code)){if(e.preventDefault(),!n||!a)return;let t=[];l.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;let l=o.get(n.id);if(l)switch(e.code){case g.vL.Down:a.topl.top&&t.push(n);break;case g.vL.Left:a.left>l.left&&t.push(n);break;case g.vL.Right:a.left1&&(c=s[1].id),null!=c){let e=l.get(n.id),t=l.get(c),r=t?o.get(t.id):null,s=null==t?void 0:t.node.current;if(s&&r&&e&&t){let n=(0,g.sl)(s).some((e,t)=>i[t]!==e),o=tI(e,t),l=function(e,t){return!!tO(e)&&!!tO(t)&&!!tI(e,t)&&e.data.current.sortable.index{let t,n,a=(0,h.c)(17),{id:o,disabled:r}=e,i;a[0]===Symbol.for("react.memo_cache_sentinel")?(i={duration:250,easing:"cubic-bezier(0, 0.2, 0.2, 1)"},a[0]=i):i=a[0],a[1]!==r||a[2]!==o?(t={id:o,disabled:r,transition:i},a[1]=r,a[2]=o,a[3]=t):t=a[3];let{attributes:s,isDragging:c,listeners:u,setNodeRef:d,transform:p,transition:f}=function(e){var t,n,a,o;let{animateLayoutChanges:r=tk,attributes:i,disabled:s,data:c,getNewIndex:u=t_,id:d,strategy:p,resizeObserverConfig:f,transition:h=tE}=e,{items:m,containerId:v,activeIndex:b,disabled:y,disableTransforms:x,sortedRects:w,overIndex:C,useDragOverlay:j,strategy:S}=(0,l.useContext)(tj),_=(t=s,n=y,"boolean"==typeof t?{draggable:t,droppable:!1}:{draggable:null!=(a=null==t?void 0:t.draggable)?a:n.draggable,droppable:null!=(o=null==t?void 0:t.droppable)?o:n.droppable}),k=m.indexOf(d),E=(0,l.useMemo)(()=>({sortable:{containerId:v,index:k,items:m},...c}),[v,c,k,m]),N=(0,l.useMemo)(()=>m.slice(m.indexOf(d)),[m,d]),{rect:D,node:P,isOver:O,setNodeRef:T}=(0,g.zM)({id:d,data:E,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...f}}),{active:R,activatorEvent:I,activeNodeRect:F,attributes:A,setNodeRef:M,listeners:L,isDragging:B,over:V,setActivatorNodeRef:z,transform:U}=(0,g.PM)({id:d,data:E,attributes:{...tP,...i},disabled:_.draggable}),H=function(){for(var e=arguments.length,t=Array(e),n=0;ne=>{t.forEach(t=>t(e))},t)}(T,M),q=!!R,W=q&&!x&&tx(b)&&tx(C),K=!j&&B,Y=K&&W?U:null,G=W?null!=Y?Y:(null!=p?p:S)({rects:w,activeNodeRect:F,activeIndex:b,overIndex:C,index:k}):null,$=tx(b)&&tx(C)?u({id:d,items:m,activeIndex:b,overIndex:C}):k,X=null==R?void 0:R.id,Z=(0,l.useRef)({activeId:X,items:m,newIndex:$,containerId:v}),Q=m!==Z.current.items,J=r({active:R,containerId:v,isDragging:B,isSorting:q,id:d,index:k,items:m,newIndex:Z.current.newIndex,previousItems:Z.current.items,previousContainerId:Z.current.containerId,transition:h,wasDragging:null!=Z.current.activeId}),ee=function(e){let{disabled:t,index:n,node:a,rect:o}=e,[r,i]=(0,l.useState)(null),s=(0,l.useRef)(n);return tm(()=>{if(!t&&n!==s.current&&a.current){let e=o.current;if(e){let t=(0,g.Sj)(a.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&i(n)}}n!==s.current&&(s.current=n)},[t,n,a,o]),(0,l.useEffect)(()=>{r&&i(null)},[r]),r}({disabled:!J,index:k,node:P,rect:D});return(0,l.useEffect)(()=>{q&&Z.current.newIndex!==$&&(Z.current.newIndex=$),v!==Z.current.containerId&&(Z.current.containerId=v),m!==Z.current.items&&(Z.current.items=m)},[q,$,v,m]),(0,l.useEffect)(()=>{if(X===Z.current.activeId)return;if(X&&!Z.current.activeId){Z.current.activeId=X;return}let e=setTimeout(()=>{Z.current.activeId=X},50);return()=>clearTimeout(e)},[X]),{active:R,activeIndex:b,attributes:A,data:E,rect:D,index:k,newIndex:$,items:m,isOver:O,isSorting:q,isDragging:B,listeners:L,node:P,overIndex:C,over:V,setNodeRef:H,setActivatorNodeRef:z,setDroppableNodeRef:T,setDraggableNodeRef:M,transform:null!=ee?ee:G,transition:ee||Q&&Z.current.newIndex===k?tD:!(K&&!function(e){if(!e)return!1;let{KeyboardEvent:t}=function(e){var t,n;let a;return e?"[object Window]"===(a=Object.prototype.toString.call(e))||"[object global]"===a?e:"nodeType"in e&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}(e.target);return t&&e instanceof t}(I)||!h)&&(q||J)?tb.Transition.toString({...h,property:tN}):void 0}}(t),m=c?"grabbing":"grab",v;a[4]!==m||a[5]!==f?(v={cursor:m,transition:f},a[4]=m,a[5]=f,a[6]=v):v=a[6],a[7]!==s||a[8]!==v?(n={...s,style:v},a[7]=s,a[8]=v,a[9]=n):n=a[9];let b=p&&"translate3d(".concat(p.x,"px, ").concat(p.y,"px, 0)"),y;return a[10]!==c||a[11]!==u||a[12]!==d||a[13]!==n||a[14]!==b||a[15]!==f?(y={attributes:n,isDragging:c,listeners:u,setNodeRef:d,transform:b,transition:f},a[10]=c,a[11]=u,a[12]=d,a[13]=n,a[14]=b,a[15]=f,a[16]=y):y=a[16],y},tA=e=>{let t=(0,h.c)(12),{id:n,children:a,disabled:o}=e,r;t[0]!==o||t[1]!==n?(r={id:n,disabled:o},t[0]=o,t[1]=n,t[2]=r):r=t[2];let{attributes:i,isDragging:s,listeners:c,setNodeRef:d,transform:p,transition:f}=tF(r),m=s?"grabbing":"grab",g;return t[3]!==i||t[4]!==a||t[5]!==s||t[6]!==c||t[7]!==d||t[8]!==m||t[9]!==p||t[10]!==f?(g=(0,u.jsx)(l.Fragment,{children:a({attributes:{...i,style:{cursor:m}},isDragging:s,listeners:c,setNodeRef:d,transform:p,transition:f})}),t[3]=i,t[4]=a,t[5]=s,t[6]=c,t[7]=d,t[8]=m,t[9]=p,t[10]=f,t[11]=g):g=t[11],g},tM=e=>{let t,n=(0,h.c)(18),{children:a,className:o,ids:r,onDragEnd:i,onDragStart:s}=e,c=(0,l.useId)(),d;n[0]!==c?(d={id:c},n[0]=c,n[1]=d):d=n[1];let{setNodeRef:p}=(0,g.zM)(d),f;n[2]===Symbol.for("react.memo_cache_sentinel")?(f={activationConstraint:{distance:5}},n[2]=f):f=n[2],n[3]===Symbol.for("react.memo_cache_sentinel")?(t={coordinateGetter:tR},n[3]=t):t=n[3];let m=(0,g.FR)((0,g.MS)(g.AN,f),(0,g.MS)(g.uN,t)),v;n[4]!==r||n[5]!==i?(v=e=>{let{active:t,over:n}=e;e.activatorEvent.stopPropagation(),t&&n&&"function"==typeof i&&i({event:e,moveFromIndex:r.findIndex(e=>e===t.id),moveToIndex:r.findIndex(e=>e===n.id)})},n[4]=r,n[5]=i,n[6]=v):v=n[6];let b=v,y;n[7]!==s?(y=e=>{let{active:t}=e;t&&"function"==typeof s&&s({id:t.id,event:e})},n[7]=s,n[8]=y):y=n[8];let x=y,w;return n[9]!==a||n[10]!==o||n[11]!==b||n[12]!==x||n[13]!==c||n[14]!==r||n[15]!==m||n[16]!==p?(w=(0,u.jsx)(g.Mp,{collisionDetection:g.fp,id:c,onDragEnd:b,onDragStart:x,sensors:m,children:(0,u.jsx)(tS,{items:r,children:(0,u.jsx)("div",{className:o,ref:p,children:a})})}),n[9]=a,n[10]=o,n[11]=b,n[12]=x,n[13]=c,n[14]=r,n[15]=m,n[16]=p,n[17]=w):w=n[17],w},tL="error-pill",tB=e=>{let{className:t,count:n,i18n:a,withMessage:o}=e,l=[tL,!o&&n1?a.t("general:errors"):a.t("general:error"))]})})},tV="field-description",tz=e=>{let t=(0,h.c)(8),{className:n,description:a,marginPlacement:o,path:l}=e,{i18n:r}=(0,s.d)();if(a){let e="field-description-".concat(null==l?void 0:l.replace(/\./g,"__")),i=o&&"".concat(tV,"--margin-").concat(o),s;t[0]!==n||t[1]!==e||t[2]!==i?(s=[tV,n,e,i].filter(Boolean),t[0]=n,t[1]=e,t[2]=i,t[3]=s):s=t[3];let c=s.join(" "),p;return t[4]!==a||t[5]!==r||t[6]!==c?(p=(0,u.jsx)("div",{className:c,children:(0,d.s)(a,r)}),t[4]=a,t[5]=r,t[6]=c,t[7]=p):p=t[7],p}return null},tU=e=>{let t=(0,h.c)(8),{alignCaret:n,message:a,path:o,showError:l}=e,r=void 0===n?"right":n,i=eS(),s;t[0]!==o?(s=e=>{let[t]=e;return t&&(null==t?void 0:t[o])||null},t[0]=o,t[1]=s):s=t[1];let c=eE(s),d;if(t[2]!==r||t[3]!==c||t[4]!==i||t[5]!==a||t[6]!==l){d=Symbol.for("react.early_return_sentinel");e:{let{errorMessage:e,valid:t}=c||{},n=a||e;if((l||i&&!1===t)&&(null==n?void 0:n.length)){d=(0,u.jsx)(tt,{alignCaret:r,className:"field-error",delay:0,staticPositioning:!0,children:n});break e}}t[2]=r,t[3]=c,t[4]=i,t[5]=a,t[6]=l,t[7]=d}else d=t[7];return d!==Symbol.for("react.early_return_sentinel")?d:null},tH=(0,l.createContext)(0),tq=e=>{let t=(0,h.c)(3),{children:n}=e,a=tW()+1,o;return t[0]!==n||t[1]!==a?(o=(0,u.jsx)(tH,{value:a,children:n}),t[0]=n,t[1]=a,t[2]=o):o=t[2],o},tW=()=>(0,l.use)(tH);function tK(){return(tK=Object.assign?Object.assign.bind():function(e){for(var t=1;t(0,l.useContext)(t7);function nt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function nn(e){for(var t=1;t0){var n=e[e.length-1];n!==t&&n.pause()}var a=e.indexOf(t);-1===a||e.splice(a,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},no=function(e){return(null==e?void 0:e.key)==="Tab"||(null==e?void 0:e.keyCode)===9},nl=function(e){return no(e)&&!e.shiftKey},nr=function(e){return no(e)&&e.shiftKey},ni=function(e){return setTimeout(e,0)},ns=function(e,t){var n=-1;return e.every(function(e,a){return!t(e)||(n=a,!1)}),n},nc=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a1?n-1:0),r=1;r=0)e=a.activeElement;else{var t=r.tabbableGroups[0];e=t&&t.firstTabbableNode||u("fallbackFocus")}if(!e)throw Error("Your focus-trap needs to have at least one focusable element");return e},p=function(){if(r.containerGroups=r.containers.map(function(e){var t=(0,s.f)(e,l.tabbableOptions),n=(0,s.g)(e,l.tabbableOptions),a=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,r=n.find(function(e){return(0,s.h)(e)}),i=n.slice().reverse().find(function(e){return(0,s.h)(e)}),c=!!t.find(function(e){return(0,s.e)(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:a,lastTabbableNode:o,firstDomTabbableNode:r,lastDomTabbableNode:i,nextTabbableNode:function(e){var a=!(arguments.length>1)||void 0===arguments[1]||arguments[1],o=t.indexOf(e);return o0}),r.tabbableGroups.length1)throw Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},f=function e(t){var n=t.activeElement;if(n)return n.shadowRoot&&null!==n.shadowRoot.activeElement?e(n.shadowRoot):n},h=function e(t){if(!1!==t&&t!==f(document)){if(!t||!t.focus)return void e(d());t.focus({preventScroll:!!l.preventScroll}),r.mostRecentlyFocusedNode=t,t.tagName&&"input"===t.tagName.toLowerCase()&&"function"==typeof t.select&&t.select()}},m=function(e){var t=u("setReturnFocus",e);return t||!1!==t&&e},g=function(e){var t=e.target,n=e.event,a=e.isBackward,o=void 0!==a&&a;t=t||nu(n),p();var i=null;if(r.tabbableGroups.length>0){var d=c(t,n),f=d>=0?r.containerGroups[d]:void 0;if(d=0){var m=0===h?r.tabbableGroups.length-1:h-1,g=r.tabbableGroups[m];i=(0,s.e)(t)>=0?g.lastTabbableNode:g.lastDomTabbableNode}else no(n)||(i=f.nextTabbableNode(t,!1))}else{var v=ns(r.tabbableGroups,function(e){var n=e.lastTabbableNode;return t===n});if(v=0){var b=v===r.tabbableGroups.length-1?0:v+1,y=r.tabbableGroups[b];i=(0,s.e)(t)>=0?y.firstTabbableNode:y.firstDomTabbableNode}else no(n)||(i=f.nextTabbableNode(t))}}else i=u("fallbackFocus");return i},v=function(e){if(!(c(nu(e),e)>=0)){if(nc(l.clickOutsideDeactivates,e))return void n.deactivate({returnFocus:l.returnFocusOnDeactivate});nc(l.allowOutsideClick,e)||e.preventDefault()}},b=function(e){var t=nu(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(r.mostRecentlyFocusedNode=t);else{e.stopImmediatePropagation();var a,o=!0;if(r.mostRecentlyFocusedNode)if((0,s.e)(r.mostRecentlyFocusedNode)>0){var i=c(r.mostRecentlyFocusedNode),u=r.containerGroups[i].tabbableNodes;if(u.length>0){var p=u.findIndex(function(e){return e===r.mostRecentlyFocusedNode});p>=0&&(l.isKeyForward(r.recentNavEvent)?p+1=0&&(a=u[p-1],o=!1))}}else r.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return(0,s.e)(e)>0})})||(o=!1);else o=!1;o&&(a=g({target:r.mostRecentlyFocusedNode,isBackward:l.isKeyBackward(r.recentNavEvent)})),h(a||r.mostRecentlyFocusedNode||d())}r.recentNavEvent=void 0},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];r.recentNavEvent=e;var n=g({event:e,isBackward:t});n&&(no(e)&&e.preventDefault(),h(n))},x=function(e){if(((null==e?void 0:e.key)==="Escape"||(null==e?void 0:e.key)==="Esc"||(null==e?void 0:e.keyCode)===27)&&!1!==nc(l.escapeDeactivates,e)){e.preventDefault(),n.deactivate();return}(l.isKeyForward(e)||l.isKeyBackward(e))&&y(e,l.isKeyBackward(e))},w=function(e){c(nu(e),e)>=0||nc(l.clickOutsideDeactivates,e)||nc(l.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},C=function(){if(r.active)return na.activateTrap(o,n),r.delayInitialFocusTimer=l.delayInitialFocus?ni(function(){h(d())}):h(d()),a.addEventListener("focusin",b,!0),a.addEventListener("mousedown",v,{capture:!0,passive:!1}),a.addEventListener("touchstart",v,{capture:!0,passive:!1}),a.addEventListener("click",w,{capture:!0,passive:!1}),a.addEventListener("keydown",x,{capture:!0,passive:!1}),n},j=function(){if(r.active)return a.removeEventListener("focusin",b,!0),a.removeEventListener("mousedown",v,!0),a.removeEventListener("touchstart",v,!0),a.removeEventListener("click",w,!0),a.removeEventListener("keydown",x,!0),n},S="u">typeof window&&"MutationObserver"in window?new MutationObserver(function(e){e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===r.mostRecentlyFocusedNode})})&&h(d())}):void 0,_=function(){S&&(S.disconnect(),r.active&&!r.paused&&r.containers.map(function(e){S.observe(e,{subtree:!0,childList:!0})}))};return(n={get active(){return r.active},get paused(){return r.paused},activate:function(e){if(r.active)return this;var t=i(e,"onActivate"),n=i(e,"onPostActivate"),o=i(e,"checkCanFocusTrap");o||p(),r.active=!0,r.paused=!1,r.nodeFocusedBeforeActivation=a.activeElement,null==t||t();var l=function(){o&&p(),C(),_(),null==n||n()};return o?o(r.containers.concat()).then(l,l):l(),this},deactivate:function(e){if(!r.active)return this;var t=nn({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},e);clearTimeout(r.delayInitialFocusTimer),r.delayInitialFocusTimer=void 0,j(),r.active=!1,r.paused=!1,_(),na.deactivateTrap(o,n);var a=i(t,"onDeactivate"),s=i(t,"onPostDeactivate"),c=i(t,"checkCanReturnFocus"),u=i(t,"returnFocus","returnFocusOnDeactivate");null==a||a();var d=function(){ni(function(){u&&h(m(r.nodeFocusedBeforeActivation)),null==s||s()})};return u&&c?c(m(r.nodeFocusedBeforeActivation)).then(d,d):d(),this},pause:function(e){if(r.paused||!r.active)return this;var t=i(e,"onPause"),n=i(e,"onPostPause");return r.paused=!0,null==t||t(),j(),_(),null==n||n(),this},unpause:function(e){if(!r.paused||!r.active)return this;var t=i(e,"onUnpause"),n=i(e,"onPostUnpause");return r.paused=!1,null==t||t(),p(),C(),_(),null==n||n(),this},updateContainerElements:function(e){return r.containers=[].concat(e).filter(Boolean).map(function(e){return"string"==typeof e?a.querySelector(e):e}),r.active&&p(),_(),this}}).updateContainerElements(e),n},nf=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&0>t.indexOf(a)&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,a=Object.getOwnPropertySymbols(e);ot.indexOf(a[o])&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(n[a[o]]=e[a[o]]);return n},nh="modal-item",nm=(a=e=>{let{children:t}=e;return t?"function"==typeof t?(0,u.jsx)(l.Fragment,{children:t(e)}):(0,u.jsx)(l.Fragment,{children:t}):null},e=>{let t=ne(),n=(0,l.useRef)(null),[i,s]=(0,l.useState)(!1),c=(0,l.useRef)(!1),[d,p]=(0,l.useState)(null),{modalState:f,classPrefix:h,containerRef:m,transTime:g,setCloseOnBlur:v,setBodyScrollLock:b,openModal:y}=t,{className:x,htmlElement:w="dialog",slug:C="",closeOnBlur:j=!0,lockBodyScroll:S=!0,classPrefix:_,onEnter:k,onEntering:E,onEntered:N,onExit:D,onExiting:P,onExited:O,openOnInit:T,trapFocus:R=!0,focusTrapOptions:I={}}=e,F=nf(e,["className","htmlElement","slug","closeOnBlur","lockBodyScroll","classPrefix","onEnter","onEntering","onEntered","onExit","onExiting","onExited","openOnInit","trapFocus","focusTrapOptions"]),A=_||h,M=o||C,L=f[M]&&f[M].isOpen;(0,l.useEffect)(()=>{if(R){let e=n.current;!1===c.current&&e&&(p(np(e,Object.assign(Object.assign({},I),{fallbackFocus:(null==I?void 0:I.fallbackFocus)||e,allowOutsideClick:!("u">typeof I.allowOutsideClick)||I.allowOutsideClick}))),c.current=!0)}},[R,i,I]),(0,l.useEffect)(()=>{s(!0)},[]),(0,l.useEffect)(()=>(d&&(L?d.activate():d.deactivate()),()=>{d&&d.deactivate()}),[L,d]),(0,l.useEffect)(()=>{L&&v(j)},[L,j,v]),(0,l.useEffect)(()=>{let e=n.current;return e&&b(!!(L&&S),e),()=>{e&&b(!1,e)}},[L,S,b]);let[B,V]=(0,l.useState)(L);if((0,l.useEffect)(()=>{L?V(L):setTimeout(()=>V(!1),g)},[L,g]),(0,l.useEffect)(()=>{T&&y(M)},[M,T,y]),m.current){let o=A?"".concat(A,"__").concat(nh):nh,l=[o,"".concat(o,"--slug-").concat(M),x].filter(Boolean).join(" "),i=Object.assign({role:"dialog"!==w?"dialog":void 0,open:"dialog"===w?B||L:void 0,"aria-modal":!0,"aria-label":F["aria-labelledby"]?void 0:M},F);return r.createPortal((0,u.jsx)(t8,{nodeRef:n,timeout:g,in:L,classNames:(e=>e?{appear:"".concat(e,"--appear"),appearActive:"".concat(e,"--appearActive"),appearDone:"".concat(e,"--appearDone"),enter:"".concat(e,"--enter"),enterActive:"".concat(e,"--enterActive"),enterDone:"".concat(e,"--enterDone"),exit:"".concat(e,"--exit"),exitActive:"".concat(e,"--exitActive"),exitDone:"".concat(e,"--exitDone")}:{})(o),appear:!0,onEnter:k,onEntering:E,onEntered:N,onExit:D,onExiting:P,onExited:O,children:(0,u.jsx)(w,Object.assign({ref:n,id:(null==F?void 0:F.id)||M,className:l},i,{children:(0,u.jsx)(a,Object.assign({},e,{isOpen:L,modal:t}))}))}),m.current)}return null});"u">typeof window&&(ol={get passive(){}},window.addEventListener("testPassive",null,ol),window.removeEventListener("testPassive",null,ol)),"u">typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints);var ng="gutter",nv=e=>{let{children:t,className:n,left:a=!0,negativeLeft:o=!1,negativeRight:l=!1,ref:r,right:i=!0}=e,s=a&&!o,c=i&&!l;return(0,u.jsx)("div",{className:[ng,s&&"".concat(ng,"--left"),c&&"".concat(ng,"--right"),o&&"".concat(ng,"--negative-left"),l&&"".concat(ng,"--negative-right"),n].filter(Boolean).join(" "),ref:r,children:t})},nb=e=>{let t=(0,h.c)(3),n=(0,l.useId)(),a=tW(),o="".concat(e,"-").concat(n),r;return t[0]!==a||t[1]!==o?(r=nx({slug:o,depth:a}),t[0]=a,t[1]=o,t[2]=r):r=t[2],r},ny="drawer",nx=e=>{let{slug:t,depth:n}=e;return"drawer_".concat(n,"_").concat(t)},nw=e=>{let t=(0,h.c)(4),{slug:n,children:a,className:o,disabled:l,onClick:r,...i}=e,{openModal:s}=ne(),c;return t[0]!==r||t[1]!==s||t[2]!==n?(c=e=>{s(n),"function"==typeof r&&r(e)},t[0]=r,t[1]=s,t[2]=n,t[3]=c):c=t[3],(0,u.jsx)("button",{className:o,disabled:l,onClick:c,type:"button",...i,children:a})},nC=e=>{var t;let n=(0,h.c)(22),{slug:a,children:o,className:r,gutter:i,Header:c,hoverTitle:d,title:p}=e,f=void 0===i||i,{t:m}=(0,s.d)(),{closeModal:g,modalState:v}=ne(),b=n_(),y=!!(null==(t=v[a])?void 0:t.isOpen),[x,w]=(0,l.useState)(y),C,j;if(n[0]!==y?(C=()=>{w(y)},j=[y],n[0]=y,n[1]=C,n[2]=j):(C=n[1],j=n[2]),(0,l.useLayoutEffect)(C,j),y){let e=x&&"".concat(ny,"--is-open"),t=b>1&&"".concat(ny,"--nested"),l;n[3]!==r||n[4]!==e||n[5]!==t?(l=[r,ny,e,t].filter(Boolean),n[3]=r,n[4]=e,n[5]=t,n[6]=l):l=n[6];let i=l.join(" "),h=100+b,v;if(n[7]!==c||n[8]!==o||n[9]!==g||n[10]!==b||n[11]!==f||n[12]!==d||n[13]!==a||n[14]!==m||n[15]!==i||n[16]!==h||n[17]!==p){let e;n[19]!==g||n[20]!==a?(e=()=>g(a),n[19]=g,n[20]=a,n[21]=e):e=n[21],v=(0,u.jsx)(nS,{children:(0,u.jsxs)(nm,{className:i,closeOnBlur:!1,slug:a,style:{zIndex:h},children:[(!b||1===b)&&(0,u.jsx)("div",{className:"".concat(ny,"__blur-bg")}),(0,u.jsx)("button",{"aria-label":m("general:close"),className:"".concat(ny,"__close"),id:"close-drawer__".concat(a),onClick:e,type:"button"}),(0,u.jsxs)("div",{className:"".concat(ny,"__content"),style:{width:"calc(100% - (".concat(b," * var(--gutter-h)))")},children:[(0,u.jsx)("div",{className:"".concat(ny,"__blur-bg-content")}),(0,u.jsxs)(nv,{className:"".concat(ny,"__content-children"),left:f,right:f,children:[c,void 0===c&&(0,u.jsxs)("div",{className:"".concat(ny,"__header"),children:[(0,u.jsx)("h2",{className:"".concat(ny,"__header__title"),title:d?p:null,children:p}),(0,u.jsx)("button",{"aria-label":m("general:close"),className:"".concat(ny,"__header__close"),id:"close-drawer__".concat(a),onClick:()=>g(a),type:"button",children:(0,u.jsx)(s.a,{})})]}),o]})]})]})}),n[7]=c,n[8]=o,n[9]=g,n[10]=b,n[11]=f,n[12]=d,n[13]=a,n[14]=m,n[15]=i,n[16]=h,n[17]=p,n[18]=v}else v=n[18];return v}return null},nj=(0,l.createContext)(1),nS=e=>{let t=(0,h.c)(3),{children:n}=e,a=n_()+1,o;return t[0]!==n||t[1]!==a?(o=(0,u.jsx)(nj,{value:a,children:n}),t[0]=n,t[1]=a,t[2]=o):o=t[2],o},n_=()=>(0,l.use)(nj),nk="confirmation-modal";function nE(e){let t,n=(0,h.c)(25),{body:a,cancelLabel:o,className:r,confirmingLabel:i,confirmLabel:c,heading:d,modalSlug:p,onCancel:f,onConfirm:m}=e,g=n_(),[v,b]=l.useState(!1),{closeModal:y,isModalOpen:x}=ne(),{t:w}=(0,s.d)(),C;n[0]!==y||n[1]!==v||n[2]!==p||n[3]!==m?(C=async()=>{v||(b(!0),"function"==typeof m&&await m(),b(!1),y(p))},n[0]=y,n[1]=v,n[2]=p,n[3]=m,n[4]=C):C=n[4];let j=C,S;n[5]!==y||n[6]!==v||n[7]!==p||n[8]!==f?(S=()=>{v||(y(p),"function"==typeof f&&f())},n[5]=y,n[6]=v,n[7]=p,n[8]=f,n[9]=S):S=n[9];let _=S;if(!x(p))return null;n[10]!==r?(t=[nk,r].filter(Boolean),n[10]=r,n[11]=t):t=n[11];let k=t.join(" "),E=100+g,N;return n[12]!==a||n[13]!==o||n[14]!==c||n[15]!==v||n[16]!==i||n[17]!==d||n[18]!==p||n[19]!==_||n[20]!==j||n[21]!==w||n[22]!==k||n[23]!==E?(N=(0,u.jsx)(nm,{className:k,closeOnBlur:!1,slug:p,style:{zIndex:E},children:(0,u.jsxs)("div",{className:"".concat(nk,"__wrapper"),children:[(0,u.jsxs)("div",{className:"".concat(nk,"__content"),children:["string"==typeof d?(0,u.jsx)("h1",{children:d}):d,"string"==typeof a?(0,u.jsx)("p",{children:a}):a]}),(0,u.jsxs)("div",{className:"".concat(nk,"__controls"),children:[(0,u.jsx)(to,{buttonStyle:"secondary",disabled:v,id:"confirm-cancel",onClick:_,size:"large",type:"button",children:o||w("general:cancel")}),(0,u.jsx)(to,{id:"confirm-action",onClick:j,size:"large",children:v?i||"".concat(w("general:loading"),"..."):c||w("general:confirm")})]})]})}),n[12]=a,n[13]=o,n[14]=c,n[15]=v,n[16]=i,n[17]=d,n[18]=p,n[19]=_,n[20]=j,n[21]=w,n[22]=k,n[23]=E,n[24]=N):N=n[24],N}function nN(e){let t,n=(0,h.c)(4),a=(0,l.useRef)(e),o,r;return n[0]!==e?(o=()=>{a.current=e},r=[e],n[0]=e,n[1]=o,n[2]=r):(o=n[1],r=n[2]),(0,l.useInsertionEffect)(o,r),n[3]===Symbol.for("react.memo_cache_sentinel")?(t=function(){for(var e=arguments.length,t=Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:{headers:{}},n=t&&t.headers?{...t.headers}:{};return fetch(e,{...t,credentials:"include",headers:{...n},method:"delete"})},get:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{headers:{}},n="";return t.params&&(n=v.A(t.params,{addQueryPrefix:!0})),fetch("".concat(e).concat(n),{credentials:"include",...t})},patch:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{headers:{}},n=t&&t.headers?{...t.headers}:{};return fetch(e,{...t,credentials:"include",headers:{...n},method:"PATCH"})},post:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{headers:{}},n=t&&t.headers?{...t.headers}:{},a={...t,credentials:"include",headers:{...n},method:"post"};return fetch("".concat(e),a)},put:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{headers:{}},n=t&&t.headers?{...t.headers}:{};return fetch(e,{...t,credentials:"include",headers:{...n},method:"put"})}},nP=(0,l.createContext)({}),nO=()=>(0,l.use)(nP),nT=(0,l.createContext)({}),nR=(0,l.createContext)({localeIsLoading:!1,setLocaleIsLoading:e=>{}}),nI=()=>(0,l.use)(nT),nF=(e,t,n)=>{if(e)return"field-".concat(e.replace(/\./g,"__")).concat(t>1?"-".concat(t):"").concat(n?"-".concat(n):"")},nA=e=>{let{as:t,hideLocale:n,htmlFor:a,label:o,localized:l,path:r,required:i,unstyled:c}=e,p=void 0===t?"label":t,f=void 0!==c&&c,{uuid:h}=eC(),m=tW(),g=a||nF(r,m,h),{i18n:v}=(0,s.d)(),{code:b,label:y}=nI();return o?(0,u.jsxs)("label"===p?g?"label":"span":p||"span",{className:"field-label".concat(f?" unstyled":""),htmlFor:g,children:[(0,d.s)(o,v),void 0!==i&&i&&!f&&(0,u.jsx)("span",{className:"required",children:"*"}),void 0!==l&&l&&!(void 0!==n&&n)&&(0,u.jsxs)("span",{className:"localized",children:["— ","string"==typeof y?y:b]})]}):null},nM=e=>{let{collapsed:t,rowID:n,rows:a}=e;return a.reduce((e,a)=>(n===a.id&&(a.collapsed=t),a.collapsed&&e.collapsedIDs.push(a.id),e.updatedRows.push(a),e),{collapsedIDs:[],updatedRows:[]})},nL=e=>{let{collapsed:t,rows:n}=e;return n.reduce((e,n)=>(n.collapsed=t,t&&e.collapsedIDs.push(n.id),e.updatedRows.push(n),e),{collapsedIDs:[],updatedRows:[]})},nB=(e,t,n)=>{let a,o=(0,h.c)(9),r;o[0]!==n?(r=void 0===n?[]:n,o[0]=n,o[1]=r):r=o[1];let i=r,s;o[2]===Symbol.for("react.memo_cache_sentinel")?(s=Date.now(),o[2]=s):s=o[2];let c=(0,l.useRef)(s),u;o[3]!==e||o[4]!==t?(u=()=>{let n=setTimeout(()=>{Date.now()-c.current>=t&&(e(),c.current=Date.now())},t-(Date.now()-c.current));return()=>{clearTimeout(n)}},o[3]=e,o[4]=t,o[5]=u):u=o[5],o[6]!==t||o[7]!==i?(a=[t,...i],o[6]=t,o[7]=i,o[8]=a):a=o[8],(0,l.useEffect)(u,a)},nV={},nz={};function nU(e,t){try{let n=(nV[e]||(nV[e]=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format))(t).split("GMT")[1]||"";return n in nz?nz[n]:nq(n,n.split(":"))}catch(n){if(e in nz)return nz[e];let t=null==e?void 0:e.match(nH);return t?nq(e,t.slice(1)):NaN}}var nH=/([+-]\d\d):?(\d\d)?/;function nq(e,t){let n=+t[0],a=+(t[1]||0);return nz[e]=n>0?60*n+a:60*n-a}var nW=class e extends Date{static tz(t){for(var n=arguments.length,a=Array(n>1?n-1:0),o=1;o1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(nU(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),nG(this,NaN),nY(this)):this.setTime(Date.now())}},nK=/^(get|set)(?!UTC)/;function nY(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function nG(e){let t=nU(e.timeZone,e),n=new Date(+e);n.setUTCHours(n.getUTCHours()-1);let a=-new Date(+e).getTimezoneOffset(),o=a- -new Date(+n).getTimezoneOffset(),l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);let r=a-t;r&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+r);let i=nU(e.timeZone,e),s=-new Date(+e).getTimezoneOffset()-i-r;if(i!==t&&s){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let t=i-nU(e.timeZone,e);t&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+t),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+t))}}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!nK.test(e))return;let t=e.replace(nK,"$1UTC");nW.prototype[t]&&(e.startsWith("get")?nW.prototype[e]=function(){return this.internal[t]()}:(nW.prototype[e]=function(){var e;return Date.prototype[t].apply(this.internal,arguments),e=this,Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),nG(e),+this},nW.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),nY(this),+this}))});var n$=Symbol.for("constructDateFrom");function nX(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&n$ in e?e[n$](t):e instanceof Date?new e.constructor(t):new Date(t)}function nZ(e,t){return nX(t||e,e)}var nQ={};function nJ(e,t){var n,a,o,l,r,i,s,c;let u=null!=(c=null!=(s=null!=(i=null!=(r=null==t?void 0:t.weekStartsOn)?r:null==t||null==(a=t.locale)||null==(n=a.options)?void 0:n.weekStartsOn)?i:nQ.weekStartsOn)?s:null==(l=nQ.locale)||null==(o=l.options)?void 0:o.weekStartsOn)?c:0,d=nZ(e,null==t?void 0:t.in),p=d.getDay();return d.setDate(d.getDate()-(7*(p=l.getTime()?a+1:n.getTime()>=i.getTime()?a:a-1}function n3(e){let t=nZ(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-n}function n2(e,t){let n=nZ(e,null==t?void 0:t.in);return n.setHours(0,0,0,0),n}function n6(e,t){var n,a,o,l,r,i,s,c;let u=nZ(e,null==t?void 0:t.in),d=u.getFullYear(),p=null!=(c=null!=(s=null!=(i=null!=(r=null==t?void 0:t.firstWeekContainsDate)?r:null==t||null==(a=t.locale)||null==(n=a.options)?void 0:n.firstWeekContainsDate)?i:nQ.firstWeekContainsDate)?s:null==(l=nQ.locale)||null==(o=l.options)?void 0:o.firstWeekContainsDate)?c:1,f=nX((null==t?void 0:t.in)||e,0);f.setFullYear(d+1,0,p),f.setHours(0,0,0,0);let h=nJ(f,t),m=nX((null==t?void 0:t.in)||e,0);m.setFullYear(d,0,p),m.setHours(0,0,0,0);let g=nJ(m,t);return+u>=+h?d+1:+u>=+g?d:d-1}function n5(e,t){let n=Math.abs(e).toString().padStart(t,"0");return(e0?n:1-n;return n5("yy"===t?a%100:a,t.length)},M(e,t){let n=e.getMonth();return"M"===t?String(n+1):n5(n+1,2)},d:(e,t)=>n5(e.getDate(),t.length),a(e,t){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>n5(e.getHours()%12||12,t.length),H:(e,t)=>n5(e.getHours(),t.length),m:(e,t)=>n5(e.getMinutes(),t.length),s:(e,t)=>n5(e.getSeconds(),t.length),S(e,t){let n=t.length;return n5(Math.trunc(e.getMilliseconds()*Math.pow(10,n-3)),t.length)}},n9={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},n8={G:function(e,t,n){let a=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});default:return n.era(a,{width:"wide"})}},y:function(e,t,n){if("yo"===t){let t=e.getFullYear();return n.ordinalNumber(t>0?t:1-t,{unit:"year"})}return n4.y(e,t)},Y:function(e,t,n,a){let o=n6(e,a),l=o>0?o:1-o;return"YY"===t?n5(l%100,2):"Yo"===t?n.ordinalNumber(l,{unit:"year"}):n5(l,t.length)},R:function(e,t){return n5(n1(e),t.length)},u:function(e,t){return n5(e.getFullYear(),t.length)},Q:function(e,t,n){let a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return n5(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,n){let a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return n5(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,n){let a=e.getMonth();switch(t){case"M":case"MM":return n4.M(e,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,n){let a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return n5(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,n,a){var o,l,r,i,s,c,u,d;let p,f,h,m,g=Math.round((nJ(m=nZ(e,null==a?void 0:a.in),a)-(p=null!=(d=null!=(u=null!=(c=null!=(s=null==a?void 0:a.firstWeekContainsDate)?s:null==a||null==(l=a.locale)||null==(o=l.options)?void 0:o.firstWeekContainsDate)?c:nQ.firstWeekContainsDate)?u:null==(i=nQ.locale)||null==(r=i.options)?void 0:r.firstWeekContainsDate)?d:1,f=n6(m,a),(h=nX((null==a?void 0:a.in)||m,0)).setFullYear(f,0,p),h.setHours(0,0,0,0),nJ(h,a)))/6048e5)+1;return"wo"===t?n.ordinalNumber(g,{unit:"week"}):n5(g,t.length)},I:function(e,t,n){var a;let o,l,r,i=Math.round((n0(r=nZ(e,void 0))-(o=n1(r,void 0),(l=nX((null==a?void 0:a.in)||r,0)).setFullYear(o,0,4),l.setHours(0,0,0,0),n0(l)))/6048e5)+1;return"Io"===t?n.ordinalNumber(i,{unit:"week"}):n5(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):n4.d(e,t)},D:function(e,t,n){let a,o,l=function(e,t,n){let[a,o]=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a"object"==typeof e));return n.map(o)}(void 0,e,t),l=n2(a),r=n2(o);return Math.round((l-n3(l)-(r-n3(r)))/864e5)}(a=nZ(e,void 0),((o=nZ(a,void 0)).setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o))+1;return"Do"===t?n.ordinalNumber(l,{unit:"dayOfYear"}):n5(l,t.length)},E:function(e,t,n){let a=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,n,a){let o=e.getDay(),l=(o-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return n5(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,a){let o=e.getDay(),l=(o-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return n5(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){let a=e.getDay(),o=0===a?7:a;switch(t){case"i":return String(o);case"ii":return n5(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,n){let a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){let a=e.getHours(),o;switch(o=12===a?n9.noon:0===a?n9.midnight:a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){let a=e.getHours(),o;switch(o=a>=17?n9.evening:a>=12?n9.afternoon:a>=4?n9.morning:n9.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return n4.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):n4.H(e,t)},K:function(e,t,n){let a=e.getHours()%12;return"Ko"===t?n.ordinalNumber(a,{unit:"hour"}):n5(a,t.length)},k:function(e,t,n){let a=e.getHours();return 0===a&&(a=24),"ko"===t?n.ordinalNumber(a,{unit:"hour"}):n5(a,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):n4.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):n4.s(e,t)},S:function(e,t){return n4.S(e,t)},X:function(e,t,n){let a=e.getTimezoneOffset();if(0===a)return"Z";switch(t){case"X":return ae(a);case"XXXX":case"XX":return at(a);default:return at(a,":")}},x:function(e,t,n){let a=e.getTimezoneOffset();switch(t){case"x":return ae(a);case"xxxx":case"xx":return at(a);default:return at(a,":")}},O:function(e,t,n){let a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+n7(a,":");default:return"GMT"+at(a,":")}},z:function(e,t,n){let a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+n7(a,":");default:return"GMT"+at(a,":")}},t:function(e,t,n){return n5(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return n5(+e,t.length)}};function n7(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=e>0?"-":"+",a=Math.abs(e),o=Math.trunc(a/60),l=a%60;return 0===l?n+String(o):n+String(o)+t+n5(l,2)}function ae(e,t){return e%60==0?(e>0?"-":"+")+n5(Math.abs(e)/60,2):at(e,t)}function at(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=Math.abs(e);return(e>0?"-":"+")+n5(Math.trunc(n/60),2)+t+n5(n%60,2)}var an=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},aa=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},ao={p:aa,P:(e,t)=>{let n,a=e.match(/(P+)(p+)?/)||[],o=a[1],l=a[2];if(!l)return an(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",an(o,t)).replace("{{time}}",aa(l,t))}},al=/^D+$/,ar=/^Y+$/,ai=["D","DD","YY","YYYY"],as=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ac=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,au=/^'([^]*?)'?$/,ad=/''/g,ap=/[a-zA-Z]/;function af(e,t,n){var a,o,l,r,i,c,u,d,p,f,h,m,g,v,b,y,x,w;let C=null!=(f=null!=(p=null==n?void 0:n.locale)?p:nQ.locale)?f:s.b,j=null!=(v=null!=(g=null!=(m=null!=(h=null==n?void 0:n.firstWeekContainsDate)?h:null==n||null==(o=n.locale)||null==(a=o.options)?void 0:a.firstWeekContainsDate)?m:nQ.firstWeekContainsDate)?g:null==(r=nQ.locale)||null==(l=r.options)?void 0:l.firstWeekContainsDate)?v:1,S=null!=(w=null!=(x=null!=(y=null!=(b=null==n?void 0:n.weekStartsOn)?b:null==n||null==(c=n.locale)||null==(i=c.options)?void 0:i.weekStartsOn)?y:nQ.weekStartsOn)?x:null==(d=nQ.locale)||null==(u=d.options)?void 0:u.weekStartsOn)?w:0,_=nZ(e,null==n?void 0:n.in);if(!(_ instanceof Date||"object"==typeof _&&"[object Date]"===Object.prototype.toString.call(_))&&"number"!=typeof _||isNaN(+nZ(_)))throw RangeError("Invalid time value");let k=t.match(ac).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,ao[t])(e,C.formatLong):e}).join("").match(as).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var n;let t;return{isToken:!1,value:(t=(n=e).match(au))?t[1].replace(ad,"'"):n}}if(n8[t])return{isToken:!0,value:e};if(t.match(ap))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});C.localize.preprocessor&&(k=C.localize.preprocessor(_,k));let E={firstWeekContainsDate:j,weekStartsOn:S,locale:C};return k.map(a=>{if(!a.isToken)return a.value;let o=a.value;return(!(null==n?void 0:n.useAdditionalWeekYearTokens)&&ar.test(o)||!(null==n?void 0:n.useAdditionalDayOfYearTokens)&&al.test(o))&&function(e,t,n){var a,o,l;let r,i=(a=e,o=t,l=n,r="Y"===a[0]?"years":"days of the month","Use `".concat(a.toLowerCase(),"` instead of `").concat(a,"` (in `").concat(o,"`) for formatting ").concat(r," to the input `").concat(l,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(console.warn(i),ai.includes(e))throw RangeError(i)}(o,t,String(e)),(0,n8[o[0]])(_,o,C.localize,E)}).join("")}function ah(e,t){var n,a;let o="function"==typeof(n=t)&&(null==(a=n.prototype)?void 0:a.constructor)===n?new t(0):nX(t,0);return o.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),o.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),o}var am=e=>{let{date:t,i18n:n,pattern:a,timezone:o}=e,l=new nW(new Date(t));if(o){let e=nW.tz(o),t=ah(l.withTimeZone(o),e);return n.dateFNS?af(t,a,{locale:n.dateFNS}):"".concat(n.t("general:loading"),"...")}return n.dateFNS?af(l,a,{locale:n.dateFNS}):"".concat(n.t("general:loading"),"...")};function ag(e){return"object"==typeof e&&"root"in e}function av(e,t){for(let n of e)"text"in n&&n.text?t+=n.text:"children"in n||(t+="[".concat(n.type,"]")),"children"in n&&n.children&&(t+=av(n.children,t));return t}var ab=e=>{var t,n,a,o,l,r,i;let s,{collectionConfig:c,data:u,dateFormat:p,fallback:f,globalConfig:h,i18n:m}=e;if(c){let e=null==c||null==(l=c.admin)?void 0:l.useAsTitle;if(e&&(s=null==u?void 0:u[e])){let t=c.fields.find(t=>"name"in t&&t.name===e),n=(null==t?void 0:t.type)==="date",a=(null==t?void 0:t.type)==="relationship";n&&(s=am({date:s,i18n:m,pattern:"date"in t.admin&&(null==t||null==(i=t.admin)||null==(r=i.date)?void 0:r.displayFormat)||p})||s),a&&(s=(e=>Array.isArray(e)?e.map(e=>"object"==typeof e&&null!==e?e.id:String(e)).filter(Boolean).join(", "):"object"==typeof e&&null!==e?e.id||"":String(e))(u[e]))}}return h&&(s=(0,d.s)(null==h?void 0:h.label,m)||(null==h?void 0:h.slug)),s&&ag(s)&&(s=av((null==(n=s.root.children)||null==(t=n[0])?void 0:t.children)||[],"")),!s&&ag(f)&&(s=av((null==(o=f.root.children)||null==(a=o[0])?void 0:a.children)||[],"")),s||(s="string"==typeof f?f:"[".concat(m.t("general:untitled"),"]")),s},ay=(0,l.createContext)({}),ax=e=>{let{children:t}=e,{id:n,collectionSlug:a,data:o,docConfig:r,globalSlug:c,initialData:d}=aE(),{config:{admin:{dateFormat:p}}}=(0,i.c)(),{i18n:f}=(0,s.d)(),[h,m]=(0,l.useState)(()=>ab({collectionConfig:a?r:void 0,data:{...d||{},id:n},dateFormat:p,fallback:null==n?void 0:n.toString(),globalConfig:c?r:void 0,i18n:f}));return(0,l.useEffect)(()=>{m(ab({collectionConfig:a?r:void 0,data:{...o,id:n},dateFormat:p,fallback:null==n?void 0:n.toString(),globalConfig:c?r:void 0,i18n:f}))},[o,p,f,n,a,r,c]),(0,u.jsx)(ay,{value:{setDocumentTitle:m,title:h},children:t})},aw=(0,l.createContext)({}),aC=()=>(0,l.use)(aw),aj=l.createContext({getUploadEdits:()=>{},resetUploadEdits:void 0,updateUploadEdits:void 0,uploadEdits:void 0}),aS=e=>{let t=(0,h.c)(10),{children:n,initialUploadEdits:a}=e,o;t[0]!==a?(o=a||{},t[0]=a,t[1]=o):o=t[1];let[r,i]=l.useState(o),s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{i({})},t[2]=s):s=t[2];let c=s,d;t[3]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{i(t=>({...t||{},...e||{}}))},t[3]=d):d=t[3];let p=d,f;t[4]!==r?(f=()=>r,t[4]=r,t[5]=f):f=t[5];let m=f,g;return t[6]!==n||t[7]!==m||t[8]!==r?(g=(0,u.jsx)(aj,{value:{getUploadEdits:m,resetUploadEdits:c,updateUploadEdits:p,uploadEdits:r},children:n}),t[6]=n,t[7]=m,t[8]=r,t[9]=g):g=t[9],g},a_=e=>{let{collectionSlug:t,docPermissions:n,globalSlug:a,isEditing:o}=e;return t?!!(o&&(null==n?void 0:n.update)||!o&&(null==n?void 0:n.create)):!!a&&!!(null==n?void 0:n.update)},ak=(0,l.createContext)({}),aE=()=>(0,l.use)(ak),aN=e=>{let{children:t,...n}=e,{id:a,collectionSlug:o,currentEditor:r,docPermissions:c,globalSlug:d,hasPublishedDoc:p,hasPublishPermission:f,hasSavePermission:h,initialData:m,initialState:g,isLocked:b,lastUpdateTime:y,mostRecentVersionIsAutosaved:x,unpublishedVersionCount:w,versionCount:C}=n,[j,S]=(0,i.a)(c),[_,k]=(0,i.a)(h),[E,N]=(0,i.a)(f),{permissions:D}=nO(),{config:{admin:{dateFormat:P},routes:{api:O},serverURL:T},getEntityConfig:R}=(0,i.c)(),I=R({collectionSlug:o}),F=R({globalSlug:d}),A=(0,l.useRef)(new AbortController),M=I||F,{i18n:L}=(0,s.d)(),{uploadEdits:B}=l.use(aj),[V,z]=(0,l.useState)(()=>ab({collectionConfig:I,data:{...m||{},id:a},dateFormat:P,fallback:null==a?void 0:a.toString(),globalConfig:F,i18n:L})),[U,H]=(0,l.useState)(x),[q,W]=(0,l.useState)(C),[K,Y]=(0,l.useState)(p),[G,$]=(0,l.useState)(w),[X,Z]=(0,i.a)(b),[Q,J]=(0,i.a)(r),[ee,et]=(0,i.a)(y),[en,ea]=(0,i.a)(m),[eo,el]=(0,i.a)("idle"),er=(0,l.useRef)({hasShownLockedModal:!1,isLocked:!1,user:null}),ei=(0,l.useCallback)(e=>{el(e)},[el]),{getPreference:es,setPreference:ec}=aC(),{code:eu}=nI(),{localeIsLoading:ed}=(0,l.use)(nR),ep=(0,l.useMemo)(()=>void 0===g||void 0===m||ed,[m,g,ed]),ef="".concat(T).concat(O),eh,em,eg;d&&(eh=d,em="globals",eg="global-".concat(eh)),o&&(eh=o,em="collections",a&&(eg="collection-".concat(eh,"-").concat(a)));let ev=(0,l.useCallback)(async(e,t)=>{try{let n=t===d,a=await nD.get("".concat(T).concat(O,"/payload-locked-documents"),{credentials:"include",params:n?{"where[globalSlug][equals]":t}:{"where[document.relationTo][equals]":t,"where[document.value][equals]":e}}),{docs:o}=await a.json();if((null==o?void 0:o.length)>0){let e=o[0].id;await nD.delete("".concat(T).concat(O,"/payload-locked-documents/").concat(e),{credentials:"include",headers:{"Content-Type":"application/json"}}),Z(!1)}}catch(e){console.error("Failed to unlock the document",e)}},[T,O,d,Z]),eb=(0,l.useCallback)(async(e,t,n)=>{try{let a=t===d,o=await nD.get("".concat(T).concat(O,"/payload-locked-documents"),{credentials:"include",params:a?{"where[globalSlug][equals]":t}:{"where[document.relationTo][equals]":t,"where[document.value][equals]":e}}),{docs:l}=await o.json();if((null==l?void 0:l.length)>0){let e=l[0].id,t="object"==typeof n?{relationTo:n.collection,value:n.id}:{relationTo:"users",value:n};await nD.patch("".concat(T).concat(O,"/payload-locked-documents/").concat(e),{body:JSON.stringify({user:t}),credentials:"include",headers:{"Content-Type":"application/json"}})}}catch(e){console.error("Failed to update the document editor",e)}},[T,O,d]),ey=(e=>{let{id:t,api:n,collectionSlug:a,globalSlug:o,i18n:r,locale:i,permissions:s,serverURL:c,setDocPermissions:u,setHasPublishPermission:d,setHasSavePermission:p}=e;return l.useCallback(async e=>{let l={locale:i||void 0},f=(null==e?void 0:e.id)||t,h=(e=>{let{id:t,collectionSlug:n,globalSlug:a}=e;return!!(a||n&&t)})({id:f,collectionSlug:a,globalSlug:o});if(h){let t=a?"/".concat(a,"/access/").concat(f):o?"/globals/".concat(o,"/access"):null;if(t){let i=await (await fetch("".concat(c).concat(n).concat(t,"?").concat(v.A(l)),{body:JSON.stringify({...e||{},_status:"draft"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"post"})).json(),s=await fetch("".concat(c).concat(n).concat(t,"?").concat(v.A(l)),{body:JSON.stringify({...e||{},_status:"published"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"POST"}).then(e=>e.json());u(i),p(a_({collectionSlug:a,docPermissions:i,globalSlug:o,isEditing:h})),d(null==s?void 0:s.update)}}else{var m,g;let e=a?null==s||null==(m=s.collections)?void 0:m[a]:null==s||null==(g=s.globals)?void 0:g[o];u(e),p(a_({collectionSlug:a,docPermissions:e,globalSlug:o,isEditing:h}))}},[i,t,a,o,c,n,r.language,u,p,d,null==s?void 0:s.collections,null==s?void 0:s.globals])})({id:a,api:O,collectionSlug:o,globalSlug:d,i18n:L,locale:eu,permissions:D,serverURL:T,setDocPermissions:S,setHasPublishPermission:N,setHasSavePermission:k}),ex=(0,l.useCallback)(()=>es(eg),[es,eg]),ew=(0,l.useCallback)(async(e,t)=>{let n=await ex();if(eg)try{var a;await ec(eg,{...n,fields:{...(null==n?void 0:n.fields)||{},[e]:{...null==n||null==(a=n.fields)?void 0:a[e],...t}}})}catch(e){console.error(e)}},[ec,eg,ex]),eC=(0,l.useCallback)(()=>{let e=q+1;I&&I.versions?I.versions.maxPerDoc>0?W(Math.min(e,I.versions.maxPerDoc)):W(e):F&&F.versions&&(F.versions.max>0?W(Math.min(e,F.versions.max)):W(e))},[I,F,q]);(0,l.useEffect)(()=>{z(ab({collectionConfig:I,data:{...en,id:a},dateFormat:P,fallback:null==a?void 0:a.toString(),globalConfig:F,i18n:L}))},[I,F,en,P,L,a]),(0,l.useEffect)(()=>{let e=A.current;return()=>{if(e)try{e.abort()}catch(e){}}},[]);let ej=l.useMemo(()=>"".concat("".concat(ef).concat("globals"===em?"/globals":"","/").concat(eh).concat(a?"/".concat(a):"")).concat(v.A({depth:0,"fallback-locale":"null",locale:eu,uploadEdits:B||void 0},{addQueryPrefix:!0})),[ef,eu,em,a,eh,B]),eS={...n,action:ej,currentEditor:Q,data:en,docConfig:M,docPermissions:j,documentIsLocked:X,documentLockState:er,getDocPermissions:ey,getDocPreferences:ex,hasPublishedDoc:K,hasPublishPermission:E,hasSavePermission:_,incrementVersionCount:eC,initialData:m,initialState:g,isInitializing:ep,lastUpdateTime:ee,mostRecentVersionIsAutosaved:U,preferencesKey:eg,savedDocumentData:en,setCurrentEditor:J,setData:ea,setDocFieldPreferences:ew,setDocumentIsLocked:Z,setDocumentTitle:z,setHasPublishedDoc:Y,setLastUpdateTime:et,setMostRecentVersionIsAutosaved:H,setUnpublishedVersionCount:$,setUploadStatus:ei,title:V,unlockDocument:ev,unpublishedVersionCount:G,updateDocumentEditor:eb,updateSavedDocumentData:ea,uploadStatus:eo,versionCount:q};return(0,u.jsx)(ak,{value:eS,children:(0,u.jsx)(ax,{children:t})})},aD=e=>(0,u.jsx)(aS,{children:(0,u.jsx)(aN,{...e})}),aP=(0,l.createContext)(""),aO=e=>{let{children:t,operation:n}=e;return(0,u.jsx)(aP,{value:n,children:t})},aT=()=>(0,l.use)(aP),aR=l.createContext(void 0),aI=()=>{let e=l.useContext(aR);if(e)return e},aF=l.createContext(void 0),aA=e=>{let t=aI(),n=l.use(aF),a=l.useRef(null);if(null===a.current){let o=(null==e?void 0:e.path)||t||e.potentiallyStalePath;a.current=!!(n&&o&&n.path===o)}if(!0===a.current){if(!n)throw Error("FieldContext was removed after mount. This breaks hook ordering.");return n}return(e=>{let t=(0,h.c)(65),n;t[0]!==e?(n=e||{},t[0]=e,t[1]=n):n=t[1];let{disableFormData:a,hasRows:o,path:r,potentiallyStalePath:c,validate:u}=n,d=void 0!==a&&a,p=aI(),f=r||p||c,m=eS(),g=e_(),v=ek(),{user:b}=nO(),{id:y,collectionSlug:x}=aE(),w=aT(),C=eE(aM),j;t[2]!==f?(j=e=>{let[t]=e;return t&&(null==t?void 0:t[f])||null},t[2]=f,t[3]=j):j=t[3];let S=eE(j),{t:_}=(0,s.d)(),{config:k}=(0,i.c)(),{getData:E,getDataByPath:N,getSiblingData:D,setModified:P}=eC(),O=ej(),T=null==S?void 0:S.filterOptions,R=null==S?void 0:S.value,I=null==S?void 0:S.initialValue,F="boolean"!=typeof(null==S?void 0:S.valid)||S.valid,A=!1===F&&m,M=(0,l.useRef)(F),L=(0,l.useRef)(null==S?void 0:S.errorMessage),B;t[4]!==f?(B=f?f.split("."):[],t[4]=f,t[5]=B):B=t[5];let V=B,z;t[6]!==d||t[7]!==C||t[8]!==o||t[9]!==f||t[10]!==P?(z=(e,t)=>{let n=e&&"object"==typeof e&&"function"==typeof e.preventDefault&&"function"==typeof e.stopPropagation?e.target.value:e;C({type:"UPDATE",disableFormData:d||o&&n>0,path:f,value:n}),void 0!==t&&t||P(!0)},t[6]=d,t[7]=C,t[8]=o,t[9]=f,t[10]=P,t[11]=z):z=t[11];let U=z,H=null==S?void 0:S.blocksFilterOptions,q=null==S?void 0:S.customComponents,W=g||v,K=null==S?void 0:S.errorMessage,Y;t[12]!==(null==S?void 0:S.errorPaths)?(Y=(null==S?void 0:S.errorPaths)||[],t[12]=null==S?void 0:S.errorPaths,t[13]=Y):Y=t[13];let G=null==S?void 0:S.rows,$=null==S?void 0:S.selectFilterOptions,X=null==S?void 0:S.valid,Z;t[14]!==T||t[15]!==I||t[16]!==v||t[17]!==f||t[18]!==g||t[19]!==U||t[20]!==A||t[21]!==m||t[22]!==G||t[23]!==$||t[24]!==X||t[25]!==H||t[26]!==q||t[27]!==W||t[28]!==K||t[29]!==Y||t[30]!==R?(Z={blocksFilterOptions:H,customComponents:q,disabled:W,errorMessage:K,errorPaths:Y,filterOptions:T,formInitializing:v,formProcessing:g,formSubmitted:m,initialValue:I,path:f,rows:G,selectFilterOptions:$,setValue:U,showError:A,valid:X,value:R},t[14]=T,t[15]=I,t[16]=v,t[17]=f,t[18]=g,t[19]=U,t[20]=A,t[21]=m,t[22]=G,t[23]=$,t[24]=X,t[25]=H,t[26]=q,t[27]=W,t[28]=K,t[29]=Y,t[30]=R,t[31]=Z):Z=t[31];let Q=Z,J;t[32]!==x||t[33]!==k||t[34]!==d||t[35]!==C||t[36]!==O||t[37]!==S||t[38]!==E||t[39]!==N||t[40]!==D||t[41]!==o||t[42]!==y||t[43]!==w||t[44]!==f||t[45]!==V||t[46]!==_||t[47]!==b||t[48]!==u||t[49]!==R?(J=()=>{(async()=>{let e=R;(null==S?void 0:S.rows)&&Array.isArray(S.rows)&&(e=N(f));let t=L.current,n=M.current,a=E(),l="function"==typeof u?await u(e,{id:y,blockData:void 0,collectionSlug:x,data:(null==O?void 0:O.getData)?O.getData():a,event:"onChange",operation:w,path:V,preferences:{},req:{payload:{config:k},t:_,user:b},siblingData:D(f)}):"string"==typeof L.current?L.current:M.current;if("string"==typeof l?(n=!1,t=l):"boolean"==typeof l&&(n=l,t=void 0),n!==M.current||t!==L.current){M.current=n,L.current=t;let e={type:"UPDATE",errorMessage:t,path:f,rows:null==S?void 0:S.rows,valid:n,validate:u,value:R};(d||o&&"number"==typeof R&&R>0)&&(e.disableFormData=!0),"function"==typeof C&&C(e)}})()},t[32]=x,t[33]=k,t[34]=d,t[35]=C,t[36]=O,t[37]=S,t[38]=E,t[39]=N,t[40]=D,t[41]=o,t[42]=y,t[43]=w,t[44]=f,t[45]=V,t[46]=_,t[47]=b,t[48]=u,t[49]=R,t[50]=J):J=t[50];let ee=null==S?void 0:S.rows,et;return t[51]!==x||t[52]!==d||t[53]!==C||t[54]!==E||t[55]!==N||t[56]!==D||t[57]!==y||t[58]!==w||t[59]!==f||t[60]!==ee||t[61]!==b||t[62]!==u||t[63]!==R?(et=[R,d,C,E,D,N,y,w,f,b,u,ee,x],t[51]=x,t[52]=d,t[53]=C,t[54]=E,t[55]=N,t[56]=D,t[57]=y,t[58]=w,t[59]=f,t[60]=ee,t[61]=b,t[62]=u,t[63]=R,t[64]=et):et=t[64],nB(J,150,et),Q})(e)};function aM(e){let[,t]=e;return t}var aL=e=>{let t=(0,h.c)(2),{children:n,path:a}=e,o;t[0]!==a?(o=e=>{let[t]=e;return t&&(null==t?void 0:t[a])||null},t[0]=a,t[1]=o):o=t[1];let{passesCondition:l}=eE(o)||{};return!1===l?null:n},aB=e=>t=>{let{path:n}=t;return(0,u.jsx)(aL,{path:n,children:(0,u.jsx)(e,{...t})})},aV=e=>{var t,n,a,o;return{...(null==e||null==(t=e.admin)?void 0:t.style)||{},...(null==e||null==(n=e.admin)?void 0:n.width)?{"--field-width":e.admin.width}:{flex:"1 1 auto"},...(null==e||null==(o=e.admin)||null==(a=o.style)?void 0:a.flex)?{flex:e.admin.style.flex}:{}}},az="field-type";function aU(e){let{fieldLocalized:t,fieldRTL:n,locale:a,localizationConfig:o}=e,l=a&&o&&o.locales&&o.locales.length>1,r=(null==a?void 0:a.code)===(null==o?void 0:o.defaultLocale);return!1!==n&&(null==a?void 0:a.rtl)===!0&&(t||!t&&!l||!t&&r)||!0===n}var aH=()=>(0,u.jsx)("svg",{className:"icon icon--check",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{className:"stroke",d:"M15.3333 6.00001L8.00001 13.3333L4.66667 10",strokeLinecap:"square"})}),aq=()=>(0,u.jsx)("svg",{className:"icon icon--line",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{className:"stroke",d:"M5.33333 10H14.6667",strokeLinecap:"square"})}),aW="checkbox-input",aK=e=>{let t=(0,h.c)(22),{id:n,name:a,AfterInput:o,BeforeInput:r,checked:i,className:s,inputRef:c,Label:d,label:p,localized:f,onToggle:m,partialChecked:g,readOnly:v,required:b}=e,y=(0,l.useId)(),x=n||y,w=i&&"".concat(aW,"--checked"),C=v&&"".concat(aW,"--read-only"),j;t[0]!==s||t[1]!==w||t[2]!==C?(j=[s,aW,w,C].filter(Boolean),t[0]=s,t[1]=w,t[2]=C,t[3]=j):j=t[3];let S=j.join(" "),_=!!i,k;if(t[4]!==o||t[5]!==r||t[6]!==d||t[7]!==i||t[8]!==x||t[9]!==c||t[10]!==p||t[11]!==f||t[12]!==a||t[13]!==m||t[14]!==g||t[15]!==v||t[16]!==b||t[17]!==S||t[18]!==_){let e=(0,u.jsx)("input",{"aria-label":"","aria-labelledby":a,defaultChecked:_,disabled:v,id:x,name:a,onInput:m,ref:c,required:b,title:a,type:"checkbox"}),n=!i&&g?"partial":"check",l;t[20]!==n?(l=["".concat(aW,"__icon"),n].filter(Boolean),t[20]=n,t[21]=l):l=t[21],k=(0,u.jsxs)("div",{className:S,children:[(0,u.jsxs)("div",{className:"".concat(aW,"__input"),children:[r,e,(0,u.jsxs)("span",{className:l.join(" "),children:[i&&(0,u.jsx)(aH,{}),!i&&g&&(0,u.jsx)(aq,{})]}),o]}),(0,u.jsx)(el,{CustomComponent:d,Fallback:(0,u.jsx)(nA,{htmlFor:x,label:p,localized:f,required:b})})]}),t[4]=o,t[5]=r,t[6]=d,t[7]=i,t[8]=x,t[9]=c,t[10]=p,t[11]=f,t[12]=a,t[13]=m,t[14]=g,t[15]=v,t[16]=b,t[17]=S,t[18]=_,t[19]=k}else k=t[19];return k},aY="checkbox",aG=aB(e=>{let{id:t,checked:n,disableFormData:a,field:o,field:{admin:{className:r,description:i}={},label:c,required:d}={},onChange:p,partialChecked:f,path:h,readOnly:m,validate:g}=e,{uuid:v}=eC(),y=tW(),{i18n:{language:x}}=(0,s.d)(),w=b.aG.includes(x),{customComponents:{AfterInput:C,BeforeInput:j,Description:S,Error:_,Label:k}={},disabled:E,path:N,setValue:D,showError:P,value:O}=aA({disableFormData:a,potentiallyStalePath:h,validate:(0,l.useCallback)((e,t)=>{if("function"==typeof g)return g(e,{...t,required:d})},[g,d])}),T=(0,l.useCallback)(()=>{m||(D(!O),"function"==typeof p&&p(!O))},[p,m,D,O]),R=n||!!O,I=t||nF(N,y,v),F=(0,l.useMemo)(()=>aV(o),[o]);return(0,u.jsxs)("div",{className:[az,aY,P&&"error",r,O&&"".concat(aY,"--checked"),(m||E)&&"".concat(aY,"--read-only")].filter(Boolean).join(" "),style:F,children:[(0,u.jsx)(el,{CustomComponent:_,Fallback:(0,u.jsx)(tU,{alignCaret:w?"right":"left",path:N,showError:P})}),(0,u.jsx)(aK,{AfterInput:C,BeforeInput:j,checked:R,id:I,inputRef:null,Label:k,label:c,name:N,onToggle:T,partialChecked:f,readOnly:m||E,required:d}),(0,u.jsx)(el,{CustomComponent:S,Fallback:(0,u.jsx)(tz,{description:i,path:N})})]})}),a$=e=>{let t,n,a=(0,h.c)(13),{fieldValue:o,localized:r,path:c,readOnly:d}=e,p=void 0!==d&&d,{code:f}=nI(),{config:m}=(0,i.c)(),{localization:g}=m,[v,b]=l.useState("number"!=typeof o),{t:y}=(0,s.d)(),{dispatchFields:x,setModified:w}=eC();if(!r||!g||g.defaultLocale===f||!g.fallback)return null;a[0]!==v||a[1]!==x||a[2]!==o||a[3]!==c||a[4]!==w?(t=()=>{let e=!v;x({type:"UPDATE",path:c,value:e?null:o||0}),w(!0),b(e)},a[0]=v,a[1]=x,a[2]=o,a[3]=c,a[4]=w,a[5]=t):t=a[5];let C=t;if(o){let e=!1;if("number"==typeof o&&o>0&&(e=!0),Array.isArray(o)&&o.length>0&&(e=!0),e)return v&&b(!1),null}return a[6]!==v||a[7]!==o||a[8]!==C||a[9]!==c||a[10]!==p||a[11]!==y?(n=(0,u.jsx)(eH,{className:"nullify-locale-field",children:!o&&p?y("general:fallbackToDefaultLocale"):(0,u.jsx)(aG,{checked:v,field:{name:"",label:y("general:fallbackToDefaultLocale")},id:"field-".concat(c.replace(/\./g,"__")),onChange:C,path:c,schemaPath:""})}),a[6]=v,a[7]=o,a[8]=C,a[9]=c,a[10]=p,a[11]=y,a[12]=n):n=a[12],n},aX=e=>{let t=document.getElementById(e);if(t){let e=t.getBoundingClientRect();window.scrollBy({behavior:"smooth",top:e.top-100})}},aZ="array-actions",aQ=e=>{let t=(0,h.c)(12),{addRow:n,copyRow:a,duplicateRow:o,hasMaxRows:r,index:i,isSortable:c,moveRow:d,pasteRow:p,removeRow:f,rowCount:m}=e,{t:g}=(0,s.d)(),v;return t[0]!==n||t[1]!==a||t[2]!==o||t[3]!==r||t[4]!==i||t[5]!==c||t[6]!==d||t[7]!==p||t[8]!==f||t[9]!==m||t[10]!==g?(v=(0,u.jsx)(te,{button:(0,u.jsx)(tc,{}),buttonClassName:"".concat(aZ,"__button"),className:aZ,horizontalAlign:"center",render:e=>{let{close:t}=e;return(0,u.jsxs)(eY.ButtonGroup,{buttonSize:"small",children:[c&&0!==i&&(0,u.jsxs)(eY.Button,{className:"".concat(aZ,"__action ").concat(aZ,"__move-up"),onClick:()=>{d(i,i-1),t()},children:[(0,u.jsx)("div",{className:"".concat(aZ,"__action-chevron"),children:(0,u.jsx)(eq,{direction:"up"})}),g("general:moveUp")]}),c&&i{d(i,i+1),t()},children:[(0,u.jsx)("div",{className:"".concat(aZ,"__action-chevron"),children:(0,u.jsx)(eq,{})}),g("general:moveDown")]}),!r&&(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)(eY.Button,{className:"".concat(aZ,"__action ").concat(aZ,"__add"),onClick:()=>{n(i+1),t()},children:[(0,u.jsx)(eK,{}),g("general:addBelow")]}),(0,u.jsxs)(eY.Button,{className:"".concat(aZ,"__action ").concat(aZ,"__duplicate"),onClick:()=>{o(i),t()},children:[(0,u.jsx)(tu,{}),g("general:duplicate")]})]}),(0,u.jsx)(eY.Button,{className:"".concat(aZ,"__action ").concat(aZ,"__copy"),onClick:()=>{a(i),t()},children:(0,u.jsx)(td,{isRow:!0})}),(0,u.jsx)(eY.Button,{className:"".concat(aZ,"__action ").concat(aZ,"__paste"),onClick:()=>{p(i),t()},children:(0,u.jsx)(td,{isPaste:!0,isRow:!0})}),(0,u.jsxs)(eY.Button,{className:"".concat(aZ,"__action ").concat(aZ,"__remove"),onClick:()=>{f(i),t()},children:[(0,u.jsx)(s.a,{}),g("general:remove")]})]})},size:"medium"}),t[0]=n,t[1]=a,t[2]=o,t[3]=r,t[4]=i,t[5]=c,t[6]=d,t[7]=p,t[8]=f,t[9]=m,t[10]=g,t[11]=v):v=t[11],v},aJ=e=>{let{className:t}=e;return(0,u.jsxs)("svg",{className:["icon icon--drag-handle",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[(0,u.jsx)("path",{className:"fill",d:"M7.99999 10.6667C8.36818 10.6667 8.66666 10.3682 8.66666 9.99999C8.66666 9.6318 8.36818 9.33332 7.99999 9.33332C7.63181 9.33332 7.33333 9.6318 7.33333 9.99999C7.33333 10.3682 7.63181 10.6667 7.99999 10.6667Z",strokeLinecap:"square"}),(0,u.jsx)("path",{className:"fill",d:"M7.99999 5.99999C8.36818 5.99999 8.66666 5.70151 8.66666 5.33332C8.66666 4.96513 8.36818 4.66666 7.99999 4.66666C7.63181 4.66666 7.33333 4.96513 7.33333 5.33332C7.33333 5.70151 7.63181 5.99999 7.99999 5.99999Z",strokeLinecap:"square"}),(0,u.jsx)("path",{className:"fill",d:"M7.99999 15.3333C8.36818 15.3333 8.66666 15.0348 8.66666 14.6667C8.66666 14.2985 8.36818 14 7.99999 14C7.63181 14 7.33333 14.2985 7.33333 14.6667C7.33333 15.0348 7.63181 15.3333 7.99999 15.3333Z",strokeLinecap:"square"}),(0,u.jsx)("path",{className:"fill",d:"M12 10.6667C12.3682 10.6667 12.6667 10.3682 12.6667 9.99999C12.6667 9.6318 12.3682 9.33332 12 9.33332C11.6318 9.33332 11.3333 9.6318 11.3333 9.99999C11.3333 10.3682 11.6318 10.6667 12 10.6667Z",strokeLinecap:"square"}),(0,u.jsx)("path",{className:"fill",d:"M12 5.99999C12.3682 5.99999 12.6667 5.70151 12.6667 5.33332C12.6667 4.96513 12.3682 4.66666 12 4.66666C11.6318 4.66666 11.3333 4.96513 11.3333 5.33332C11.3333 5.70151 11.6318 5.99999 12 5.99999Z",strokeLinecap:"square"}),(0,u.jsx)("path",{className:"fill",d:"M12 15.3333C12.3682 15.3333 12.6667 15.0348 12.6667 14.6667C12.6667 14.2985 12.3682 14 12 14C11.6318 14 11.3333 14.2985 11.3333 14.6667C11.3333 15.0348 11.6318 15.3333 12 15.3333Z",strokeLinecap:"square"})]})},a0=e=>{let{id:t,children:n,className:a,duration:o=300,height:r}=e,[i,s]=l.useState(()=>!!r),c=(0,l.useRef)(i),[d,p]=l.useState(()=>i?"":"none"),[f,h]=l.useState(()=>i?"":"hidden"),[m,g]=l.useState(!1),v=(0,l.useRef)(null),b=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let e,t,n=!!r,a=c.current!==n;return c.current=n,a&&(g(!0),h("hidden"),n?p(""):e=window.setTimeout(()=>{p("none")},o),s(n),t=window.setTimeout(()=>{h(""),g(!1)},o)),()=>{e&&clearTimeout(e),t&&clearTimeout(t)}},[r,o]),(e=>{let{containerRef:t,contentRef:n,duration:a,open:o}=e,r=(0,l.useMemo)(()=>!!("u">typeof CSS&&CSS)&&!!CSS.supports&&CSS.supports("interpolate-size","allow-keywords"),[]),i=(0,l.useRef)(!1),s=(0,l.useRef)(o),[c,u]=(0,l.useState)(!1),d=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let e=t.current,l=n.current;if(!e||!l||r)return;let p=t=>{e.style.height=t};return(()=>{if(!i.current&&o){p("auto"),u(!1);return}i.current=!0,s.current!==o&&p(o?"0px":"".concat(l.scrollHeight,"px")),e.offsetHeight,u(!0),e.style.transition="height ".concat(a,"ms ease"),p(o?"".concat(l.scrollHeight,"px"):"0px");let t=()=>{e&&(e.style.transition="",e.style.height=o?"auto":"0px",u(!1)),e.removeEventListener("transitionend",t)};e.addEventListener("transitionend",t)})(),s.current=o,d.current=new ResizeObserver(()=>{c&&(e.style.height=o?"".concat(l.scrollHeight,"px"):"0px")}),d.current.observe(l),()=>{var t;e&&(e.style.transition="",e.style.height=""),null==(t=d.current)||t.disconnect()}},[o,a,t,n,r])})({containerRef:v,contentRef:b,duration:o,open:i}),(0,u.jsx)("div",{"aria-hidden":!i,className:[a,"rah-static",i&&"auto"===r&&"rah-static--height-auto",m&&"rah-animating--".concat(i?"down":"up"),m&&"auto"===r&&"rah-animating--to-height-auto"].filter(Boolean).join(" "),id:t,ref:v,style:{overflow:f,transition:"height ".concat(o,"ms ease")},children:(0,u.jsx)("div",{ref:b,...d?{style:{display:d}}:{},children:n})})},a1=(0,l.createContext)({isCollapsed:void 0,isVisible:void 0,isWithinCollapsible:void 0,toggle:()=>{}}),a3=e=>{let{children:t,isCollapsed:n,isWithinCollapsible:a=!0,toggle:o}=e,{isCollapsed:r,isVisible:i}=a2(),s=l.useMemo(()=>({isCollapsed:n,isVisible:i&&!r,isWithinCollapsible:a,toggle:o}),[n,a,o,r,i]);return(0,u.jsx)(a1,{value:s,children:t})},a2=()=>(0,l.use)(a1),a6="collapsible",a5=e=>{let t,n=(0,h.c)(25),{actions:a,AfterCollapsible:o,children:r,className:i,collapsibleStyle:c,disableHeaderToggle:d,disableToggleIndicator:p,dragHandleProps:f,header:m,initCollapsed:g,isCollapsed:v,onToggle:b}=e,y=void 0!==d&&d,x=void 0!==p&&p,[w,C]=(0,l.useState)(!!g),[j,S]=(0,l.useState)(!1),{isWithinCollapsible:_}=a2(),{t:k}=(0,s.d)(),E="boolean"==typeof v?v:w,N;n[0]!==E||n[1]!==b?(N=()=>{"function"==typeof b&&b(!E),C(!E)},n[0]=E,n[1]=b,n[2]=N):N=n[2];let D=N,P=f&&"".concat(a6,"--has-drag-handle"),O=E&&"".concat(a6,"--collapsed"),T=_&&"".concat(a6,"--nested"),R=j&&!y&&"".concat(a6,"--hovered"),I="".concat(a6,"--style-").concat(void 0===c?"default":c),F;n[3]!==i||n[4]!==P||n[5]!==O||n[6]!==T||n[7]!==R||n[8]!==I?(F=[a6,i,P,O,T,R,I].filter(Boolean),n[3]=i,n[4]=P,n[5]=O,n[6]=T,n[7]=R,n[8]=I,n[9]=F):F=n[9];let A=F.join(" "),M="".concat(a6,"__toggle-wrap").concat(y?" toggle-disabled":""),L,B;return n[10]===Symbol.for("react.memo_cache_sentinel")?(L=()=>S(!0),B=()=>S(!1),n[10]=L,n[11]=B):(L=n[10],B=n[11]),n[12]!==o||n[13]!==a||n[14]!==r||n[15]!==y||n[16]!==x||n[17]!==f||n[18]!==m||n[19]!==E||n[20]!==k||n[21]!==A||n[22]!==M||n[23]!==D?(t=(0,u.jsx)("div",{className:A,children:(0,u.jsxs)(a3,{isCollapsed:E,toggle:D,children:[(0,u.jsxs)("div",{className:M,onMouseEnter:L,onMouseLeave:B,children:[!y&&(0,u.jsx)("button",{className:["".concat(a6,"__toggle"),"".concat(a6,"__toggle--").concat(E?"collapsed":"open")].filter(Boolean).join(" "),onClick:D,type:"button",children:(0,u.jsx)("span",{children:k("fields:toggleBlock")})}),f&&(0,u.jsx)("div",{className:"".concat(a6,"__drag"),...f.attributes,...f.listeners,children:(0,u.jsx)(aJ,{})}),m?(0,u.jsx)("div",{className:["".concat(a6,"__header-wrap"),f&&"".concat(a6,"__header-wrap--has-drag-handle")].filter(Boolean).join(" "),children:m}):null,(0,u.jsxs)("div",{className:"".concat(a6,"__actions-wrap"),children:[a?(0,u.jsx)("div",{className:"".concat(a6,"__actions"),children:a}):null,!x&&(0,u.jsx)("div",{className:"".concat(a6,"__indicator"),children:(0,u.jsx)(eq,{direction:E?void 0:"up"})})]})]}),(0,u.jsx)(a0,{height:E?0:"auto",children:(0,u.jsx)("div",{className:"".concat(a6,"__content"),children:r})}),o]})}),n[12]=o,n[13]=a,n[14]=r,n[15]=y,n[16]=x,n[17]=f,n[18]=m,n[19]=E,n[20]=k,n[21]=A,n[22]=M,n[23]=D,n[24]=t):t=n[24],t},a4=e=>{var t;let n=(0,h.c)(9),{children:a,className:o,forceRender:r}=e,[i,s]=l.useState(!!r),c;n[0]===Symbol.for("react.memo_cache_sentinel")?(c={rootMargin:"1000px"},n[0]=c):c=n[0];let[d,p]=e4(c,!!r),f=!!(null==p?void 0:p.isIntersecting),m=(null==p||null==(t=p.boundingClientRect)?void 0:t.top){g&&!i&&s(!0)},b=[g,i],n[1]=i,n[2]=g,n[3]=v,n[4]=b):(v=n[3],b=n[4]),l.useEffect(v,b);let y=i?a:null,x;return n[5]!==o||n[6]!==d||n[7]!==y?(x=(0,u.jsx)("div",{className:o,ref:d,children:y}),n[5]=o,n[6]=d,n[7]=y,n[8]=x):x=n[8],x},a9="pill",a8=e=>{let t=(0,h.c)(12),{id:n,className:a}=e,o;t[0]!==n?(o={id:n},t[0]=n,t[1]=o):o=t[1];let{attributes:l,isDragging:r,listeners:i,setNodeRef:s,transform:c}=tF(o),d=r&&"".concat(a9,"--is-dragging"),p;t[2]!==a||t[3]!==d?(p=[d,a].filter(Boolean),t[2]=a,t[3]=d,t[4]=p):p=t[4];let f=p.join(" "),m;return t[5]!==l||t[6]!==i||t[7]!==e||t[8]!==s||t[9]!==f||t[10]!==c?(m=(0,u.jsx)(a7,{...e,className:f,elementProps:{...i,...l,ref:s,style:{transform:c}}}),t[5]=l,t[6]=i,t[7]=e,t[8]=s,t[9]=f,t[10]=c,t[11]=m):m=t[11],m},a7=e=>{let{id:t,alignIcon:n="right","aria-checked":a,"aria-controls":o,"aria-expanded":l,"aria-label":r,children:i,className:s,draggable:c,elementProps:d,icon:p,onClick:f,pillStyle:h="light",rounded:m,size:g="medium",to:v}=e,b=[a9,"".concat(a9,"--style-").concat(h),"".concat(a9,"--size-").concat(g),s&&s,v&&"".concat(a9,"--has-link"),(v||f)&&"".concat(a9,"--has-action"),p&&"".concat(a9,"--has-icon"),p&&"".concat(a9,"--align-icon-").concat(n),c&&"".concat(a9,"--draggable"),m&&"".concat(a9,"--rounded")].filter(Boolean).join(" "),y="div";return f&&!v&&(y="button"),v&&(y=ez),(0,u.jsxs)(y,{...d,"aria-checked":a,"aria-controls":o,"aria-expanded":l,"aria-label":r,className:b,href:v||null,id:t,onClick:f,type:"button"===y?"button":void 0,children:[(0,u.jsx)("span",{className:"".concat(a9,"__label"),children:i}),!!p&&(0,u.jsx)("span",{className:"".concat(a9,"__icon"),children:p})]})},oe=e=>{let{draggable:t}=e;return t?(0,u.jsx)(a8,{...e}):(0,u.jsx)(a7,{...e})};function ot(e,t){let[n,a]=(0,l.useState)(e);return(0,l.useEffect)(()=>{let n=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(n)}},[e,t]),n}var on="thumbnail-card",oa=e=>{let t=(0,h.c)(13),{alignLabel:n,className:a,collection:o,doc:l,label:r,onClick:c,thumbnail:d}=e,{config:p}=(0,i.c)(),{i18n:f}=(0,s.d)(),m="function"==typeof c&&"".concat(on,"--has-on-click"),g=n&&"".concat(on,"--align-label-").concat(n),v;t[0]!==a||t[1]!==m||t[2]!==g?(v=[on,a,m,g].filter(Boolean),t[0]=a,t[1]=m,t[2]=g,t[3]=v):v=t[3];let b=v.join(" "),y;if(t[4]!==b||t[5]!==o||t[6]!==p||t[7]!==l||t[8]!==f||t[9]!==r||t[10]!==c||t[11]!==d){let e=r;e||(e=ab({collectionConfig:o,data:l,dateFormat:p.admin.dateFormat,fallback:null==l?void 0:l.filename,i18n:f})),y=(0,u.jsxs)("button",{className:b,onClick:c,title:e,type:"button",children:[(0,u.jsx)("div",{className:"".concat(on,"__thumbnail"),children:d}),(0,u.jsx)("div",{className:"".concat(on,"__label"),children:e})]}),t[4]=b,t[5]=o,t[6]=p,t[7]=l,t[8]=f,t[9]=r,t[10]=c,t[11]=d,t[12]=y}else y=t[12];return y},oo=[];for(or=0;ortypeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},ou=function(e,t,n){if(oc.randomUUID&&!t&&!e)return oc.randomUUID();var a=(e=e||{}).random||(e.rng||function(){if(!oi&&!(oi="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oi(os)})();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){n=n||0;for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:0;return(oo[e[t+0]]+oo[e[t+1]]+oo[e[t+2]]+oo[e[t+3]]+"-"+oo[e[t+4]]+oo[e[t+5]]+"-"+oo[e[t+6]]+oo[e[t+7]]+"-"+oo[e[t+8]]+oo[e[t+9]]+"-"+oo[e[t+10]]+oo[e[t+11]]+oo[e[t+12]]+oo[e[t+13]]+oo[e[t+14]]+oo[e[t+15]]).toLowerCase()}(a)},od=()=>{let[e]=(0,l.useState)(()=>"pattern".concat(ou()));return(0,u.jsxs)("svg",{fill:"none",height:"151",preserveAspectRatio:"xMidYMid slice",viewBox:"0 0 231 151",width:"231",xmlns:"http://www.w3.org/2000/svg",children:[(0,u.jsxs)("g",{clipPath:"url(#".concat(e,")"),children:[(0,u.jsx)("rect",{fill:"#D9D9D9",height:"100%",rx:"2",width:"100%"}),(0,u.jsx)("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 33.7051 79.3051)",width:"85.8593",x:"33.7051",y:"79.3051"}),(0,u.jsx)("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 86.1219 92.6272)",width:"85.8593",x:"86.1219",y:"92.6272"}),(0,u.jsx)("circle",{cx:"189",cy:"45",fill:"#BCBCBC",r:"19"}),(0,u.jsx)("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"98",x:"66",y:"70"}),(0,u.jsx)("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"76",x:"77",y:"82"})]}),(0,u.jsx)("defs",{children:(0,u.jsx)("clipPath",{id:"".concat(e),children:(0,u.jsx)("rect",{fill:"white",height:"151",width:"231"})})})]})},op=()=>(0,u.jsx)("svg",{className:"icon icon--search",fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{className:"stroke",d:"M16 16L13.1333 13.1333M14.6667 9.33333C14.6667 12.2789 12.2789 14.6667 9.33333 14.6667C6.38781 14.6667 4 12.2789 4 9.33333C4 6.38781 6.38781 4 9.33333 4C12.2789 4 14.6667 6.38781 14.6667 9.33333Z",strokeLinecap:"square"})}),of="block-search",oh=e=>{let t=(0,h.c)(5),{setSearchTerm:n}=e,{t:a}=(0,s.d)(),o;t[0]!==n?(o=e=>{n(e.target.value)},t[0]=n,t[1]=o):o=t[1];let l=o,r;return t[2]!==l||t[3]!==a?(r=(0,u.jsxs)("div",{className:of,children:[(0,u.jsx)("input",{className:"".concat(of,"__input"),onChange:l,placeholder:a("fields:searchForBlock")}),(0,u.jsx)(op,{})]}),t[2]=l,t[3]=a,t[4]=r):r=t[4],r},om="blocks-drawer",og=e=>{let{addRow:t,addRowIndex:n,blocks:a,drawerSlug:o,labels:r}=e,[c,p]=(0,l.useState)(""),[f,h]=(0,l.useState)(a),{closeModal:m,isModalOpen:g}=ne(),{i18n:v,t:b}=(0,s.d)(),{config:y}=(0,i.c)(),x=(0,l.useMemo)(()=>{let e={_none:[]};return f.forEach(t=>{var n;if("object"==typeof t&&(null==(n=t.admin)?void 0:n.group)){let n=t.admin.group,a="string"==typeof n?n:(0,d.s)(n,v);Object.hasOwn(e,a)?e[a].push(t):e[a]=[t]}else e._none.push(t)}),e},[f,v]);return(0,l.useEffect)(()=>{g(o)||p("")},[g,o]),(0,l.useEffect)(()=>{let e=c.toLowerCase();h(null==a?void 0:a.reduce((t,n)=>{let a="string"==typeof n?y.blocksMap[n]:n;return((e,t)=>"string"==typeof e.labels.singular?e.labels.singular.toLowerCase():"object"==typeof e.labels.singular?(0,d.s)(e.labels.singular,t).toLowerCase():"")(a,v).includes(e)&&t.push(a),t},[]))},[c,a,v,y.blocksMap]),(0,u.jsxs)(nC,{slug:o,title:b("fields:addLabel",{label:(0,d.s)(r.singular,v)}),children:[(0,u.jsx)(oh,{setSearchTerm:p}),(0,u.jsx)("div",{className:"".concat(om,"__blocks-wrapper"),children:(0,u.jsx)("ul",{className:"".concat(om,"__block-groups"),children:Object.entries(x).map(e=>{let[a,l]=e;return l.length?(0,u.jsxs)("li",{className:["".concat(om,"__block-group"),"_none"===a&&"".concat(om,"__block-group-none")].filter(Boolean).join(" "),children:["_none"!==a&&(0,u.jsx)("h3",{className:"".concat(om,"__block-group-label"),children:a}),(0,u.jsx)("ul",{className:"".concat(om,"__blocks"),children:l.map((e,a)=>{let{slug:l,imageAltText:r,imageURL:i,labels:s}="string"==typeof e?y.blocksMap[e]:e;return(0,u.jsx)("li",{className:"".concat(om,"__block"),children:(0,u.jsx)(oa,{alignLabel:"center",label:(0,d.s)(null==s?void 0:s.singular,v),onClick:()=>{t(n,l),m(o)},thumbnail:(0,u.jsx)("div",{className:"".concat(om,"__default-image"),children:i?(0,u.jsx)("img",{alt:r,src:i}):(0,u.jsx)(od,{})})})},a)})})]},a):null})})})]})},ov=e=>{let t,n=(0,h.c)(28),{addRow:a,blocks:o,blockType:r,copyRow:i,duplicateRow:s,hasMaxRows:c,isSortable:d,labels:p,moveRow:f,pasteRow:m,removeRow:g,rowCount:v,rowIndex:b}=e,{closeModal:y,openModal:x}=ne(),w=nb("blocks-drawer"),[C,j]=l.useState(null),S;if(n[0]!==a||n[1]!==y||n[2]!==w||n[3]!==C?(S=(e,t)=>{"function"==typeof a&&a(C,t),y(w)},n[0]=a,n[1]=y,n[2]=w,n[3]=C,n[4]=S):S=n[4],n[5]!==r||n[6]!==o||n[7]!==i||n[8]!==w||n[9]!==s||n[10]!==c||n[11]!==d||n[12]!==p||n[13]!==f||n[14]!==x||n[15]!==m||n[16]!==g||n[17]!==v||n[18]!==b||n[19]!==S){let e,a;n[21]!==w||n[22]!==x?(e=e=>{j(e),x(w)},n[21]=w,n[22]=x,n[23]=e):e=n[23],n[24]!==r||n[25]!==s||n[26]!==b?(a=()=>s(b,r),n[24]=r,n[25]=s,n[26]=b,n[27]=a):a=n[27],t=(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)(og,{addRow:S,addRowIndex:b,blocks:o,drawerSlug:w,labels:p}),(0,u.jsx)(aQ,{addRow:e,copyRow:i,duplicateRow:a,hasMaxRows:c,index:b,isSortable:d,moveRow:f,pasteRow:m,removeRow:g,rowCount:v})]}),n[5]=r,n[6]=o,n[7]=i,n[8]=w,n[9]=s,n[10]=c,n[11]=d,n[12]=p,n[13]=f,n[14]=x,n[15]=m,n[16]=g,n[17]=v,n[18]=b,n[19]=S,n[20]=t}else t=n[20];return t},ob="section-title",oy=e=>{let t=(0,h.c)(14),{customOnChange:n,customValue:a,path:o,readOnly:l}=e,r;t[0]!==o?(r={path:o},t[0]=o,t[1]=r):r=t[1];let{setValue:i,value:c}=aA(r),{t:d}=(0,s.d)(),p;t[2]===Symbol.for("react.memo_cache_sentinel")?(p=[ob].filter(Boolean),t[2]=p):p=t[2];let f=p.join(" "),m;t[3]!==n||t[4]!==i?(m=n||(e=>{e.stopPropagation(),e.preventDefault(),i(e.target.value)}),t[3]=n,t[4]=i,t[5]=m):m=t[5];let g=m,v=a||c,b;return t[6]!==a||t[7]!==g||t[8]!==o||t[9]!==l||t[10]!==d||t[11]!==v||t[12]!==c?(b=(0,u.jsx)("div",{className:f,"data-value":v,children:(0,u.jsx)("input",{className:"".concat(ob,"__input"),id:o,name:o,onChange:g,placeholder:d("general:untitled"),readOnly:l,type:"text",value:a||c||""})}),t[6]=a,t[7]=g,t[8]=o,t[9]=l,t[10]=d,t[11]=v,t[12]=c,t[13]=b):b=t[13],b},ox="blocks-field",ow=e=>{var t,n;let a=(0,h.c)(42),{addRow:o,attributes:l,block:r,blocks:c,copyRow:p,duplicateRow:f,errorCount:m,fields:g,hasMaxRows:v,isLoading:b,isSortable:y,Label:x,labels:w,listeners:C,moveRow:j,parentPath:S,pasteRow:_,path:k,permissions:E,readOnly:N,removeRow:D,row:P,rowCount:O,rowIndex:T,schemaPath:R,setCollapse:I,setNodeRef:F,transform:A}=e,M=ot(b,500),{i18n:L}=(0,s.d)(),B=eS()&&m>0,V=!(null==(t=r.admin)?void 0:t.disableBlockName),z=B?"".concat(ox,"__row--has-errors"):"".concat(ox,"__row--no-errors"),U;a[0]!==z?(U=["".concat(ox,"__row"),z].filter(Boolean),a[0]=z,a[1]=U):U=a[1];let H=U.join(" "),q;if(a[2]!==x||a[3]!==o||a[4]!==l||a[5]!==r.fields||a[6]!==r.labels||a[7]!==r.slug||a[8]!==c||a[9]!==H||a[10]!==p||a[11]!==f||a[12]!==m||a[13]!==B||a[14]!==g||a[15]!==v||a[16]!==L||a[17]!==M||a[18]!==y||a[19]!==w||a[20]!==C||a[21]!==j||a[22]!==S||a[23]!==_||a[24]!==k||a[25]!==E||a[26]!==N||a[27]!==D||a[28]!==P.blockType||a[29]!==P.collapsed||a[30]!==P.id||a[31]!==O||a[32]!==T||a[33]!==R||a[34]!==I||a[35]!==F||a[36]!==V||a[37]!==A){let e,t;if(!0===E)e=!0;else{let t=(null==E||null==(n=E.blocks)?void 0:n[r.slug])||(null==E?void 0:E.blocks);if(!0===t)e=!0;else if(null==t?void 0:t.fields)e=t.fields;else if("object"==typeof E&&E&&!t){let n=!0===E.read,a=!E.create||!E.update;e=n&&(a||"object"==typeof E&&1===Object.keys(E).length&&E.read)?{read:!0}:null==t?void 0:t.fields}else e=null==t?void 0:t.fields}a[39]!==P.id||a[40]!==I?(t=e=>I(P.id,e),a[39]=P.id,a[40]=I,a[41]=t):t=a[41],q=(0,u.jsx)("div",{id:"".concat(null==S?void 0:S.split(".").join("-"),"-row-").concat(T),ref:F,style:{transform:A},children:(0,u.jsx)(a5,{actions:N?void 0:(0,u.jsx)(ov,{addRow:o,blocks:c,blockType:P.blockType,copyRow:p,duplicateRow:f,fields:r.fields,hasMaxRows:v,isSortable:y,labels:w,moveRow:j,pasteRow:_,removeRow:D,rowCount:O,rowIndex:T}),className:H,collapsibleStyle:B?"error":"default",dragHandleProps:y?{id:P.id,attributes:l,listeners:C}:void 0,header:M?(0,u.jsx)(i.f,{height:"1rem",width:"8rem"}):(0,u.jsxs)("div",{className:"".concat(ox,"__block-header"),children:[(0,u.jsx)(eO,{CustomComponent:x,label:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{className:"".concat(ox,"__block-number"),children:String(T+1).padStart(2,"0")}),(0,u.jsx)(oe,{className:"".concat(ox,"__block-pill ").concat(ox,"__block-pill-").concat(P.blockType),pillStyle:"white",size:"small",children:(0,d.s)(r.labels.singular,L)}),V&&(0,u.jsx)(oy,{path:"".concat(k,".blockName"),readOnly:N})]}),path:k,rowNumber:T}),B&&(0,u.jsx)(tB,{count:m,i18n:L,withMessage:!0})]}),isCollapsed:P.collapsed,onToggle:t,children:M?(0,u.jsx)(i.f,{}):(0,u.jsx)(pa,{className:"".concat(ox,"__fields"),fields:g,margins:"small",parentIndexPath:"",parentPath:k,parentSchemaPath:R,permissions:e,readOnly:N})},P.id)},"".concat(S,"-row-").concat(T)),a[2]=x,a[3]=o,a[4]=l,a[5]=r.fields,a[6]=r.labels,a[7]=r.slug,a[8]=c,a[9]=H,a[10]=p,a[11]=f,a[12]=m,a[13]=B,a[14]=g,a[15]=v,a[16]=L,a[17]=M,a[18]=y,a[19]=w,a[20]=C,a[21]=j,a[22]=S,a[23]=_,a[24]=k,a[25]=E,a[26]=N,a[27]=D,a[28]=P.blockType,a[29]=P.collapsed,a[30]=P.id,a[31]=O,a[32]=T,a[33]=R,a[34]=I,a[35]=F,a[36]=V,a[37]=A,a[38]=q}else q=a[38];return q},oC="blocks-field",oj=aB(e=>{let{i18n:t,t:n}=(0,s.d)(),{field:a,field:{name:o,type:r,admin:{className:c,description:p,isSortable:f=!0}={},blockReferences:h,blocks:m,label:g,labels:v,localized:b,maxRows:y,minRows:x,required:w},path:C,permissions:j,readOnly:S,schemaPath:_,validate:k}=e,E=null!=_?_:o,N=+(null!=x?!!x:!!w),{setDocFieldPreferences:D}=aE(),{addFieldRow:P,dispatchFields:O,getFields:T,moveFieldRow:R,removeFieldRow:I,replaceState:F,setModified:A}=eC(),{code:M}=nI(),{config:{localization:L},config:B}=(0,i.c)(),V=nb("blocks-drawer"),z=eS(),U={plural:n("fields:blocks"),singular:n("fields:block"),...v},H=!L||!L.fallback||M===L.defaultLocale,{blocksFilterOptions:q,customComponents:{AfterInput:W,BeforeInput:K,Description:Y,Error:G,Label:$}={},disabled:X,errorPaths:Z,path:Q,rows:J=[],showError:ee,valid:et,value:en}=aA({hasRows:!0,potentiallyStalePath:C,validate:(0,l.useCallback)((e,t)=>!H&&null===e||("function"==typeof k?k(e,{...t,maxRows:y,minRows:N,required:w}):void 0),[y,N,w,k,H])}),{clientBlocks:ea,clientBlocksAfterFilter:eo}=(0,l.useMemo)(()=>{let e=[];if(h)for(let t of h){let n="string"==typeof t?B.blocksMap[t]:t;n&&e.push(n)}else e=m;if(Array.isArray(q)){let t=e.filter(e=>{let t="string"==typeof e?e:e.slug;return q.includes(t)});return{clientBlocks:e,clientBlocksAfterFilter:t}}return{clientBlocks:e,clientBlocksAfterFilter:e}},[h,m,q,B.blocksMap]),er=(0,l.useCallback)((e,t)=>{P({blockType:t,path:Q,rowIndex:e,schemaPath:E}),setTimeout(()=>{aX("".concat(Q,"-row-").concat(e+1))},0)},[P,Q,E]),ei=(0,l.useCallback)(e=>{O({type:"DUPLICATE_ROW",path:Q,rowIndex:e}),A(!0),setTimeout(()=>{aX("".concat(Q,"-row-").concat(e+1))},0)},[O,Q,A]),es=(0,l.useCallback)(e=>{I({path:Q,rowIndex:e})},[Q,I]),ec=(0,l.useCallback)((e,t)=>{R({moveFromIndex:e,moveToIndex:t,path:Q})},[R,Q]),eu=(0,l.useCallback)(e=>{let{collapsedIDs:t,updatedRows:n}=nL({collapsed:e,rows:J});O({type:"SET_ALL_ROWS_COLLAPSED",path:Q,updatedRows:n}),D(Q,{collapsed:t})},[O,Q,J,D]),ed=(0,l.useCallback)((e,t)=>{let{collapsedIDs:n,updatedRows:a}=nM({collapsed:t,rowID:e,rows:J});O({type:"SET_ROW_COLLAPSED",path:Q,updatedRows:a}),D(Q,{collapsed:n})},[O,Q,J,D]),ep=(0,l.useCallback)(e=>{let t=ti({type:r,blocks:ea,getDataToCopy:()=>tf({formState:{...T()},path:Q,rowIndex:e}),path:Q,rowIndex:e,t:n});"string"==typeof t?eF.error(t):eF.success(n("general:copied"))},[ea,Q,n,r,T]),ef=(0,l.useCallback)(e=>{let t=ts({onPaste:t=>{F(th({dataFromClipboard:t,formState:{...T()},path:Q,rowIndex:e})),A(!0)},path:Q,schemaBlocks:ea,t:n});"string"==typeof t&&eF.error(t)},[ea,T,Q,F,A,n]),eh=(0,l.useCallback)(e=>{F(th({dataFromClipboard:e,formState:{...T()},path:Q})),A(!0)},[T,Q,F,A]),em=y&&J.length>=y,eg=Z.length,ev=z&&eg+ +!et>0,eb=J.lengthaV(a),[a]);return(0,u.jsxs)("div",{className:[az,oC,c,ev?"".concat(oC,"--has-error"):"".concat(oC,"--has-no-error")].filter(Boolean).join(" "),id:"field-".concat(null==Q?void 0:Q.replace(/\./g,"__")),style:ex,children:[ee&&(0,u.jsx)(el,{CustomComponent:G,Fallback:(0,u.jsx)(tU,{path:Q,showError:ee})}),(0,u.jsxs)("header",{className:"".concat(oC,"__header"),children:[(0,u.jsxs)("div",{className:"".concat(oC,"__header-wrap"),children:[(0,u.jsxs)("div",{className:"".concat(oC,"__heading-with-error"),children:[(0,u.jsx)("h3",{children:(0,u.jsx)(el,{CustomComponent:$,Fallback:(0,u.jsx)(nA,{as:"span",label:g,localized:b,path:Q,required:w})})}),ev&&eg>0&&(0,u.jsx)(tB,{count:eg,i18n:t,withMessage:!0})]}),(0,u.jsxs)("ul",{className:"".concat(oC,"__header-actions"),children:[J.length>0&&(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)("li",{children:(0,u.jsx)("button",{className:"".concat(oC,"__header-action"),onClick:()=>eu(!0),type:"button",children:n("fields:collapseAll")})}),(0,u.jsx)("li",{children:(0,u.jsx)("button",{className:"".concat(oC,"__header-action"),onClick:()=>eu(!1),type:"button",children:n("fields:showAll")})})]}),(0,u.jsx)("li",{children:(0,u.jsx)(tp,{allowCopy:(null==J?void 0:J.length)>0,allowPaste:!S,blocks:ea,className:"".concat(oC,"__header-action"),disabled:X,getDataToCopy:()=>tf({formState:{...T()},path:Q}),onPaste:eh,path:Q,type:r})})]})]}),(0,u.jsx)(el,{CustomComponent:Y,Fallback:(0,u.jsx)(tz,{description:p,path:Q})})]}),K,(0,u.jsx)(a$,{fieldValue:en,localized:b,path:Q,readOnly:S}),(J.length>0||!et&&(ey||eb))&&(0,u.jsxs)(tM,{className:"".concat(oC,"__rows"),ids:J.map(e=>e.id),onDragEnd:e=>{let{moveFromIndex:t,moveToIndex:n}=e;return ec(t,n)},children:[J.map((e,t)=>{var n;let{blockType:a,isLoading:o}=e,l=null!=(n=B.blocksMap[a])?n:ea.find(e=>e.slug===a);if(l){let n="".concat(Q,".").concat(t),a=Z.filter(e=>e.startsWith(n+".")).length;return(0,u.jsx)(tA,{disabled:S||X||!f,id:e.id,children:r=>{var i,s;return(0,u.jsx)(ow,{...r,addRow:er,block:l,blocks:ea,copyRow:ep,duplicateRow:ei,errorCount:a,fields:l.fields,hasMaxRows:em,isLoading:o,isSortable:f,Label:null==J||null==(s=J[t])||null==(i=s.customComponents)?void 0:i.RowLabel,labels:U,moveRow:ec,parentPath:Q,pasteRow:ef,path:n,permissions:j,readOnly:S||X,removeRow:es,row:e,rowCount:J.length,rowIndex:t,schemaPath:E+l.slug,setCollapse:ed})}},e.id)}return null}),!H&&(0,u.jsxs)(l.Fragment,{children:[eb&&(0,u.jsx)(eH,{type:"error",children:n("validation:requiresAtLeast",{count:N,label:(0,d.s)(N>1?U.plural:U.singular,t)||n(N>1?"general:row":"general:rows")})}),ey&&(0,u.jsx)(eH,{children:n("validation:fieldHasNo",{label:(0,d.s)(U.plural,t)})})]})]}),!em&&(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)(nw,{className:"".concat(oC,"__drawer-toggler"),disabled:S||X,slug:V,children:(0,u.jsx)(to,{buttonStyle:"icon-label",disabled:S||X,el:"span",icon:"plus",iconPosition:"left",iconStyle:"with-border",children:n("fields:addLabel",{label:(0,d.s)(U.singular,t)})})}),(0,u.jsx)(og,{addRow:er,addRowIndex:(null==J?void 0:J.length)||0,blocks:eo,drawerSlug:V,labels:U})]}),W]})}),oS=(0,l.lazy)(()=>n.e(8363).then(n.bind(n,68363))),o_=e=>(0,u.jsx)(l.Suspense,{fallback:(0,u.jsx)(i.f,{}),children:(0,u.jsx)(oS,{...e})}),ok={js:"javascript",ts:"typescript",tsx:"typescript"},oE=aB(e=>{let{field:t,field:{admin:{className:n,description:a,editorOptions:o,editorProps:r,language:i="javascript"}={},label:s,localized:c,required:d},onMount:p,path:f,readOnly:h,validate:m}=e,g=l.useRef("formState"),[v,b]=(0,l.useState)(Date.now()),{customComponents:{AfterInput:y,BeforeInput:x,Description:w,Error:C,Label:j}={},disabled:S,initialValue:_,path:k,setValue:E,showError:N,value:D}=aA({potentiallyStalePath:f,validate:(0,l.useCallback)((e,t)=>{if("function"==typeof m)return m(e,{...t,required:d})},[m,d])}),P=l.useRef((D||_)!==void 0?null!=D?D:_:void 0),O=(0,l.useCallback)(e=>{if(!(h||S)){g.current="internalEditor";try{E(e||null),P.current=e}catch(t){E(e||null),P.current=e}}},[h,S,E]);(0,l.useEffect)(()=>{"formState"===g.current&&(P.current=(D||_)!==void 0?null!=D?D:_:void 0,b(Date.now())),g.current="formState"},[_,k,D]);let T=(0,l.useMemo)(()=>aV(t),[t]);return(0,u.jsxs)("div",{className:[az,"code-field",n,N&&"error",(h||S)&&"read-only"].filter(Boolean).join(" "),style:T,children:[(0,u.jsx)(el,{CustomComponent:j,Fallback:(0,u.jsx)(nA,{label:s,localized:c,path:k,required:d})}),(0,u.jsxs)("div",{className:"".concat(az,"__wrap"),children:[(0,u.jsx)(el,{CustomComponent:C,Fallback:(0,u.jsx)(tU,{path:k,showError:N})}),x,(0,u.jsx)(o_,{defaultLanguage:ok[i]||i,onChange:O,onMount:p,options:o,readOnly:h||S,recalculatedHeightAt:v,value:P.current,wrapperProps:{id:"field-".concat(null==k?void 0:k.replace(/\./g,"__"))},...r||{}}),y]}),(0,u.jsx)(el,{CustomComponent:w,Fallback:(0,u.jsx)(tz,{description:a,path:k})})]})}),oN=e=>e.reduce((e,t)=>{var n;let a="fields"in t?t.fields:void 0;return a?(0,m.Z7)(t)?e.push("".concat(t.name,".")):e.push(...oN(a)):"tabs"===t.type?"tabs"in t&&(null==(n=t.tabs)||n.forEach(t=>{"name"in t?e.push("".concat(t.name,".")):e.push(...oN(t.fields))})):(0,m.Z7)(t)&&e.push(t.name),e},[]),oD=e=>{let t,n=(0,h.c)(12),{fields:a,path:o,setErrorCount:l}=e,[r]=eN(),i=eS(),s;n[0]!==a?(s=oN(a),n[0]=a,n[1]=s):s=n[1];let c=s,u;return n[2]!==r||n[3]!==i||n[4]!==o||n[5]!==c||n[6]!==l?(u=()=>{if(i){let e=0;Object.entries(r).forEach(t=>{let[n]=t;if(null==c?void 0:c.some(e=>{let t=[...o,e].join(".");return t.endsWith(".")?n.startsWith(t):n===t})){let t=r[n];"valid"in t&&!t.valid&&(e+=1)}}),l(e)}},n[2]=r,n[3]=i,n[4]=o,n[5]=c,n[6]=l,n[7]=u):u=n[7],n[8]!==a||n[9]!==r||n[10]!==i?(t=[r,i,a],n[8]=a,n[9]=r,n[10]=i,n[11]=t):t=n[11],nB(u,250,t),null},oP="collapsible-field",oO=aB(e=>{let{field:t,field:{admin:{className:n,description:a,initCollapsed:o=!1}={},fields:r,label:i}={},indexPath:c,parentPath:p,parentSchemaPath:f,path:h,permissions:m,readOnly:g}=e,{i18n:v}=(0,s.d)(),{getPreference:b,setPreference:y}=aC(),{preferencesKey:x}=aE(),[w,C]=(0,l.useState)(),j="collapsible-".concat(null==h?void 0:h.replace(/\./g,"__")),[S,_]=(0,l.useState)(0),k=S>0,{customComponents:{AfterInput:E,BeforeInput:N,Description:D,Label:P}={},disabled:O}=aA({path:h}),T=(0,l.useCallback)(async e=>{var t,n;let a=await b(x);x&&y(x,{...a,...h?{fields:{...(null==a?void 0:a.fields)||{},[h]:{...null==a||null==(t=a.fields)?void 0:t[h],collapsed:e}}}:{fields:{...(null==a?void 0:a.fields)||{},[j]:{...null==a||null==(n=a.fields)?void 0:n[j],collapsed:e}}}})},[x,j,b,y,h]);(0,l.useEffect)(()=>{(async()=>{if(x){var e,t,n,a;let l=await b(x),r=h?null==l||null==(t=l.fields)||null==(e=t[h])?void 0:e.collapsed:null==l||null==(a=l.fields)||null==(n=a[j])?void 0:n.collapsed;C(void 0!==r?!!r:"boolean"==typeof o&&o)}else C("boolean"==typeof o&&o)})()},[b,x,j,o,h]);let R=(0,l.useMemo)(()=>aV(t),[t]);return"boolean"!=typeof w?null:(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)(oD,{fields:r,path:h.split(".").slice(0,-1),setErrorCount:_}),(0,u.jsxs)("div",{className:[az,oP,n,k?"".concat(oP,"--has-error"):"".concat(oP,"--has-no-error")].filter(Boolean).join(" "),id:"field-".concat(j),style:R,children:[N,(0,u.jsx)(a5,{className:"".concat(oP,"__collapsible"),collapsibleStyle:k?"error":"default",header:(0,u.jsxs)("div",{className:"".concat(oP,"__row-label-wrap"),children:[(0,u.jsx)(eO,{CustomComponent:P,label:(0,d.s)(i,v),path:h}),k&&(0,u.jsx)(tB,{count:S,i18n:v,withMessage:!0})]}),initCollapsed:w,onToggle:T,children:(0,u.jsx)(pa,{fields:r,margins:"small",parentIndexPath:c,parentPath:p,parentSchemaPath:f,permissions:m,readOnly:g||O})}),E,(0,u.jsx)(el,{CustomComponent:D,Fallback:(0,u.jsx)(tz,{description:a,path:h})})]})]})}),oT=(0,l.lazy)(()=>n.e(9887).then(n.bind(n,69887))),oR=e=>(0,u.jsx)(l.Suspense,{fallback:(0,u.jsx)(i.f,{height:50}),children:(0,u.jsx)(oT,{...e})});function oI(e){return(oI="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})(e)}function oF(e){var t=function(e,t){if("object"!=oI(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=oI(a))return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==oI(t)?t:t+""}function oA(e,t,n){return(t=oF(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,a)}return n}function oL(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,a=Array(t);ntypeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,o,l,r,i=[],s=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(a=l.call(n)).done)&&(i.push(a.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(c)throw o}}return i}}(e,t)||oV(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oU(e,t){if(null==e)return{};var n,a,o=tY(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;atypeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||oV(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var o$=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(((t=document.createElement("style")).setAttribute("data-emotion",this.key),void 0!==this.nonce&&t.setAttribute("nonce",this.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t));var t,n=this.tags[this.tags.length-1];if(this.isSpeedy){var a=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?p[v]+" "+b:o4(b,/&\f/g,p[v])).trim())&&(s[g++]=y);return ls(e,t,n,0===o?o0:i,s,c,u)}function lg(e,t,n,a){return ls(e,t,n,o1,o7(e,0,a),o7(e,a+1,-1),a)}function lv(e,t){for(var n="",a=e.length,o=0;o-1&&!e.return)switch(e.type){case o1:e.return=function e(t,n){switch(45^o8(t,0)?(((n6)switch(o8(t,n+1)){case 109:if(45!==o8(t,n+4))break;case 102:return o4(t,/(.+:)(.+)-([^]+)/,"$1"+oQ+"$2-$3$1"+oZ+(108==o8(t,n+3)?"$3":"$2-$3"))+t;case 115:return~o9(t,"stretch")?e(o4(t,"stretch","fill-available"),n)+t:t}break;case 4949:if(115!==o8(t,n+1))break;case 6444:switch(o8(t,le(t)-3-(~o9(t,"!important")&&10))){case 107:return o4(t,":",":"+oQ)+t;case 101:return o4(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+oQ+(45===o8(t,14)?"inline-":"")+"box$3$1"+oQ+"$2$3$1"+oX+"$2box$3")+t}break;case 5936:switch(o8(t,n+11)){case 114:return oQ+t+oX+o4(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return oQ+t+oX+o4(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return oQ+t+oX+o4(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return oQ+t+oX+t+t}return t}(e.value,e.length);break;case o3:return lv([lc(e,{value:o4(e.value,"@","@"+oQ)})],a);case o0:if(e.length){var o,l;return o=e.props,l=function(t){var n;switch(n=t,(n=/(::plac\w+|:read-\w+)/.exec(n))?n[0]:n){case":read-only":case":read-write":return lv([lc(e,{props:[o4(t,/:(read-\w+)/,":"+oZ+"$1")]})],a);case"::placeholder":return lv([lc(e,{props:[o4(t,/:(plac\w+)/,":"+oQ+"input-$1")]}),lc(e,{props:[o4(t,/:(plac\w+)/,":"+oZ+"$1")]}),lc(e,{props:[o4(t,/:(plac\w+)/,oX+"input-$1")]})],a)}return""},o.map(l).join("")}}}],lk=function(e,t,n){var a=e.key+"-"+t.name;!1===n&&void 0===e.registered[a]&&(e.registered[a]=t.styles)},lE=function(e,t,n){lk(e,t,n);var a=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do e.insert(t===o?"."+a:"",o,e.sheet,!0),o=o.next;while(void 0!==o)}},lN={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},lD=/[A-Z]|^ms/g,lP=/_EMO_([^_]+?)_([^]*?)_EMO_/g,lO=function(e){return 45===e.charCodeAt(1)},lT=function(e){return null!=e&&"boolean"!=typeof e},lR=function(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}(function(e){return lO(e)?e:e.replace(lD,"-$&").toLowerCase()}),lI=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(lP,function(e,t,n){return lA={name:t,styles:n,next:lA},t})}return 1===lN[e]||lO(e)||"number"!=typeof t||0===t?t:t+"px"};function lF(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return lA={name:n.name,styles:n.styles,next:lA},n.name;if(void 0!==n.styles){var a=n.next;if(void 0!==a)for(;void 0!==a;)lA={name:a.name,styles:a.styles,next:lA},a=a.next;return n.styles+";"}return function(e,t,n){var a="";if(Array.isArray(n))for(var o=0;o=4;++a,o-=4)t=(65535&(t=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))>>16)*59797>>24,n=(65535&t)*0x5bd1e995+((t>>>16)*59797>>16)*59797>>16)*59797>>13,(((n=(65535&n)*0x5bd1e995+((n>>>16)*59797>>15)>>>0).toString(36)}(o)+s,styles:o,next:lA}}var lB=!!l.useInsertionEffect&&l.useInsertionEffect||function(e){return e()},lV=l.createContext("u">typeof HTMLElement?function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var a,o=e.stylisPlugins||l_,l={},r=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n2||lp(lr)>3?"":" "}(g);break;case 92:_+=function(e,t){for(var n;--t&&lu()&&!(lr102||lr>57&&lr70&&lr0&&le(_)-f&&lt(m>32?lg(_+";",o,a,f-1):lg(o4(_," ","")+";",o,a,f-2),c);break;case 59:_+=";";default:if(lt(S=lm(_,n,a,d,p,l,s,w,C=[],j=[],f),r),123===x)if(0===p)e(_,n,S,S,C,r,f,s,j);else switch(99===h&&110===o8(_,3)?100:h){case 100:case 108:case 109:case 115:e(t,S,S,o&&lt(lm(t,S,S,0,0,l,s,w,l,C=[],f),j),l,j,f,s,o?C:j);break;default:e(_,S,S,S,[""],j,0,s,j)}}d=p=m=0,v=y=1,w=_="",f=i;break;case 58:f=1+le(_),m=g;default:if(v0?o8(li,--ll):0,la--,10===lr&&(la=1,ln--),lr))continue}switch(_+=o6(x),x*v){case 38:y=p>0?1:(_+="\f",-1);break;case 44:s[d++]=(le(_)-1)*y,y=1;break;case 64:45===ld()&&(_+=lh(lu())),h=ld(),p=f=le(w=_+=function(e){for(;!lp(ld());)lu();return o7(li,e,ll)}(ll)),x++;break;case 45:45===g&&2==le(_)&&(v=0)}}return r}("",null,null,null,[""],t=lf(t=e),0,[0],t),li="",n),d)},f={key:t,sheet:new o$({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:l,registered:{},insert:function(e,t,n,a){u=n,p(e?e+"{"+t.styles+"}":t.styles),a&&(f.inserted[t.name]=!0)}};return f.sheet.hydrate(r),f}({key:"css"}):null);lV.Provider;var lz=l.createContext({}),lU={}.hasOwnProperty,lH="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",lq=function(e,t){var n={};for(var a in t)lU.call(t,a)&&(n[a]=t[a]);return n[lH]=e,n},lW=function(e){var t=e.cache,n=e.serialized,a=e.isStringTag;return lk(t,n,a),lB(function(){return lE(t,n,a)}),null},lK=(rn=function(e,t,n){var a,o,r,i=e.css;"string"==typeof i&&void 0!==t.registered[i]&&(i=t.registered[i]);var s=e[lH],c=[i],u="";"string"==typeof e.className?(a=t.registered,o=e.className,r="",o.split(" ").forEach(function(e){void 0!==a[e]?c.push(a[e]+";"):e&&(r+=e+" ")}),u=r):null!=e.className&&(u=e.className+" ");var d=lL(c,void 0,l.useContext(lz));u+=t.key+"-"+d.name;var p={};for(var f in e)lU.call(e,f)&&"css"!==f&&f!==lH&&(p[f]=e[f]);return p.className=u,n&&(p.ref=n),l.createElement(l.Fragment,null,l.createElement(lW,{cache:t,serialized:d,isStringTag:"string"==typeof s}),l.createElement(s,p))},(0,l.forwardRef)(function(e,t){return rn(e,(0,l.useContext)(lV),t)}));(0,c.e)(Q());var lY=function(e,t){var n=arguments;if(null==t||!lU.call(t,"css"))return l.createElement.apply(void 0,n);var a=n.length,o=Array(a);o[0]=lK,o[1]=lq(e,t);for(var r=2;r2?n-2:0),o=2;o-1}function l2(e){return l3(e)?window.pageYOffset:e.scrollTop}function l6(e,t){if(l3(e))return void window.scrollTo(0,t);e.scrollTop=t}function l5(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:lZ,o=l2(e),l=t-o,r=0;!function t(){var i;r+=10,l6(e,l*((i=(i=r)/n-1)*i*i+1)+o),rn.bottom?l6(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+o,e.scrollHeight)):a.top-otypeof window?window:{};l7.addEventListener&&l7.removeEventListener&&(l7.addEventListener("p",lZ,{get passive(){return l8=!0}}),l7.removeEventListener("p",lZ,!1));var re=l8;function rt(e){return null!=e}var rn,ra,ro=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a=h)return{placement:"bottom",maxHeight:n};if(S>=h&&!i)return r&&l5(c,_,160),{placement:"bottom",maxHeight:n};if(!i&&S>=o||i&&C>=o)return r&&l5(c,_,160),{placement:"bottom",maxHeight:i?C-y:S-y};if("auto"===l||i){var E=n,N=i?w:j;return N>=o&&(E=Math.min(N-y-s,n)),{placement:"top",maxHeight:E}}if("bottom"===l)return r&&l6(c,_),{placement:"bottom",maxHeight:n};break;case"top":if(w>=h)return{placement:"top",maxHeight:n};if(j>=h&&!i)return r&&l5(c,k,160),{placement:"top",maxHeight:n};if(!i&&j>=o||i&&w>=o){var D=n;return(!i&&j>=o||i&&w>=o)&&(D=i?w-x:j-x),r&&l5(c,k,160),{placement:"top",maxHeight:D}}return{placement:"bottom",maxHeight:n};default:throw Error('Invalid placement provided "'.concat(l,'".'))}return u}({maxHeight:a,menuEl:e,minHeight:n,placement:o,shouldScroll:i&&!t,isFixedPosition:t,controlHeight:v});f(l.maxHeight),g(l.placement),null==c||c(l.placement)}},[a,o,r,i,n,c,v]),t({ref:u,placerProps:oL(oL({},e),{},{placement:m||ri(o),maxHeight:p})})},ru=function(e,t){var n=e.theme,a=n.spacing.baseUnit,o=n.colors;return oL({textAlign:"center"},t?{}:{color:o.neutral40,padding:"".concat(2*a,"px ").concat(3*a,"px")})},rd=["size"],rp=["innerProps","isRtl","size"],rf={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},rh=function(e){var t=e.size,n=oU(e,rd);return lY("svg",tK({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:rf},n))},rm=function(e){return lY(rh,tK({size:20},e),lY("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},rg=function(e){return lY(rh,tK({size:20},e),lY("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},rv=function(e,t){var n=e.isFocused,a=e.theme,o=a.spacing.baseUnit,l=a.colors;return oL({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?l.neutral60:l.neutral20,padding:2*o,":hover":{color:n?l.neutral80:l.neutral40}})},rb=function(){var e=lG.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(ra||(ra=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"]))),ry=function(e){var t=e.delay,n=e.offset;return lY("span",{css:lG({animation:"".concat(rb," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},rx=["data"],rw=["innerRef","isDisabled","isHidden","inputClassName"],rC={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},rj={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":oL({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},rC)},rS=function(e){var t=e.children,n=e.innerProps;return lY("div",n,t)},r_={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return lY("div",tK({},l1(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||lY(rm,null))},Control:function(e){var t=e.children,n=e.isDisabled,a=e.isFocused,o=e.innerRef,l=e.innerProps,r=e.menuIsOpen;return lY("div",tK({ref:o},l1(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":a,"control--menu-is-open":r}),l,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return lY("div",tK({},l1(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||lY(rg,null))},DownChevron:rg,CrossIcon:rm,Group:function(e){var t=e.children,n=e.cx,a=e.getStyles,o=e.getClassNames,l=e.Heading,r=e.headingProps,i=e.innerProps,s=e.label,c=e.theme,u=e.selectProps;return lY("div",tK({},l1(e,"group",{group:!0}),i),lY(l,tK({},r,{selectProps:u,theme:c,getStyles:a,getClassNames:o,cx:n}),s),lY("div",null,t))},GroupHeading:function(e){var t=l0(e);t.data;var n=oU(t,rx);return lY("div",tK({},l1(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return lY("div",tK({},l1(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return lY("span",tK({},t,l1(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,a=l0(e),o=a.innerRef,l=a.isDisabled,r=a.isHidden,i=a.inputClassName,s=oU(a,rw);return lY("div",tK({},l1(e,"input",{"input-container":!0}),{"data-value":n||""}),lY("input",tK({className:t({input:!0},i),ref:o,style:oL({label:"input",color:"inherit",background:0,opacity:+!r,width:"100%"},rC),disabled:l},s)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,a=e.size,o=oU(e,rp);return lY("div",tK({},l1(oL(oL({},o),{},{innerProps:t,isRtl:n,size:void 0===a?4:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),lY(ry,{delay:0,offset:n}),lY(ry,{delay:160,offset:!0}),lY(ry,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,a=e.innerProps;return lY("div",tK({},l1(e,"menu",{menu:!0}),{ref:n},a),t)},MenuList:function(e){var t=e.children,n=e.innerProps,a=e.innerRef,o=e.isMulti;return lY("div",tK({},l1(e,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:a},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,a=e.controlElement,o=e.innerProps,i=e.menuPlacement,c=e.menuPosition,u=(0,l.useRef)(null),d=(0,l.useRef)(null),p=oz((0,l.useState)(ri(i)),2),f=p[0],h=p[1],m=(0,l.useMemo)(function(){return{setPortalPlacement:h}},[]),g=oz((0,l.useState)(null),2),v=g[0],b=g[1],y=(0,l.useCallback)(function(){if(a){var e,t={bottom:(e=a.getBoundingClientRect()).bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width},n="fixed"===c?0:window.pageYOffset,o=t[f]+n;(o!==(null==v?void 0:v.offset)||t.left!==(null==v?void 0:v.rect.left)||t.width!==(null==v?void 0:v.rect.width))&&b({offset:o,rect:t})}},[a,c,f,null==v?void 0:v.offset,null==v?void 0:v.rect.left,null==v?void 0:v.rect.width]);l$(function(){y()},[y]);var x=(0,l.useCallback)(function(){"function"==typeof d.current&&(d.current(),d.current=null),a&&u.current&&(d.current=(0,s.k)(a,u.current,y,{elementResize:"ResizeObserver"in window}))},[a,y]);l$(function(){x()},[x]);var w=(0,l.useCallback)(function(e){u.current=e,x()},[x]);if(!t&&"fixed"!==c||!v)return null;var C=lY("div",tK({ref:w},l1(oL(oL({},e),{},{offset:v.offset,position:c,rect:v.rect}),"menuPortal",{"menu-portal":!0}),o),n);return lY(rs.Provider,{value:m},t?(0,r.createPortal)(C,t):C)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,a=e.innerProps,o=oU(e,rr);return lY("div",tK({},l1(oL(oL({},o),{},{children:n,innerProps:a}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),a),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,a=e.innerProps,o=oU(e,rl);return lY("div",tK({},l1(oL(oL({},o),{},{children:n,innerProps:a}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),a),n)},MultiValue:function(e){var t=e.children,n=e.components,a=e.data,o=e.innerProps,l=e.isDisabled,r=e.removeProps,i=e.selectProps,s=n.Container,c=n.Label,u=n.Remove;return lY(s,{data:a,innerProps:oL(oL({},l1(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":l})),o),selectProps:i},lY(c,{data:a,innerProps:oL({},l1(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:i},t),lY(u,{data:a,innerProps:oL(oL({},l1(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},r),selectProps:i}))},MultiValueContainer:rS,MultiValueLabel:rS,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return lY("div",tK({role:"button"},n),t||lY(rm,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,a=e.isFocused,o=e.isSelected,l=e.innerRef,r=e.innerProps;return lY("div",tK({},l1(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":a,"option--is-selected":o}),{ref:l,"aria-disabled":n},r),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return lY("div",tK({},l1(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,a=e.isDisabled,o=e.isRtl;return lY("div",tK({},l1(e,"container",{"--is-disabled":a,"--is-rtl":o}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,a=e.innerProps;return lY("div",tK({},l1(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),a),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,a=e.isMulti,o=e.hasValue;return lY("div",tK({},l1(e,"valueContainer",{"value-container":!0,"value-container--is-multi":a,"value-container--has-value":o}),n),t)}},rk=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function rE(e,t){if(e.length!==t.length)return!1;for(var n,a,o=0;o1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return l?"option ".concat(a," is disabled. Select another option."):"option ".concat(a,", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,a=e.options,o=e.label,l=void 0===o?"":o,r=e.selectValue,i=e.isDisabled,s=e.isSelected,c=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&r)return"value ".concat(l," focused, ").concat(u(r,n),".");if("menu"===t&&c){var d="".concat(s?" selected":"").concat(i?" disabled":"");return"".concat(l).concat(d,", ").concat(u(a,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},rO=function(e){var t=e.ariaSelection,n=e.focusedOption,a=e.focusedValue,o=e.focusableOptions,r=e.isFocused,i=e.selectValue,s=e.selectProps,c=e.id,u=e.isAppleDevice,d=s.ariaLiveMessages,p=s.getOptionLabel,f=s.inputValue,h=s.isMulti,m=s.isOptionDisabled,g=s.isSearchable,v=s.menuIsOpen,b=s.options,y=s.screenReaderStatus,x=s.tabSelectsValue,w=s.isLoading,C=s["aria-label"],j=s["aria-live"],S=(0,l.useMemo)(function(){return oL(oL({},rP),d||{})},[d]),_=(0,l.useMemo)(function(){var e="";if(t&&S.onChange){var n=t.option,a=t.options,o=t.removedValue,l=t.removedValues,r=t.value,s=o||n||(Array.isArray(r)?null:r),c=s?p(s):"",u=a||l||void 0,d=u?u.map(p):[],f=oL({isDisabled:s&&m(s,i),label:c,labels:d},t);e=S.onChange(f)}return e},[t,S,m,i,p]),k=(0,l.useMemo)(function(){var e="",t=n||a,l=!!(n&&i&&i.includes(n));if(t&&S.onFocus){var r={focused:t,label:p(t),isDisabled:m(t,i),isSelected:l,options:o,context:t===n?"menu":"value",selectValue:i,isAppleDevice:u};e=S.onFocus(r)}return e},[n,a,p,m,S,o,i,u]),E=(0,l.useMemo)(function(){var e="";if(v&&b.length&&!w&&S.onFilter){var t=y({count:o.length});e=S.onFilter({inputValue:f,resultsMessage:t})}return e},[o,f,v,S,b,y,w]),N=(null==t?void 0:t.action)==="initial-input-focus",D=(0,l.useMemo)(function(){var e="";if(S.guidance){var t=a?"value":v?"menu":"input";e=S.guidance({"aria-label":C,context:t,isDisabled:n&&m(n,i),isMulti:h,isSearchable:g,tabSelectsValue:x,isInitialFocus:N})}return e},[C,n,a,h,m,g,v,S,i,x,N]),P=lY(l.Fragment,null,lY("span",{id:"aria-selection"},_),lY("span",{id:"aria-focused"},k),lY("span",{id:"aria-results"},E),lY("span",{id:"aria-guidance"},D));return lY(l.Fragment,null,lY(rD,{id:c},N&&P),lY(rD,{"aria-live":j,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},r&&!N&&P))},rT=[{base:"A",letters:"AⒶA\xc0\xc1\xc2ẦẤẪẨ\xc3ĀĂẰẮẴẲȦǠ\xc4ǞẢ\xc5ǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"\xc6ǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČ\xc7ḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺE\xc8\xc9\xcaỀẾỄỂẼĒḔḖĔĖ\xcbẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾI\xcc\xcd\xceĨĪĬİ\xcfḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃ\xd1ṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄO\xd2\xd3\xd4ỒỐỖỔ\xd5ṌȬṎŌṐṒŎȮȰ\xd6ȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬ\xd8ǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊU\xd9\xda\xdbŨṸŪṺŬ\xdcǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲ\xddŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚ\xe0\xe1\xe2ầấẫẩ\xe3āăằắẵẳȧǡ\xe4ǟả\xe5ǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"\xe6ǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċč\xe7ḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔe\xe8\xe9\xeaềếễểẽēḕḗĕė\xebẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘi\xec\xed\xeeĩīĭ\xefḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹń\xf1ṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞo\xf2\xf3\xf4ồốỗổ\xf5ṍȭṏōṑṓŏȯȱ\xf6ȫỏőǒȍȏơờớỡởợọộǫǭ\xf8ǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢs\xdfśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤu\xf9\xfa\xfbũṹūṻŭ\xfcǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳ\xfdŷỹȳẏ\xffỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],rR=RegExp("["+rT.map(function(e){return e.letters}).join("")+"]","g"),rI={};for(rM=0;rMtypeof window&&window.document&&window.document.createElement),rQ=0,rJ={capture:!1,passive:!1},r0=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},r1={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function r3(e){var t,n,a,o,r,i,s,c,u,d,p,f,h,m,g,v,b,y,x,w,C,j,S,_,k=e.children,E=e.lockEnabled,N=e.captureEnabled,D=(n=(t={isEnabled:void 0===N||N,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}).isEnabled,a=t.onBottomArrive,o=t.onBottomLeave,r=t.onTopArrive,i=t.onTopLeave,s=(0,l.useRef)(!1),c=(0,l.useRef)(!1),u=(0,l.useRef)(0),d=(0,l.useRef)(null),p=(0,l.useCallback)(function(e,t){if(null!==d.current){var n=d.current,l=n.scrollTop,u=n.scrollHeight,p=n.clientHeight,f=d.current,h=t>0,m=u-p-l,g=!1;m>t&&s.current&&(o&&o(e),s.current=!1),h&&c.current&&(i&&i(e),c.current=!1),h&&t>m?(a&&!s.current&&a(e),f.scrollTop=u,g=!0,s.current=!0):!h&&-t>l&&(r&&!c.current&&r(e),f.scrollTop=0,g=!0,c.current=!0),g&&rq(e)}},[a,o,r,i]),f=(0,l.useCallback)(function(e){p(e,e.deltaY)},[p]),h=(0,l.useCallback)(function(e){u.current=e.changedTouches[0].clientY},[]),m=(0,l.useCallback)(function(e){var t=u.current-e.changedTouches[0].clientY;p(e,t)},[p]),g=(0,l.useCallback)(function(e){if(e){var t=!!re&&{passive:!1};e.addEventListener("wheel",f,t),e.addEventListener("touchstart",h,t),e.addEventListener("touchmove",m,t)}},[m,h,f]),v=(0,l.useCallback)(function(e){e&&(e.removeEventListener("wheel",f,!1),e.removeEventListener("touchstart",h,!1),e.removeEventListener("touchmove",m,!1))},[m,h,f]),(0,l.useEffect)(function(){if(n){var e=d.current;return g(e),function(){v(e)}}},[n,g,v]),function(e){d.current=e}),P=(y=(b={isEnabled:E}).isEnabled,w=void 0===(x=b.accountForScrollbars)||x,C=(0,l.useRef)({}),j=(0,l.useRef)(null),S=(0,l.useCallback)(function(e){if(rZ){var t=document.body,n=t&&t.style;if(w&&rW.forEach(function(e){var t=n&&n[e];C.current[e]=t}),w&&rQtypeof window&&null!=window.navigator&&e.test((null==(t=window.navigator.userAgentData)?void 0:t.platform)||window.navigator.platform)}var r4=function(e){return e.label},r9=function(e){return e.value},r8={clearIndicator:rv,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,a=e.isFocused,o=e.theme,l=o.colors,r=o.borderRadius;return oL({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:o.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?l.neutral5:l.neutral0,borderColor:n?l.neutral10:a?l.primary:l.neutral20,borderRadius:r,borderStyle:"solid",borderWidth:1,boxShadow:a?"0 0 0 1px ".concat(l.primary):void 0,"&:hover":{borderColor:a?l.primary:l.neutral30}})},dropdownIndicator:rv,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,a=n.colors,o=n.spacing;return oL({label:"group",cursor:"default",display:"block"},t?{}:{color:a.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*o.baseUnit,paddingRight:3*o.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,a=e.theme,o=a.spacing.baseUnit,l=a.colors;return oL({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?l.neutral10:l.neutral20,marginBottom:2*o,marginTop:2*o})},input:function(e,t){var n=e.isDisabled,a=e.value,o=e.theme,l=o.spacing,r=o.colors;return oL(oL({visibility:n?"hidden":"visible",transform:a?"translateZ(0)":""},rj),t?{}:{margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,color:r.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,a=e.size,o=e.theme,l=o.colors,r=o.spacing.baseUnit;return oL({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:a,lineHeight:1,marginRight:a,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?l.neutral60:l.neutral20,padding:2*r})},loadingMessage:ru,menu:function(e,t){var n,a=e.placement,o=e.theme,l=o.borderRadius,r=o.spacing,i=o.colors;return oL((oA(n={label:"menu"},a?({bottom:"top",top:"bottom"})[a]:"bottom","100%"),oA(n,"position","absolute"),oA(n,"width","100%"),oA(n,"zIndex",1),n),t?{}:{backgroundColor:i.neutral0,borderRadius:l,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:r.menuGutter,marginTop:r.menuGutter})},menuList:function(e,t){var n=e.maxHeight,a=e.theme.spacing.baseUnit;return oL({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:a,paddingTop:a})},menuPortal:function(e){var t=e.rect,n=e.offset,a=e.position;return{left:t.left,position:a,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,a=n.spacing,o=n.borderRadius,l=n.colors;return oL({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:l.neutral10,borderRadius:o/2,margin:a.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,a=n.borderRadius,o=n.colors,l=e.cropWithEllipsis;return oL({overflow:"hidden",textOverflow:l||void 0===l?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:a/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,a=n.spacing,o=n.borderRadius,l=n.colors,r=e.isFocused;return oL({alignItems:"center",display:"flex"},t?{}:{borderRadius:o/2,backgroundColor:r?l.dangerLight:void 0,paddingLeft:a.baseUnit,paddingRight:a.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}})},noOptionsMessage:ru,option:function(e,t){var n=e.isDisabled,a=e.isFocused,o=e.isSelected,l=e.theme,r=l.spacing,i=l.colors;return oL({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:o?i.primary:a?i.primary25:"transparent",color:n?i.neutral20:o?i.neutral0:"inherit",padding:"".concat(2*r.baseUnit,"px ").concat(3*r.baseUnit,"px"),":active":{backgroundColor:n?void 0:o?i.primary:i.primary50}})},placeholder:function(e,t){var n=e.theme,a=n.spacing,o=n.colors;return oL({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:o.neutral50,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,a=e.theme,o=a.spacing,l=a.colors;return oL({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?l.neutral40:l.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,a=e.isMulti,o=e.hasValue,l=e.selectProps.controlShouldRenderValue;return oL({alignItems:"center",display:a&&o&&l?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},r7={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},ie={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:l9(),captureMenuScroll:!l9(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=oL({ignoreCase:!0,ignoreAccents:!0,stringify:rz,trim:!0,matchFrom:"any"},void 0),a=n.ignoreCase,o=n.ignoreAccents,l=n.stringify,r=n.trim,i=n.matchFrom,s=r?rV(t):t,c=r?rV(l(e)):l(e);return a&&(s=s.toLowerCase(),c=c.toLowerCase()),o&&(s=rB(s),c=rL(c)),"start"===i?c.substr(0,s.length)===s:c.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:r4,getOptionValue:r9,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function it(e,t,n,a){var o=iu(e,t,n),l=id(e,t,n),r=is(e,t),i=ic(e,t);return{type:"option",data:t,isDisabled:o,isSelected:l,label:r,value:i,index:a}}function ia(e,t){return e.options.map(function(n,a){if("options"in n){var o=n.options.map(function(n,a){return it(e,n,t,a)}).filter(function(t){return ir(e,t)});return o.length>0?{type:"group",data:n,options:o,index:a}:void 0}var l=it(e,n,t,a);return ir(e,l)?l:void 0}).filter(rt)}function io(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,oG(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function il(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,oG(n.options.map(function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}}))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e},[])}function ir(e,t){var n=e.inputValue,a=t.data,o=t.isSelected,l=t.label,r=t.value;return(!ih(e)||!o)&&ip(e,{label:l,value:r,data:a},void 0===n?"":n)}var ii=function(e,t){var n;return(null==(n=e.find(function(e){return e.data===t}))?void 0:n.id)||null},is=function(e,t){return e.getOptionLabel(t)},ic=function(e,t){return e.getOptionValue(t)};function iu(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function id(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var a=ic(e,t);return n.some(function(t){return ic(e,t)===a})}function ip(e,t,n){return!e.filterOption||e.filterOption(t,n)}var ih=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},im=1,ig=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&tG(r,e);var t,n,a,o=(t=oY(),function(){var e,n=oK(r);e=t?Reflect.construct(n,arguments,oK(this).constructor):n.apply(this,arguments);if(e&&("object"==oI(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===this)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return this});function r(e){var t;if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r),(t=o.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.isAppleDevice=r5(/^Mac/i)||r5(/^iPhone/i)||r5(/^iPad/i)||r5(/^Mac/i)&&navigator.maxTouchPoints>1,t.controlRef=null,t.getControlRef=function(e){t.controlRef=e},t.focusedOptionRef=null,t.getFocusedOptionRef=function(e){t.focusedOptionRef=e},t.menuListRef=null,t.getMenuListRef=function(e){t.menuListRef=e},t.inputRef=null,t.getInputRef=function(e){t.inputRef=e},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(e,n){var a=t.props,o=a.onChange;n.name=a.name,t.ariaOnChange(e,n),o(e,n)},t.setValue=function(e,n,a){var o=t.props,l=o.closeMenuOnSelect,r=o.isMulti,i=o.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:i}),l&&(t.setState({inputIsHiddenAfterUpdate:!r}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:n,option:a})},t.selectOption=function(e){var n=t.props,a=n.blurInputOnSelect,o=n.isMulti,l=n.name,r=t.state.selectValue,i=o&&t.isOptionSelected(e,r),s=t.isOptionDisabled(e,r);if(i){var c=t.getOptionValue(e);t.setValue(r.filter(function(e){return t.getOptionValue(e)!==c}),"deselect-option",e)}else{if(s)return void t.ariaOnChange(e,{action:"select-option",option:e,name:l});o?t.setValue([].concat(oG(r),[e]),"select-option",e):t.setValue(e,"select-option")}a&&t.blurInput()},t.removeValue=function(e){var n,a=t.props.isMulti,o=t.state.selectValue,l=t.getOptionValue(e),r=o.filter(function(e){return t.getOptionValue(e)!==l}),i=(n=r[0]||null,a?r:n);t.onChange(i,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e,n,a=t.state.selectValue;t.onChange((e=t.props.isMulti,n=[],e?n:null),{action:"clear",removedValues:a})},t.popValue=function(){var e,n=t.props.isMulti,a=t.state.selectValue,o=a[a.length-1],l=a.slice(0,a.length-1),r=(e=l[0]||null,n?l:e);o&&t.onChange(r,{action:"pop-value",removedValue:o})},t.getFocusedOptionId=function(e){return ii(t.state.focusableOptionsWithIds,e)},t.getFocusableOptionsWithIds=function(){return il(ia(t.props,t.state.selectValue),t.getElementId("option"))},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var e=arguments.length,n=Array(e),a=0;a5||l>5}},t.onTouchEnd=function(e){t.userIsDragging||(t.controlRef&&!t.controlRef.contains(e.target)&&t.menuListRef&&!t.menuListRef.contains(e.target)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(e){t.userIsDragging||t.onControlMouseDown(e)},t.onClearIndicatorTouchEnd=function(e){t.userIsDragging||t.onClearIndicatorMouseDown(e)},t.onDropdownIndicatorTouchEnd=function(e){t.userIsDragging||t.onDropdownIndicatorMouseDown(e)},t.handleInputChange=function(e){var n=t.props.inputValue,a=e.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(a,{action:"input-change",prevInputValue:n}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(e){t.props.onFocus&&t.props.onFocus(e),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(e){var n=t.props.inputValue;if(t.menuListRef&&t.menuListRef.contains(document.activeElement))return void t.inputRef.focus();t.props.onBlur&&t.props.onBlur(e),t.onInputChange("",{action:"input-blur",prevInputValue:n}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1})},t.onOptionHover=function(e){if(!(t.blockOptionHover||t.state.focusedOption===e)){var n=t.getFocusableOptions().indexOf(e);t.setState({focusedOption:e,focusedOptionId:n>-1?t.getFocusedOptionId(e):null})}},t.shouldHideSelectedOptions=function(){return ih(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var n=t.props,a=n.isMulti,o=n.backspaceRemovesValue,l=n.escapeClearsValue,r=n.inputValue,i=n.isClearable,s=n.isDisabled,c=n.menuIsOpen,u=n.onKeyDown,d=n.tabSelectsValue,p=n.openMenuOnFocus,f=t.state,h=f.focusedOption,m=f.focusedValue,g=f.selectValue;if(!s&&!("function"==typeof u&&(u(e),e.defaultPrevented))){switch(t.blockOptionHover=!0,e.key){case"ArrowLeft":if(!a||r)return;t.focusValue("previous");break;case"ArrowRight":if(!a||r)return;t.focusValue("next");break;case"Delete":case"Backspace":if(r)return;if(m)t.removeValue(m);else{if(!o)return;a?t.popValue():i&&t.clearValue()}break;case"Tab":if(t.isComposing||e.shiftKey||!c||!d||!h||p&&t.isOptionSelected(h,g))return;t.selectOption(h);break;case"Enter":if(229===e.keyCode)break;if(c){if(!h||t.isComposing)return;t.selectOption(h);break}return;case"Escape":c?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:r}),t.onMenuClose()):i&&l&&t.clearValue();break;case" ":if(r)return;if(!c){t.openMenu("first");break}if(!h)return;t.selectOption(h);break;case"ArrowUp":c?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":c?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!c)return;t.focusOption("pageup");break;case"PageDown":if(!c)return;t.focusOption("pagedown");break;case"Home":if(!c)return;t.focusOption("first");break;case"End":if(!c)return;t.focusOption("last");break;default:return}e.preventDefault()}},t.state.instancePrefix="react-select-"+(t.props.instanceId||++im),t.state.selectValue=lJ(e.value),e.menuIsOpen&&t.state.selectValue.length){var n=t.getFocusableOptionsWithIds(),a=t.buildFocusableOptions(),l=a.indexOf(t.state.selectValue[0]);t.state.focusableOptionsWithIds=n,t.state.focusedOption=a[l],t.state.focusedOptionId=ii(n,a[l])}return t}return n=[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&l4(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,a=t.menuIsOpen,o=this.state.isFocused;(o&&!n&&e.isDisabled||o&&a&&!e.menuIsOpen)&&this.focusInput(),o&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):o||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(l4(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,a=n.selectValue,o=n.isFocused,l=this.buildFocusableOptions(),r="first"===e?0:l.length-1;if(!this.props.isMulti){var i=l.indexOf(a[0]);i>-1&&(r=i)}this.scrollToFocusedOptionOnUpdate=!(o&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[r],focusedOptionId:this.getFocusedOptionId(l[r])},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,a=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var o=n.indexOf(a);a||(o=-1);var l=n.length-1,r=-1;if(n.length){switch(e){case"previous":r=0===o?0:-1===o?l:o-1;break;case"next":o>-1&&o0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var o=0,l=a.indexOf(n);n||(l=-1),"up"===e?o=l>0?l-1:a.length-1:"down"===e?o=(l+1)%a.length:"pageup"===e?(o=l-t)a.length-1&&(o=a.length-1):"last"===e&&(o=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[o],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[o])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(r7):oL(oL({},r7),this.props.theme):r7}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,a=this.getClassNames,o=this.getValue,l=this.selectOption,r=this.setValue,i=this.props,s=i.isMulti,c=i.isRtl,u=i.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:a,getValue:o,hasValue:this.hasValue(),isMulti:s,isRtl:c,options:u,selectOption:l,selectProps:i,setValue:r,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return iu(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return id(this.props,e,t)}},{key:"filterOption",value:function(e,t){return ip(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"!=typeof this.props.formatOptionLabel)return this.getOptionLabel(e);var n=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:a})}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,a=e.inputId,o=e.inputValue,r=e.tabIndex,i=e.form,s=e.menuIsOpen,c=e.required,u=this.getComponents().Input,d=this.state,p=d.inputIsHidden,f=d.ariaSelection,h=this.commonProps,m=a||this.getElementId("input"),g=oL(oL(oL({"aria-autocomplete":"list","aria-expanded":s,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},s&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?(null==f?void 0:f.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?l.createElement(u,tK({},h,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:t,isHidden:p,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:r,form:i,type:"text",value:o},g)):l.createElement(rH,tK({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:lZ,onFocus:this.onInputFocus,disabled:t,tabIndex:r,inputMode:"none",form:i,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,a=t.MultiValueContainer,o=t.MultiValueLabel,r=t.MultiValueRemove,i=t.SingleValue,s=t.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,p=u.isDisabled,f=u.isMulti,h=u.inputValue,m=u.placeholder,g=this.state,v=g.selectValue,b=g.focusedValue,y=g.isFocused;if(!this.hasValue()||!d)return h?null:l.createElement(s,tK({},c,{key:"placeholder",isDisabled:p,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),m);if(f)return v.map(function(t,i){var s=t===b,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return l.createElement(n,tK({},c,{components:{Container:a,Label:o,Remove:r},isFocused:s,isDisabled:p,key:u,index:i,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(h)return null;var x=v[0];return l.createElement(i,tK({},c,{data:x,isDisabled:p}),this.formatOptionLabel(x,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,a=n.isDisabled,o=n.isLoading,r=this.state.isFocused;if(!this.isClearable()||!e||a||!this.hasValue()||o)return null;var i={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return l.createElement(e,tK({},t,{innerProps:i,isFocused:r}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,a=n.isDisabled,o=n.isLoading,r=this.state.isFocused;return e&&o?l.createElement(e,tK({},t,{innerProps:{"aria-hidden":"true"},isDisabled:a,isFocused:r})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var a=this.commonProps,o=this.props.isDisabled,r=this.state.isFocused;return l.createElement(n,tK({},a,{isDisabled:o,isFocused:r}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,a=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return l.createElement(e,tK({},t,{innerProps:o,isDisabled:n,isFocused:a}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,a=t.GroupHeading,o=t.Menu,r=t.MenuList,i=t.MenuPortal,s=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,d=this.commonProps,p=this.state.focusedOption,f=this.props,h=f.captureMenuScroll,m=f.inputValue,g=f.isLoading,v=f.loadingMessage,b=f.minMenuHeight,y=f.maxMenuHeight,x=f.menuIsOpen,w=f.menuPlacement,C=f.menuPosition,j=f.menuPortalTarget,S=f.menuShouldBlockScroll,_=f.menuShouldScrollIntoView,k=f.noOptionsMessage,E=f.onMenuScrollToTop,N=f.onMenuScrollToBottom;if(!x)return null;var D,P=function(t,n){var a=t.type,o=t.data,r=t.isDisabled,i=t.isSelected,s=t.label,c=t.value,f=p===o,h=r?void 0:function(){return e.onOptionHover(o)},m=r?void 0:function(){return e.selectOption(o)},g="".concat(e.getElementId("option"),"-").concat(n),v={id:g,onClick:m,onMouseMove:h,onMouseOver:h,tabIndex:-1,role:"option","aria-selected":e.isAppleDevice?void 0:i};return l.createElement(u,tK({},d,{innerProps:v,data:o,isDisabled:r,isSelected:i,key:g,label:s,type:a,value:c,isFocused:f,innerRef:f?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())D=this.getCategorizedOptions().map(function(t){if("group"===t.type){var o=t.data,r=t.options,i=t.index,s="".concat(e.getElementId("group"),"-").concat(i),c="".concat(s,"-heading");return l.createElement(n,tK({},d,{key:s,data:o,options:r,Heading:a,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return P(e,"".concat(i,"-").concat(e.index))}))}if("option"===t.type)return P(t,"".concat(t.index))});else if(g){var O=v({inputValue:m});if(null===O)return null;D=l.createElement(s,d,O)}else{var T=k({inputValue:m});if(null===T)return null;D=l.createElement(c,d,T)}var R={minMenuHeight:b,maxMenuHeight:y,menuPlacement:w,menuPosition:C,menuShouldScrollIntoView:_},I=l.createElement(rc,tK({},d,R),function(t){var n=t.ref,a=t.placerProps,i=a.placement,s=a.maxHeight;return l.createElement(o,tK({},d,R,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:i}),l.createElement(r3,{captureEnabled:h,onTopArrive:E,onBottomArrive:N,lockEnabled:S},function(t){return l.createElement(r,tK({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:s,focusedOption:p}),D)}))});return j||"fixed"===C?l.createElement(i,tK({},d,{appendTo:j,controlElement:this.controlRef,menuPlacement:w,menuPosition:C}),I):I}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,a=t.isDisabled,o=t.isMulti,r=t.name,i=t.required,s=this.state.selectValue;if(i&&!this.hasValue()&&!a)return l.createElement(r6,{name:r,onFocus:this.onValueInputFocus});if(!(!r||a))if(o)if(n){var c=s.map(function(t){return e.getOptionValue(t)}).join(n);return l.createElement("input",{name:r,type:"hidden",value:c})}else{var u=s.length>0?s.map(function(t,n){return l.createElement("input",{key:"i-".concat(n),name:r,type:"hidden",value:e.getOptionValue(t)})}):l.createElement("input",{name:r,type:"hidden",value:""});return l.createElement("div",null,u)}else{var d=s[0]?this.getOptionValue(s[0]):"";return l.createElement("input",{name:r,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,a=t.focusedOption,o=t.focusedValue,r=t.isFocused,i=t.selectValue,s=this.getFocusableOptions();return l.createElement(rO,tK({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:a,focusedValue:o,isFocused:r,selectValue:i,focusableOptions:s,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,a=e.SelectContainer,o=e.ValueContainer,r=this.props,i=r.className,s=r.id,c=r.isDisabled,u=r.menuIsOpen,d=this.state.isFocused,p=this.commonProps=this.getCommonProps();return l.createElement(a,tK({},p,{className:i,innerProps:{id:s,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),l.createElement(t,tK({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),l.createElement(o,tK({},p,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),l.createElement(n,tK({},p,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],a=[{key:"getDerivedStateFromProps",value:function(e,t){var n,a=t.prevProps,o=t.clearFocusValueOnUpdate,l=t.inputIsHiddenAfterUpdate,r=t.ariaSelection,i=t.isFocused,s=t.prevWasFocused,c=t.instancePrefix,u=e.options,d=e.value,p=e.menuIsOpen,f=e.inputValue,h=e.isMulti,m=lJ(d),g={};if(a&&(d!==a.value||u!==a.options||p!==a.menuIsOpen||f!==a.inputValue)){var v,b=p?io(ia(e,m)):[],y=p?il(ia(e,m),"".concat(c,"-option")):[],x=o?function(e,t){var n=e.focusedValue,a=e.selectValue.indexOf(n);if(a>-1){if(t.indexOf(n)>-1)return n;if(a-1?v:b[0],C=ii(y,w);g={selectValue:m,focusedOption:w,focusedOptionId:C,focusableOptionsWithIds:y,focusedValue:x,clearFocusValueOnUpdate:!1}}var j=null!=l&&e!==a?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},S=r,_=i&&s;return i&&!_&&(S={value:(n=m[0]||null,h?m:n),options:m,action:"initial-input-focus"},_=!s),(null==r?void 0:r.action)==="initial-input-focus"&&(S=null),oL(oL(oL({},g),j),{},{prevProps:e,ariaSelection:S,prevWasFocused:_})}}],n&&oW(r.prototype,n),a&&oW(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r}(l.Component);ig.defaultProps=ie;var iv=(0,l.forwardRef)(function(e,t){var n=oq(e);return l.createElement(ig,tK({ref:t},n))}),ib=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],iy=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,a=String(e).toLowerCase(),o=String(n.getOptionValue(t)).toLowerCase(),l=String(n.getOptionLabel(t)).toLowerCase();return o===a||l===a},ix={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,t,n,a){return!(!e||t.some(function(t){return iy(e,t,a)})||n.some(function(t){return iy(e,t,a)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}},iw=(0,l.forwardRef)(function(e,t){var n,a,o,r,i,s,c,u,d,p,f,h,m,g,v,b,y,x,w,C,j,S,_,k,E,N,D,P,O=(o=void 0!==(a=(n=oq(e)).allowCreateWhileLoading)&&a,i=void 0===(r=n.createOptionPosition)?"last":r,c=void 0===(s=n.formatCreateLabel)?ix.formatCreateLabel:s,d=void 0===(u=n.isValidNewOption)?ix.isValidNewOption:u,f=void 0===(p=n.getNewOptionData)?ix.getNewOptionData:p,h=n.onCreateOption,g=void 0===(m=n.options)?[]:m,v=n.onChange,x=void 0===(y=(b=oU(n,ib)).getOptionValue)?r9:y,C=void 0===(w=b.getOptionLabel)?r4:w,j=b.inputValue,S=b.isLoading,_=b.isMulti,k=b.value,E=b.name,N=(0,l.useMemo)(function(){return d(j,lJ(k),g,{getOptionValue:x,getOptionLabel:C})?f(j,c(j)):void 0},[c,f,C,x,j,d,g,k]),D=(0,l.useMemo)(function(){return(o||!S)&&N?"first"===i?[N].concat(oG(g)):[].concat(oG(g),[N]):g},[o,i,S,N,g]),P=(0,l.useCallback)(function(e,t){if("select-option"!==t.action)return v(e,t);var n=Array.isArray(e)?e:[e];if(n[n.length-1]===N){if(h)h(j);else{var a,o=f(j,j);v((a=[].concat(oG(lJ(k)),[o]),_?a:o),{action:"create-option",name:E,option:o})}return}v(e,t)},[f,j,_,E,N,h,v,k]),oL(oL({},b),{},{options:D,onChange:P}));return l.createElement(ig,tK({ref:t},O))}),iC="clear-indicator",ij=e=>{let{clearValue:t,innerProps:{ref:n,...a}}=e;return(0,u.jsx)("div",{className:iC,ref:"string"==typeof n?null:n,...a,onKeyDown:e=>{"Enter"===e.key&&(t(),e.stopPropagation())},role:"button",tabIndex:0,children:(0,u.jsx)(s.a,{className:"".concat(iC,"__icon")})})},iS=e=>{let{children:t,innerProps:n,selectProps:{customProps:{disableKeyDown:a,disableMouseDown:o}={}}={}}=e;return(0,u.jsx)(l.Fragment,{children:(0,u.jsx)(r_.Control,{...e,innerProps:{...n,onKeyDown:e=>{if(a){e.stopPropagation();let t=new CustomEvent("bypassKeyDown",{detail:e});document.dispatchEvent(t)}},onMouseDown:e=>{o||n.onMouseDown(e)}},children:t})})},i_="dropdown-indicator",ik=e=>{let{innerProps:{ref:t,...n}}=e;return(0,u.jsx)("button",{className:i_,ref:t,...n,onKeyDown:e=>{"Enter"===e.key&&(e.key=" ")},type:"button",children:(0,u.jsx)(eq,{className:"".concat(i_,"__icon")})})},iE=e=>(0,u.jsx)(l.Fragment,{children:(0,u.jsx)(r_.Input,{...e,"aria-activedescendant":void 0})}),iN="multi-value";function iD(e,t){return"function"==typeof t?t(e):null==e?void 0:e.value}var iP=e=>{let t=(0,h.c)(26),{className:n,data:a,innerProps:o,isDisabled:r,selectProps:i}=e,s;t[0]!==i?(s=void 0===i?{}:i,t[0]=i,t[1]=s):s=t[1];let{customProps:c,getOptionValue:d,isSortable:p}=s,f;t[2]!==c?(f=void 0===c?{}:c,t[2]=c,t[3]=f):f=t[3];let{disableMouseDown:m}=f,g;t[4]!==a||t[5]!==d?(g=iD(a,d),t[4]=a,t[5]=d,t[6]=g):g=t[6];let v=g,b=!p,y;t[7]!==v||t[8]!==b?(y={id:v,disabled:b},t[7]=v,t[8]=b,t[9]=y):y=t[9];let{attributes:x,isDragging:w,listeners:C,setNodeRef:j,transform:S}=tF(y),_=!r&&p&&"draggable",k=w&&"".concat(iN,"--is-dragging"),E;t[10]!==n||t[11]!==_||t[12]!==k?(E=[iN,n,_,k].filter(Boolean),t[10]=n,t[11]=_,t[12]=k,t[13]=E):E=t[13];let N=E.join(" "),D;if(t[14]!==x||t[15]!==N||t[16]!==m||t[17]!==o||t[18]!==p||t[19]!==C||t[20]!==e||t[21]!==j||t[22]!==S){let n;t[24]!==m?(n=e=>{m||e.stopPropagation()},t[24]=m,t[25]=n):n=t[25],D=(0,u.jsx)(l.Fragment,{children:(0,u.jsx)(r_.MultiValue,{...e,className:N,innerProps:{...p?{...x,...C}:{},...o,onMouseDown:n,ref:j,style:p?{transform:S,...null==x?void 0:x.style}:{}}})}),t[14]=x,t[15]=N,t[16]=m,t[17]=o,t[18]=p,t[19]=C,t[20]=e,t[21]=j,t[22]=S,t[23]=D}else D=t[23];return D},iO="multi-value-label",iT=e=>{let{data:t,selectProps:{customProps:{draggableProps:n,editableProps:a}={}}={}}=e,o="".concat(iO,"__text");return(0,u.jsx)("div",{className:iO,children:(0,u.jsx)(r_.MultiValueLabel,{...e,innerProps:{className:o,...a&&a(t,o,e.selectProps)||{},...n||{}}})})},iR="multi-value-remove",iI=e=>{let t=(0,h.c)(12),{innerProps:n}=e,{className:a,onClick:o,onTouchEnd:r}=n,[i,c]=l.useState(!1),{t:d}=(0,s.d)(),p;if(t[0]!==a||t[1]!==o||t[2]!==r||t[3]!==i||t[4]!==d){let e,n,l,f=d("general:remove"),h;t[6]!==a?(h=[iR,a].filter(Boolean),t[6]=a,t[7]=h):h=t[7],t[8]!==o?(e=e=>{c(!1),o(e)},t[8]=o,t[9]=e):e=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),l=()=>c(!1),t[10]=n,t[11]=l):(n=t[10],l=t[11]),p=(0,u.jsxs)("button",{"aria-label":f,className:h.join(" "),onClick:e,onKeyDown:iF,onMouseDown:iA,onMouseEnter:n,onMouseLeave:l,onTouchEnd:r,type:"button",children:[(0,u.jsx)(tt,{className:"".concat(iR,"__tooltip"),show:i,children:d("general:remove")}),(0,u.jsx)(s.a,{className:"".concat(iR,"__icon")})]}),t[0]=a,t[1]=o,t[2]=r,t[3]=i,t[4]=d,t[5]=p}else p=t[5];return p};function iF(e){"Enter"===e.key&&e.stopPropagation()}function iA(e){return e.stopPropagation()}var iM=e=>{let{children:t,className:n}=e;return(0,u.jsx)(l.Fragment,{children:(0,u.jsx)(r_.SingleValue,{...e,className:["react-select--single-value",n].filter(Boolean).join(" "),children:t})})},iL="value-container",iB=e=>{let{selectProps:{customProps:t}={}}=e;return(0,u.jsxs)("div",{className:iL,ref:null==t?void 0:t.droppableRef,children:[(null==t?void 0:t.valueContainerLabel)&&(0,u.jsx)("span",{className:"".concat(iL,"__label"),children:null==t?void 0:t.valueContainerLabel}),(0,u.jsx)(r_.ValueContainer,{...e})]})},iV=e=>{let{i18n:t,t:n}=(0,s.d)(),[a,o]=l.useState(""),r=(0,l.useId)(),[c,p]=l.useState(!1);(0,l.useEffect)(()=>{p(!0)},[]);let{className:f,components:h,customProps:m,disabled:g=!1,filterOption:v,getOptionValue:b,isClearable:y=!0,isCreatable:x,isLoading:w,isSearchable:C=!0,noOptionsMessage:j=()=>n("general:noOptions"),numberOnly:S=!1,onChange:_,onMenuClose:k,onMenuOpen:E,options:N,placeholder:D=n("general:selectValue"),showError:P,value:O}=e,T=()=>n("general:loading")+"...",R=[f,"react-select",P&&"react-select--error"].filter(Boolean).join(" "),I={menu:e=>({...e,zIndex:void 0})};return c?x?(0,u.jsx)(iw,{captureMenuScroll:!0,isLoading:w,...e,className:R,classNamePrefix:"rs",components:{ClearIndicator:ij,Control:iS,DropdownIndicator:ik,Input:iE,MultiValue:iP,MultiValueLabel:iT,MultiValueRemove:iI,SingleValue:iM,ValueContainer:iB,...h},filterOption:v,inputValue:a,instanceId:r,isClearable:y,isDisabled:g,isSearchable:C,loadingMessage:T,menuPlacement:"auto",noOptionsMessage:j,onChange:_,onInputChange:e=>o(e),onKeyDown:e=>{if(!0===S){let t=!/\D/.test(e.key),n=["Tab","Escape","Backspace","Enter","ArrowRight","ArrowLeft","ArrowUp","ArrowDown"].includes(e.key);if(!t&&!n)return void e.preventDefault()}if(!(!O||!a||""===a.trim())&&!(v&&!v(null,a)))switch(e.key){case"Enter":case"Tab":_([...O,(e=>({label:e,value:e}))(a)]),o(""),e.preventDefault()}},onMenuClose:k,onMenuOpen:E,options:N,placeholder:(0,d.s)(D,t),styles:I,unstyled:!0,value:O}):(0,u.jsx)(iv,{captureMenuScroll:!0,customProps:m,isLoading:w,...e,className:R,classNamePrefix:"rs",components:{ClearIndicator:ij,Control:iS,DropdownIndicator:ik,Input:iE,MultiValue:iP,MultiValueLabel:iT,MultiValueRemove:iI,SingleValue:iM,ValueContainer:iB,...h},filterOption:v,getOptionValue:b,instanceId:r,isClearable:y,isDisabled:g,isSearchable:C,loadingMessage:T,menuPlacement:"auto",noOptionsMessage:j,onChange:_,onMenuClose:k,onMenuOpen:E,options:N,placeholder:(0,d.s)(D,t),styles:I,unstyled:!0,value:O}):(0,u.jsx)(i.f,{height:"calc(var(--base) * 2 + 2px)"})},iz=e=>{let{getOptionValue:t,onChange:n,value:a}=e,o=[];return a&&(o=(Array.isArray(a)?a:[a]).map(e=>iD(e,t))),(0,u.jsx)(tM,{className:"react-select-container",ids:o,onDragEnd:e=>{let{moveFromIndex:t,moveToIndex:o}=e,l=a;a&&Array.isArray(a)&&(l=ty(a,t,o)),n(l)},children:(0,u.jsx)(iV,{...e})})},iU=e=>{let{isMulti:t,isSortable:n}=e;return t&&n?(0,u.jsx)(iz,{...e}):(0,u.jsx)(iV,{...e})},iH=e=>{let{id:t,onChange:n,options:a,readOnly:o,required:r,selectedTimezone:i}=e,{t:c}=(0,s.d)(),d=a.map(e=>"object"==typeof e&&(e.value||""===e.value)?e:{label:e,value:e}),p=(0,l.useMemo)(()=>d.find(e=>("string"==typeof e?e:e.value)===(i||"UTC")),[d,i]),f=!!o||1===d.length;return(0,u.jsxs)("div",{className:"timezone-picker-wrapper",children:[(0,u.jsx)(nA,{htmlFor:t,label:"".concat(c("general:timezone")," ").concat(r?"*":""),required:r,unstyled:!0}),(0,u.jsx)(iU,{className:"timezone-picker",disabled:f,inputId:t,isClearable:!r,isCreatable:!1,onChange:e=>{n&&n((null==e?void 0:e.value)||"")},options:d,value:p})]})},iq="date-time-field",iW=aB(e=>{let{field:t,field:{admin:{className:n,date:a,description:o,placeholder:r}={},label:c,localized:p,required:f,timezone:h},path:m,readOnly:g,validate:v}=e,b=(null==a?void 0:a.pickerAppearance)||"default",y=Intl.DateTimeFormat().resolvedOptions().timeZone,{config:x}=(0,i.c)(),{i18n:w}=(0,s.d)(),{dispatchFields:C,setModified:j}=eC(),{customComponents:{AfterInput:S,BeforeInput:_,Description:k,Error:E,Label:N}={},disabled:D,path:P,setValue:O,showError:T,value:R}=aA({potentiallyStalePath:m,validate:(0,l.useCallback)((e,t)=>{if("function"==typeof v)return v(e,{...t,required:f})},[v,f])}),I=P+"_tz",F=eE(e=>{let[t,n]=e;return null==t?void 0:t[I]}),A=(0,l.useMemo)(()=>h&&"object"==typeof h&&h.supportedTimezones?h.supportedTimezones:x.admin.timezones.supportedTimezones,[x.admin.timezones.supportedTimezones,h]),M=["dayOnly","default","monthOnly"].includes(b),L=null==F?void 0:F.value,B=f||h&&"object"==typeof h&&h.required,V=(0,l.useMemo)(()=>{if(h&&L&&y&&R){let e=nW.tz(L),t=nW.tz(y),n=ah(new nW(R).withTimeZone(L),e);return ah(n,t).toISOString()}return R},[h,L,R,y]),z=(0,l.useMemo)(()=>aV(t),[t]),U=(0,l.useCallback)(e=>{if(!(g||D))if(h&&L&&e){let t=nW.tz(L);if(M){let n=e.getTimezoneOffset()/60,a=e.getHours()+n;e.setHours(a),O(ah(e,t).toISOString()||null)}else O(ah(new nW(e),t).toISOString()||null)}else O((null==e?void 0:e.toISOString())||null)},[g,D,h,L,M,O]),H=(0,l.useCallback)(e=>{I&&(C({type:"UPDATE",path:I,value:e}),j(!0))},[C,j,I]);return(0,u.jsxs)("div",{className:[az,iq,n,T&&"".concat(iq,"--has-error"),(g||D)&&"read-only"].filter(Boolean).join(" "),style:z,children:[(0,u.jsx)(el,{CustomComponent:N,Fallback:(0,u.jsx)(nA,{label:c,localized:p,path:P,required:f})}),(0,u.jsxs)("div",{className:"".concat(az,"__wrap"),id:"field-".concat(P.replace(/\./g,"__")),children:[(0,u.jsx)(el,{CustomComponent:E,Fallback:(0,u.jsx)(tU,{path:P,showError:T})}),_,(0,u.jsx)(oR,{...a,onChange:U,overrides:{...null==a?void 0:a.overrides},placeholder:(0,d.s)(r,w),readOnly:g||D,value:V}),h&&A.length>0&&(0,u.jsx)(iH,{id:"".concat(P,"-timezone-picker"),onChange:H,options:A,readOnly:g||D,required:B,selectedTimezone:L}),S]}),(0,u.jsx)(el,{CustomComponent:k,Fallback:(0,u.jsx)(tz,{description:o,path:P})})]})}),iK=aB(e=>{let{field:t,field:{admin:{autoComplete:n,className:a,description:o,placeholder:r}={},label:i,localized:c,required:p}={},path:f,readOnly:h,validate:m}=e,{i18n:g}=(0,s.d)(),{customComponents:{AfterInput:v,BeforeInput:b,Description:y,Error:x,Label:w}={},disabled:C,path:j,setValue:S,showError:_,value:k}=aA({potentiallyStalePath:f,validate:(0,l.useCallback)((e,t)=>{if("function"==typeof m)return m(e,{...t,required:p})},[m,p])}),E=(0,l.useMemo)(()=>aV(t),[t]);return(0,u.jsxs)("div",{className:[az,"email",a,_&&"error",(h||C)&&"read-only"].filter(Boolean).join(" "),style:E,children:[(0,u.jsx)(el,{CustomComponent:w,Fallback:(0,u.jsx)(nA,{label:i,localized:c,path:j,required:p})}),(0,u.jsxs)("div",{className:"".concat(az,"__wrap"),children:[(0,u.jsx)(el,{CustomComponent:x,Fallback:(0,u.jsx)(tU,{path:j,showError:_})}),b,(0,u.jsx)("input",{autoComplete:n,disabled:h||C,id:"field-".concat(j.replace(/\./g,"__")),name:j,onChange:S,placeholder:(0,d.s)(r,g),required:p,type:"email",value:k||""}),v]}),(0,u.jsx)(el,{CustomComponent:y,Fallback:(0,u.jsx)(tz,{description:o,path:j})})]})}),iY=(0,l.createContext)(!1),iG=e=>{let{children:t,withinRow:n=!0}=e;return(0,u.jsx)(iY,{value:n,children:t})},i$=(0,l.createContext)(!1),iX=e=>{let{children:t,withinTab:n=!0}=e;return(0,u.jsx)(i$,{value:n,children:t})},iZ=(0,l.createContext)(!1),iQ=e=>{let{children:t,withinGroup:n=!0}=e;return(0,u.jsx)(iZ,{value:n,children:t})},iJ="group-field",i0=aB(e=>{let{field:t,field:{admin:{className:n,description:a,hideGutter:o}={},fields:r,label:i},indexPath:c,parentPath:p,parentSchemaPath:f,path:h,permissions:g,readOnly:v,schemaPath:b}=e,y=null!=b?b:"group"===t.type&&(0,m.jY)(t)?t.name:h,{i18n:x}=(0,s.d)(),{isWithinCollapsible:w}=a2(),C=(0,l.use)(iZ),j=(0,l.use)(iY),S=(0,l.use)(i$),{customComponents:{AfterInput:_,BeforeInput:k,Description:E,Label:N}={},errorPaths:D}=aA({path:h}),P=eS(),O=D.length,T=P&&O>0,R=!(w||C||j),I=(0,l.useMemo)(()=>aV(t),[t]);return(0,u.jsxs)("div",{className:[az,iJ,R&&"".concat(iJ,"--top-level"),w&&"".concat(iJ,"--within-collapsible"),C&&"".concat(iJ,"--within-group"),j&&"".concat(iJ,"--within-row"),S&&"".concat(iJ,"--within-tab"),!o&&C&&"".concat(iJ,"--gutter"),T&&"".concat(iJ,"--has-error"),n].filter(Boolean).join(" "),id:"field-".concat(null==h?void 0:h.replace(/\./g,"__")),style:I,children:[(0,u.jsx)(iQ,{children:(0,u.jsxs)("div",{className:"".concat(iJ,"__wrap"),children:[!!(N||E||i||T)&&(0,u.jsxs)("div",{className:"".concat(iJ,"__header"),children:[!!(N||E||i)&&(0,u.jsxs)("header",{children:[(0,u.jsx)(el,{CustomComponent:N,Fallback:(0,u.jsx)("h3",{className:"".concat(iJ,"__title"),children:(0,u.jsx)(nA,{as:"span",label:(0,d.s)(i,x),localized:!1,path:h,required:!1})})}),(0,u.jsx)(el,{CustomComponent:E,Fallback:(0,u.jsx)(tz,{description:a,path:h})})]}),T&&(0,u.jsx)(tB,{count:O,i18n:x,withMessage:!0})]}),k,(0,m.jY)(t)?(0,u.jsx)(pa,{fields:r,margins:"small",parentIndexPath:"",parentPath:h,parentSchemaPath:y,permissions:!0===g?g:null==g?void 0:g.fields,readOnly:v}):(0,u.jsx)(pa,{fields:r,margins:"small",parentIndexPath:c,parentPath:p,parentSchemaPath:f,permissions:g,readOnly:v})]})}),_]})}),i1=aB(e=>{let t=(0,h.c)(13),{disableModifyingForm:n,path:a,value:o}=e,r=void 0===n||n,i;t[0]!==a?(i={potentiallyStalePath:a},t[0]=a,t[1]=i):i=t[1];let{formInitializing:s,path:c,setValue:d,value:p}=aA(i),f,m;t[2]!==r||t[3]!==s||t[4]!==d||t[5]!==o?(f=()=>{void 0===o||s||d(o,r)},m=[o,d,r,s],t[2]=r,t[3]=s,t[4]=d,t[5]=o,t[6]=f,t[7]=m):(f=t[6],m=t[7]),(0,l.useEffect)(f,m);let g="field-".concat(null==c?void 0:c.replace(/\./g,"__")),v=p||"",b;return t[8]!==c||t[9]!==d||t[10]!==g||t[11]!==v?(b=(0,u.jsx)("input",{id:g,name:c,onChange:d,type:"hidden",value:v}),t[8]=c,t[9]=d,t[10]=g,t[11]=v,t[12]=b):b=t[12],b}),i3=(0,c.e)(J(),1),i2=(0,l.createContext)({}),i6=e=>{let{children:t,...n}=e;return(0,u.jsx)(i2,{value:{isInDrawer:!!n.drawerSlug,...n},children:t})};function i5(e){let t=e.toString();return _.q(t,{depth:10,ignoreQueryPrefix:!0})}var i4=(0,l.createContext)({}),i9=()=>(0,l.use)(i4),i8=(0,l.createContext)(!1),i7=e=>{let t={...e};return Object.entries(t).forEach(e=>{let[n,a]=e;if("columns"===n&&("[]"===a||Array.isArray(t[n])&&0===t[n].length)&&delete t[n],"where"!==n||"object"!=typeof a||Object.keys(a).length||delete t[n],("limit"===n||"page"===n)&&"string"==typeof a){let e=parseInt(a,10);t[n]=Number.isNaN(e)?void 0:e}"page"===n&&0===a&&delete t[n],""===a&&delete t[n]}),t},se=e=>{var t;let{children:n,collectionSlug:a,data:o,modifySearchParams:r,onQueryChange:s,orderableFieldName:c,query:d}=e,p=(0,f.useRouter)(),h=(0,f.useSearchParams)(),{startRouteTransition:m}=eM(),[g,b]=(0,l.useState)(!1),{getEntityConfig:y}=(0,i.c)(),x=y({collectionSlug:a}),w=(0,l.useMemo)(()=>i7(i5(h)),[h]),C=(0,l.useRef)({});C.current.modified=g;let{onQueryChange:j}=(()=>{let e=(0,l.use)(i2);if(!e)throw Error("useListDrawerContext must be used within a ListDrawerContextProvider");return e})(),[S,_]=(0,l.useState)(()=>r?w:{limit:d.limit,sort:d.sort}),k=(0,l.useCallback)(async(e,t)=>{b(void 0===t||t);let n=((e,t,n)=>{var a,o,l,r,i,s;let c,u="page"in t?t.page:null==e?void 0:e.page;return["where","search","groupBy"].some(e=>e in t&&!["limit","page"].includes(e))&&(u=1),["where","search","page","limit","groupBy","sort"].some(e=>e in t)||(c={...(null==e?void 0:e.queryByGroup)||{},...t.queryByGroup?Object.fromEntries(Object.entries(t.queryByGroup).map(t=>{var n;let[a,o]=t;return[a,{...(null==e||null==(n=e.queryByGroup)?void 0:n[a])||{},...o}]})):{}}),{...e,...t,columns:"columns"in t?t.columns:e.columns,groupBy:"groupBy"in t?t.groupBy:null!=(r=null==e?void 0:e.groupBy)?r:null==n||null==(a=n.defaults)?void 0:a.groupBy,limit:"limit"in t?t.limit:null!=(i=null==e?void 0:e.limit)?i:null==n||null==(o=n.defaults)?void 0:o.limit,page:u,preset:"preset"in t?t.preset:null==e?void 0:e.preset,queryByGroup:c,search:"search"in t?t.search:null==e?void 0:e.search,sort:"sort"in t?t.sort:null!=(s=null==e?void 0:e.sort)?s:null==n||null==(l=n.defaults)?void 0:l.sort,where:"where"in t?t.where:null==e?void 0:e.where}})(S,e,{defaults:{limit:d.limit,sort:d.sort}});r?m(()=>p.replace("".concat(v.A({...n,columns:JSON.stringify(n.columns),queryByGroup:JSON.stringify(n.queryByGroup)},{addQueryPrefix:!0})))):("function"==typeof j||"function"==typeof s)&&(j||s)(n),_(n)},[S,d.limit,d.sort,r,j,s,m,p]),E=(0,l.useCallback)(async e=>{await k({page:e})},[k]),N=l.useCallback(async e=>{await k({limit:e,page:1})},[k]),D=(0,l.useCallback)(async e=>{await k({search:""===e?void 0:e})},[k]),P=(0,l.useCallback)(async e=>{await k({sort:e})},[k]),O=(0,l.useCallback)(async e=>{await k({where:e})},[k]),T=nN(()=>{let e=i7({...S||{},...d||{}}),t="?".concat(v.A({...e,columns:JSON.stringify(e.columns),queryByGroup:JSON.stringify(e.queryByGroup)}));window.location.search!==t&&(_(e),window.history.replaceState(null,"",t))});return(0,l.useEffect)(()=>{r&&T()},[r,d]),(0,u.jsx)(i4,{value:{collectionSlug:a,data:o,handlePageChange:E,handlePerPageChange:N,handleSearchChange:D,handleSortChange:P,handleWhereChange:O,isGroupingBy:!!((null==x||null==(t=x.admin)?void 0:t.groupBy)&&(null==S?void 0:S.groupBy)),orderableFieldName:c,query:S,refineListData:k,setModified:b,...C.current},children:(0,u.jsx)(i8,{value:g,children:n})})},st=(0,l.createContext)(void 0),sn=()=>{let e=l.use(st);if(void 0===e)throw Error("useServerFunctions must be used within a ServerFunctionsProvider");return e},sa=(0,l.createContext)({}),so=e=>{let{children:t,collectionSlug:n,columnState:a,LinkedCellOverride:o}=e,{getEntityConfig:r}=(0,i.c)(),{query:s,refineListData:c}=i9(),{admin:{defaultColumns:d}={}}=r({collectionSlug:n}),[p,f]=l.useOptimistic(a,(e,t)=>t),h=(0,l.useRef)({}),m=(0,l.useCallback)(async e=>{let t=(p||[]).map(t=>t.accessor===e?{...t,active:!t.active}:t);(0,l.startTransition)(()=>{f(t)}),await c({columns:(0,S.F)(t)})},[c,p,f]),g=(0,l.useCallback)(async e=>{let{fromIndex:t,toIndex:n}=e,a=[...p||[]],[o]=a.splice(t,1);a.splice(n,0,o),(0,l.startTransition)(()=>{f(a)}),await c({columns:(0,S.F)(a)})},[p,c,f]),v=(0,l.useCallback)(async e=>{let t=s.columns;e.forEach(e=>{let n=t.findIndex(t=>e===t);void 0!==n&&"-"===t[n][0]&&(t[n]=e.slice(1))}),await c({columns:t})},[s,c]),b=l.useCallback(async()=>{await c({columns:d||[]})},[d,c]);return(0,u.jsx)(sa,{value:{columns:p,LinkedCellOverride:o,moveColumn:g,resetColumnsState:b,setActiveColumns:v,toggleColumn:m,...h.current},children:t})},sl="pill-selector",sr=e=>{let{draggable:t,onClick:n,pills:a}=e,o=l.useMemo(()=>a.map((e,a)=>{var o,l;return(0,u.jsx)(oe,{alignIcon:"left","aria-checked":e.selected,className:["".concat(sl,"__pill"),e.selected&&"".concat(sl,"__pill--selected")].filter(Boolean).join(" "),draggable:!!t,icon:e.selected?(0,u.jsx)(s.a,{}):(0,u.jsx)(eK,{}),id:e.name,onClick:()=>{n&&n({pill:e})},size:"small",children:null!=(o=e.Label)?o:(0,u.jsx)("span",{className:"".concat(sl,"__pill-label"),children:e.name})},null!=(l=e.key)?l:"".concat(e.name,"-").concat(a))}),[a,n,t]);return t?(0,u.jsx)(tM,{className:sl,ids:a.map(e=>e.name),onDragEnd:e=>{let{moveFromIndex:n,moveToIndex:a}=e;t.onDragEnd({moveFromIndex:n,moveToIndex:a})},children:o}):(0,u.jsx)("div",{className:sl,children:o})},si=e=>{let{collectionSlug:t}=e,{columns:n,moveColumn:a,toggleColumn:o}=(0,l.use)(sa),r=(0,l.useId)(),i=tW(),s=(0,l.useMemo)(()=>null==n?void 0:n.filter(e=>{var t,n;return!((0,m.I2)(e.field)&&!(0,m.uT)(e.field))&&!(null==e||null==(n=e.field)||null==(t=n.admin)?void 0:t.disableListColumn)}),[n]),c=(0,l.useMemo)(()=>s?s.map((e,n)=>{let{accessor:a,active:o,field:l}=e,s="labelWithPrefix"in l&&void 0!==l.labelWithPrefix?l.labelWithPrefix:"label"in l&&void 0!==l.label?l.label:"name"in l&&void 0!==l.name?l.name:void 0;return{name:a,key:"".concat(t,"-").concat(a,"-").concat(n).concat(i?"-".concat(i,"-"):"").concat(r),Label:(0,u.jsx)(nA,{label:s,unstyled:!0}),selected:o}}):null,[t,i,s,r]);return c?(0,u.jsx)(sr,{draggable:{onDragEnd:e=>{let{moveFromIndex:t,moveToIndex:n}=e;a({fromIndex:t,toIndex:n})}},onClick:e=>{let{pill:t}=e;o(t.name)},pills:c}):null},ss=e=>{let t=(0,h.c)(3),{getEntityConfig:n}=(0,i.c)(),a;t[0]!==n||t[1]!==e?(a=()=>e?("string"==typeof e?[e]:e).map(e=>n({collectionSlug:e})):[],t[0]=n,t[1]=e,t[2]=a):a=t[2];let[o]=(0,l.useState)(a);return o},sc=(0,l.createContext)({isOnScreen:!1,toggleLoadingOverlay:void 0}),su="loading-overlay",sd=e=>{let t=(0,h.c)(8),{animationDuration:n,loadingText:a,overlayType:o,show:l}=e,{t:r}=(0,s.d)(),i=void 0===l||l?"".concat(su,"--entering"):"".concat(su,"--exiting"),c=o?"".concat(su,"--").concat(o):"",d;t[0]!==i||t[1]!==c?(d=[su,i,c].filter(Boolean),t[0]=i,t[1]=c,t[2]=d):d=t[2];let p=d.join(" "),f=n||"500ms",m;return t[3]!==a||t[4]!==r||t[5]!==p||t[6]!==f?(m=(0,u.jsxs)("div",{className:p,style:{animationDuration:f},children:[(0,u.jsxs)("div",{className:"".concat(su,"__bars"),children:[(0,u.jsx)("div",{className:"".concat(su,"__bar")}),(0,u.jsx)("div",{className:"".concat(su,"__bar")}),(0,u.jsx)("div",{className:"".concat(su,"__bar")}),(0,u.jsx)("div",{className:"".concat(su,"__bar")}),(0,u.jsx)("div",{className:"".concat(su,"__bar")})]}),(0,u.jsx)("span",{className:"".concat(su,"__text"),children:a||r("general:loading")})]}),t[3]=a,t[4]=r,t[5]=p,t[6]=f,t[7]=m):m=t[7],m};function sp(e){if(e)try{e.abort()}catch(e){}}function sf(e){let t=new AbortController;if(e.current)try{e.current.abort()}catch(e){}return e.current=t,t}var sh=(0,l.createContext)({}),sm=e=>{let{children:t,...n}=e;return(0,u.jsx)(sh,{value:{...n},children:t})},sg=e=>{let{id:t,collectionSlug:n,disableActions:a,drawerSlug:o,initialData:r,onDelete:c,onDuplicate:d,onSave:p,overrideEntityVisibility:f=!0,redirectAfterCreate:h,redirectAfterDelete:m,redirectAfterDuplicate:g,redirectAfterRestore:v}=e,{getEntityConfig:b}=(0,i.c)(),y=nI(),[x]=(0,l.useState)(()=>b({collectionSlug:n})),w=l.useRef(null),{closeModal:C}=ne(),{t:j}=(0,s.d)(),{renderDocument:S}=sn(),[_,k]=(0,l.useState)(void 0),[E,N]=(0,l.useState)(!0),D=(0,l.useRef)(!1),P=(0,l.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=sf(w);(async()=>{t&&N(!0);try{let t=await S({collectionSlug:n,disableActions:a,docID:e,drawerSlug:o,initialData:r,locale:y,overrideEntityVisibility:f,redirectAfterCreate:h,redirectAfterDelete:void 0!==m&&m,redirectAfterDuplicate:void 0!==g&&g,redirectAfterRestore:void 0!==v&&v,signal:l.signal});(null==t?void 0:t.Document)&&(k(t.Document),N(!1))}catch(e){eF.error((null==e?void 0:e.message)||j("error:unspecific")),C(o)}w.current=null})()},[n,a,o,r,m,g,v,S,h,C,f,j,y]),O=(0,l.useCallback)(e=>{"create"===e.operation&&P(e.doc.id),"function"==typeof p&&p({...e,collectionConfig:x})},[p,x,P]),T=(0,l.useCallback)(e=>{P(e.doc.id),"function"==typeof d&&d({...e,collectionConfig:x})},[d,x,P]),R=(0,l.useCallback)(e=>{"function"==typeof c&&c({...e,collectionConfig:x}),C(o)},[c,C,o,x]),I=(0,l.useCallback)(()=>{P(void 0,!0)},[P]);return(0,l.useEffect)(()=>{_||D.current||(P(t,!0),D.current=!0)},[_,P,t]),(0,l.useEffect)(()=>{let e=w.current;return()=>{sp(e)}},[]),E?(0,u.jsx)(sd,{}):(0,u.jsx)(sm,{clearDoc:I,drawerSlug:o,onDelete:R,onDuplicate:T,onSave:O,children:_})},sv="doc-drawer",sb=e=>{let t=(0,h.c)(2),{children:n,className:a,collectionSlug:o,disabled:l,drawerSlug:r,onClick:i,operation:c,...d}=e,{t:p}=(0,s.d)(),[f]=ss(o),m=p("create"===c?"fields:addNewLabel":"general:editLabel",{label:null==f?void 0:f.labels.singular}),g;return t[0]!==a?(g=[a,"".concat(sv,"__toggler")].filter(Boolean),t[0]=a,t[1]=g):g=t[1],(0,u.jsx)(nw,{"aria-label":m,className:g.join(" "),disabled:l,onClick:i,slug:r,...d,children:n})},sy=e=>{let{drawerSlug:t}=e;return(0,u.jsx)(nC,{className:sv,gutter:!1,Header:null,slug:t,children:(0,u.jsx)(sg,{...e})})},sx=e=>{let t,n=(0,h.c)(38),{id:a,collectionSlug:o,overrideEntityVisibility:r}=e,i=tW(),s=(0,l.useId)(),{closeModal:c,modalState:d,openModal:p,toggleModal:f}=ne(),[m,g]=(0,l.useState)(!1),v;n[0]!==o||n[1]!==i||n[2]!==a||n[3]!==s?(v=(e=>{let{id:t,collectionSlug:n,depth:a,uuid:o}=e;return"doc-drawer_".concat(n,"_").concat(a).concat(t?"_".concat(t):"","_").concat(o)})({id:a,collectionSlug:o,depth:i,uuid:s}),n[0]=o,n[1]=i,n[2]=a,n[3]=s,n[4]=v):v=n[4];let b=v,y,x;n[5]!==b||n[6]!==d?(y=()=>{var e;g(!!(null==(e=d[b])?void 0:e.isOpen))},x=[d,b],n[5]=b,n[6]=d,n[7]=y,n[8]=x):(y=n[7],x=n[8]),(0,l.useEffect)(y,x),n[9]!==b||n[10]!==f?(t=()=>{f(b)},n[9]=b,n[10]=f,n[11]=t):t=n[11];let w=t,C;n[12]!==c||n[13]!==b?(C=()=>{c(b)},n[12]=c,n[13]=b,n[14]=C):C=n[14];let j=C,S;n[15]!==b||n[16]!==p?(S=()=>{p(b)},n[15]=b,n[16]=p,n[17]=S):S=n[17];let _=S,k;n[18]!==o||n[19]!==b||n[20]!==a||n[21]!==r?(k=e=>(0,l.createElement)(sy,{...e,collectionSlug:o,drawerSlug:b,id:a,key:b,overrideEntityVisibility:r}),n[18]=o,n[19]=b,n[20]=a,n[21]=r,n[22]=k):k=n[22];let E=k,N;n[23]!==o||n[24]!==b||n[25]!==a?(N=e=>(0,u.jsx)(sb,{...e,collectionSlug:o,drawerSlug:b,operation:a?"update":"create"}),n[23]=o,n[24]=b,n[25]=a,n[26]=N):N=n[26];let D=N,P;n[27]!==j||n[28]!==b||n[29]!==i||n[30]!==m||n[31]!==_||n[32]!==w?(P={closeDrawer:j,drawerDepth:i,drawerSlug:b,isDrawerOpen:m,openDrawer:_,toggleDrawer:w},n[27]=j,n[28]=b,n[29]=i,n[30]=m,n[31]=_,n[32]=w,n[33]=P):P=n[33];let O=P,T;return n[34]!==E||n[35]!==O||n[36]!==D?(T=[E,D,O],n[34]=E,n[35]=O,n[36]=D,n[37]=T):T=n[37],T};function sw(e,t){switch(t.type){case"ADD_LOADED":{let n={...e};"object"!=typeof n[t.relationTo]&&(n[t.relationTo]={});let a=[...t.idsToLoad];return Array.isArray(t.docs)&&t.docs.forEach(e=>{a.splice(a.indexOf(e.id),1),n[t.relationTo][e.id]=e}),a.forEach(e=>{n[t.relationTo][e]=!1}),n}case"REQUEST":{let n={...e};return t.docs.forEach(e=>{let{relationTo:t,value:a}=e;"object"!=typeof n[t]&&(n[t]={}),n[t][a]=null}),n}default:return e}}var sC=(0,l.createContext)({}),sj=e=>{let t,n=(0,h.c)(16),{children:a}=e,o;n[0]===Symbol.for("react.memo_cache_sentinel")?(o={},n[0]=o):o=n[0];let[r,c]=(0,l.useReducer)(sw,o),d=function(e,t){let n=(0,h.c)(4),[a,o]=(0,l.useState)(e),r,i;return 100!==n[0]||n[1]!==e?(r=()=>{let t=setTimeout(()=>{o(e)},100);return()=>{clearTimeout(t)}},i=[e,t],n[0]=t,n[1]=e,n[2]=r,n[3]=i):(r=n[2],i=n[3]),(0,l.useEffect)(r,i),a}(r,100),{config:p}=(0,i.c)(),{collections:f,routes:m,serverURL:g}=p,{api:b}=m,{i18n:y}=(0,s.d)(),{code:x}=nI(),w=(0,l.useRef)(x),C;n[1]!==b||n[2]!==f||n[3]!==d||n[4]!==y||n[5]!==x||n[6]!==g?(C=e=>{let t=void 0!==e&&e;Object.entries(d).forEach(async e=>{let[n,a]=e,o=[];if(Object.entries(a).forEach(e=>{let[n,a]=e;(null===a||t)&&o.push(n)}),o.length>0){let e="".concat(g).concat(b,"/").concat(n),t=new URLSearchParams,a={};t.append("depth","0"),t.append("limit","250");let r=f.find(e=>e.slug===n);if(r.admin.enableListViewSelectAPI){var l;a[null!=(l=r.admin.useAsTitle)?l:"id"]=!0,r.upload&&(0,k.f)({collectionConfig:r,select:a})}x&&t.append("locale",x);let i=o.map(sS);t.append("where[id][in]",i.join(","));let s="?".concat(t.toString(),"&").concat(v.A({select:a})),u=await fetch("".concat(e).concat(s),{credentials:"include",headers:{"Accept-Language":y.language}});if(u.ok){let e=await u.json();e.docs&&c({type:"ADD_LOADED",docs:e.docs,idsToLoad:o,relationTo:n})}else c({type:"ADD_LOADED",docs:[],idsToLoad:o,relationTo:n})}})},n[1]=b,n[2]=f,n[3]=d,n[4]=y,n[5]=x,n[6]=g,n[7]=C):C=n[7];let j=C,S,_;n[8]!==j||n[9]!==x?(S=()=>{j(x&&w.current!==x),w.current=x},_=[x,j],n[8]=j,n[9]=x,n[10]=S,n[11]=_):(S=n[10],_=n[11]),(0,l.useEffect)(S,_),n[12]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{c({type:"REQUEST",docs:e})},n[12]=t):t=n[12];let E=t,N;return n[13]!==a||n[14]!==r?(N=(0,u.jsx)(sC,{value:{documents:r,getRelationships:E},children:a}),n[13]=a,n[14]=r,n[15]=N):N=n[15],N};function sS(e){return String(e)}var s_=e=>{let{allowCreate:t,baseClass:n,buttonStyle:a,className:o,collections:l,i18n:r,icon:i,label:s,onClick:c,permissions:p,relationTo:f}=e;return t?Array.isArray(f)?(0,u.jsx)("div",{className:"".concat(n,"__add-new-polymorphic-wrapper"),children:(0,u.jsx)(te,{button:(0,u.jsx)(to,{buttonStyle:a,className:o,icon:i,children:s}),buttonType:"custom",horizontalAlign:"center",render:e=>{let{close:t}=e;return(0,u.jsx)(eY.ButtonGroup,{children:f.map(e=>{var a;return(null==(a=p.collections[e])?void 0:a.create)?(0,u.jsx)(eY.Button,{className:"".concat(n,"__relation-button--").concat(e),onClick:()=>{t(),c(e)},children:(0,d.s)(l.find(t=>t.slug===e).labels.singular,r)},e):null})})},size:"medium"})}):(0,u.jsx)(to,{buttonStyle:a,className:o,onClick:()=>c(),children:s}):null},sk=Symbol.for("react.lazy");function sE(e){return l.isValidElement(e)||(null==e?void 0:e.$$typeof)===sk}var sN=e=>{let{cellData:t,nowrap:n}=e,a=(null==t?void 0:t.length)>100?"".concat(t.substring(0,100),"…"):t;return(0,u.jsx)("code",{className:"code-cell",style:n?{whiteSpace:"nowrap"}:{},children:(0,u.jsx)("span",{children:a})})};function sD(e){let{blockType:t}=e;return t}var sP=()=>(0,u.jsxs)("svg",{height:"150",style:{backgroundColor:"#333333"},viewBox:"0 0 150 150",width:"150",xmlns:"http://www.w3.org/2000/svg",children:[(0,u.jsx)("path",{d:"M82.8876 50.5H55.5555V100.5H94.4444V61.9818H82.8876V50.5Z",fill:"white"}),(0,u.jsx)("path",{d:"M82.8876 61.9818H94.4444L82.8876 50.5V61.9818Z",fill:"#9A9A9A"})]}),sO="thumbnail",sT=e=>{let t=(0,h.c)(6),{className:n,doc:a,fileSrc:o,height:r,imageCacheTag:s,size:c,width:d}=e,p=void 0===n?"":n,{filename:f}=void 0===a?{}:a,[m,g]=l.useState(void 0),v="".concat(sO,"--size-").concat(c||"medium"),b;t[0]!==p||t[1]!==v?(b=[sO,v,p],t[0]=p,t[1]=v,t[2]=b):b=t[2];let y=b.join(" "),x,w;t[3]!==o?(x=()=>{if(!o)return void g(!1);g(void 0);let e=new Image;e.src=o,e.onload=()=>{g(!0)},e.onerror=()=>{g(!1)}},w=[o],t[3]=o,t[4]=x,t[5]=w):(x=t[4],w=t[5]),l.useEffect(x,w);let C=null;if(o){let e=(null==o?void 0:o.includes("?"))?"&":"?";C=s?"".concat(o).concat(e).concat(encodeURIComponent(s)):o}return(0,u.jsxs)("div",{className:y,children:[void 0===m&&(0,u.jsx)(i.f,{height:"100%"}),m&&(0,u.jsx)("img",{alt:f,height:r,src:C,width:d}),!1===m&&(0,u.jsx)(sP,{})]})};function sR(e){let t,n=(0,h.c)(12),{alt:a,className:o,filename:r,fileSrc:s,imageCacheTag:c,size:d}=e,p=void 0===o?"":o,[f,m]=l.useState(void 0),g="".concat(sO,"--size-").concat(d||"medium"),v;n[0]!==p||n[1]!==g?(v=[sO,g,p],n[0]=p,n[1]=g,n[2]=v):v=n[2];let b=v.join(" "),y,x;n[3]!==s?(y=()=>{if(!s)return void m(!1);m(void 0);let e=new Image;e.src=s,e.onload=()=>{m(!0)},e.onerror=()=>{m(!1)}},x=[s],n[3]=s,n[4]=y,n[5]=x):(y=n[4],x=n[5]),l.useEffect(y,x);let w="";if(s){let e=(null==s?void 0:s.includes("?"))?"&":"?";w=c?"".concat(s).concat(e).concat(encodeURIComponent(c)):s}return n[6]!==a||n[7]!==b||n[8]!==f||n[9]!==r||n[10]!==w?(t=(0,u.jsxs)("div",{className:b,children:[void 0===f&&(0,u.jsx)(i.f,{height:"100%"}),f&&(0,u.jsx)("img",{alt:a||r,src:w}),!1===f&&(0,u.jsx)(sP,{})]}),n[6]=a,n[7]=b,n[8]=f,n[9]=r,n[10]=w,n[11]=t):t=n[11],t}var sI="file",sF=e=>{var t,n,a;let{cellData:o,collectionConfig:l,field:r,rowData:i}=e;if(null!=(a=null!=(n="displayPreview"in r?r.displayPreview:void 0)?n:null==(t=l.upload)?void 0:t.displayPreview)&&!a)return(0,u.jsx)(u.Fragment,{children:String(o)});{let e=(0,D.w)(null==i?void 0:i.mimeType),t=e?(null==i?void 0:i.thumbnailURL)||(null==i?void 0:i.url):null==i?void 0:i.thumbnailURL;return e&&(t=(0,P.k)({sizes:null==i?void 0:i.sizes,thumbnailURL:null==i?void 0:i.thumbnailURL,url:null==i?void 0:i.url,width:null==i?void 0:i.width})),(0,u.jsxs)("div",{className:sI,children:[(0,u.jsx)(sT,{className:"".concat(sI,"__thumbnail"),collectionSlug:null==l?void 0:l.slug,doc:{...i,filename:o},fileSrc:t,size:"small",uploadConfig:null==l?void 0:l.upload}),(0,u.jsx)("span",{className:"".concat(sI,"__filename"),children:String(o)})]})}},sA=!!("u">typeof window&&window.document&&window.document.createElement),sM=e=>{var t;let n,a,o,r,c=(0,h.c)(40),{cellData:p,customCellProps:f,field:m,field:g}=e,{label:v}=g,b="relationTo"in m&&m.relationTo||"collection"in m&&m.collection,y="collection"in m?null==p?void 0:p.docs:p,{config:x,getEntityConfig:w}=(0,i.c)(),{collections:C,routes:j}=x,[S,_]=e4(),k;c[0]===Symbol.for("react.memo_cache_sentinel")?(k=[],c[0]=k):k=c[0];let[E,N]=(0,l.useState)(k),{documents:D,getRelationships:P}=(0,l.use)(sC),[O,T]=(0,l.useState)(!1),{i18n:R,t:I}=(0,s.d)(),F=!!sA&&(null==_||null==(t=_.boundingClientRect)?void 0:t.top){if((y||"number"==typeof y)&&F&&!O){let e=[],t=Array.isArray(y)?y:[y];t.slice(0,t.length{"object"==typeof t&&"relationTo"in t&&"value"in t&&e.push(t),("number"==typeof t||"string"==typeof t)&&"string"==typeof b&&e.push({relationTo:b,value:t})}),P(e),T(!0),N(e)}},c[1]=y,c[2]=P,c[3]=O,c[4]=F,c[5]=b,c[6]=A):A=c[6],c[7]!==y||c[8]!==C||c[9]!==P||c[10]!==O||c[11]!==F||c[12]!==b||c[13]!==j.api?(n=[y,b,C,F,j.api,O,P],c[7]=y,c[8]=C,c[9]=P,c[10]=O,c[11]=F,c[12]=b,c[13]=j.api,c[14]=n):n=c[14],(0,l.useEffect)(A,n),c[15]!==O?(a=()=>{O&&T(!1)},c[15]=O,c[16]=a):a=c[16],c[17]!==y?(o=[y],c[17]=y,c[18]=o):o=c[18],(0,l.useEffect)(a,o),c[19]!==y||c[20]!==x.admin||c[21]!==f||c[22]!==D||c[23]!==m||c[24]!==w||c[25]!==R||c[26]!==S||c[27]!==v||c[28]!==I||c[29]!==E){let e;c[31]!==x.admin||c[32]!==f||c[33]!==D||c[34]!==m||c[35]!==w||c[36]!==R||c[37]!==I||c[38]!==E.length?(e=(e,t)=>{var n,a,o;let{relationTo:r,value:i}=e,s=D[r][i],c=w({collectionSlug:r}),d=ab({collectionConfig:c,data:s||null,dateFormat:x.admin.dateFormat,fallback:"".concat(I("general:untitled")," - ID: ").concat(i),i18n:R}),p=null;return"upload"===m.type&&(null==(o=null!=(a="displayPreview"in m?m.displayPreview:void 0)?a:null==(n=c.upload)?void 0:n.displayPreview)||o)&&s&&(p=(0,u.jsx)(sF,{cellData:d,collectionConfig:c,collectionSlug:c.slug,customCellProps:f,field:m,rowData:s})),(0,u.jsxs)(l.Fragment,{children:[!1===s&&"".concat(I("general:untitled")," - ID: ").concat(i),null===s&&"".concat(I("general:loading"),"..."),s?p||d:null,E.length>t+1&&", "]},t)},c[31]=x.admin,c[32]=f,c[33]=D,c[34]=m,c[35]=w,c[36]=R,c[37]=I,c[38]=E.length,c[39]=e):e=c[39],r=(0,u.jsxs)("div",{className:"relationship-cell",ref:S,children:[E.map(e),Array.isArray(y)&&y.length>3&&I("fields:itemsAndMore",{count:y.length-3,items:""}),0===E.length&&I("general:noLabel",{label:(0,d.s)(v||"",R)})]}),c[19]=y,c[20]=x.admin,c[21]=f,c[22]=D,c[23]=m,c[24]=w,c[25]=R,c[26]=S,c[27]=v,c[28]=I,c[29]=E,c[30]=r}else r=c[30];return r},sL=e=>{let t=(0,h.c)(7),{cellData:n,field:a}=e,{options:o}=a,{i18n:l}=(0,s.d)(),r;t[0]!==l||t[1]!==o?(r=e=>e.map(e=>{var t,n;let a=null==(n=o.filter(t=>t.value===e))||null==(t=n[0])?void 0:t.label;return(0,d.s)(a,l)}).join(", "),t[0]=l,t[1]=o,t[2]=r):r=t[2];let i=r,c;if(t[3]!==n||t[4]!==i||t[5]!==o){let e;e=(0,m.Vh)(o)?i(Array.isArray(n)?n:[n]):Array.isArray(n)?n.join(", "):n,c=(0,u.jsx)("span",{children:e}),t[3]=n,t[4]=i,t[5]=o,t[6]=c}else c=t[6];return c},sB={array:e=>{let t=(0,h.c)(2),{cellData:n,field:a}=e,{labels:o}=a,{i18n:l}=(0,s.d)(),r=null!=n?n:[],i=1===r.length?"".concat(r.length," ").concat((0,d.s)((null==o?void 0:o.singular)||l.t("general:rows"),l)):"".concat(r.length," ").concat((0,d.s)((null==o?void 0:o.plural)||l.t("general:rows"),l)),c;return t[0]!==i?(c=(0,u.jsx)("span",{children:i}),t[0]=i,t[1]=c):c=t[1],c},blocks:e=>{var t;let n,a=(0,h.c)(2),{cellData:o,field:l}=e,{blockReferences:r,blocks:c,labels:p}=l,{i18n:f}=(0,s.d)(),{config:m}=(0,i.c)(),g=Array.isArray(o)?o.map(sD):[],v=null==(t=null!=r?r:c)?void 0:t.map(e=>{let t="string"==typeof e?m.blocksMap[e]:e;return{slug:t.slug,label:(0,d.s)(t.labels.singular,f)}}),b="0 ".concat((0,d.s)(null==p?void 0:p.plural,f)),y=e=>e.map(e=>{var t,n;return null==(n=v.filter(t=>t.slug===e))||null==(t=n[0])?void 0:t.label}).join(", ");if(g.length>5){let e=g.length-5;b="".concat(g.length," ").concat((0,d.s)(null==p?void 0:p.plural,f)," - ").concat(f.t("fields:itemsAndMore",{count:e,items:y(g.slice(0,5))}))}else g.length>0&&(b="".concat(g.length," ").concat((0,d.s)(1===g.length?null==p?void 0:p.singular:null==p?void 0:p.plural,f)," - ").concat(y(g)));return a[0]!==b?(n=(0,u.jsx)("span",{children:b}),a[0]=b,a[1]=n):n=a[1],n},checkbox:e=>{let t=(0,h.c)(3),{cellData:n}=e,{t:a}=(0,s.d)(),o="general:".concat(n),l;return t[0]!==a||t[1]!==o?(l=(0,u.jsx)("code",{className:"bool-cell",children:(0,u.jsx)("span",{children:a(o).toLowerCase()})}),t[0]=a,t[1]=o,t[2]=l):l=t[2],l},code:sN,date:e=>{let{cellData:t,field:n,rowData:a}=e,{name:o,accessor:l,admin:r,timezone:c}=n,{date:d}=void 0===r?{}:r,{config:p}=(0,i.c)(),{admin:f}=p,{dateFormat:h}=f,{i18n:m}=(0,s.d)(),g=c&&a?(0,N.v)(a,"".concat(l||o,"_tz"),void 0):void 0,v=(null==d?void 0:d.displayFormat)||h;return(0,u.jsx)("span",{children:!!t&&am({date:t,i18n:m,pattern:v,timezone:g})})},File:sF,join:sM,json:e=>{let{cellData:t}=e,n=(null==t?void 0:t.length)>100?"".concat(t.substring(0,100),"…"):t;return(0,u.jsx)("code",{className:"json-cell",children:(0,u.jsx)("span",{children:JSON.stringify(n)})})},radio:sL,relationship:sM,select:sL,textarea:e=>{let{cellData:t}=e,n=(null==t?void 0:t.length)>100?"".concat(t.substring(0,100),"…"):t;return(0,u.jsx)("span",{children:n})},upload:sM},sV=e=>{let t=(0,h.c)(16),{cellData:n,className:a,collectionSlug:o,field:l,field:r,link:c,linkURL:p,onClick:f,rowData:g,viewType:v}=e,{admin:b}=r,{i18n:y}=(0,s.d)(),{config:x,getEntityConfig:w}=(0,i.c)(),{routes:C}=x,{admin:j}=C,S,_;if(t[0]!==b||t[1]!==j||t[2]!==n||t[3]!==a||t[4]!==o||t[5]!==l||t[6]!==w||t[7]!==y||t[8]!==c||t[9]!==p||t[10]!==f||t[11]!==e||t[12]!==g||t[13]!==v){_=Symbol.for("react.early_return_sentinel");e:{let t=w({collectionSlug:o}),r=b&&"className"in b?b.className:void 0,i=a||(l.admin&&"className"in l.admin?l.admin.className:null)||r,s="span",h={className:i};if(c&&(h.prefetch=!1,s=ez,p?h.href=p:h.href=(null==t?void 0:t.slug)?(0,E.Q)({adminRoute:j,path:"/collections/".concat(null==t?void 0:t.slug).concat("trash"===v?"/trash":"","/").concat(encodeURIComponent(g.id))}):""),"function"==typeof f&&(s="button",h.type="button",h.onClick=()=>{f({cellData:n,collectionSlug:null==t?void 0:t.slug,rowData:g})}),(0,m.uT)(l)){_=(0,u.jsx)(s,{...h,children:(0,u.jsx)(sN,{cellData:"ID: ".concat(n),collectionConfig:t,collectionSlug:o,field:{...l,type:"code"},nowrap:!0,rowData:g})});break e}let x=((e,t,n)=>{if(((null==t?void 0:t.type)==="select"||(null==t?void 0:t.type)==="radio")&&Array.isArray(t.options)){let a=t.options.find(t=>"object"==typeof t?t.value===e:t===e);if(a)return"object"==typeof a&&"label"in a?sE(a.label)?a.label:(0,d.s)(a.label,n)||a.value:a}return e})(n,l,y),C="u">typeof n&&sB[l.type],k=null;if(sE(x))k=x;else if(C)k=(0,u.jsx)(C,{cellData:n,rowData:g,...e});else if(!C)if((null==t?void 0:t.upload)&&(0,m.Z7)(l)&&"filename"===l.name&&"text"===l.type){let a=sB.File;k=(0,u.jsx)(a,{cellData:n,rowData:g,...e,collectionConfig:t,field:l})}else{_=(0,u.jsxs)(s,{...h,children:[(""===x||typeof x>"u"||null===x)&&y.t("general:noLabel",{label:(0,d.s)(("label"in l?l.label:null)||"data",y)}),"string"==typeof x&&x,"number"==typeof x&&x,"object"==typeof x&&null!==x&&JSON.stringify(x)]});break e}if(("select"===l.type||"radio"===l.type)&&l.options.length&&n){let e=Array.isArray(n)?n.map(sz).join(" "):"selected--".concat(n),t=[h.className,e].filter(Boolean).join(" ");_=(0,u.jsx)(s,{...h,className:t,children:k});break e}S=(0,u.jsx)(s,{...h,children:k})}t[0]=b,t[1]=j,t[2]=n,t[3]=a,t[4]=o,t[5]=l,t[6]=w,t[7]=y,t[8]=c,t[9]=p,t[10]=f,t[11]=e,t[12]=g,t[13]=v,t[14]=S,t[15]=_}else S=t[14],_=t[15];return _!==Symbol.for("react.early_return_sentinel")?_:S};function sz(e){return"selected--".concat(e)}var sU=l.createContext(null),sH=e=>{let t=(0,h.c)(3),{onDrawerOpen:n}=e,a=l.use(sU),o;return t[0]!==a||t[1]!==n?(o=(0,u.jsxs)("div",{className:"drawer-link",children:[(0,u.jsx)(sV,{...a,className:"drawer-link__cell",link:!1,onClick:null}),(0,u.jsx)("button",{className:"drawer-link__doc-drawer-toggler",onClick:()=>{n(a.rowData.id)},type:"button",children:(0,u.jsx)(eW,{})})]}),t[0]=a,t[1]=n,t[2]=o):o=t[2],o},sq="clickable-arrow",sW="paginator__page",sK=e=>{let{isCurrent:t,isFirstPage:n=!1,isLastPage:a=!1,page:o=1,updatePage:l}=e,r=[sW,t&&"".concat(sW,"--is-current"),n&&"".concat(sW,"--is-first-page"),a&&"".concat(sW,"--is-last-page")].filter(Boolean).join(" ");return(0,u.jsx)("button",{className:r,onClick:()=>l(o),type:"button",children:o})},sY={ClickableArrow:e=>{let{direction:t="right",isDisabled:n=!1,updatePage:a}=e,o=[sq,n&&"".concat(sq,"--is-disabled"),t&&"".concat(sq,"--").concat(t)].filter(Boolean).join(" ");return(0,u.jsx)("button",{className:o,disabled:n,onClick:n?void 0:a,type:"button",children:(0,u.jsx)(eq,{})})},Page:sK,Separator:()=>(0,u.jsx)("span",{className:"paginator__separator",children:"—"})},sG=e=>{let{hasNextPage:t=!1,hasPrevPage:n=!1,nextPage:a=null,numberOfNeighbors:o=1,onChange:l,page:r,prevPage:i=null,totalPages:s=null}=e;if(!n&&!t)return null;let c=e=>{"function"==typeof l&&l(e)},d=Array.from({length:s},(e,t)=>t+1),p=r-1-o;p=2&&h.unshift({type:"Separator"}),r>o+1&&h.unshift({type:"Page",props:{isFirstPage:!0,page:1,updatePage:c}}),r+o+1c(null!=a?a:r+1)}}),h.unshift({type:"ClickableArrow",props:{direction:"left",isDisabled:!n,updatePage:()=>c(null!=i?i:Math.max(1,r-1))}}),(0,u.jsx)("div",{className:"paginator",children:h.map((e,t)=>{if("number"==typeof e)return(0,u.jsx)(sK,{isCurrent:r===e,page:e,updatePage:c},t);let n=sY[e.type];return(0,u.jsx)(n,{...e.props},t)})})},s$=()=>{let e=(0,h.c)(11),{data:t,handlePageChange:n}=i9(),a=t.nextPage||2,o;e[0]!==n?(o=e=>{n(e)},e[0]=n,e[1]=o):o=e[1];let l=t.page||1,r=t.prevPage||void 0,i;return e[2]!==t.hasNextPage||e[3]!==t.hasPrevPage||e[4]!==t.limit||e[5]!==t.totalPages||e[6]!==a||e[7]!==o||e[8]!==l||e[9]!==r?(i=(0,u.jsx)(sG,{hasNextPage:t.hasNextPage,hasPrevPage:t.hasPrevPage,limit:t.limit,nextPage:a,numberOfNeighbors:1,onChange:o,page:l,prevPage:r,totalPages:t.totalPages}),e[2]=t.hasNextPage,e[3]=t.hasPrevPage,e[4]=t.limit,e[5]=t.totalPages,e[6]=a,e[7]=o,e[8]=l,e[9]=r,e[10]=i):i=e[10],i},sX="relationship-table",sZ=e=>{var t,n,a,o,r,c;let{AfterInput:p,allowCreate:f=!0,BeforeInput:h,disableTable:m=!1,field:g,fieldPath:v,filterOptions:b,initialData:y,initialDrawerData:x,Label:w,parent:C,relationTo:_}=e,[k,E]=(0,l.useState)(null),{config:N,getEntityConfig:D}=(0,i.c)(),{i18n:P,t:O}=(0,s.d)(),[T,R]=(0,l.useState)(),[I,F]=(0,l.useState)(!1),[A]=(0,l.useState)(()=>D({collectionSlug:_})),M=Array.isArray(_),[L,B]=(0,l.useState)(M?void 0:_),{permissions:V}=nO(),z=(0,l.useRef)(!1),[U,H]=(0,l.useState)(void 0),[q,,{closeDrawer:W,isDrawerOpen:K,openDrawer:Y}]=sx({id:U,collectionSlug:L}),[G,$]=(0,l.useState)(!m),[X,Z]=(0,l.useState)(()=>y?{...y,docs:Array.isArray(y.docs)?y.docs.reduce((e,t)=>"string"==typeof t||"number"==typeof t?[...e,{id:t}]:[...e,t],[]):[]}:void 0),[Q,J]=(0,l.useState)(),{getTableState:ee}=sn(),et=(0,l.useCallback)(async e=>{var t,n;let a={limit:(null==g?void 0:g.defaultLimit)||(null==A||null==(n=A.admin)||null==(t=n.pagination)?void 0:t.defaultLimit),sort:g.defaultSort||(null==A?void 0:A.defaultSort),...T||{},where:{...(null==T?void 0:T.where)||{}}};b&&(a.where=(0,j.Y)(a.where,b));let o=g.admin.defaultColumns?g.admin.defaultColumns.map(e=>({accessor:e,active:!0})):void 0,l="boolean"==typeof g.admin.disableRowTypes?!g.admin.disableRowTypes:Array.isArray(_),{data:r,state:i,Table:s}=await ee({collectionSlug:_,columns:(0,S.l)(null==T?void 0:T.columns)||o,data:e,enableRowSelections:!1,orderableFieldName:!g.orderable||Array.isArray(g.collection)?void 0:"_".concat(g.collection,"_").concat(g.name,"_order"),parent:C,query:a,renderRowTypes:l,tableAppearance:"condensed"});Z(r),E(s),J(i),$(!1)},[g.defaultLimit,g.defaultSort,g.admin.defaultColumns,g.admin.disableRowTypes,g.collection,g.name,g.orderable,null==A||null==(n=A.admin)||null==(t=n.pagination)?void 0:t.defaultLimit,null==A?void 0:A.defaultSort,T,b,ee,_,C]),en=nN((e,t)=>{t||k&&!e||et()});(0,l.useEffect)(()=>{en(T,m)},[T,m]);let ea=(0,l.useCallback)(e=>{var t;let{doc:n,operation:a}=e;"create"===a&&W();let o=null==X||null==(t=X.docs)?void 0:t.findIndex(e=>e.id===n.id),l={docs:[]};if(-1!==o){let e=[...X.docs];e[o]=n,l.docs=e}else l.docs=[n,...X.docs];et(l)},[null==X?void 0:X.docs,et,W]),eo=(0,l.useCallback)(e=>{let t=X.docs.filter(t=>t.id!==e.id);et({...X,docs:t}),H(void 0)},[X,et]),el=(0,l.useCallback)(e=>{z.current=!0,H(e||void 0)},[]);(0,l.useEffect)(()=>{z.current&&(z.current=!1,Y())},[Y]),(0,l.useEffect)(()=>{K||H(void 0)},[K]);let er=!1!==f&&(null==V||null==(o=V.collections)||null==(a=o[M?_[0]:_])?void 0:a.create);(0,l.useEffect)(()=>{M&&L&&Y()},[L,Y,M]),(0,l.useEffect)(()=>{M&&!K&&L&&B(void 0)},[K]);let ei=l.useMemo(()=>{var e,t,n,a,o;return{columns:null==(e=(0,S.l)(Q))?void 0:e.map(e=>{let{accessor:t}=e;return t}),limit:null!=(a=g.defaultLimit)?a:null==A||null==(n=A.admin)||null==(t=n.pagination)?void 0:t.defaultLimit,sort:null!=(o=g.defaultSort)?o:null==A?void 0:A.defaultSort}},[Q,g,A]);return(0,u.jsxs)("div",{className:sX,children:[(0,u.jsxs)("div",{className:"".concat(sX,"__header"),children:[w,(0,u.jsxs)("div",{className:"".concat(sX,"__actions"),children:[(0,u.jsx)(s_,{allowCreate:!1!==f,baseClass:sX,buttonStyle:"none",className:"".concat(sX,"__add-new").concat(M?"-polymorphic":" doc-drawer__toggler"),collections:N.collections,i18n:P,icon:M?"plus":void 0,label:P.t("fields:addNew"),onClick:M?B:Y,permissions:V,relationTo:_}),(0,u.jsx)(oe,{"aria-controls":"".concat(sX,"-columns"),"aria-expanded":I,className:"".concat(sX,"__toggle-columns ").concat(I?"".concat(sX,"__buttons-active"):""),icon:(0,u.jsx)(eq,{direction:I?"up":"down"}),onClick:()=>F(!I),pillStyle:"light",size:"small",children:O("general:columns")})]})]}),h,G?(0,u.jsx)("p",{children:O("general:loading")}):(0,u.jsxs)(l.Fragment,{children:[(null==X?void 0:X.docs)&&0===X.docs.length&&(0,u.jsxs)("div",{className:"".concat(sX,"__no-results"),children:[(0,u.jsx)("p",{children:P.t("general:noResults",{label:M?P.t("general:documents"):(0,d.s)(null==A||null==(r=A.labels)?void 0:r.plural,P)})}),(0,u.jsx)(s_,{allowCreate:er,baseClass:sX,collections:N.collections,i18n:P,label:P.t("general:createNewLabel",{label:M?P.t("general:document"):(0,d.s)(null==A||null==(c=A.labels)?void 0:c.singular,P)}),onClick:M?B:Y,permissions:V,relationTo:_})]}),(null==X?void 0:X.docs)&&X.docs.length>0&&(0,u.jsx)(sj,{children:(0,u.jsx)(se,{data:X,modifySearchParams:!1,onQueryChange:R,orderableFieldName:!g.orderable||Array.isArray(g.collection)?void 0:"_".concat(g.collection,"_").concat(v.replaceAll(".","_"),"_order"),query:ei,children:(0,u.jsxs)(so,{collectionSlug:M?_[0]:_,columnState:Q,LinkedCellOverride:(0,u.jsx)(sH,{currentDrawerID:U,onDrawerOpen:el}),children:[(0,u.jsx)(a0,{className:"".concat(sX,"__columns"),height:I?"auto":0,id:"".concat(sX,"-columns"),children:(0,u.jsx)("div",{className:"".concat(sX,"__columns-inner"),children:A&&(0,u.jsx)(si,{collectionSlug:A.slug})})}),k,(0,u.jsx)(s$,{})]})})})]}),p,(0,u.jsx)(q,{initialData:x,onDelete:eo,onSave:ea})]})},sQ="default"in i3.default?i3.default.default:i3.default,sJ=e=>{var t;let{collectionSlug:n,config:a,docID:o,fields:l,segments:r}=e,i=(0,C.L)(l,{keepPresentationalFields:!0}),s=r[0],c=i.find(e=>e.name===s);if(!c)return null;if("relationship"===c.type||"upload"===c.type){let e=o;return Array.isArray(c.relationTo)&&(e={relationTo:n,value:o}),{[c.name]:c.hasMany?[e]:e}}let u=r.slice(1,r.length);if("tab"===c.type||"group"===c.type&&(0,m.Z7)(c))return{[c.name]:sJ({collectionSlug:n,config:a,docID:o,fields:c.fields,segments:u})};if("array"===c.type){let e=sJ({collectionSlug:n,config:a,docID:o,fields:c.fields,segments:u});return e.id=sQ().toHexString(),{[c.name]:[e]}}if("blocks"===c.type)for(let e of null!=(t=c.blockReferences)?t:c.blocks){let t="string"==typeof e?a.blocksMap[e]:e,l=sJ({collectionSlug:n,config:a,docID:o,fields:t.fields,segments:u});if(l)return l.id=sQ().toHexString(),l.blockType=t.slug,{[c.name]:[l]}}},s0=aB(e=>{let{field:t,field:{admin:{allowCreate:n,description:a},collection:o,label:r,localized:s,on:c,required:d},path:p}=e,{id:f,docConfig:h}=aE(),{config:m,getEntityConfig:g}=(0,i.c)(),{customComponents:{AfterInput:v,BeforeInput:b,Description:y,Error:x,Label:w}={},path:C,showError:j,value:S}=aA({potentiallyStalePath:p}),_=(0,l.useMemo)(()=>{if(!f)return null;let e=f;Array.isArray(t.targetField.relationTo)&&(e={relationTo:h.slug,value:e});let n=Array.isArray(o)?{}:{[c]:{equals:e}};return t.where?{and:[n,t.where]}:n},[f,o,t.targetField.relationTo,t.where,c,null==h?void 0:h.slug]),k=(0,l.useMemo)(()=>{let e=g({collectionSlug:Array.isArray(t.collection)?t.collection[0]:t.collection});return sJ({collectionSlug:null==h?void 0:h.slug,config:m,docID:f,fields:null==e?void 0:e.fields,segments:t.on.split(".")})},[g,t.collection,t.on,null==h?void 0:h.slug,f,m]);return h?(0,u.jsxs)("div",{className:[az,j&&"error","join"].filter(Boolean).join(" "),id:"field-".concat(null==C?void 0:C.replace(/\./g,"__")),children:[(0,u.jsx)(el,{CustomComponent:x,Fallback:(0,u.jsx)(tU,{path:C,showError:j})}),(0,u.jsx)(sZ,{AfterInput:v,allowCreate:"u">typeof f&&n,BeforeInput:b,disableTable:null===_,field:t,fieldPath:C,filterOptions:_,initialData:f&&S?S:{docs:[]},initialDrawerData:k,Label:(0,u.jsx)("h4",{style:{margin:0},children:w||(0,u.jsx)(nA,{label:r,localized:s,path:C,required:d})}),parent:Array.isArray(o)?{id:f,collectionSlug:h.slug,joinPath:C}:void 0,relationTo:o}),(0,u.jsx)(el,{CustomComponent:y,Fallback:(0,u.jsx)(tz,{description:a,path:C})})]}):null}),s1=aB(e=>{let{field:t,field:{admin:{className:n,description:a,editorOptions:o,maxHeight:r}={},jsonSchema:s,label:c,localized:d,required:p},path:f,readOnly:h,validate:m}=e,{insertSpaces:g=i.k.insertSpaces,tabSize:v=i.k.tabSize}=o||{},b=(0,l.useCallback)(e=>{if(void 0!==e)return null===e?"":g?JSON.stringify(e,null,v):JSON.stringify(e,null," ")},[v,g]),[y,x]=(0,l.useState)(),w=l.useRef("formState"),[C,j]=(0,l.useState)(Date.now()),{customComponents:{AfterInput:S,BeforeInput:_,Description:k,Error:E,Label:N}={},disabled:D,initialValue:P,path:O,setValue:T,showError:R,value:I}=aA({potentiallyStalePath:f,validate:(0,l.useCallback)((e,t)=>{if("function"==typeof m)return m(e,{...t,jsonError:y,required:p})},[m,p,y])}),F=l.useRef(b(null!=I?I:P)),A=(0,l.useCallback)((e,t)=>{if(!s)return;t.languages.json.jsonDefaults.setDiagnosticsOptions({enableSchemaRequest:!0,schemas:[...t.languages.json.jsonDefaults.diagnosticsOptions.schemas||[],s],validate:!0});let n=s.uri,a=n.includes("?")?"".concat(n,"&").concat(crypto.randomUUID?crypto.randomUUID():ou()):"".concat(n,"?").concat(crypto.randomUUID?crypto.randomUUID():ou());e.setModel(t.editor.createModel(b(I)||"","json",t.Uri.parse(a)))},[s,b,I]),M=(0,l.useCallback)(e=>{if(!(h||D)){w.current="internalEditor";try{T(e?JSON.parse(e):null),F.current=e,x(void 0)}catch(t){T(e||null),F.current=e,x(t)}}},[h,D,T]);(0,l.useEffect)(()=>{if("formState"===w.current){let e=b(null!=I?I:P);e!==F.current&&(F.current=e,j(Date.now()))}w.current="formState"},[P,O,b,I]);let L=(0,l.useMemo)(()=>aV(t),[t]);return(0,u.jsxs)("div",{className:[az,"json-field",n,R&&"error",(h||D)&&"read-only"].filter(Boolean).join(" "),style:L,children:[(0,u.jsx)(el,{CustomComponent:N,Fallback:(0,u.jsx)(nA,{label:c,localized:d,path:O,required:p})}),(0,u.jsxs)("div",{className:"".concat(az,"__wrap"),children:[(0,u.jsx)(el,{CustomComponent:E,Fallback:(0,u.jsx)(tU,{message:y,path:O,showError:R})}),_,(0,u.jsx)(o_,{defaultLanguage:"json",maxHeight:r,onChange:M,onMount:A,options:o,readOnly:h||D,recalculatedHeightAt:C,value:F.current,wrapperProps:{id:"field-".concat(null==O?void 0:O.replace(/\./g,"__"))}}),S]}),(0,u.jsx)(el,{CustomComponent:k,Fallback:(0,u.jsx)(tz,{description:a,path:O})})]})}),s3=aB(e=>{let{field:t,field:{admin:{className:n,description:a,placeholder:o,step:r=1}={},hasMany:i=!1,label:c,localized:p,max:f=1/0,maxRows:h=1/0,min:m=-1/0,required:g},onChange:v,path:b,readOnly:y,validate:x}=e,{i18n:w,t:C}=(0,s.d)(),{customComponents:{AfterInput:j,BeforeInput:S,Description:_,Error:k,Label:E}={},disabled:N,path:D,setValue:P,showError:T,value:R}=aA({potentiallyStalePath:b,validate:(0,l.useCallback)((e,t)=>{if("function"==typeof x)return x(e,{...t,max:f,min:m,required:g})},[x,m,f,g])}),I=(0,l.useCallback)(e=>{let t=parseFloat(e.target.value),n=t;Number.isNaN(t)&&(n=null),"function"==typeof v&&v(n),P(n)},[v,P]),[F,A]=(0,l.useState)([]),M=(0,l.useCallback)(e=>{if(!(y||N)){var t;P(e?Array.isArray(e)?e.map(e=>{var t;return Number((null==(t=e.value)?void 0:t.value)||e.value)}):[Number((null==(t=e.value)?void 0:t.value)||e.value)]:[])}},[y,N,P]);(0,l.useEffect)(()=>{i&&Array.isArray(R)&&A(R.map((e,t)=>({id:"".concat(e).concat(t),label:"".concat(e),value:{toString:()=>"".concat(e).concat(t),value:(null==e?void 0:e.value)||e}})))},[R,i]);let L=(0,l.useMemo)(()=>aV(t),[t]),B=(0,d.s)(o,w);return(0,u.jsxs)("div",{className:[az,"number",n,T&&"error",(y||N)&&"read-only",i&&"has-many"].filter(Boolean).join(" "),style:L,children:[(0,u.jsx)(el,{CustomComponent:E,Fallback:(0,u.jsx)(nA,{label:c,localized:p,path:D,required:g})}),(0,u.jsxs)("div",{className:"".concat(az,"__wrap"),children:[(0,u.jsx)(el,{CustomComponent:k,Fallback:(0,u.jsx)(tU,{path:D,showError:T})}),S,i?(0,u.jsx)(iU,{className:"field-".concat(D.replace(/\./g,"__")),disabled:y||N,filterOption:(e,t)=>{let n=Array.isArray(R)&&R.length>=h;return(0,O.E)(t)&&!n},isClearable:!0,isCreatable:!0,isMulti:!0,isSortable:!0,noOptionsMessage:()=>Array.isArray(R)&&R.length>=h?C("validation:limitReached",{max:h,value:R.length+1}):null,onChange:M,options:[],placeholder:B,showError:T,value:F}):(0,u.jsx)("div",{children:(0,u.jsx)("input",{disabled:y||N,id:"field-".concat(D.replace(/\./g,"__")),max:f,min:m,name:D,onChange:I,onWheel:e=>{e.target.blur()},placeholder:B,step:r,type:"number",value:"number"==typeof R?R:""})}),j,(0,u.jsx)(el,{CustomComponent:_,Fallback:(0,u.jsx)(tz,{description:a,path:D})})]})]})}),s2="point",s6=aB(e=>{let{field:t,field:{admin:{className:n,description:a,placeholder:o,step:r}={},label:i,localized:c,required:p},path:f,readOnly:h,validate:m}=e,{i18n:g,t:v}=(0,s.d)(),{customComponents:{AfterInput:b,BeforeInput:y,Description:x,Error:w,Label:C}={},disabled:j,path:S,setValue:_,showError:k,value:E=[null,null]}=aA({potentiallyStalePath:f,validate:(0,l.useCallback)((e,t)=>{if("function"==typeof m)return m(e,{...t,required:p})},[m,p])}),N=(0,l.useCallback)((e,t)=>{let n=parseFloat(e.target.value);Number.isNaN(n)&&(n=e.target.value);let a=[...E];a[t]=n,_(a)},[_,E]),D=e=>{let t=v("longitude"===e?"fields:longitude":"fields:latitude"),n=i?(0,d.s)(i,g):"";return"".concat(n).concat(n?" - ":"").concat(t)},P=(0,l.useMemo)(()=>aV(t),[t]);return(0,u.jsxs)("div",{className:[az,s2,n,k&&"error",(h||j)&&"read-only"].filter(Boolean).join(" "),style:P,children:[(0,u.jsxs)("ul",{className:"".concat(s2,"__wrap"),children:[(0,u.jsxs)("li",{children:[(0,u.jsx)(el,{CustomComponent:C,Fallback:(0,u.jsx)(nA,{label:D("longitude"),localized:c,path:S,required:p})}),(0,u.jsxs)("div",{className:"input-wrapper",children:[y,(0,u.jsx)("input",{disabled:h||j,id:"field-longitude-".concat(null==S?void 0:S.replace(/\./g,"__")),name:"".concat(S,".longitude"),onChange:e=>N(e,0),placeholder:(0,d.s)(o,g),step:r,type:"number",value:E&&"number"==typeof E[0]?E[0]:""}),b]})]}),(0,u.jsxs)("li",{children:[(0,u.jsx)(el,{CustomComponent:C,Fallback:(0,u.jsx)(nA,{label:D("latitude"),localized:c,path:S,required:p})}),(0,u.jsxs)("div",{className:"input-wrapper",children:[(0,u.jsx)(el,{CustomComponent:w,Fallback:(0,u.jsx)(tU,{path:S,showError:k})}),y,(0,u.jsx)("input",{disabled:h||j,id:"field-latitude-".concat(null==S?void 0:S.replace(/\./g,"__")),name:"".concat(S,".latitude"),onChange:e=>N(e,1),placeholder:(0,d.s)(o,g),step:r,type:"number",value:E&&"number"==typeof E[1]?E[1]:""}),b]})]})]}),(0,u.jsx)(el,{CustomComponent:x,Fallback:(0,u.jsx)(tz,{description:a,path:S})})]})}),s5="radio-input",s4=e=>{let t,n=(0,h.c)(16),{isSelected:a,onChange:o,option:l,path:r,readOnly:i,uuid:c}=e,{i18n:p}=(0,s.d)(),f=tW(),m="field-".concat(r,"-").concat(l.value).concat(f>1?"-".concat(f):"").concat(c?"-".concat(c):""),g=a&&"".concat(s5,"--is-selected"),v;n[0]!==g?(v=[s5,g].filter(Boolean),n[0]=g,n[1]=v):v=n[1];let b=v.join(" "),y;if(n[2]!==o||n[3]!==l.value?(y=()=>"function"==typeof o?o(l.value):null,n[2]=o,n[3]=l.value,n[4]=y):y=n[4],n[5]!==p||n[6]!==m||n[7]!==a||n[8]!==l.label||n[9]!==r||n[10]!==i||n[11]!==b||n[12]!==y){let e=(0,u.jsx)("input",{checked:a,disabled:i,id:m,name:r,onChange:y,type:"radio"}),o=i&&"".concat(s5,"__styled-radio--disabled"),s;n[14]!==o?(s=["".concat(s5,"__styled-radio"),o].filter(Boolean),n[14]=o,n[15]=s):s=n[15],t=(0,u.jsx)("label",{htmlFor:m,children:(0,u.jsxs)("div",{className:b,children:[e,(0,u.jsx)("span",{className:s.join(" ")}),(0,u.jsx)("span",{className:"".concat(s5,"__label"),children:(0,d.s)(l.label,p)})]})}),n[5]=p,n[6]=m,n[7]=a,n[8]=l.label,n[9]=r,n[10]=i,n[11]=b,n[12]=y,n[13]=t}else t=n[13];return t},s9="radio-group",s8=aB(e=>{let{disableModifyingForm:t,field:n,field:{admin:{className:a,description:o,layout:r="horizontal"}={},label:i,localized:s,options:c=[],required:d}={},onChange:p,path:f,readOnly:h,validate:g,value:v}=e,{uuid:b}=eC(),{customComponents:{AfterInput:y,BeforeInput:x,Description:w,Error:C,Label:j}={},disabled:S,path:_,setValue:k,showError:E,value:N}=aA({potentiallyStalePath:f,validate:(0,l.useCallback)((e,t)=>{if("function"==typeof g)return g(e,{...t,options:c,required:d})},[g,c,d])}),D=N||v,P=(0,l.useMemo)(()=>aV(n),[n]);return(0,u.jsxs)("div",{className:[az,s9,a,"".concat(s9,"--layout-").concat(r),E&&"error",(h||S)&&"".concat(s9,"--read-only")].filter(Boolean).join(" "),style:P,children:[(0,u.jsx)(el,{CustomComponent:C,Fallback:(0,u.jsx)(tU,{path:_,showError:E})}),(0,u.jsx)(el,{CustomComponent:j,Fallback:(0,u.jsx)(nA,{label:i,localized:s,path:_,required:d})}),(0,u.jsxs)("div",{className:"".concat(az,"__wrap"),children:[x,(0,u.jsx)("ul",{className:"".concat(s9,"--group"),id:"field-".concat(_.replace(/\./g,"__")),children:c.map(e=>{let n="",a=String(n=(0,m.vs)(e)?e.value:e)===String(D),o="field-".concat(_,"-").concat(n).concat(b?"-".concat(b):"");return(0,u.jsx)("li",{children:(0,u.jsx)(s4,{id:o,isSelected:a,onChange:()=>{"function"==typeof p&&p(n),h||S||k(n,!!t)},option:(0,m.vs)(e)?e:{label:e,value:e},path:_,readOnly:h||S,uuid:b})},"".concat(_," - ").concat(n))})}),y,(0,u.jsx)(el,{CustomComponent:w,Fallback:(0,u.jsx)(tz,{description:o,path:_})})]})]})}),s7="relationship-add-new",ce=e=>{var t,n;let a,o,r,i,c,p,f=(0,h.c)(47),{Button:m,hasMany:g,onChange:v,path:b,relationTo:y,unstyled:x,value:w}=e,C=ss(y),{permissions:j}=nO(),[S,_]=(0,l.useState)(!1),[k,E]=(0,l.useState)(),N=C.length>1,D;f[0]!==C[0]||f[1]!==N?(D=()=>N?void 0:C[0],f[0]=C[0],f[1]=N,f[2]=D):D=f[2];let[P,O]=(0,l.useState)(D),[T,R]=(0,l.useState)(!1),{i18n:I,t:F}=(0,s.d)(),[A,M]=(0,l.useState)(!1),L=null==P?void 0:P.slug,B;f[3]!==L?(B={collectionSlug:L},f[3]=L,f[4]=B):B=f[4];let[V,z,U]=sx(B),{isDrawerOpen:H,toggleDrawer:q}=U,W;f[5]!==P||f[6]!==g||f[7]!==v||f[8]!==C[0]||f[9]!==w?(W=e=>{var t;let{doc:n,operation:a}=e,o="object"==typeof(null==P||null==(t=P.versions)?void 0:t.drafts)&&P.versions.drafts.autosave;("create"===a||"update"===a&&o)&&(w&&(Array.isArray(w)?w.some(e=>e&&e.value===n.id):w.value===n.id)||v(!0===g?[...Array.isArray(w)?w:[],{relationTo:null==P?void 0:P.slug,value:n.id}]:{relationTo:C[0].slug,value:n.id}),E(void 0))},f[5]=P,f[6]=g,f[7]=v,f[8]=C[0],f[9]=w,f[10]=W):W=f[10];let K=W,Y;f[11]===Symbol.for("react.memo_cache_sentinel")?(Y=e=>{R(e)},f[11]=Y):Y=f[11];let G=Y,$,X;f[12]!==j||f[13]!==C?($=()=>{var e,t;j&&(1===C.length?_(null==(e=j.collections[null==(t=C[0])?void 0:t.slug])?void 0:e.create):_(C.some(e=>{var t;return null==(t=j.collections[null==e?void 0:e.slug])?void 0:t.create})))},X=[j,C],f[12]=j,f[13]=C,f[14]=$,f[15]=X):($=f[14],X=f[15]),(0,l.useEffect)($,X),f[16]!==C||f[17]!==N||f[18]!==k?(o=()=>{N&&k&&O(C.find(e=>(null==e?void 0:e.slug)===k))},a=[k,N,C],f[16]=C,f[17]=N,f[18]=k,f[19]=a,f[20]=o):(a=f[19],o=f[20]),(0,l.useEffect)(o,a),f[21]!==P||f[22]!==N||f[23]!==q?(r=()=>{N&&P&&(q(),E(void 0))},i=[q,N,P],f[21]=P,f[22]=N,f[23]=q,f[24]=r,f[25]=i):(r=f[24],i=f[25]),(0,l.useEffect)(r,i),f[26]!==H||f[27]!==N?(c=()=>{N&&!H&&O(void 0)},p=[H,N],f[26]=H,f[27]=N,f[28]=c,f[29]=p):(c=f[28],p=f[29]),(0,l.useEffect)(c,p);let Z=null==(t=C[0])?void 0:t.labels.singular,Q,J;if(f[30]!==m||f[31]!==V||f[32]!==z||f[33]!==P||f[34]!==I||f[35]!==K||f[36]!==b||f[37]!==j||f[38]!==T||f[39]!==C||f[40]!==S||f[41]!==A||f[42]!==F||f[43]!==Z||f[44]!==x){J=Symbol.for("react.early_return_sentinel");e:{let e=F("fields:addNewLabel",{label:(0,d.s)(Z,I)});if(!S){J=null;break e}Q=(0,u.jsxs)("div",{className:s7,id:"".concat(b,"-add-new"),children:[1===C.length&&(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)(z,{className:["".concat(s7,"__add-button"),x&&"".concat(s7,"__add-button--unstyled")].filter(Boolean).join(" "),onClick:()=>{M(!1)},onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:m||(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)(tt,{className:"".concat(s7,"__tooltip"),show:A,children:e}),(0,u.jsx)(eK,{})]})}),(0,u.jsx)(V,{onSave:K})]}),C.length>1&&(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)(te,{button:m||(0,u.jsx)(to,{buttonStyle:"none",className:"".concat(s7,"__add-button"),tooltip:T?void 0:F("fields:addNew"),children:(0,u.jsx)(eK,{})}),buttonType:"custom",horizontalAlign:"center",onToggleOpen:G,render:e=>{let{close:t}=e;return(0,u.jsx)(eZ,{children:C.map(e=>{var n;return j.collections[null==e?void 0:e.slug].create?(0,u.jsx)(eQ,{className:"".concat(s7,"__relation-button--").concat(null==e?void 0:e.slug),onClick:()=>{t(),E(null==e?void 0:e.slug)},children:(0,d.s)(null==e||null==(n=e.labels)?void 0:n.singular,I)},null==e?void 0:e.slug):null})})},size:"medium"}),P&&(null==(n=j.collections[null==P?void 0:P.slug])?void 0:n.create)&&(0,u.jsx)(V,{onSave:K})]})]})}f[30]=m,f[31]=V,f[32]=z,f[33]=P,f[34]=I,f[35]=K,f[36]=b,f[37]=j,f[38]=T,f[39]=C,f[40]=S,f[41]=A,f[42]=F,f[43]=Z,f[44]=x,f[45]=Q,f[46]=J}else Q=f[45],J=f[46];return J!==Symbol.for("react.early_return_sentinel")?J:Q},ct=e=>{let{allowCreate:t=!0,collectionSlugs:n,disableQueryPresets:a,drawerSlug:o,enableRowSelections:r,filterOptions:s,onBulkSelect:c,onSelect:d,overrideEntityVisibility:p=!0,selectedCollection:f}=e,{closeModal:h,isModalOpen:m}=ne(),{serverFunction:g}=sn(),[v,b]=(0,l.useState)(void 0),[y,x]=(0,l.useState)(!0),{config:{collections:w},getEntityConfig:C}=(0,i.c)(),S=m(o),_=w.filter(e=>{let{slug:t}=e;return n.includes(t)}),[k,E]=(0,l.useState)(()=>{var e;let t=C({collectionSlug:f||(null==(e=_[0])?void 0:e.slug)});return t?{label:t.labels,value:t.slug}:void 0}),[N,D,{drawerSlug:P}]=sx({collectionSlug:k.value}),O=nN(e=>{var t;e&&e!==(null==k?void 0:k.value)&&E({label:null==(t=C({collectionSlug:e}))?void 0:t.labels,value:e})});(0,l.useEffect)(()=>{O(f)},[f]);let T=(0,l.useCallback)(async e=>{let{slug:t,query:n}=e;try{let e={...n||{},where:{...(null==n?void 0:n.where)||{}}},l=null==s?void 0:s[t];if(s&&"boolean"!=typeof l&&(e.where=(0,j.Y)(e.where,l)),t){let n=await g({name:"render-list",args:{collectionSlug:t,disableBulkDelete:!0,disableBulkEdit:!0,disableQueryPresets:a,drawerSlug:o,enableRowSelections:r,overrideEntityVisibility:p,query:e}});b((null==n?void 0:n.List)||null)}else b(null);x(!1)}catch(e){console.error("Error rendering List View: ",e),S&&h(o)}},[g,h,o,S,r,s,p,a]);(0,l.useEffect)(()=>{v||T({slug:null==k?void 0:k.value})},[T,v,k.value]);let R=(0,l.useCallback)(e=>{let{doc:t}=e;"function"==typeof d&&d({collectionSlug:null==k?void 0:k.value,doc:t,docID:t.id}),h(P),h(o)},[h,P,o,d,k.value]),I=(0,l.useCallback)(e=>{T({slug:null==k?void 0:k.value,query:e})},[T,k.value]),F=(0,l.useCallback)(e=>{E(e),T({slug:null==e?void 0:e.value})},[T]),A=(0,l.useCallback)(async e=>{var t;e&&E({label:null==(t=C({collectionSlug:e}))?void 0:t.labels,value:e}),await T({slug:k.value||e})},[C,T,k.value]);return y?(0,u.jsx)(sd,{}):(0,u.jsxs)(i6,{allowCreate:t,createNewDrawerSlug:P,DocumentDrawerToggler:D,drawerSlug:o,enabledCollections:n,onBulkSelect:c,onQueryChange:I,onSelect:d,refresh:A,selectedOption:k,setSelectedOption:F,children:[v,(0,u.jsx)(N,{onSave:R})]})},cn="list-drawer",ca=e=>{let{children:t,className:n,disabled:a,drawerSlug:o,onClick:l,...r}=e;return(0,u.jsx)(nw,{className:[n,"".concat(cn,"__toggler")].filter(Boolean).join(" "),disabled:a,onClick:l,slug:o,...r,children:t})},co=e=>{let{drawerSlug:t}=e;return(0,u.jsx)(nC,{className:cn,gutter:!1,Header:null,slug:t,children:(0,u.jsx)(ct,{...e})})},cl=e=>{let t,n,a,o=(0,h.c)(42),{collectionSlugs:r,filterOptions:s,selectedCollection:c,uploads:d}=e,{config:p}=(0,i.c)(),{collections:f}=p,m=tW(),g=(0,l.useId)(),{closeModal:v,modalState:b,openModal:y,toggleModal:x}=ne(),[w,C]=(0,l.useState)(!1),[j,S]=(0,l.useState)(r),_;o[0]!==m||o[1]!==g?(_=(e=>{let{depth:t,uuid:n}=e;return"list-drawer_".concat(t,"_").concat(n)})({depth:m,uuid:g}),o[0]=m,o[1]=g,o[2]=_):_=o[2];let k=_,E,N;o[3]!==k||o[4]!==b?(E=()=>{var e;C(!!(null==(e=b[k])?void 0:e.isOpen))},N=[b,k],o[3]=k,o[4]=b,o[5]=E,o[6]=N):(E=o[5],N=o[6]),(0,l.useEffect)(E,N),o[7]!==j||o[8]!==f||o[9]!==d?(t=()=>{j&&0!==j.length||S(f.filter(e=>{let{upload:t}=e;return!d||!!t}).map(cr))},n=[j,d,f],o[7]=j,o[8]=f,o[9]=d,o[10]=t,o[11]=n):(t=o[10],n=o[11]),(0,l.useEffect)(t,n),o[12]!==k||o[13]!==x?(a=()=>{x(k)},o[12]=k,o[13]=x,o[14]=a):a=o[14];let D=a,P;o[15]!==v||o[16]!==k?(P=()=>{v(k)},o[15]=v,o[16]=k,o[17]=P):P=o[17];let O=P,T;o[18]!==k||o[19]!==y?(T=()=>{y(k)},o[18]=k,o[19]=y,o[20]=T):T=o[20];let R=T,I;o[21]!==O||o[22]!==j||o[23]!==k||o[24]!==s||o[25]!==c||o[26]!==d?(I=e=>(0,l.createElement)(co,{...e,closeDrawer:O,collectionSlugs:j,drawerSlug:k,filterOptions:s,key:k,selectedCollection:c,uploads:d}),o[21]=O,o[22]=j,o[23]=k,o[24]=s,o[25]=c,o[26]=d,o[27]=I):I=o[27];let F=I,A;o[28]!==k?(A=e=>(0,u.jsx)(ca,{...e,drawerSlug:k}),o[28]=k,o[29]=A):A=o[29];let M=A,L;o[30]!==O||o[31]!==j||o[32]!==m||o[33]!==k||o[34]!==w||o[35]!==R||o[36]!==D?(L={closeDrawer:O,collectionSlugs:j,drawerDepth:m,drawerSlug:k,isDrawerOpen:w,openDrawer:R,setCollectionSlugs:S,toggleDrawer:D},o[30]=O,o[31]=j,o[32]=m,o[33]=k,o[34]=w,o[35]=R,o[36]=D,o[37]=L):L=o[37];let B=L,V;return o[38]!==F||o[39]!==B||o[40]!==M?(V=[F,M,B],o[38]=F,o[39]=B,o[40]=M,o[41]=V):V=o[41],V};function cr(e){let{slug:t}=e;return t}function ci(){let e=(0,l.useRef)([]),t=(0,l.useRef)(!1);return{queueTask:(0,l.useCallback)((n,a)=>{e.current.push(n),async function(){if(!t.current&&("function"!=typeof(null==a?void 0:a.beforeProcess)||!1!==a.beforeProcess()))for(;e.current.length>0;){let n=e.current.pop();e.current=[],t.current=!0;try{await n()}catch(e){console.error("Error in queued function:",e)}finally{t.current=!1,"function"==typeof(null==a?void 0:a.afterProcess)&&a.afterProcess()}}}()},[])}}var cs=(0,l.createContext)({mostRecentUpdate:null,reportUpdate:()=>null}),cc=()=>(0,l.use)(cs),cu=e=>{for(let t in e){let n=e[t];if(("and"===t.toLowerCase()||"or"===t.toLowerCase())&&Array.isArray(n))for(let e of n)cu(e);else n&&"object"==typeof n&&"in"in n&&Array.isArray(n.in)&&0===n.in.length&&(e[t]={exists:!1})}return e},cd=e=>{let{hasMany:t,relationTo:n,value:a}=e,o=n.reduce((e,t)=>({...e,[t]:[]}),{});if(null===a)return o;if(a){let e=(e,t)=>{("string"==typeof t||"number"==typeof t)&&"string"==typeof e&&(o[e]?o[e].push(t):o[e]=[t])};!0===t?a.forEach(t=>{t&&e(t.relationTo,t.value)}):e(a.relationTo,a.value)}return o},cp=e=>e.reduce((e,t)=>t.options?[...e,...cp(t.options)]:[...e,{id:t.value,relationTo:t.relationTo}],[]),cf=e=>e.sort((e,t)=>{var n,a;return"function"==typeof(null==e||null==(n=e.label)?void 0:n.localeCompare)&&"function"==typeof(null==t||null==(a=t.label)?void 0:a.localeCompare)?e.label.localeCompare(t.label):0}),ch=(e,t)=>{switch(t.type){case"ADD":{let{collection:n,config:a,docs:o,i18n:l,ids:r=[],sort:i}=t,s=n.slug,c=cp(e),u=[...e],p=u.find(e=>e.label===n.labels.plural),f=o.reduce((e,t)=>0===c.filter(e=>e.id===t.id&&e.relationTo===s).length?(c.push({id:t.id,relationTo:s}),[...e,{label:ab({collectionConfig:n,data:t,dateFormat:a.admin.dateFormat,fallback:"".concat(l.t("general:untitled")," - ID: ").concat(t.id),i18n:l}),relationTo:s,value:t.id}]):e,[]);if(r.forEach(e=>{0===c.filter(t=>t.id===e&&t.relationTo===s).length&&(c.push({id:e,relationTo:s}),f.push({allowEdit:!1,label:"".concat(l.t("general:untitled")," - ID: ").concat(e),relationTo:s,value:e}))}),p){let e=[...p.options,...f];p.options=i?cf(e):e}else u.push({label:(0,d.s)(n.labels.plural,l),options:i?cf(f):f});return u}case"CLEAR":{let n=t.exemptValues?Array.isArray(t.exemptValues)?t.exemptValues:[t.exemptValues]:[];return e.filter(e=>{let t=e.options.filter(e=>!!n&&n.some(t=>t&&e.value===t.value));return e.options=t,t.length>0})}case"REMOVE":{let{id:n,collection:a}=t,o=[...e],l=o.findIndex(e=>e.label===a.labels.plural);return -1===l||(o[l]={...o[l],options:o[l].options.filter(e=>e.value!==n)}),o}case"UPDATE":{var n,a;let{collection:o,config:l,doc:r,i18n:i}=t,s=o.slug,c=[...e],u=ab({collectionConfig:o,data:r,dateFormat:l.admin.dateFormat,fallback:"".concat(i.t("general:untitled")," - ID: ").concat(r.id),i18n:i}),d=null==(a=c.find(e=>e.label===o.labels.plural))||null==(n=a.options)?void 0:n.find(e=>e.value===r.id);return d&&(d.label=u,d.relationTo=s),c}default:return e}},cm="relationship--multi-value-label",cg=e=>{var t,n;let{data:a,selectProps:o}=e,{allowEdit:r,label:i,relationTo:c,value:d}=a,{customProps:p}=void 0===o?{}:o,{draggableProps:f,onDocumentOpen:h}=void 0===p?{}:p,{permissions:m}=nO(),[g,v]=(0,l.useState)(!1),{t:b}=(0,s.d)(),y=!!(null==m||null==(n=m.collections)||null==(t=n[c])?void 0:t.read);return(0,u.jsxs)("div",{className:cm,children:[(0,u.jsx)("div",{className:"".concat(cm,"__content"),children:(0,u.jsx)(r_.MultiValueLabel,{...e,innerProps:{className:"".concat(cm,"__text"),...f||{}}})}),c&&y&&!1!==r&&(0,u.jsx)(l.Fragment,{children:(0,u.jsxs)("button",{"aria-label":"Edit ".concat(i),className:"".concat(cm,"__drawer-toggler"),onClick:e=>{v(!1),h({id:d,collectionSlug:c,hasReadPermission:y,openInNewTab:e.metaKey||e.ctrlKey})},onKeyDown:cv,onMouseDown:cb,onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),onTouchEnd:cy,type:"button",children:[(0,u.jsx)(tt,{className:"".concat(cm,"__tooltip"),show:g,children:b("general:editLabel",{label:""})}),(0,u.jsx)(eW,{className:"".concat(cm,"__icon")})]})})]})};function cv(e){"Enter"===e.key&&e.stopPropagation()}function cb(e){return e.stopPropagation()}function cy(e){return e.stopPropagation()}var cx="relationship--single-value",cw=e=>{var t,n;let a=(0,h.c)(15),{children:o,data:r,selectProps:i}=e,{allowEdit:c,label:d,relationTo:p,value:f}=r,m;a[0]!==i?(m=void 0===i?{}:i,a[0]=i,a[1]=m):m=a[1];let{customProps:g}=m,v;a[2]!==g?(v=void 0===g?{}:g,a[2]=g,a[3]=v):v=a[3];let{onDocumentOpen:b}=v,[y,x]=(0,l.useState)(!1),{t:w}=(0,s.d)(),{permissions:C}=nO(),j=!!(null==C||null==(n=C.collections)||null==(t=n[p])?void 0:t.read),S;return a[4]!==c||a[5]!==o||a[6]!==j||a[7]!==d||a[8]!==b||a[9]!==e||a[10]!==p||a[11]!==y||a[12]!==w||a[13]!==f?(S=(0,u.jsx)(r_.SingleValue,{...e,className:cx,children:(0,u.jsx)("div",{className:"".concat(cx,"__label"),children:(0,u.jsxs)("div",{className:"".concat(cx,"__label-text"),children:[(0,u.jsx)("div",{className:"".concat(cx,"__text"),children:o}),p&&j&&!1!==c&&(0,u.jsx)(l.Fragment,{children:(0,u.jsxs)("button",{"aria-label":w("general:editLabel",{label:d}),className:"".concat(cx,"__drawer-toggler"),onClick:e=>{x(!1),b({id:f,collectionSlug:p,hasReadPermission:j,openInNewTab:e.metaKey||e.ctrlKey})},onKeyDown:cC,onMouseDown:cj,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),onTouchEnd:cS,type:"button",children:[(0,u.jsx)(tt,{className:"".concat(cx,"__tooltip"),show:y,children:w("general:edit")}),(0,u.jsx)(eW,{})]})})]})})}),a[4]=c,a[5]=o,a[6]=j,a[7]=d,a[8]=b,a[9]=e,a[10]=p,a[11]=y,a[12]=w,a[13]=f,a[14]=S):S=a[14],S};function cC(e){"Enter"===e.key&&e.stopPropagation()}function cj(e){return e.stopPropagation()}function cS(e){return e.stopPropagation()}var c_="relationship",ck=e=>{let{AfterInput:t,allowCreate:n=!0,allowEdit:a=!0,appearance:o="select",BeforeInput:r,className:c,description:d,Description:p,Error:f,filterOptions:m,formatDisplayedOptions:g,hasMany:b,initialValue:x,isSortable:w=!0,label:C,Label:j,localized:S,maxResultsPerRequest:_=10,onChange:k,path:N,placeholder:D,readOnly:P,relationTo:O,required:R,showError:I,sortOptions:F,style:A,value:M}=e,{config:L,getEntityConfig:B}=(0,i.c)(),{routes:{api:V},serverURL:z}=L,{i18n:U,t:H}=(0,s.d)(),{permissions:q}=nO(),{code:W}=nI(),[K,Y]=(0,l.useState)({id:void 0,collectionSlug:void 0,hasReadPermission:!1}),[G,$]=(0,l.useState)(-1),[X,Z]=(0,l.useState)({}),[Q,J]=(0,l.useState)(""),[ee,et]=(0,l.useState)(""),[en,ea]=(0,l.useState)(!1),[eo,er]=(0,l.useState)(!1),[ei,es]=(0,l.useState)(!1),ec=(0,l.useRef)(!1),{queueTask:eu}=ci(),[ed,ep]=(0,l.useReducer)(ch,[]),ef=(0,l.useRef)(M),[eh,,{drawerSlug:em,isDrawerOpen:eg,openDrawer:ev}]=sx({id:K.id,collectionSlug:K.collectionSlug}),eb=(0,l.useMemo)(()=>{let e=m;if(M){let t=(!1===b?[M]:M).reduce((e,t)=>(e[t.relationTo]||(e[t.relationTo]=[]),e[t.relationTo].push(t.value),e),{});(Array.isArray(O)?O:[O]).forEach(n=>{e={...e||{},[n]:{..."object"==typeof(null==m?void 0:m[n])?m[n]:{},...t[n]?{id:{not_in:t[n]}}:{}}}})}return e},[m,M,b,O]),[ey,,{closeDrawer:ex,isDrawerOpen:ew,openDrawer:eC}]=cl({collectionSlugs:O,filterOptions:eb}),ej=(0,l.useCallback)(e=>{let{collectionSlug:t,doc:n}=e;b?k([...Array.isArray(M)?M:[],{relationTo:t,value:n.id}]):!1===b&&k({relationTo:t,value:n.id}),ex()},[b,k,ex,M]),eS=(0,l.useRef)(!1),e_=(0,l.useCallback)(e=>{let{filterOptions:t,hasMany:n,lastFullyLoadedRelation:a,lastLoadedPage:o,onSuccess:l,search:r,sort:i,value:s}=e;q&&eu(async()=>{let e="u">typeof a?a:-1,c=Array.isArray(O)?O:[O],u=-1===e?c:c.slice(e+1),d=0,p=cd(!0===n?{hasMany:!0,relationTo:O,value:s}:{hasMany:!1,relationTo:O,value:s});Q||(await u.reduce(async(e,n)=>{let a=null==t?void 0:t[n],l;if(l=ee!==r?1:o[n]+1,await e,!1===a)return $(c.indexOf(n)),Promise.resolve();if(d({...e,[n]:l})),t.nextPage||$(c.indexOf(n)),t.docs.length>0&&(d+=t.docs.length,ep({type:"ADD",collection:e,config:L,docs:t.docs,i18n:U,sort:i}))}else 403===f.status?($(c.indexOf(n)),ep({type:"ADD",collection:e,config:L,docs:[],i18n:U,ids:p[n],sort:i})):J(H("error:unspecific"))}},Promise.resolve()),"function"==typeof l&&l())})},[q,eu,O,Q,ee,B,F,_,W,z,V,U,L,H]),ek=((e,t)=>{let n=(0,h.c)(3),a=(0,l.useRef)(void 0),o;return n[0]!==e||n[1]!==t?(o=function(){for(var n=arguments.length,o=Array(n),l=0;l{clearTimeout(a.current),e(...o)},t)},n[0]=e,n[1]=t,n[2]=o):o=n[2],o})(e=>{let{hasMany:t,search:n,value:a}=e;eF({filterOptions:m,lastLoadedPage:{},onSuccess:()=>{ea(!1)},search:n,sort:!0,hasMany:t,value:a}),et(n)},300),eE=(0,l.useCallback)(e=>{ee!==e.search&&(ea(!0),Z({}),ek(e))},[ee,ek]),eN=nN(e=>{let{hasMany:t,value:n}=e;Object.entries(cd({hasMany:t,relationTo:O,value:n})).reduce(async(e,t)=>{let[n,a]=t;await e;let o=a.filter(e=>!ed.find(t=>{var a;return null==t||null==(a=t.options)?void 0:a.find(t=>t.value===e&&t.relationTo===n)}));if(o.length>0){var l;let e=B({collectionSlug:n}),t=(null==e||null==(l=e.admin)?void 0:l.useAsTitle)||"id",a={depth:0,draft:!0,limit:o.length,locale:W,select:{[t]:!0},where:{id:{in:o}}};if(!Q){let t=await fetch("".concat(z).concat(V,"/").concat(n),{body:v.A(a),credentials:"include",headers:{"Accept-Language":U.language,"Content-Type":"application/x-www-form-urlencoded","X-Payload-HTTP-Method-Override":"GET"},method:"POST"}),l=[];t.ok&&(l=(await t.json()).docs),ep({type:"ADD",collection:e,config:L,docs:l,i18n:U,ids:o,sort:!0})}}},Promise.resolve())}),{mostRecentUpdate:eD}=cc(),eP=nN(e=>{if(!M)return!1;let t=e.doc.id,n=!1;"update"===e.operation?!0===b?n=(Array.isArray(M)?M:[M]).some(n=>n.value===t&&n.relationTo===e.entitySlug):!1===b&&(n=(null==M?void 0:M.value)===t&&(null==M?void 0:M.relationTo)===e.entitySlug):"create"===e.operation&&(n=e.drawerSlug===em),n&&((ep({type:"UPDATE",collection:B({collectionSlug:e.entitySlug}),config:L,doc:e.doc,i18n:U}),b)?k((M?Array.isArray(M)?M:[M]:[]).map(n=>({relationTo:n.value===t?e.entitySlug:n.relationTo,value:n.value}))):!1===b&&k({relationTo:e.entitySlug,value:t}))});(0,l.useEffect)(()=>{eD&&eP(eD)},[eD]);let eO=(0,l.useCallback)(e=>{ep({type:"ADD",collection:e.collectionConfig,config:L,docs:[e.doc],i18n:U,sort:!0}),b?k(M?M.concat({relationTo:e.collectionConfig.slug,value:e.doc.id}):null):!1===b&&k({relationTo:e.collectionConfig.slug,value:e.doc.id})},[U,L,b,k,M]),eT=(0,l.useCallback)(e=>{ep({id:e.id,type:"REMOVE",collection:e.collectionConfig,config:L,i18n:U}),k(b&&M?M.filter(t=>t.value!==e.id):null)},[U,L,b,k,M]),eR=(0,l.useCallback)((e,t)=>{if(!t)return!0;let n=(0,T.m)(t||""),a=String(e.label);for(;a.length>250;){let e=a.indexOf(" ",t.length);if(n.test(a.slice(0,-1===e?t.length:e+1)))return!0;a=a.slice(-1===e?t.length:e+1)}return n.test(a.slice(-250))},[]),eI=(0,l.useCallback)(e=>{let{id:t,collectionSlug:n,hasReadPermission:a,openInNewTab:o}=e;if(o){if(a&&t&&n){let e=(0,E.Q)({adminRoute:L.routes.admin,path:"/collections/".concat(n,"/").concat(t)});window.open(e,"_blank")}}else eS.current=!0,Y({id:t,collectionSlug:n,hasReadPermission:a})},[L.routes.admin]),eF=nN(e=>e_(e));(0,l.useEffect)(()=>{ec.current&&ei&&(ea(!0),eF({filterOptions:m,lastLoadedPage:{},onSuccess:()=>{ec.current=!0,ea(!1)},...{hasMany:b,value:ef.current}})),ep({type:"CLEAR",exemptValues:ef.current}),$(-1),Z({})},[O,m,W,N,ei,b]);let eA=(0,l.useRef)(M),eM=(0,l.useRef)(!0);(0,l.useEffect)(()=>{(eM.current||!(0,y.j)(M,eA.current))&&eN({hasMany:b,value:M}),eM.current=!1,eA.current=M},[M,b]),(0,l.useEffect)(()=>{er(!(Array.isArray(O)?O:[O]).reduce((e,t)=>{var n,a;return"id"===((null==(a=B({collectionSlug:t}))||null==(n=a.admin)?void 0:n.useAsTitle)||"id")&&e},!0))},[O,B]),(0,l.useEffect)(()=>{eS.current&&(ev(),eS.current=!1)},[ev,K]),(0,l.useEffect)(()=>{ef.current=M},[M]);let eL=(e=>{let{allowEdit:t,options:n,value:a}=e;if(a||"number"==typeof a){let e;return Array.isArray(a)?a.map(e=>{let a;return n.forEach(t=>{a||(a=t.options.find(t=>t.value===e.value&&t.relationTo===e.relationTo))}),a?{allowEdit:t,...a}:void 0}):(n.forEach(t=>{e||(e=t.options.find(e=>e.value===a.value&&e.relationTo===a.relationTo))}),e?{allowEdit:t,...e}:void 0)}})({allowEdit:a,options:ed,value:M});return Array.isArray(eL)||(null==eL?void 0:eL.value)!=="null"||(eL.value=null),(0,u.jsxs)("div",{className:[az,c_,c,I&&"error",Q&&"error-loading",P&&"".concat(c_,"--read-only"),!P&&n&&"".concat(c_,"--allow-create")].filter(Boolean).join(" "),id:"field-".concat(N.replace(/\./g,"__")),style:A,children:[(0,u.jsx)(el,{CustomComponent:j,Fallback:(0,u.jsx)(nA,{label:C,localized:S,path:N,required:R})}),(0,u.jsxs)("div",{className:"".concat(az,"__wrap"),children:[(0,u.jsx)(el,{CustomComponent:f,Fallback:(0,u.jsx)(tU,{path:N,showError:I})}),r,Q?(0,u.jsx)("div",{className:"".concat(c_,"__error-loading"),children:Q}):(0,u.jsxs)("div",{className:"".concat(c_,"__wrap"),children:[(0,u.jsx)(iU,{backspaceRemovesValue:!(eg||ew),components:{MultiValueLabel:cg,SingleValue:cw,..."select"!==o&&{DropdownIndicator:null}},customProps:{disableKeyDown:eg||ew,disableMouseDown:eg||ew,onDocumentOpen:eI},disabled:P||eg||ew,filterOption:eo?eR:void 0,getOptionValue:e=>{if(e)return b&&Array.isArray(O)?"".concat(e.relationTo,"_").concat(e.value):e.value},isLoading:"select"===o&&en,isMulti:b,isSearchable:"select"===o,isSortable:w,menuIsOpen:"select"===o&&ei,onChange:P?void 0:e=>{b?null===e?(ef.current=[],k([])):(ef.current=e,k(e)):!1===b&&(null===e?(ef.current=null,k(null)):(ef.current=e,k(e)))},onInputChange:e=>eE({search:e,hasMany:b,value:M}),onMenuClose:()=>{es(!1)},onMenuOpen:()=>{"drawer"===o?eC():"select"===o&&(es(!0),ec.current||(ea(!0),eF({filterOptions:m,lastLoadedPage:{},onSuccess:()=>{ec.current=!0,ea(!1)},hasMany:b,value:M})))},onMenuScrollToBottom:()=>{ea(!0),eF({filterOptions:m,lastFullyLoadedRelation:G,lastLoadedPage:X,onSuccess:()=>{ea(!1)},search:ee,sort:!1,hasMany:b,value:x})},options:"function"==typeof g?g(ed):ed,placeholder:D,showError:I,value:null!=eL?eL:null}),!P&&n&&(0,u.jsx)(ce,{path:N,relationTo:O,hasMany:b,onChange:k,value:M})]}),t,(0,u.jsx)(el,{CustomComponent:p,Fallback:(0,u.jsx)(tz,{description:d,path:N})})]}),K.collectionSlug&&K.hasReadPermission&&(0,u.jsx)(eh,{onDelete:eT,onDuplicate:eO}),"drawer"===o&&!P&&(0,u.jsx)(ey,{allowCreate:n,enableRowSelections:!1,onSelect:ej})]})},cE=aB(e=>{let{field:t,field:{admin:{allowCreate:n=!0,allowEdit:a=!0,appearance:o="select",className:r,description:i,isSortable:s=!0,placeholder:c,sortOptions:d}={},hasMany:p,label:f,localized:h,relationTo:m,required:g},path:v,readOnly:b,validate:y}=e,{customComponents:{AfterInput:x,BeforeInput:w,Description:C,Error:j,Label:S}={},disabled:_,filterOptions:k,initialValue:E,path:N,setValue:D,showError:P,value:O}=aA({potentiallyStalePath:v,validate:(0,l.useCallback)((e,t)=>{if("function"==typeof y)return y(e,{...t,required:g})},[y,g])}),T=(0,l.useMemo)(()=>aV(t),[t]),R=Array.isArray(m),[I]=l.useState(()=>Array.isArray(m)?m:[m]),F=(0,l.useCallback)(e=>{if(!e)return void D(null,e===O);let t=!1;t=R?Array.isArray(O)&&Array.isArray(e)&&O.length===e.length&&O.every((t,n)=>{let a=e[n];return t.value===a.value&&t.relationTo===a.relationTo}):Array.isArray(O)&&Array.isArray(e)&&O.length===e.length&&O.every((t,n)=>t===e[n].value),D(e.map(e=>R?e:e.value),t)},[R,D,O]),A=(0,l.useCallback)(e=>{if(!e)return void D(null,e===O);let t=!1;t=R?O&&e&&O.value===e.value&&O.relationTo===e.relationTo:O&&e&&O===e.value,D(R?e:e.value,t)},[R,D,O]),M=l.useMemo(()=>!0===p?Array.isArray(O)?O.map(e=>R?e:{relationTo:Array.isArray(I)?I[0]:I,value:e}):O:O&&(R?O:{relationTo:Array.isArray(I)?I[0]:I,value:O}),[p,O,R,I]),L=l.useMemo(()=>!0===p?Array.isArray(E)?E.map(e=>R?e:{relationTo:Array.isArray(I)?I[0]:I,value:e}):E:E&&(R?E:{relationTo:Array.isArray(I)?I[0]:I,value:E}),[E,R,I,p]);return(0,u.jsx)(ck,{AfterInput:x,allowCreate:n,allowEdit:a,appearance:o,BeforeInput:w,className:r,Description:C,description:i,Error:j,filterOptions:k,formatDisplayedOptions:R?void 0:e=>e.map(e=>e.options).flat(),isSortable:s,Label:S,label:f,localized:h,maxResultsPerRequest:10,maxRows:null==t?void 0:t.maxRows,minRows:null==t?void 0:t.minRows,path:N,placeholder:c,readOnly:b||_,relationTo:I,required:g,showError:P,sortOptions:d,style:T,...!0===p?{hasMany:!0,initialValue:L,onChange:F,value:M}:{hasMany:!1,initialValue:L,onChange:A,value:M}})}),cN=()=>null,cD=aB(e=>{let{field:{admin:{className:t,style:n}={},fields:a},forceRender:o=!1,indexPath:l="",parentPath:r="",parentSchemaPath:i="",permissions:s,readOnly:c}=e;return(0,u.jsx)(iG,{children:(0,u.jsx)("div",{className:[az,"row",t].filter(Boolean).join(" "),style:n||void 0,children:(0,u.jsx)(pa,{className:"".concat("row","__fields"),fields:a,forceRender:o,margins:!1,parentIndexPath:l,parentPath:r,parentSchemaPath:i,permissions:s,readOnly:c})})})}),cP=e=>{let t=(0,h.c)(37),{id:n,AfterInput:a,BeforeInput:o,className:l,Description:r,description:i,Error:c,filterOption:p,hasMany:f,isClearable:m,isSortable:g,label:v,Label:b,localized:y,onChange:x,onInputChange:w,options:C,path:j,placeholder:S,readOnly:_,required:k,showError:E,style:N,value:D}=e,P=void 0!==f&&f,O=void 0===m||m,T=void 0===g||g,{i18n:R}=(0,s.d)(),I;if(t[0]!==a||t[1]!==o||t[2]!==r||t[3]!==c||t[4]!==b||t[5]!==l||t[6]!==i||t[7]!==p||t[8]!==P||t[9]!==R||t[10]!==n||t[11]!==O||t[12]!==T||t[13]!==v||t[14]!==y||t[15]!==x||t[16]!==w||t[17]!==C||t[18]!==j||t[19]!==S||t[20]!==_||t[21]!==k||t[22]!==E||t[23]!==N||t[24]!==D){let e,s;if(P&&Array.isArray(D)){let n;t[26]!==R||t[27]!==C?(n=e=>{var t;let n=C.find(t=>t.value===e);return{label:n?(0,d.s)(n.label,R):e,value:null!=(t=null==n?void 0:n.value)?t:e}},t[26]=R,t[27]=C,t[28]=n):n=t[28],e=D.map(n)}else if(D){var F;let n;t[29]!==D?(n=e=>e.value===D,t[29]=D,t[30]=n):n=t[30];let a=C.find(n);e={label:a?(0,d.s)(a.label,R):D,value:null!=(F=null==a?void 0:a.value)?F:D}}else e=null;let f=E&&"error",h=_&&"read-only",m;t[31]!==l||t[32]!==f||t[33]!==h?(m=[az,"select",l,f,h].filter(Boolean),t[31]=l,t[32]=f,t[33]=h,t[34]=m):m=t[34],t[35]!==R?(s=e=>({...e,label:(0,d.s)(e.label,R)}),t[35]=R,t[36]=s):s=t[36],I=(0,u.jsxs)("div",{className:m.join(" "),id:"field-".concat(j.replace(/\./g,"__")),style:N,children:[(0,u.jsx)(el,{CustomComponent:b,Fallback:(0,u.jsx)(nA,{label:v,localized:y,path:j,required:k})}),(0,u.jsxs)("div",{className:"".concat(az,"__wrap"),children:[(0,u.jsx)(el,{CustomComponent:c,Fallback:(0,u.jsx)(tU,{path:j,showError:E})}),o,(0,u.jsx)(iU,{disabled:_,filterOption:p,id:n,isClearable:O,isMulti:P,isSortable:T,onChange:x,onInputChange:w,options:C.map(s),placeholder:S,showError:E,value:e}),a]}),(0,u.jsx)(el,{CustomComponent:r,Fallback:(0,u.jsx)(tz,{description:i,path:j})})]}),t[0]=a,t[1]=o,t[2]=r,t[3]=c,t[4]=b,t[5]=l,t[6]=i,t[7]=p,t[8]=P,t[9]=R,t[10]=n,t[11]=O,t[12]=T,t[13]=v,t[14]=y,t[15]=x,t[16]=w,t[17]=C,t[18]=j,t[19]=S,t[20]=_,t[21]=k,t[22]=E,t[23]=N,t[24]=D,t[25]=I}else I=t[25];return I},cO=aB(e=>{let{field:t,field:{name:n,admin:{className:a,description:o,isClearable:r=!0,isSortable:i=!0,placeholder:s}={},hasMany:c=!1,label:d,localized:p,options:f=[],required:h},onChange:m,path:g,readOnly:v,validate:b}=e,y=l.useMemo(()=>f.map(e=>"object"==typeof e&&(e.value||""===e.value)?e:{label:e,value:e}),[f]),{customComponents:{AfterInput:x,BeforeInput:w,Description:C,Error:j,Label:S}={},disabled:_,path:k,selectFilterOptions:E,setValue:N,showError:D,value:P}=aA({potentiallyStalePath:g,validate:(0,l.useCallback)((e,t)=>{if("function"==typeof b)return b(e,{...t,hasMany:c,options:y,required:h})},[b,h,c,y])}),O=(0,l.useCallback)(e=>{if(!v||_){let t=null;e&&c?t=Array.isArray(e)?e.map(e=>e.value):[]:e&&!Array.isArray(e)&&(t=e.value),"function"==typeof m&&m(t),N(t)}},[v,_,c,N,m]),T=(0,l.useMemo)(()=>aV(t),[t]);return(0,u.jsx)(cP,{AfterInput:x,BeforeInput:w,className:a,Description:C,description:o,Error:j,filterOption:E?(e,t)=>{let{label:n,value:a}=e;return(null==E?void 0:E.some(e=>("string"==typeof e?e:e.value)===a))&&n.toLowerCase().includes(t.toLowerCase())}:void 0,hasMany:c,isClearable:r,isSortable:i,Label:S,label:d,localized:p,name:n,onChange:O,options:y,path:k,placeholder:s,readOnly:v||_,required:h,showError:D,style:T,value:P})}),cT=(0,c.e)(ee(),1);function cR(e){let t=(0,h.c)(5),{errorMessage:n}=e,a;t[0]!==n?(a=()=>(function(e){let[t,n]=e.split(":");if(!n)return{message:t};let a=n.split(",").map(e=>e.replaceAll(" > "," → ").trim());return 1===a.length?{errors:a,message:"".concat(t,": ")}:{errors:function(e){let t=[];for(let n of e)if(n){let e=n.split(" → "),a=!1;for(let o=0;o0?1===r.length?(0,u.jsx)("span",{"data-testid":"field-error",children:r[0]}):(0,u.jsx)("ul",{"data-testid":"field-errors",children:r.map(cI)}):null]}),t[2]=r,t[3]=i,t[4]=s):s=t[4],s}function cI(e,t){return(0,u.jsx)("li",{children:e},t)}var cF=l.createContext(null),cA=()=>{let e=l.use(cF);if(null===e)throw Error("useUploadHandlers must be used within UploadHandlersProvider");return e},cM={413:"Your request was too large to submit successfully."},cL=(0,c.e)(J(),1),cB=(e,t)=>{let n={},a=Object.entries(t).reduce((t,a)=>{let[o,l]=a;if(0===o.indexOf("".concat(e,"."))){let[n]=o.replace("".concat(e,"."),"").split(".");t[n]||(t[n]={}),t[n][o.replace("".concat(e,".").concat(String(n),"."),"")]={...l}}else n[o]=l;return t},[]);return{remainingFields:n,rows:a}},cV=(e,t)=>t.reduce((t,n,a)=>({...t,...Object.entries(n).reduce((t,n)=>{let[o,l]=n;return{...t,["".concat(e,".").concat(a,".").concat(o)]:{...l}}},{})}),{}),cz="default"in cL.default?cL.default.default:cL.default;function cU(e,t){var n,a,o,l,r,i,s,c,u,d;switch(t.type){case"ADD_ROW":{let{blockType:r,path:i,rowIndex:s,subFieldState:c={}}=t,u="number"==typeof s?s:(null==(a=e[i])||null==(n=a.rows)?void 0:n.length)||0,d=[...(null==(o=e[i])?void 0:o.rows)||[]],p={id:(null==c||null==(l=c.id)?void 0:l.value)||new cz().toHexString(),isLoading:!0};r&&(p.blockType=r),d.splice(u,0,p),r&&(c.blockType={initialValue:r,valid:!0,value:r});let{remainingFields:f,rows:h}=cB(i,e);return h.splice(u,0,c),{...f,...cV(i,h),["".concat(i,".").concat(u,".id")]:{initialValue:p.id,passesCondition:!0,valid:!0,value:p.id},[i]:{...e[i],disableFormData:!0,rows:d,value:h.length}}}case"ADD_SERVER_ERRORS":{let n={...e},a=[];return t.errors.forEach(e=>{let{message:t,path:o}=e;n[o]={...n[o]||{initialValue:null,value:null},errorMessage:t,valid:!1};let l=o.split(".");l.length>1&&a.push({fieldErrorPath:o,parentPath:l.slice(0,l.length-1).join(".")})}),n=Object.entries(n).reduce((e,t)=>{let[n,o]=t,l=a.reduce((e,t)=>{let{fieldErrorPath:a,parentPath:o}=t;return o.startsWith(n)&&e.push(a),e},[]),r=!1;if(l.length>0){let t=Array.isArray(o.errorPaths)?o.errorPaths:[];l.forEach(e=>{t.includes(e)||(t.push(e),r=!0)}),r&&(e[n]={...o,errorPaths:t})}return r||(e[n]=o),e},{})}case"DUPLICATE_ROW":{let{path:n,rowIndex:a}=t,{remainingFields:o,rows:l}=cB(n,e),c=[...e[n].rows||[]],u=(0,A.KS)(c[a]),d=new cz().toHexString();u.id&&(u.id=d),(null==(i=c[a])||null==(r=i.customComponents)?void 0:r.RowLabel)&&(u.customComponents={RowLabel:c[a].customComponents.RowLabel});let p=(0,A.KS)(l[a]);for(let e of(p.id&&(p.id.value=d,p.id.initialValue=d),Object.keys(p).filter(e=>e.endsWith(".id")))){let t=p[e],n=new cz().toHexString();if(t&&"string"==typeof t.value&&cz.isValid(t.value)){p[e].value=n,p[e].initialValue=n;let t=e.split("."),a=parseInt(t[t.length-2],10),o=t.slice(0,t.length-2).join("."),l=null==p||null==(s=p[o])?void 0:s.rows;p[o]&&Array.isArray(l)&&(l[a]?l[a].id=n:l[a]={id:n})}}return Object.keys(p).length>0&&(l.splice(a+1,0,p),c.splice(a+1,0,u)),{...o,...cV(n,l),[n]:{...e[n],disableFormData:!0,rows:c,value:l.length}}}case"MERGE_SERVER_STATE":{let{acceptValues:n,prevStateRef:a,serverState:o}=t,l=(e=>{let{acceptValues:t,currentState:n={},incomingState:a}=e,o={...n};for(let[e,i]of Object.entries(a||{})){var l,r;if(!(e in n)&&!i.addedByServer)continue;let a=i.addedByServer||!0===t||"object"==typeof t&&null!==t&&!1===t.overrideLocalChanges&&!(null==(l=n[e])?void 0:l.isModified),s=i;if(!a){let{initialValue:e,value:t,...n}=i;s=n}o[e]={...n[e],...s},n[e]&&"errorPaths"in n[e]&&!("errorPaths"in i)&&(o[e].errorPaths=[]),Array.isArray(i.rows)&&e in n&&(o[e].rows=[...(null==(r=n[e])?void 0:r.rows)||[]],i.rows.forEach(t=>{var a;let l=null==(a=n[e].rows)?void 0:a.findIndex(e=>e.id===t.id);if(l>-1)o[e].rows[l]={...n[e].rows[l],...t};else if(t.addedByServer){let n={...t};delete n.addedByServer,o[e].rows.push(n)}})),!1!==i.valid&&(o[e].valid=!0),!1!==i.passesCondition&&(o[e].passesCondition=!0),i.blocksFilterOptions||delete o[e].blocksFilterOptions,delete o[e].addedByServer}return(0,y.j)(o,n)?n:o})({acceptValues:n,currentState:e||{},incomingState:o});return a.current=l,l}case"MOVE_ROW":{let{moveFromIndex:n,moveToIndex:a,path:o}=t,{remainingFields:l,rows:r}=cB(o,e),i=r[n];r.splice(n,1),r.splice(a,0,i);let s=[...(null==(c=e[o])?void 0:c.rows)||[]],u={...s[n]};return s.splice(n,1),s.splice(a,0,u),{...l,...cV(o,r),[o]:{...e[o],rows:s}}}case"REMOVE":{let n={...e};return n[t.path]&&delete n[t.path],n}case"REMOVE_ROW":{let{path:n,rowIndex:a}=t,{remainingFields:o,rows:l}=cB(n,e),r=[...(null==(u=e[n])?void 0:u.rows)||[]];return l.splice(a,1),r.splice(a,1),{...o,[n]:{...e[n],disableFormData:l.length>0,rows:r,value:l.length},...cV(n,l)}}case"REPLACE_ROW":{let{blockType:n,path:a,rowIndex:o,subFieldState:l={}}=t,{remainingFields:r,rows:i}=cB(a,e),s=Math.max(0,Math.min(o,(null==i?void 0:i.length)-1||0)),c=[...(null==(d=e[a])?void 0:d.rows)||[]];return c[s]={id:new cz().toHexString(),blockType:n||void 0,collapsed:!1},n&&(l.blockType={initialValue:n,valid:!0,value:n}),i[s]=l,{...r,...cV(a,i),[a]:{...e[a],disableFormData:!0,rows:c,value:i.length}}}case"REPLACE_STATE":if(!1!==t.optimize){let n={};for(let[a,o]of Object.entries(t.state)){let t=e[a];!1!==o.valid&&(o.valid=!0),!1!==o.passesCondition&&(o.passesCondition=!0),(0,y.j)(t,o)?t&&(n[a]=t):n[a]=o}return n}if(t.sanitize)for(let e of Object.values(t.state))!1!==e.valid&&(e.valid=!0),!1!==e.passesCondition&&(e.passesCondition=!0);return t.state;case"SET_ALL_ROWS_COLLAPSED":{let{path:n,updatedRows:a}=t;return{...e,[n]:{...e[n],rows:a}}}case"SET_ROW_COLLAPSED":{let{path:n,updatedRows:a}=t;return{...e,[n]:{...e[n],rows:a}}}case"UPDATE":{let n=Object.entries(t).reduce((e,t)=>{let[n,a]=t;return["disableFormData","errorMessage","initialValue","rows","valid","validate","value"].includes(n)?{...e,[n]:a,..."value"===n?{isModified:!0}:{}}:e},(null==e?void 0:e[t.path])||{}),a={...e,[t.path]:n};if("value"in t)for(let[e,n]of Object.entries(a))e!==t.path&&"isModified"in n&&delete a[e].isModified;return a}case"UPDATE_MANY":{let n={...e};return Object.entries(t.formState).forEach(e=>{let[t,a]=e;n[t]=a}),n}default:return e}}var cH={addFieldRow:()=>{},buildRowErrors:()=>{},createFormData:()=>{},disabled:!1,dispatchFields:()=>{},fields:{},formRef:null,getData:()=>{},getDataByPath:()=>{},getField:()=>{},getFields:()=>({}),getSiblingData:()=>{},initializing:void 0,isValid:!0,moveFieldRow:()=>{},removeFieldRow:()=>{},replaceFieldRow:()=>{},replaceState:()=>{},reset:()=>{},setBackgroundProcessing:()=>{},setDisabled:()=>{},setIsValid:()=>{},setModified:()=>{},setProcessing:()=>{},setSubmitted:()=>{},submit:()=>{},validateForm:()=>{}},cq=e=>{var t,n,a;let{id:o,collectionSlug:r,docConfig:c,docPermissions:d,getDocPreferences:p,globalSlug:m}=aE(),g=null!=c&&null!=(t=c.versions)&&!!t.drafts&&"object"==typeof(null==c||null==(n=c.versions)?void 0:n.drafts)&&null!=(a=c.versions.drafts.validate)&&a,{action:v,beforeSubmit:b,children:x,className:w,disabled:C,disableSuccessStatus:j,disableValidationOnSubmit:S,el:_,handleResponse:k,initialState:E,isDocumentForm:N,isInitializing:D,onChange:P,onSubmit:O,onSuccess:T,redirect:R,submitted:B,uuid:V,waitForAutocomplete:z}=e,U="method"in e?null==e?void 0:e.method:void 0,H=(0,f.useRouter)(),q=ej(),{code:W}=nI(),{i18n:K,t:Y}=(0,s.d)(),{refreshCookie:G,user:$}=nO(),X=aT(),{queueTask:Z}=ci(),{getFormState:Q}=sn(),{startRouteTransition:J}=eM(),{getUploadHandler:ee}=cA(),{config:et}=(0,i.c)(),[en,ea]=(0,l.useState)(C||!1),[eo,el]=(0,l.useState)(!1),[er,ei]=(0,l.useState)(!1),[es,ec]=(0,l.useState)(!0),[eu,ed]=(0,l.useState)(D),[ep,eC]=(0,l.useState)(!1),[eS,e_]=(0,l.useState)(!1),[ek,eE]=(0,l.useState)(!1),eN=(0,l.useRef)(null),eD=(0,l.useRef)({}),eP=(0,l.useRef)(null),eO=(0,l.useRef)(!0),eT=(0,l.useReducer)(cU,{},()=>E),[eR,eI]=eT;eD.current.fields=eR;let eA=(0,l.useRef)(eR),eL=(0,l.useCallback)(async()=>{let e={},t=!0,n=eD.current.getData(),a=Object.entries(eD.current.fields).map(async a=>{let[l,i]=a,s=l?l.split("."):[];if(!1!==i.passesCondition){let e=i.valid;if("validate"in i&&"function"==typeof i.validate){let t=i.value;(null==i?void 0:i.rows)&&Array.isArray(i.rows)&&(t=eD.current.getDataByPath(l)),"string"==typeof(e=await i.validate(t,{...i,id:o,collectionSlug:r,blockData:void 0,data:(null==q?void 0:q.getData)?q.getData():n,event:"submit",operation:X,path:s,preferences:{},req:{payload:{config:et},t:Y,user:$},siblingData:eD.current.getSiblingData(l)}))?(i.errorMessage=e,i.valid=!1):(i.valid=!0,i.errorMessage=void 0)}!1===i.valid&&(t=!1)}e[l]=i});return await Promise.all(a),(0,y.j)(eD.current.fields,e)||eI({type:"REPLACE_STATE",state:e}),ec(t),t},[r,et,eI,o,X,Y,$,q]),eB=(0,l.useCallback)(async(e,t)=>{let{acceptValues:n=!0,action:a=v,context:o,disableFormWhileProcessing:l=!0,disableSuccessStatus:r,method:i=U,overrides:s={},skipValidation:c}=e||{},d=null!=r?r:j;if(en){t&&t.preventDefault();return}let p,f,h=new Promise((e,t)=>{f=e,p=t}),m=a||"string"==typeof v||"function"==typeof v;R||d||!m?(f=e=>eF.success(e),p=e=>eF.error(e)):eF.promise(h,{error:e=>e,loading:Y("general:submitting"),success:e=>e}),t&&(t.stopPropagation(),t.preventDefault()),l&&(eC(!0),ea(!0)),z&&await (0,I.u)(100);let y=(0,F.r)(eD.current.fields,!0),x=(0,A.KS)(eD.current.fields);if(Array.isArray(b)){let e;await b.reduce(async(t,n)=>{await t,e=await n({formState:x})},Promise.resolve());let t=Object.entries(e).every(e=>{let[,t]=e;return!1!==t.valid});if(ec(t),!t)return eC(!1),eE(!0),ea(!1),eI({type:"REPLACE_STATE",state:e})}let w=!!c||!!S||await eD.current.validateForm();if(ec(w),!w){p(Y("error:correctInvalidFields")),eC(!1),eE(!0),ea(!1);return}let C={};if("function"==typeof s?C=s(eD.current.fields):"object"==typeof s&&(C=s),O){for(let[e,t]of Object.entries(C))y[e]=t;O(eD.current.fields,y)}if(!m){eC(!1),eE(!0),ea(!1);return}let _=await eD.current.createFormData(C,{data:y,mergeOverrideData:"function"!=typeof s});try{let e;if("string"==typeof a?e=await nD[i.toLowerCase()](a,{body:_,headers:{"Accept-Language":K.language}}):"function"==typeof v&&(e=await v(_)),ei(!1),ea(!1),"function"==typeof k)return void k(e,f,p);let t=e.headers.get("content-type"),l=t&&-1!==t.indexOf("application/json"),r={};if(l&&(r=await e.json()),e.statusH.push(R)):d||f(r.message||Y("general:submissionSuccessful"))}else{if(eC(!1),eE(!0),"draft"===s._status&&(ei(!0),g||eE(!1)),eD.current={...eD.current},r.message)return void p(r.message);if(Array.isArray(r.errors)){let[e,t]=r.errors.reduce((e,t)=>{var n,a;let[o,l]=e,r=[],i=[];return(null==t?void 0:t.message)&&i.push(t),Array.isArray(null==t||null==(n=t.data)?void 0:n.errors)&&(null==(a=t.data)||a.errors.forEach(e=>{(null==e?void 0:e.path)?r.push(e):i.push(e)})),[[...o,...r],[...l,...i]]},[[],[]]);ec(!1),eI({type:"ADD_SERVER_ERRORS",errors:e}),t.forEach(e=>{p((0,u.jsx)(cR,{errorMessage:e.message||Y("error:unknown")}))});return}let t=(null==cM?void 0:cM[e.status])||(null==e?void 0:e.statusText)||Y("error:unknown");p(t)}return{formState:eD.current.fields,res:e}}catch(e){console.error("Error submitting form",e),eC(!1),eE(!0),ea(!1),p(e.message)}},[b,J,v,j,S,en,eI,k,U,O,T,R,H,Y,K,g,z]),eV=(0,l.useCallback)(()=>eD.current.fields,[]),ez=(0,l.useCallback)(e=>eD.current.fields[e],[]),eU=(0,l.useCallback)(()=>(0,F.r)(eD.current.fields,!0),[]),eH=(0,l.useCallback)(e=>(0,M.d)(eD.current.fields,e),[]),eq=(0,l.useCallback)(e=>(0,L.Z)(eD.current.fields,e),[]),eW=(0,l.useCallback)(async(e,t)=>{let{data:n,mergeOverrideData:a=!0}=t,o=n||(0,F.r)(eD.current.fields,!0),l=null==o?void 0:o.file;if(c&&"upload"in c&&c.upload&&l){delete o.file;let e=ee({collectionSlug:r});if("function"==typeof e){let t=l.name;l=JSON.stringify({clientUploadContext:await e({file:l,updateFilename:e=>{t=e}}),collectionSlug:r,filename:t,mimeType:l.type,size:l.size})}}let i={_payload:JSON.stringify(o=a?{...o,...e}:e)};return c&&"upload"in c&&c.upload&&l&&(i.file=l),(0,cT.serialize)(i,{indices:!0,nullsAsUndefineds:!1})},[r,c,ee]),eK=(0,l.useCallback)(async e=>{let t=sf(eP),n=await p(),{state:a}=await Q({id:o,collectionSlug:r,data:e,docPermissions:d,docPreferences:n,globalSlug:m,locale:W,operation:X,renderAllFields:!0,schemaPath:r||m,signal:t.signal,skipValidation:!0});eD.current={...cH},ei(!1),eI({type:"REPLACE_STATE",state:a}),eP.current=null},[r,eI,m,o,X,Q,d,p,W]),eY=(0,l.useCallback)(e=>{eD.current={...cH},ei(!1),eI({type:"REPLACE_STATE",state:e})},[eI]),eG=(0,l.useCallback)(e=>{let{blockType:t,path:n,rowIndex:a,subFieldState:o}=e,l=eq(n)||[];eI({type:"ADD_ROW",blockType:t,path:n,rowIndex:void 0===a?l.length:a,subFieldState:o}),ei(!0)},[eI,eq]),e$=(0,l.useCallback)(e=>{let{moveFromIndex:t,moveToIndex:n,path:a}=e;eI({type:"MOVE_ROW",moveFromIndex:t,moveToIndex:n,path:a}),ei(!0)},[eI]),eX=(0,l.useCallback)(e=>{let{path:t,rowIndex:n}=e;eI({type:"REMOVE_ROW",path:t,rowIndex:n}),ei(!0)},[eI]),eZ=(0,l.useCallback)(e=>{let{blockType:t,path:n,rowIndex:a,subFieldState:o}=e,l=eq(n);eI({type:"REPLACE_ROW",blockType:t,path:n,rowIndex:void 0===a?l.length:a,subFieldState:o}),ei(!0)},[eI,eq]);(0,l.useEffect)(()=>{let e=eP.current;return()=>{sp(e)}},[]),(0,l.useEffect)(()=>{void 0!==D&&ed(D)},[D]),eD.current.submit=eB,eD.current.getFields=eV,eD.current.getField=ez,eD.current.getData=eU,eD.current.getSiblingData=eH,eD.current.getDataByPath=eq,eD.current.validateForm=eL,eD.current.createFormData=eW,eD.current.setModified=ei,eD.current.setProcessing=eC,eD.current.setBackgroundProcessing=e_,eD.current.setSubmitted=eE,eD.current.setIsValid=ec,eD.current.disabled=en,eD.current.setDisabled=ea,eD.current.formRef=eN,eD.current.reset=eK,eD.current.replaceState=eY,eD.current.dispatchFields=eI,eD.current.addFieldRow=eG,eD.current.removeFieldRow=eX,eD.current.moveFieldRow=e$,eD.current.replaceFieldRow=eZ,eD.current.uuid=V,eD.current.initializing=eu,eD.current.isValid=es,(0,l.useEffect)(()=>{el(!0)},[]),(0,l.useEffect)(()=>{"boolean"==typeof C&&ea(C)},[C]),(0,l.useEffect)(()=>{"boolean"==typeof B&&eE(B)},[B]),(0,l.useEffect)(()=>{E&&(eD.current={...cH},eI({type:"REPLACE_STATE",optimize:!1,sanitize:!0,state:E}))},[E,eI]),nB(()=>{G()},15e3,[eR]),(0,l.useEffect)(()=>{eD.current={...eD.current},ei(!1)},[W]);let eQ=[w,"form"].filter(Boolean).join(" "),eJ=nN(e=>{Z(async()=>{if(Array.isArray(P)){let t;for(let n of P)t=await n({formState:(0,A.KS)(eR),submitted:e});eI({type:"MERGE_SERVER_STATE",prevStateRef:eA,serverState:t})}})});!function(e,t,n){let a,o,r,i=(0,h.c)(11),s;i[0]!==e?(s=()=>e,i[0]=e,i[1]=s):s=i[1];let[c,u]=(0,l.useState)(s),d;250!==i[2]||i[3]!==e?(d=()=>{let t=setTimeout(()=>{u(()=>e)},250);return()=>{clearTimeout(t)}},i[2]=n,i[3]=e,i[4]=d):d=i[4],i[5]!==n||i[6]!==t?(a=[...t,n],i[5]=n,i[6]=t,i[7]=a):a=i[7],(0,l.useEffect)(d,a),i[8]!==c?(o=()=>{c()},r=[c],i[8]=c,i[9]=o,i[10]=r):(o=i[9],r=i[10]),(0,l.useEffect)(o,r)}(()=>{(eO.current||!(0,y.j)(eR,eA.current))&&er&&eJ(ek),eA.current=eR,eO.current=!1},[er,ek,eR],250);let e0=N?eh:l.Fragment,e1=N?{value:eD.current}:{};return(0,u.jsx)(_||"form",{action:"function"==typeof v?void 0:v,className:eQ,method:U,noValidate:!0,onSubmit:e=>void eD.current.submit({},e),ref:eN,children:(0,u.jsx)(e0,{...e1,children:(0,u.jsx)(ef,{value:eD.current,children:(0,u.jsx)(em,{value:{fields:eR,...eD.current},children:(0,u.jsx)(eg,{value:ek,children:(0,u.jsx)(ex,{value:!eo||eo&&eu,children:(0,u.jsx)(ev,{value:ep,children:(0,u.jsx)(eb,{value:eS,children:(0,u.jsx)(ey,{value:er,children:(0,u.jsx)(ew.Provider,{value:eT,children:x})})})})})})})})})})},cW="tabs-field__tab-button",cK=e=>{let t=(0,h.c)(12),{hidden:n,isActive:a,parentPath:o,setIsActive:r,tab:i}=e,{i18n:c}=(0,s.d)(),[p,f]=(0,l.useState)(void 0),g;if(t[0]!==p||t[1]!==n||t[2]!==c||t[3]!==a||t[4]!==o||t[5]!==r||t[6]!==i){let e=[...o?o.split(".").slice(0,-1):[],...(0,m.pz)(i)?[i.name]:[]],s=p>0,h=(0,u.jsx)(oD,{fields:i.fields,path:e,setErrorCount:f}),v=s&&"".concat(cW,"--has-error"),b=a&&"".concat(cW,"--active"),y=n&&"".concat(cW,"--hidden"),x;t[8]!==v||t[9]!==b||t[10]!==y?(x=[cW,v,b,y].filter(Boolean),t[8]=v,t[9]=b,t[10]=y,t[11]=x):x=t[11],g=(0,u.jsxs)(l.Fragment,{children:[h,(0,u.jsxs)("button",{className:x.join(" "),onClick:r,type:"button",children:[i.label?(0,d.s)(i.label,c):(0,m.pz)(i)?i.name:"",s&&(0,u.jsx)(tB,{count:p,i18n:c})]})]}),t[0]=p,t[1]=n,t[2]=c,t[3]=a,t[4]=o,t[5]=r,t[6]=i,t[7]=g}else g=t[7];return g},cY="tabs-field";function cG(e){let{activeTabConfig:t,path:n}=e,a=n;return(0,m.pz)(t)&&t.name&&(a=n?"".concat(n,".").concat(t.name):t.name),a}var c$=aB(e=>{var t,n;let a,o,r,i=(0,h.c)(59),{field:c,forceRender:d,indexPath:p,parentPath:f,parentSchemaPath:g,path:v,permissions:b,readOnly:y}=e,{admin:x,tabs:w}=c,C;i[0]!==x?(C=void 0===x?{}:x,i[0]=x,i[1]=C):C=i[1];let{className:j}=C,S;i[2]!==w?(S=void 0===w?[]:w,i[2]=w,i[3]=S):S=i[3];let _=S,k=void 0===p?"":p,E=void 0===f?"":f,N=void 0===g?"":g,D=void 0===v?"":v,{getPreference:P,setPreference:O}=aC(),{preferencesKey:T}=aE(),{i18n:R}=(0,s.d)(),{isWithinCollapsible:I}=a2(),F;i[4]!==_?(F=e=>{let[t]=e;return _.map((e,n)=>{var a,o;let l=null==e?void 0:e.id;return{index:n,passesCondition:null==(o=null==t||null==(a=t[l])?void 0:a.passesCondition)||o,tab:e}})},i[4]=_,i[5]=F):F=i[5];let A=eE(F),M;i[6]!==A?(M=()=>{var e,t,n;return null!=(n=null==(t=A.filter(cZ))||null==(e=t[0])?void 0:e.index)?n:0},i[6]=A,i[7]=M):M=i[7];let[L,B]=(0,l.useState)(M),V="tabs-".concat(k),z;i[8]!==L||i[9]!==E||i[10]!==_?(z=()=>cG({activeTabConfig:_[L],path:E}),i[8]=L,i[9]=E,i[10]=_,i[11]=z):z=i[11];let[U,H]=(0,l.useState)(z),q;i[12]!==N||i[13]!==_[0]?(q=()=>cG({activeTabConfig:_[0],path:N}),i[12]=N,i[13]=_[0],i[14]=q):q=i[14];let[W,K]=(0,l.useState)(q),Y;i[15]!==L||i[16]!==U||i[17]!==E||i[18]!==_?(Y=(0,m.pz)(_[L])?U:E,i[15]=L,i[16]=U,i[17]=E,i[18]=_,i[19]=Y):Y=i[19];let G=Y,$=A[L],X=null==$?void 0:$.tab,Z;i[20]!==L||i[21]!==W||i[22]!==N||i[23]!==_?(Z=(0,m.pz)(_[L])?W:N,i[20]=L,i[21]=W,i[22]=N,i[23]=_,i[24]=Z):Z=i[24];let Q=Z,J=null!=(n=null==(t=X.admin)?void 0:t.description)?n:X.description,ee="function"==typeof J?J({i18n:R,t:R.t}):J,et=A.some(cQ),en;i[25]!==P||i[26]!==E||i[27]!==N||i[28]!==D||i[29]!==T||i[30]!==O||i[31]!==_||i[32]!==V?(en=async e=>{var t,n;B(e),H(cG({activeTabConfig:_[e],path:E})),K(cG({activeTabConfig:_[e],path:N}));let a=await P(T);T&&O(T,{...a,...D?{fields:{...(null==a?void 0:a.fields)||{},[D]:{...null==a||null==(t=a.fields)?void 0:t[D],tabIndex:e}}}:{fields:{...null==a?void 0:a.fields,[V]:{...null==a||null==(n=a.fields)?void 0:n[V],tabIndex:e}}}})},i[25]=P,i[26]=E,i[27]=N,i[28]=D,i[29]=T,i[30]=O,i[31]=_,i[32]=V,i[33]=en):en=i[33];let ea=en,eo,el;i[34]!==P||i[35]!==E||i[36]!==N||i[37]!==D||i[38]!==T||i[39]!==_||i[40]!==V?(eo=()=>{T&&(async()=>{var e,t,n,a;let o=await P(T),l=(D?null==o||null==(t=o.fields)||null==(e=t[D])?void 0:e.tabIndex:null==o||null==(a=o.fields)||null==(n=a[V])?void 0:n.tabIndex)||0;B(l),H(cG({activeTabConfig:_[l],path:E})),K(cG({activeTabConfig:_[l],path:N}))})()},el=[D,P,T,V,_,E,N],i[34]=P,i[35]=E,i[36]=N,i[37]=D,i[38]=T,i[39]=_,i[40]=V,i[41]=eo,i[42]=el):(eo=i[41],el=i[42]),(0,l.useEffect)(eo,el),i[43]!==(null==$?void 0:$.passesCondition)||i[44]!==ea||i[45]!==A?(a=()=>{if((null==$?void 0:$.passesCondition)===!1){let e=A.find(cJ);e&&ea(e.index)}},i[43]=null==$?void 0:$.passesCondition,i[44]=ea,i[45]=A,i[46]=a):a=i[46],i[47]!==$||i[48]!==ea||i[49]!==A?(o=[$,A,ea],i[47]=$,i[48]=ea,i[49]=A,i[50]=o):o=i[50],(0,l.useEffect)(a,o);let er=I&&"".concat(cY,"--within-collapsible"),ei=!et&&"".concat(cY,"--hidden"),es;return i[51]!==j||i[52]!==er||i[53]!==ei?(es=[az,j,cY,er,ei].filter(Boolean),i[51]=j,i[52]=er,i[53]=ei,i[54]=es):es=i[54],i[55]!==L||i[56]!==ea||i[57]!==D?(r=e=>{let{index:t,passesCondition:n,tab:a}=e;return(0,u.jsx)(cK,{hidden:!n,isActive:L===t,parentPath:D,setIsActive:()=>{ea(t)},tab:a},t)},i[55]=L,i[56]=ea,i[57]=D,i[58]=r):r=i[58],(0,u.jsx)("div",{className:es.join(" "),children:(0,u.jsxs)(iX,{children:[(0,u.jsx)("div",{className:"".concat(cY,"__tabs-wrap"),children:(0,u.jsx)("div",{className:"".concat(cY,"__tabs"),children:A.map(r)})}),(0,u.jsx)("div",{className:"".concat(cY,"__content-wrap"),children:X&&(0,u.jsx)(cX,{description:ee,fields:X.fields,forceRender:void 0!==d&&d,hidden:!1,parentIndexPath:(0,m.pz)(X)?"":"".concat(k?k+"-":"")+String($.index),parentPath:G,parentSchemaPath:Q,path:U,permissions:b&&"object"==typeof b&&"name"in X?b[X.name]&&"object"==typeof b[X.name]&&"fields"in b[X.name]?b[X.name].fields:b[X.name]:b,readOnly:y})})]})})});function cX(e){let t=(0,h.c)(21),{description:n,fields:a,forceRender:o,hidden:l,label:r,parentIndexPath:i,parentPath:c,parentSchemaPath:p,permissions:f,readOnly:m}=e,{i18n:g}=(0,s.d)(),{customComponents:v,path:b}=aA(),y,x;if(t[0]!==n||t[1]!==a||t[2]!==o||t[3]!==l||t[4]!==g||t[5]!==r||t[6]!==i||t[7]!==c||t[8]!==p||t[9]!==b||t[10]!==f||t[11]!==m||t[12]!==v){x=Symbol.for("react.early_return_sentinel");e:{let e,{AfterInput:s,BeforeInput:h,Description:w,Field:C}=void 0===v?{}:v;if(C){x=C;break e}let j=l&&"".concat(cY,"__tab--hidden"),S;t[15]!==g||t[16]!==r?(S=r&&"".concat(cY,"__tabConfigLabel-").concat((0,R.f)((0,d.s)(r,g))),t[15]=g,t[16]=r,t[17]=S):S=t[17],t[18]!==j||t[19]!==S?(e=[j,"".concat(cY,"__tab"),S].filter(Boolean),t[18]=j,t[19]=S,t[20]=e):e=t[20],y=(0,u.jsxs)("div",{className:e.join(" "),children:[(0,u.jsx)(el,{CustomComponent:w,Fallback:(0,u.jsx)(tz,{description:n,marginPlacement:"bottom",path:b})}),h,(0,u.jsx)(pa,{fields:a,forceRender:o,parentIndexPath:i,parentPath:c,parentSchemaPath:p,permissions:f,readOnly:m}),s]})}t[0]=n,t[1]=a,t[2]=o,t[3]=l,t[4]=g,t[5]=r,t[6]=i,t[7]=c,t[8]=p,t[9]=b,t[10]=f,t[11]=m,t[12]=v,t[13]=y,t[14]=x}else y=t[13],x=t[14];return x!==Symbol.for("react.early_return_sentinel")?x:y}function cZ(e){let{passesCondition:t}=e;return t}function cQ(e){let{passesCondition:t}=e;return t}function cJ(e){let{passesCondition:t}=e;return t}var c0=e=>{let t=(0,h.c)(32),{AfterInput:n,BeforeInput:a,className:o,Description:l,description:r,Error:i,hasMany:c,htmlAttributes:p,inputRef:f,Label:m,label:g,localized:v,maxRows:b,onChange:y,onKeyDown:x,path:w,placeholder:C,readOnly:j,required:S,rtl:_,showError:k,style:E,value:N,valueToRender:D}=e,{i18n:P,t:O}=(0,s.d)(),T;if(t[0]!==n||t[1]!==a||t[2]!==l||t[3]!==i||t[4]!==m||t[5]!==o||t[6]!==r||t[7]!==c||t[8]!==p||t[9]!==P||t[10]!==f||t[11]!==g||t[12]!==v||t[13]!==b||t[14]!==y||t[15]!==x||t[16]!==w||t[17]!==C||t[18]!==j||t[19]!==S||t[20]!==_||t[21]!==k||t[22]!==E||t[23]!==O||t[24]!==N||t[25]!==D){let e=(0,d.s)(C,P),s=k&&"error",h=j&&"read-only",R=c&&"has-many",I;t[27]!==o||t[28]!==s||t[29]!==h||t[30]!==R?(I=[az,"text",o,s,h,R].filter(Boolean),t[27]=o,t[28]=s,t[29]=h,t[30]=R,t[31]=I):I=t[31],T=(0,u.jsxs)("div",{className:I.join(" "),style:E,children:[(0,u.jsx)(el,{CustomComponent:m,Fallback:(0,u.jsx)(nA,{label:g,localized:v,path:w,required:S})}),(0,u.jsxs)("div",{className:"".concat(az,"__wrap"),children:[(0,u.jsx)(el,{CustomComponent:i,Fallback:(0,u.jsx)(tU,{path:w,showError:k})}),a,c?(0,u.jsx)(iU,{className:"field-".concat(w.replace(/\./g,"__")),components:{DropdownIndicator:null},customProps:{editableProps:c3},disabled:j,filterOption:()=>!b||!(Array.isArray(N)&&b&&N.length>=b),isClearable:!1,isCreatable:!0,isMulti:!0,isSortable:!0,menuIsOpen:!1,noOptionsMessage:()=>Array.isArray(N)&&N.length>=b?O("validation:limitReached",{max:b,value:N.length+1}):null,onChange:y,options:[],placeholder:e,showError:k,value:D}):(0,u.jsx)("input",{"data-rtl":_,disabled:j,id:"field-".concat(null==w?void 0:w.replace(/\./g,"__")),name:w,onChange:y,onKeyDown:x,placeholder:e,ref:f,type:"text",value:N||"",...null!=p?p:{}}),n,(0,u.jsx)(el,{CustomComponent:l,Fallback:(0,u.jsx)(tz,{description:r,path:w})})]})]}),t[0]=n,t[1]=a,t[2]=l,t[3]=i,t[4]=m,t[5]=o,t[6]=r,t[7]=c,t[8]=p,t[9]=P,t[10]=f,t[11]=g,t[12]=v,t[13]=b,t[14]=y,t[15]=x,t[16]=w,t[17]=C,t[18]=j,t[19]=S,t[20]=_,t[21]=k,t[22]=E,t[23]=O,t[24]=N,t[25]=D,t[26]=T}else T=t[26];return T};function c1(e){e.currentTarget.contentEditable="false"}function c3(e,t,n){let a="".concat(t,"--editable");return{onBlur:c1,onClick:e=>{e.currentTarget.contentEditable="true",e.currentTarget.classList.add(a),e.currentTarget.focus()},onKeyDown:t=>{if("Enter"===t.key||"Tab"===t.key||"Escape"===t.key){if(t.currentTarget.contentEditable="false",t.currentTarget.classList.remove(a),e.value.value=t.currentTarget.innerText,e.label=t.currentTarget.innerText,e.value.value.replaceAll("\n",""))n.onChange(n.value,{action:"create-option",option:e});else if(Array.isArray(n.value)){let t=n.value.filter(t=>t.id!==e.id);n.onChange(t,{action:"pop-value",removedValue:e})}t.preventDefault()}t.stopPropagation()}}}var c2=aB(e=>{let{field:t,field:{admin:{autoComplete:n,className:a,description:o,placeholder:r,rtl:s}={},hasMany:c,label:d,localized:p,maxLength:f,maxRows:h,minLength:m,minRows:g,required:v},inputRef:b,path:y,readOnly:x,validate:w}=e,C=nI(),{config:{localization:j}}=(0,i.c)(),{customComponents:{AfterInput:S,BeforeInput:_,Description:k,Error:E,Label:N}={},disabled:D,path:P,setValue:O,showError:T,value:R}=aA({potentiallyStalePath:y,validate:(0,l.useCallback)((e,t)=>{if("function"==typeof w)return w(e,{...t,maxLength:f,minLength:m,required:v})},[w,m,f,v])}),I=aU({fieldLocalized:p,fieldRTL:s,locale:C,localizationConfig:j||void 0}),[F,A]=(0,l.useState)([]),M=(0,l.useCallback)(e=>{if(!(x||D)){var t;O(e?Array.isArray(e)?e.map(e=>{var t;return(null==(t=e.value)?void 0:t.value)||e.value}):[(null==(t=e.value)?void 0:t.value)||e.value]:[])}},[x,O,D]);(0,l.useEffect)(()=>{c&&Array.isArray(R)&&A(R.map((e,t)=>({id:"".concat(e).concat(t),label:"".concat(e),value:{toString:()=>"".concat(e).concat(t),value:(null==e?void 0:e.value)||e}})))},[R,c]);let L=(0,l.useMemo)(()=>aV(t),[t]);return(0,u.jsx)(c0,{AfterInput:S,BeforeInput:_,className:a,Description:k,description:o,Error:E,hasMany:c,htmlAttributes:{autoComplete:n||void 0},inputRef:b,Label:N,label:d,localized:p,maxRows:h,minRows:g,onChange:c?M:e=>{O(e.target.value)},path:P,placeholder:r,readOnly:x||D,required:v,rtl:I,showError:T,style:L,value:R||"",valueToRender:F})}),c6=e=>{let t=(0,h.c)(26),{AfterInput:n,BeforeInput:a,className:o,Description:l,description:r,Error:i,Label:c,label:p,localized:f,onChange:m,path:g,placeholder:v,readOnly:b,required:y,rows:x,rtl:w,showError:C,style:j,value:S}=e,{i18n:_}=(0,s.d)(),k=C&&"error",E=b&&"read-only",N;t[0]!==o||t[1]!==k||t[2]!==E?(N=[az,"textarea",o,k,E].filter(Boolean),t[0]=o,t[1]=k,t[2]=E,t[3]=N):N=t[3];let D=N.join(" "),P="field-".concat(g.replace(/\./g,"__")),O;return t[4]!==n||t[5]!==a||t[6]!==l||t[7]!==i||t[8]!==c||t[9]!==r||t[10]!==_||t[11]!==p||t[12]!==f||t[13]!==m||t[14]!==g||t[15]!==v||t[16]!==b||t[17]!==y||t[18]!==x||t[19]!==w||t[20]!==C||t[21]!==j||t[22]!==D||t[23]!==P||t[24]!==S?(O=(0,u.jsxs)("div",{className:D,style:j,children:[(0,u.jsx)(el,{CustomComponent:c,Fallback:(0,u.jsx)(nA,{htmlFor:P,label:p,localized:f,path:g,required:y})}),(0,u.jsxs)("div",{className:"".concat(az,"__wrap"),children:[(0,u.jsx)(el,{CustomComponent:i,Fallback:(0,u.jsx)(tU,{path:g,showError:C})}),a,(0,u.jsx)("div",{className:"textarea-outer",children:(0,u.jsx)("textarea",{"data-rtl":w,disabled:b,id:"field-".concat(g.replace(/\./g,"__")),name:g,onChange:m,placeholder:(0,d.s)(v,_),rows:x,style:{"--rows":x},value:S||""})}),n,(0,u.jsx)(el,{CustomComponent:l,Fallback:(0,u.jsx)(tz,{description:r,path:g})})]})]}),t[4]=n,t[5]=a,t[6]=l,t[7]=i,t[8]=c,t[9]=r,t[10]=_,t[11]=p,t[12]=f,t[13]=m,t[14]=g,t[15]=v,t[16]=b,t[17]=y,t[18]=x,t[19]=w,t[20]=C,t[21]=j,t[22]=D,t[23]=P,t[24]=S,t[25]=O):O=t[25],O},c5=aB(e=>{let{field:t,field:{admin:{className:n,description:a,placeholder:o,rows:r,rtl:c}={},label:p,localized:f,maxLength:h,minLength:m,required:g},path:v,readOnly:b,validate:y}=e,{i18n:x}=(0,s.d)(),{config:{localization:w}}=(0,i.c)(),C=aU({fieldLocalized:f,fieldRTL:c,locale:nI(),localizationConfig:w||void 0}),{customComponents:{AfterInput:j,BeforeInput:S,Description:_,Error:k,Label:E}={},disabled:N,path:D,setValue:P,showError:O,value:T}=aA({potentiallyStalePath:v,validate:(0,l.useCallback)((e,t)=>{if("function"==typeof y)return y(e,{...t,maxLength:h,minLength:m,required:g})},[y,g,h,m])}),R=(0,l.useMemo)(()=>aV(t),[t]);return(0,u.jsx)(c6,{AfterInput:j,BeforeInput:S,className:n,Description:_,description:a,Error:k,Label:E,label:p,localized:f,onChange:e=>{P(e.target.value)},path:D,placeholder:(0,d.s)(o,x),readOnly:b||N,required:g,rows:r,rtl:C,showError:O,style:R,value:T})}),c4=()=>null,c9=(0,l.createContext)(void 0),c8=e=>{let t=(0,h.c)(5),{children:n}=e,[a,o]=(0,l.useState)(null),[r,i]=(0,l.useState)(""),[s,c]=(0,l.useState)(null),d;return t[0]!==n||t[1]!==s||t[2]!==a||t[3]!==r?(d=(0,u.jsx)(c9,{value:{setUploadControlFile:c,setUploadControlFileName:o,setUploadControlFileUrl:i,uploadControlFile:s,uploadControlFileName:a,uploadControlFileUrl:r},children:n}),t[0]=n,t[1]=s,t[2]=a,t[3]=r,t[4]=d):d=t[4],d},c7=e=>{e.preventDefault(),e.stopPropagation()};function ue(e){let{children:t,className:n,disabled:a=!1,dropzoneStyle:o="default",multipleFiles:r,onChange:i}=e,s=l.useRef(null),[c,d]=l.useState(!1),p=l.useCallback(e=>{if(!r&&e.length>1){let t=new DataTransfer;t.items.add(e[0]),i(t.files)}else i(e)},[r,i]),f=l.useCallback(e=>{e.preventDefault(),e.stopPropagation(),e.clipboardData.files&&e.clipboardData.files.length>0&&p(e.clipboardData.files)},[p]),h=l.useCallback(e=>{e.preventDefault(),e.stopPropagation(),d(!0)},[]),m=l.useCallback(e=>{e.preventDefault(),e.stopPropagation(),d(!1)},[]),g=l.useCallback(e=>{e.preventDefault(),e.stopPropagation(),d(!1),e.dataTransfer.files&&e.dataTransfer.files.length>0&&(p(e.dataTransfer.files),d(!1),e.dataTransfer.clearData())},[p]);l.useEffect(()=>{let e=s.current;return e&&!a?(e.addEventListener("dragenter",h),e.addEventListener("dragleave",m),e.addEventListener("dragover",c7),e.addEventListener("drop",g),e.addEventListener("paste",f),()=>{e.removeEventListener("dragenter",h),e.removeEventListener("dragleave",m),e.removeEventListener("dragover",c7),e.removeEventListener("drop",g),e.removeEventListener("paste",f)}):()=>null},[a,h,m,g,f]);let v=["dropzone",n,c?"dragging":"","dropzoneStyle--".concat(o)].filter(Boolean).join(" ");return(0,u.jsx)("div",{className:v,ref:s,children:t})}function ut(e){let t=(0,h.c)(3),{onClick:n}=e,{t:a}=(0,s.d)(),o;return t[0]!==n||t[1]!==a?(o=(0,u.jsx)("button",{"aria-label":a("general:close"),className:"drawer-close-button",onClick:n,type:"button",children:(0,u.jsx)(s.a,{})}),t[0]=n,t[1]=a,t[2]=o):o=t[2],o}function un(e){let{onClose:t,title:n}=e;return(0,u.jsxs)("div",{className:"bulk-upload--drawer-header",children:[(0,u.jsx)("h2",{title:n,children:n}),(0,u.jsx)(ut,{onClick:t})]})}var ua="bulk-upload--add-files";function uo(e){let{acceptMimeTypes:t,onCancel:n,onDrop:a}=e,{t:o}=(0,s.d)(),r=l.useRef(null);return(0,u.jsxs)("div",{className:ua,children:[(0,u.jsx)(un,{onClose:n,title:o("upload:addFiles")}),(0,u.jsx)("div",{className:"".concat(ua,"__dropArea"),children:(0,u.jsxs)(ue,{multipleFiles:!0,onChange:a,children:[(0,u.jsx)(to,{buttonStyle:"subtle",iconPosition:"left",onClick:()=>{r.current&&r.current.click()},size:"small",children:o("upload:selectFile")}),(0,u.jsx)("input",{accept:t,"aria-hidden":"true",className:"".concat(ua,"__hidden-input"),hidden:!0,multiple:!0,onChange:e=>{e.target.files&&e.target.files.length>0&&a(e.target.files)},ref:r,type:"file"}),(0,u.jsxs)("p",{className:"".concat(ua,"__dragAndDropText"),children:[o("general:or")," ",o("upload:dragAndDrop")]})]})})]})}var ul=(0,c.e)(ee(),1);async function ur(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=(0,F.r)(e,!0),l=null==o?void 0:o.file;if(l&&delete o.file,l&&"function"==typeof a){let e=l.name;l=JSON.stringify({clientUploadContext:await a({file:l,updateFilename:t=>{e=t}}),collectionSlug:n,filename:e,mimeType:l.type,size:l.size})}let r={_payload:JSON.stringify({...o,...t}),file:l};return(0,ul.serialize)(r,{indices:!0,nullsAsUndefineds:!1})}function ui(e,t){switch(t.type){case"ADD_FORMS":{var n;let a=[];for(let e=0;e=t.index,l=Math.min(n.length-1,e.activeIndex===t.index?t.index:o?e.activeIndex-1:e.activeIndex);return{...e,activeIndex:o?l:e.activeIndex,forms:n,totalErrorCount:e.totalErrorCount-a.errorCount}}case"REPLACE":return{...e,...t.state};case"SET_ACTIVE_INDEX":return{...e,activeIndex:t.index};case"UPDATE_ERROR_COUNT":{let n=[...e.forms];return n[t.index].errorCount=t.count,{...e,forms:n,totalErrorCount:e.forms.reduce((e,t)=>e+t.errorCount,0)}}case"UPDATE_FORM":{let n=[...e.forms];return n[t.index].errorCount=t.errorCount,n[t.index]={...n[t.index],formState:{...n[t.index].formState,...t.formState},uploadEdits:{...n[t.index].uploadEdits,...t.uploadEdits}},{...e,forms:n,totalErrorCount:e.forms.reduce((e,t)=>e+t.errorCount,0)}}default:return e}}var us=l.createContext({activeIndex:0,addFiles:()=>Promise.resolve(),bulkUpdateForm:()=>null,collectionSlug:"",docPermissions:void 0,documentSlots:{},forms:[],getFormDataRef:{current:()=>({})},hasPublishPermission:!1,hasSavePermission:!1,hasSubmitted:!1,isInitializing:!1,removeFile:()=>{},saveAllDocs:()=>Promise.resolve(),setActiveIndex:()=>0,setFormTotalErrorCount:()=>{},totalErrorCount:0,updateUploadEdits:()=>{}}),uc={activeIndex:0,forms:[],totalErrorCount:0};function uu(e){let{children:t}=e,{config:n}=(0,i.c)(),{routes:{api:a},serverURL:o}=n,{code:r}=nI(),{i18n:c,t:d}=(0,s.d)(),{getDocumentSlots:p,getFormState:f}=sn(),{getUploadHandler:h}=cA(),[m,g]=l.useState({}),[b,y]=l.useState(!1),[x,w]=l.useState(),[C,j]=l.useState(!1),[S,_]=l.useState(!1),[k,E]=l.useState(!1),[N,D]=l.useState(!1),[P,O]=l.useState(!1),[T,R]=l.useReducer(ui,uc),{activeIndex:I,forms:F,totalErrorCount:A}=T;l.useRef(F).current=F;let{toggleLoadingOverlay:M}=(()=>{let e=l.use(sc);if(void 0===e)throw Error("useLoadingOverlay must be used within a LoadingOverlayProvider");return e})(),{closeModal:L}=ne(),{collectionSlug:B,drawerSlug:V,initialFiles:z,initialForms:U,onSuccess:H,setInitialFiles:q,setInitialForms:W,setSuccessfullyUploaded:K}=dJ(),[Y,G]=l.useState(!1),[$,X]=l.useState(""),Z=l.useRef(!1),Q=l.useRef(null),J=l.useRef(()=>({})),ee="".concat(o).concat(a,"/").concat(B),et=l.useCallback(async()=>{let e={locale:r||void 0},t="/".concat(B,"/access"),n=await (await fetch("".concat(o).concat(a).concat(t,"?").concat(v.A(e)),{credentials:"include",headers:{"Accept-Language":c.language,"Content-Type":"application/json"},method:"post"})).json(),l=await fetch("".concat(o).concat(a).concat(t,"?").concat(v.A(e)),{body:JSON.stringify({_status:"published"}),credentials:"include",headers:{"Accept-Language":c.language,"Content-Type":"application/json"},method:"POST"}).then(e=>e.json());w(n),j(a_({collectionSlug:B,docPermissions:n,isEditing:!1})),_(null==l?void 0:l.update),D(!0)},[a,r,B,c.language,o]),en=l.useCallback(async e=>{(null==e?void 0:e.signal)&&e.abort("aborting previous fetch for initial form state without files"),g(await p({collectionSlug:B}));try{let{state:e}=await f({collectionSlug:B,docPermissions:x,docPreferences:{fields:{}},locale:r,operation:"create",renderAllFields:!0,schemaPath:B,skipValidation:!0});Q.current=e,E(!0)}catch(e){}},[p,B,f,x,r]),ea=l.useCallback(e=>{let t=J.current();R({type:"REPLACE",state:{activeIndex:e,forms:F.map((e,n)=>n===I?{errorCount:e.errorCount,formID:e.formID,formState:t,uploadEdits:e.uploadEdits}:e)}})},[F,I]),eo=l.useCallback(async e=>{F.length&&R({type:"UPDATE_FORM",errorCount:F[I].errorCount,formState:J.current(),index:I}),M({isLoading:!0,key:"addingDocs"}),k||await en(),R({type:"ADD_FORMS",forms:Array.from(e).map(e=>({file:e,initialState:Q.current}))}),M({isLoading:!1,key:"addingDocs"})},[en,k,M,I,F]),el=nN(eo),er=nN(async e=>{M({isLoading:!0,key:"addingDocs"}),k||await en(),R({type:"ADD_FORMS",forms:e.map(e=>({...e,initialState:(null==e?void 0:e.initialState)||Q.current}))}),M({isLoading:!1,key:"addingDocs"})}),ei=l.useCallback(e=>{R({type:"REMOVE_FORM",index:e})},[]),es=l.useCallback(e=>{let{errorCount:t,index:n}=e;R({type:"UPDATE_ERROR_COUNT",count:t,index:n})},[]),ec=l.useCallback(async function(){let{overrides:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=J.current(),n=[...F];n[I]={errorCount:n[I].errorCount,formID:n[I].formID,formState:t,uploadEdits:n[I].uploadEdits};let a=[];G(!0);for(let t=0;t{var n,a;let[o,l]=e,r=[],i=[];return(null==t?void 0:t.message)&&i.push(t),Array.isArray(null==t||null==(n=t.data)?void 0:n.errors)&&(null==(a=t.data)||a.errors.forEach(e=>{(null==e?void 0:e.path)?r.push(e):i.push(e)})),[[...o,...r],[...l,...i]]},[[],[]]);n[t]={errorCount:m.length,formID:n[t].formID,formState:cU(n[t].formState,{type:"ADD_SERVER_ERRORS",errors:m})},(413===p.status||400===p.status)&&(n[t]={...n[t],errorCount:n[t].errorCount+1},eF.error(null==(i=g[0])?void 0:i.message))}catch(e){}y(!0),X(""),G(!1);let s=[];n.forEach((e,t)=>{let{errorCount:a}=e;a&&s.push(n[t])});let c=Math.max(0,n.length-s.length),u=n.length-c;c&&(eF.success("Successfully saved ".concat(c," files")),K(!0),"function"==typeof H&&H(a,u)),u?eF.error("Failed to save ".concat(u," files")):L(V),R({type:"REPLACE",state:{activeIndex:0,forms:s,totalErrorCount:s.reduce((e,t)=>{let{errorCount:n}=t;return e+n},0)}}),0===s.length&&(q(void 0),W(void 0))},[F,I,d,ee,r,B,h,H,L,K,V,q,W]),eu=l.useCallback(async(e,t)=>{for(let n=0;n{let[t,a]=e;F[n].formState[t]&&(F[n].formState[t].value=a,R({type:"UPDATE_FORM",errorCount:F[n].errorCount,formState:F[n].formState,index:n}))}),"function"==typeof t&&t(),b){let{state:e}=await f({collectionSlug:B,docPermissions:x,docPreferences:null,formState:F[n].formState,operation:"create",schemaPath:B});R({type:"UPDATE_FORM",errorCount:Object.values(e).reduce((e,t)=>(null==t?void 0:t.valid)===!1?e+1:e,0),formState:e,index:n})}},[B,x,F,f,b]),ed=l.useCallback(e=>{R({type:"UPDATE_FORM",errorCount:F[I].errorCount,formState:F[I].formState,index:I,uploadEdits:e})},[I,F]),ep=l.useCallback(()=>{R({type:"REPLACE",state:{forms:F.map(e=>({...e,uploadEdits:{}}))}})},[F]);return l.useEffect(()=>{B&&(k||en(),N||et(),(z||U)&&O(!k||!N),k&&((null==U?void 0:U.length)||(null==z?void 0:z.length))&&!Z.current&&((null==U?void 0:U.length)&&er(U),(null==z?void 0:z.length)&&el(z),Z.current=!0))},[z,en,et,B,k,N,U]),(0,u.jsxs)(us,{value:{activeIndex:T.activeIndex,addFiles:eo,bulkUpdateForm:eu,collectionSlug:B,docPermissions:x,documentSlots:m,forms:F,getFormDataRef:J,hasPublishPermission:S,hasSavePermission:C,hasSubmitted:b,isInitializing:P,removeFile:ei,resetUploadEdits:ep,saveAllDocs:ec,setActiveIndex:ea,setFormTotalErrorCount:es,totalErrorCount:A,updateUploadEdits:ed},children:[Y&&(0,u.jsx)(sd,{animationDuration:"250ms",loadingText:$,overlayType:"fullscreen",show:!0}),t]})}function ud(){return l.use(us)}var up=(e,t)=>e?(0,m.Z7)(t)&&t.name?"".concat(e,".").concat(t.name):e:(0,m.Z7)(t)?t.name:"",uf=e=>{let{CustomLabel:t,field:n,prefix:a}=e;return(0,u.jsxs)(l.Fragment,{children:[a?(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)("span",{style:{display:"inline-block"},children:a})," > "]}):null,(0,u.jsx)("span",{style:{display:"inline-block"},children:(0,u.jsx)(el,{CustomComponent:t,Fallback:(0,u.jsx)(nA,{label:"label"in n&&n.label})})})]})},uh=e=>{var t,n;let{fields:a,formState:o,labelPrefix:l=null,parentPath:r="",path:i="",permissions:s}=e;if(!a)return[];let c=null==o||null==(n=o[i])||null==(t=n.customComponents)?void 0:t.Label;return null==a?void 0:a.reduce((e,t)=>{var n;let{operation:a,permissions:o,read:u}=(0,x.P)({field:t,operation:"update",parentName:(null==r?void 0:r.includes("."))?r.split(".")[r.split(".").length-1]:r,permissions:s});return((0,m.Z7)(t)||"ui"===t.type)&&((null==(n=t.admin)?void 0:n.disableBulkEdit)||t.unique||(0,m.I2)(t)||"readOnly"in t&&t.readOnly||!a||!u)?e:"array"!==t.type&&"blocks"!==t.type&&(0,m.sd)(t)?[...e,...uh({fields:t.fields,labelPrefix:uf({CustomLabel:c,field:t,prefix:l}),parentPath:i,path:up(i,t),permissions:o})]:"tabs"===t.type&&"tabs"in t?[...e,...t.tabs.reduce((e,n)=>{if("fields"in n){let a="name"in n&&n.name;return[...e,...uh({fields:n.fields,labelPrefix:l,parentPath:i,path:a?up(i,t):i,permissions:o})]}},[])]:[...e,{label:uf({CustomLabel:c,field:t,prefix:l}),value:{field:t,fieldPermissions:o,path:up(i,t)}}]},[])},um=e=>{let t=(0,h.c)(14),{fields:n,onChange:a,permissions:o}=e,{t:r}=(0,s.d)(),{dispatchFields:i,getFields:c}=eC(),d;t[0]!==n||t[1]!==c||t[2]!==o?(d=()=>uh({fields:(e=>{let t=["file","mimeType","thumbnailURL","width","height","filesize","filename","url","focalX","focalY","sizes"];return e.filter(e=>!t.includes("name"in e&&e.name))})(n),formState:c(),permissions:o}),t[0]=n,t[1]=c,t[2]=o,t[3]=d):d=t[3];let[p]=(0,l.useState)(d),f;if(t[4]!==i||t[5]!==c||t[6]!==a||t[7]!==p||t[8]!==r){let e;t[10]!==i||t[11]!==c||t[12]!==a?(e=e=>a({dispatchFields:i,formState:c(),selected:e}),t[10]=i,t[11]=c,t[12]=a,t[13]=e):e=t[13],f=(0,u.jsxs)("div",{className:"field-select",children:[(0,u.jsx)(nA,{label:r("fields:selectFieldsToEdit")}),(0,u.jsx)(iU,{getOptionValue:ug,isMulti:!0,onChange:e,options:p})]}),t[4]=i,t[5]=c,t[6]=a,t[7]=p,t[8]=r,t[9]=f}else f=t[9];return f};function ug(e){return"object"==typeof e.value&&"path"in e.value?String(e.value.path):String(e.value)}var uv=e=>{var t;let{collection:{fields:n,labels:{plural:a,singular:o}}={},collection:r,drawerSlug:i,forms:c}=e,[p,f]=(0,l.useState)(!1),{permissions:h}=nO(),{i18n:m,t:g}=(0,s.d)(),{closeModal:v}=ne(),{bulkUpdateForm:b}=ud(),{getFormState:y}=sn(),x=l.useRef(null),[w,C]=(0,l.useState)([]),j=null==h||null==(t=h.collections)?void 0:t[r.slug],S=(0,l.useMemo)(()=>(0,V.s)(w.reduce((e,t)=>(e[t.value.path]=!0,e),{})),[w]),_=(0,l.useCallback)(async e=>{let{formState:t,submitted:n}=e,a=sf(x),{state:o}=await y({collectionSlug:r.slug,docPermissions:j,docPreferences:null,formState:t,operation:"update",schemaPath:r.slug,select:S,signal:a.signal,skipValidation:!n});return x.current=null,o},[y,r,j,S]);(0,l.useEffect)(()=>{let e=x.current;return()=>{sp(e)}},[]);let k=(0,l.useCallback)(e=>{b(w.reduce((t,n)=>(e[n.value.path]&&(t[n.value.path]=e[n.value.path].value),t),{}),()=>v(i))},[v,i,b,w]),E=(0,l.useCallback)(async e=>{let{dispatchFields:t,formState:n,selected:a}=e;f(!0),C(a||[]);let{state:o}=await y({collectionSlug:r.slug,docPermissions:j,docPreferences:null,formState:n,operation:"update",schemaPath:r.slug,select:(0,V.s)(a.reduce((e,t)=>(e[t.value.path]=!0,e),{})),skipValidation:!0});t({type:"UPDATE_MANY",formState:o}),f(!1)},[y,r,j]);return(0,u.jsxs)("div",{className:"".concat(ub,"__main"),children:[(0,u.jsxs)("div",{className:"".concat(ub,"__header"),children:[(0,u.jsx)("h2",{className:"".concat(ub,"__header__title"),children:g("general:editingLabel",{count:c.length,label:(0,d.s)(c.length>1?a:o,m)})}),(0,u.jsx)("button",{"aria-label":g("general:close"),className:"".concat(ub,"__header__close"),id:"close-drawer__".concat(i),onClick:()=>v(i),type:"button",children:(0,u.jsx)(s.a,{})})]}),(0,u.jsxs)(cq,{className:"".concat(ub,"__form"),isInitializing:p,onChange:[_],onSubmit:k,children:[(0,u.jsx)(um,{fields:n,onChange:E,permissions:j.fields}),0===w.length?null:(0,u.jsx)("div",{className:"render-fields",children:(0,u.jsx)(aR,{value:void 0,children:w.map((e,t)=>{let{value:{field:n,fieldPermissions:a,path:o}}=e;return(0,u.jsx)(pt,{clientFieldConfig:n,indexPath:"",parentPath:"",parentSchemaPath:"",path:o,permissions:a},"".concat(o,"-").concat(t))})})}),(0,u.jsx)("div",{className:"".concat(ub,"__sidebar-wrap"),children:(0,u.jsx)("div",{className:"".concat(ub,"__sidebar"),children:(0,u.jsx)("div",{className:"".concat(ub,"__sidebar-sticky-wrap"),children:(0,u.jsx)("div",{className:"".concat(ub,"__document-actions"),children:(0,u.jsx)(to,{type:"submit",children:g("general:applyChanges")})})})})})]})]})},ub="edit-many-bulk-uploads",uy=e=>{var t,n;let a,o=(0,h.c)(5),{collection:l,collection:r}=e,{slug:i}=void 0===l?{}:l,{permissions:c}=nO(),{t:d}=(0,s.d)(),{forms:p}=ud(),f=null==c||null==(n=c.collections)||null==(t=n[i])?void 0:t.update,m="edit-".concat(i,"-bulk-uploads");return f?(o[0]!==r||o[1]!==m||o[2]!==p||o[3]!==d?(a=(0,u.jsxs)("div",{className:ub,children:[(0,u.jsx)(nw,{"aria-label":d("general:editAll"),className:"".concat(ub,"__toggle"),slug:m,children:d("general:editAll")}),(0,u.jsx)(tq,{children:(0,u.jsx)(nC,{Header:null,slug:m,children:(0,u.jsx)(uv,{collection:r,drawerSlug:m,forms:p})})})]}),o[0]=r,o[1]=m,o[2]=p,o[3]=d,o[4]=a):a=o[4],a):null},ux="bulk-upload--actions-bar";function uw(e){let t=(0,h.c)(15),{collectionConfig:n}=e,{activeIndex:a,forms:o,setActiveIndex:l}=ud(),{t:r}=(0,s.d)(),i=a+1,c;if(t[0]!==a||t[1]!==n||t[2]!==o.length||t[3]!==l||t[4]!==r||t[5]!==i){let e,s;t[7]!==a||t[8]!==o.length||t[9]!==l?(e=()=>{let e=a-1;e{let e=a+1;e===o.length?l(0):l(e)},t[11]=a,t[12]=o.length,t[13]=l,t[14]=s):s=t[14],c=(0,u.jsxs)("div",{className:ux,children:[(0,u.jsxs)("div",{className:"".concat(ux,"__navigation"),children:[(0,u.jsxs)("p",{className:"".concat(ux,"__locationText"),children:[(0,u.jsx)("strong",{children:i})," ".concat(r("general:of")," "),(0,u.jsx)("strong",{children:o.length})]}),(0,u.jsxs)("div",{className:"".concat(ux,"__controls"),children:[(0,u.jsx)(to,{"aria-label":r("general:previous"),buttonStyle:"none",onClick:e,type:"button",children:(0,u.jsx)(eq,{direction:"left"})}),(0,u.jsx)(to,{"aria-label":r("general:next"),buttonStyle:"none",onClick:s,type:"button",children:(0,u.jsx)(eq,{direction:"right"})})]}),(0,u.jsx)(uy,{collection:n})]}),(0,u.jsx)(uC,{className:"".concat(ux,"__saveButtons")})]}),t[0]=a,t[1]=n,t[2]=o.length,t[3]=l,t[4]=r,t[5]=i,t[6]=c}else c=t[6];return c}function uC(e){var t,n,a,o,l;let r=(0,h.c)(12),{className:c}=e,{getEntityConfig:d}=(0,i.c)(),{t:p}=(0,s.d)(),{collectionSlug:f,hasPublishPermission:m,hasSavePermission:g,saveAllDocs:v}=ud(),b;r[0]!==f||r[1]!==d?(b=d({collectionSlug:f}),r[0]=f,r[1]=d,r[2]=b):b=r[2];let y=b,x;r[3]!==c?(x=["".concat(ux,"__buttons"),c].filter(Boolean),r[3]=c,r[4]=x):x=r[4];let w=x.join(" "),C;return r[5]!==(null==y||null==(t=y.versions)?void 0:t.drafts)||r[6]!==m||r[7]!==g||r[8]!==v||r[9]!==p||r[10]!==w?(C=(0,u.jsxs)("div",{className:w,children:[(null==y||null==(n=y.versions)?void 0:n.drafts)&&g?(0,u.jsx)(to,{buttonStyle:"secondary",onClick:()=>void v({overrides:{_status:"draft"}}),children:p("version:saveDraft")}):null,(null==y||null==(a=y.versions)?void 0:a.drafts)&&m?(0,u.jsx)(to,{onClick:()=>void v({overrides:{_status:"published"}}),children:p("version:publish")}):null,(null==y||null==(o=y.versions)?void 0:o.drafts)||!g?null:(0,u.jsx)(to,{onClick:()=>void v(),children:p("general:save")})]}),r[5]=null==y||null==(l=y.versions)?void 0:l.drafts,r[6]=m,r[7]=g,r[8]=v,r[9]=p,r[10]=w,r[11]=C):C=r[11],C}var uj="bulk-upload--discard-without-saving";function uS(){let e=(0,h.c)(9),{t:t}=(0,s.d)(),{closeModal:n}=ne(),{drawerSlug:a}=dJ(),o;e[0]!==n?(o=()=>{n(uj)},e[0]=n,e[1]=o):o=e[1];let l=o,r;e[2]!==n||e[3]!==a?(r=()=>{n(a),n(uj)},e[2]=n,e[3]=a,e[4]=r):r=e[4];let i=r,c;return e[5]!==l||e[6]!==i||e[7]!==t?(c=(0,u.jsx)(nE,{body:t("general:changesNotSaved"),cancelLabel:t("general:stayOnThisPage"),confirmLabel:t("general:leaveAnyway"),heading:t("general:leaveWithoutSaving"),modalSlug:uj,onCancel:l,onConfirm:i}),e[5]=l,e[6]=i,e[7]=t,e[8]=c):c=e[8],c}function u_(e){let{className:t}=e;return(0,u.jsx)("svg",{className:[t,"icon icon--trash"].filter(Boolean).join(" "),fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{d:"M4.1499 6.1H15.8499M14.5499 6.1V15.2C14.5499 15.85 13.8999 16.5 13.2499 16.5H6.7499C6.0999 16.5 5.4499 15.85 5.4499 15.2V6.1M7.3999 6.1V4.8C7.3999 4.15 8.0499 3.5 8.6999 3.5H11.2999C11.9499 3.5 12.5999 4.15 12.5999 4.8V6.1M8.6999 9.35V13.25M11.2999 9.35V13.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})})}var uk=()=>{let{getEntityConfig:e}=(0,i.c)(),{collectionSlug:t}=aE(),{labels:n}=e({collectionSlug:t}),{i18n:a}=(0,s.d)();return(0,u.jsxs)("div",{className:"trash-banner",children:[(0,u.jsx)(u_,{}),(0,u.jsx)("p",{children:a.t("general:documentIsTrashed",{label:"".concat((0,d.s)(null==n?void 0:n.singular,a))})})]})},uE="document-fields",uN=e=>{let{AfterFields:t,BeforeFields:n,docPermissions:a,fields:o,forceSidebarWrap:r,isTrashed:i=!1,readOnly:s,schemaPathSegments:c}=e,{hasSidebarFields:d,mainFields:p,sidebarFields:f}=(0,l.useMemo)(()=>o.reduce((e,t)=>((0,m.zj)(t)?(e.sidebarFields.push(t),e.mainFields.push(null),e.hasSidebarFields=!0):(e.mainFields.push(t),e.sidebarFields.push(null)),e),{hasSidebarFields:!1,mainFields:[],sidebarFields:[]}),[o]);return(0,u.jsxs)("div",{className:[uE,d?"".concat(uE,"--has-sidebar"):"".concat(uE,"--no-sidebar"),r&&"".concat(uE,"--force-sidebar-wrap")].filter(Boolean).join(" "),children:[(0,u.jsx)("div",{className:"".concat(uE,"__main"),children:(0,u.jsxs)(nv,{className:"".concat(uE,"__edit"),children:[i&&(0,u.jsx)(uk,{}),n,(0,u.jsx)(pa,{className:"".concat(uE,"__fields"),fields:p,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:c.join("."),permissions:null==a?void 0:a.fields,readOnly:s}),t]})}),d?(0,u.jsx)("div",{className:"".concat(uE,"__sidebar-wrap"),children:(0,u.jsx)("div",{className:"".concat(uE,"__sidebar"),children:(0,u.jsx)("div",{className:"".concat(uE,"__sidebar-fields"),children:(0,u.jsx)(pa,{fields:f,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:c.join("."),permissions:null==a?void 0:a.fields,readOnly:s})})})}):null]})};function uD(e){let{className:t}=e;return(0,u.jsx)("svg",{className:[t,"icon icon--folder"].filter(Boolean).join(" "),fill:"none",height:"16",viewBox:"0 0 16 16",width:"16",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{d:"M13.3333 13.3333C13.6869 13.3333 14.026 13.1929 14.2761 12.9428C14.5261 12.6928 14.6666 12.3536 14.6666 12V5.33333C14.6666 4.97971 14.5261 4.64057 14.2761 4.39052C14.026 4.14048 13.6869 4 13.3333 4H8.06659C7.84359 4.00219 7.62362 3.94841 7.42679 3.84359C7.22996 3.73877 7.06256 3.58625 6.93992 3.4L6.39992 2.6C6.27851 2.41565 6.11323 2.26432 5.91892 2.1596C5.7246 2.05488 5.50732 2.00004 5.28659 2H2.66659C2.31296 2 1.97382 2.14048 1.72378 2.39052C1.47373 2.64057 1.33325 2.97971 1.33325 3.33333V12C1.33325 12.3536 1.47373 12.6928 1.72378 12.9428C1.97382 13.1929 2.31296 13.3333 2.66659 13.3333H13.3333Z",fill:"currentColor"})})}var uP=l.createContext({activeCollectionFolderSlugs:[],allCollectionFolderSlugs:[],allowCreateCollectionSlugs:[],breadcrumbs:[],checkIfItemIsDisabled:()=>!1,clearSelections:()=>{},currentFolder:null,documents:[],dragOverlayItem:void 0,focusedRowIndex:-1,folderCollectionConfig:null,folderCollectionSlug:"",folderFieldName:"folder",folderID:void 0,FolderResultsComponent:null,folderType:void 0,getFolderRoute:()=>"",getSelectedItems:()=>[],isDragging:!1,itemKeysToMove:void 0,moveToFolder:()=>Promise.resolve(void 0),onItemClick:()=>{},onItemKeyPress:()=>{},refineFolderData:()=>{},search:"",selectedFolderCollections:void 0,selectedItemKeys:new Set,setBreadcrumbs:()=>{},setFocusedRowIndex:()=>-1,setIsDragging:()=>!1,sort:"name",subfolders:[]});function uO(e){var t,n;let{activeCollectionFolderSlugs:a,allCollectionFolderSlugs:o=[],allowCreateCollectionSlugs:r,allowMultiSelection:c=!0,baseFolderPath:d,breadcrumbs:p=[],children:h,documents:m,folderFieldName:g,folderID:b,FolderResultsComponent:y,onItemClick:x,search:w,sort:C="name",subfolders:j}=e,S=uT(),{config:_}=(0,i.c)(),{routes:k,serverURL:N}=_,D=n_(),{t:P}=(0,s.d)(),O=(0,f.useRouter)(),{startRouteTransition:T}=eM(),R=nI(),I=R?R.code:void 0,F=l.useRef(new Set),[A,M]=l.useState([]),[L,B]=l.useState(y||(()=>null)),[V]=l.useState(()=>_.collections.find(e=>_.folders&&e.slug===_.folders.slug)),H=V.slug,q=(0,f.useSearchParams)(),W=l.useMemo(()=>i5(q),[q]),[K,Y]=l.useState(W),[G,$]=l.useState(!1),[X,Z]=l.useState(()=>new Set),[Q,J]=l.useState(-1),[ee,et]=l.useState(),[en,ea]=l.useState(p),eo=l.useRef(null),el=j.length+m.length,er=l.useCallback(()=>{J(-1),Z(new Set),et(void 0),F.current=new Set},[]),ei=l.useCallback(function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="page"in t?t.page:null==K?void 0:K.page;return"search"in t&&(n="1"),{...K,...t,locale:I,page:n,relationTo:"relationTo"in t?t.relationTo:null==K?void 0:K.relationTo,search:"search"in t?t.search:null==K?void 0:K.search,sort:"sort"in t?t.sort:null!=(e=null==K?void 0:K.sort)?e:void 0}},[K,I]),es=l.useCallback(e=>{let{query:t,updateURL:n}=e;if(n){let e=ei(t);T(()=>O.replace("".concat(v.A({...e,relationTo:JSON.stringify(e.relationTo)},{addQueryPrefix:!0})))),Y(e)}},[ei,O,T]),ec=l.useCallback(e=>{let t=v.A(ei({page:"1",search:""}),{addQueryPrefix:!0});return(0,E.Q)({adminRoute:_.routes.admin,path:"".concat(d).concat(e?"/".concat(e):"").concat(t),serverURL:_.serverURL})},[d,_.routes.admin,_.serverURL,ei]),eu=l.useCallback(e=>[...j,...m].find(t=>t.itemKey===e),[m,j]),ed=l.useCallback(()=>Array.from(X).reduce((e,t)=>{let n=eu(t);return n&&e.push(n),e},[]),[X,eu]),ep=l.useCallback(e=>{let{collectionSlug:t,docID:n}=e;1===D?t===H?T(()=>{O.push(ec(n)),er()}):t&&T(()=>{O.push((0,E.Q)({adminRoute:_.routes.admin,path:"/collections/".concat(t,"/").concat(n)})),er()}):er(),"function"==typeof x&&x(eu("".concat(t,"-").concat(n)))},[er,_.routes.admin,D,H,ec,eu,x,O,T]),ef=l.useCallback(e=>{let t=[...j,...m].reduce((e,t,n)=>(X.has(t.itemKey)&&e.push(n),e),[]);if(0===t.length)return[e];let n=Math.min(...t),a=Math.max(...t),o=e>=n&&e=Math.abs(e-a)?n:a:Math.abs(e-n)r+t);return o?i:[...new Set([...t,...i])]},[j,m,X]),eh=l.useCallback(e=>{let{indexes:t}=e,{newSelectedFolderCollections:n,newSelectedItemKeys:a}=[...j,...m].reduce((e,n,a)=>{var o;return t.includes(a)&&(e.newSelectedItemKeys.add(n.itemKey),n.relationTo===H?null==(o=n.value.folderType)||o.forEach(t=>{e.newSelectedFolderCollections.includes(t)||e.newSelectedFolderCollections.push(t)}):e.newSelectedFolderCollections.includes(n.relationTo)||e.newSelectedFolderCollections.push(n.relationTo)),e},{newSelectedFolderCollections:[],newSelectedItemKeys:new Set});M(n),Z(a)},[m,H,j]),em=l.useCallback(e=>{let{event:t,item:n}=e,{code:a,ctrlKey:o,metaKey:l,shiftKey:r}=t,i=o||l,s=X.has(n.itemKey),u=[...j,...m],d=u.findIndex(e=>e.itemKey===n.itemKey);switch(a){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":{if(t.preventDefault(),-1===d)break;let e="ArrowLeft"===a||"ArrowUp"===a?d-1:d+1;if(eel-1)return;if(J(e),i)break;if(r&&c)return void eh({indexes:ef(e)});r||Z(new Set([u[e].itemKey]));break}case"Enter":if(1===X.size){J(void 0),ep({collectionSlug:n.relationTo,docID:(0,z.r)(n.value)});return}break;case"Escape":er();break;case"KeyA":c&&i&&(t.preventDefault(),J(el-1),eh({indexes:Array.from({length:el},(e,t)=>t)}));break;case"Space":c&&r?(t.preventDefault(),eh({indexes:[...j,...m].reduce((e,t,a)=>{if(t.itemKey===n.itemKey){if(s)return e;e.push(a)}else X.has(t.itemKey)&&e.push(a);return e},[])})):(t.preventDefault(),eh({indexes:s?[]:[d]}));break;case"Tab":if(c&&r){let e=d-1;e0&&J(e)}else d+1===el&&X.size>0&&J(el-1)}},[X,j,m,c,ef,eh,ep,er,el]),eg=l.useCallback(e=>{let{event:t,item:n}=e,a=!1,o=t.ctrlKey||t.metaKey,l=t.shiftKey,r=X.has(n.itemKey),i=[...j,...m],s=i.findIndex(e=>e.itemKey===n.itemKey);if(c&&o){let e;t.preventDefault(),eh({indexes:i.reduce((a,o,l)=>{if(o.itemKey===n.itemKey){if(r&&"pointermove"!==t.type)return a;a.push(l),e=o.itemKey}else X.has(o.itemKey)&&a.push(l);return a},[])}),e&&et(eu(e))}else if(c&&l)-1!==s&&eh({indexes:ef(s)});else if(c&&"pointermove"===t.type)r||eh({indexes:i.reduce((e,t,a)=>(t.itemKey===n.itemKey&&e.push(a),e),[])}),et(eu(n.itemKey));else{let e=Date.now();a=e-eo.current{let{itemsToMove:t,toFolderID:n}=e;if(t.length){if(1===t.length&&t[0].relationTo===H&&t[0].value.id===b){let e=v.A({depth:0,locale:I},{addQueryPrefix:!0});200!==(await fetch("".concat(N).concat(k.api,"/").concat(H,"/").concat(b).concat(e),{body:JSON.stringify({[g]:n||null}),credentials:"include",headers:{"content-type":"application/json"},method:"PATCH"})).status&&eF.error(P("general:error"))}else for(let[e,a]of Object.entries(t.reduce((e,t)=>(e[t.relationTo]||(e[t.relationTo]=[]),e[t.relationTo].push(t.value.id),e),{}))){let t=v.A({depth:0,limit:0,locale:I,where:{id:{in:a}}},{addQueryPrefix:!0});try{await fetch("".concat(N).concat(k.api,"/").concat(e).concat(t),{body:JSON.stringify({[g]:n||null}),credentials:"include",headers:{"content-type":"application/json"},method:"PATCH"})}catch(e){eF.error(P("general:error")),console.error(e);continue}}er()}},[b,er,H,g,k.api,N,P,I]),eb=l.useCallback(e=>{var t;function n(e){let{item:t,selectedFolderCollections:n}=e;return!(!t.value.folderType||Array.isArray(t.value.folderType)&&0===t.value.folderType.length)&&(0===n.length?!!(t.value.folderType||t.value.folderType.length>0):n.some(e=>!t.value.folderType.includes(e)))}return G?!!X.has(e.itemKey)||e.relationTo!==H||n({item:e,selectedFolderCollections:A}):(null==S||null==(t=S.selectedItemKeys)?void 0:t.size)?!!S.selectedItemKeys.has(e.itemKey)||e.relationTo!==H||n({item:e,selectedFolderCollections:S.selectedFolderCollections}):void 0},[A,G,X,H,null==S?void 0:S.selectedFolderCollections,null==S?void 0:S.selectedItemKeys]);return l.useEffect(()=>{y&&B(y)},[y]),(0,u.jsx)(uP,{value:{activeCollectionFolderSlugs:a||o,allCollectionFolderSlugs:o,allowCreateCollectionSlugs:r,breadcrumbs:en,checkIfItemIsDisabled:eb,clearSelections:er,currentFolder:(null==en||null==(t=en[en.length-1])?void 0:t.id)!==void 0?(0,U.p)({folderFieldName:g,isUpload:!1,relationTo:H,useAsTitle:V.admin.useAsTitle,value:en[en.length-1]}):null,documents:m,dragOverlayItem:ee,focusedRowIndex:Q,folderCollectionConfig:V,folderCollectionSlug:H,folderFieldName:g,folderID:b,FolderResultsComponent:L,folderType:null==en||null==(n=en[en.length-1])?void 0:n.folderType,getFolderRoute:ec,getSelectedItems:ed,isDragging:G,itemKeysToMove:S.selectedItemKeys,moveToFolder:ev,onItemClick:eg,onItemKeyPress:em,refineFolderData:es,search:w,selectedFolderCollections:A,selectedItemKeys:X,setBreadcrumbs:ea,setFocusedRowIndex:J,setIsDragging:$,sort:C,subfolders:j},children:h})}function uT(){let e=l.use(uP);if(void 0===e)throw Error("useFolder must be used within a FolderProvider");return e}var uR=(0,l.createContext)({cachingEnabled:!0,clearRouteCache:()=>{}}),uI=e=>{let{type:t="submit",buttonId:n,children:a,disabled:o,onClick:r,programmaticSubmit:i,ref:s}=e,c=e_(),d=(0,l.use)(eb),p=ek(),{disabled:f,submit:h}=eC();return(0,u.jsx)("div",{className:"form-submit",children:(0,u.jsx)(to,{ref:s,...e,disabled:!!(o||p||c||d||f)||void 0,id:n,onClick:null!=r?r:i?()=>{h()}:void 0,type:t,children:a})})},uF="drawer-action-header",uA=e=>{let t=(0,h.c)(10),{cancelLabel:n,className:a,onCancel:o,onSave:l,saveLabel:r,title:i}=e,{t:c}=(0,s.d)(),d;t[0]!==a?(d=[uF,a].filter(Boolean),t[0]=a,t[1]=d):d=t[1];let p=d.join(" "),f;return t[2]!==n||t[3]!==o||t[4]!==l||t[5]!==r||t[6]!==c||t[7]!==p||t[8]!==i?(f=(0,u.jsx)("div",{className:p,children:(0,u.jsxs)("div",{className:"".concat(uF,"__content"),children:[(0,u.jsx)("h1",{className:"".concat(uF,"__title"),children:i}),(0,u.jsxs)("div",{className:"".concat(uF,"__actions"),children:[(0,u.jsx)(to,{"aria-label":c("general:cancel"),buttonStyle:"secondary",onClick:o,children:n||c("general:cancel")}),(0,u.jsx)(uI,{"aria-label":c("general:applyChanges"),onClick:l,children:r||c("general:applyChanges")})]})]})}),t[2]=n,t[3]=o,t[4]=l,t[5]=r,t[6]=c,t[7]=p,t[8]=i,t[9]=f):f=t[9],f};function uM(e){let{children:t,className:n}=e;return(0,u.jsx)("div",{className:["drawer-content-container",n].filter(Boolean).join(" "),children:t})}var uL="create-new-doc-in-folder";function uB(e){let t,n=(0,h.c)(22),{buttonLabel:a,collectionSlugs:o,folderAssignedCollections:r,onCreateSuccess:c,slugPrefix:p}=e,f="".concat(p,"-new-doc-in-folder-drawer"),{i18n:m}=(0,s.d)(),{closeModal:g,openModal:v}=ne(),{config:b}=(0,i.c)(),{folderCollectionConfig:y,folderCollectionSlug:x,folderFieldName:w,folderID:C}=uT(),j;n[0]!==x?(j={collectionSlug:x},n[0]=x,n[1]=j):j=n[1];let[S,,_]=sx(j),{closeDrawer:k,openDrawer:E}=_,[N,D]=l.useState(),P;n[2]!==o||n[3]!==b?(P=()=>o.reduce((e,t)=>{let n=b.collections.find(e=>{let{slug:n}=e;return n===t});return n&&e.push(n),e},[]),n[2]=o,n[3]=b,n[4]=P):P=n[4];let[O]=l.useState(P);return 0===O.length?null:(n[5]!==S||n[6]!==a||n[7]!==k||n[8]!==g||n[9]!==o||n[10]!==N||n[11]!==O||n[12]!==r||n[13]!==y.slug||n[14]!==w||n[15]!==C||n[16]!==m||n[17]!==f||n[18]!==c||n[19]!==E||n[20]!==v?(t=(0,u.jsxs)(l.Fragment,{children:[1===O.length?(0,u.jsx)(to,{buttonStyle:"pill",className:"".concat(uL,"__button"),el:"div",onClick:()=>{O[0].slug===y.slug?E():(D(O[0].slug),v(f))},size:"small",children:a}):(0,u.jsx)(te,{button:(0,u.jsx)(to,{buttonStyle:"pill",className:"".concat(uL,"__popup-button"),el:"div",icon:"chevron",size:"small",children:a}),buttonType:"default",className:"".concat(uL,"__action-popup"),children:(0,u.jsx)(eY.ButtonGroup,{children:O.map((e,t)=>(0,u.jsx)(eY.Button,{onClick:()=>{e.slug===y.slug?E():(D(e.slug),v(f))},children:(0,d.s)(e.labels.singular,m)},t))})}),N&&(0,u.jsx)(sy,{collectionSlug:N,drawerSlug:f,initialData:{[w]:C},onSave:async e=>{let{doc:t}=e;await c({collectionSlug:N,doc:t}),g(f)},redirectAfterCreate:!1}),o.includes(y.slug)&&(0,u.jsx)(S,{initialData:{[w]:C,folderType:N?r||[N]:r},onSave:async e=>{await c({collectionSlug:y.slug,doc:e.doc}),k()},redirectAfterCreate:!1})]}),n[5]=S,n[6]=a,n[7]=k,n[8]=g,n[9]=o,n[10]=N,n[11]=O,n[12]=r,n[13]=y.slug,n[14]=w,n[15]=C,n[16]=m,n[17]=f,n[18]=c,n[19]=E,n[20]=v,n[21]=t):t=n[21],t)}var uV="no-results";function uz(e){let{Actions:t,Message:n}=e;return(0,u.jsxs)("div",{className:uV,children:[n,t&&t.length>0&&(0,u.jsx)("div",{className:"".concat(uV,"__actions"),children:t.map((e,t)=>(0,u.jsx)(l.Fragment,{children:e},t))})]})}var uU=e=>{let{elements:t,translationString:n}=e,a=n.split(/(]+>.*?]+>)/g);return(0,u.jsx)("span",{children:a.map((e,n)=>{if(t&&e.startsWith("")){let a=e[1],o=t[a];if(o){let t=RegExp("(.*?)").concat(a,">"),"g"),l=e.replace(t,(e,t)=>t);return(0,u.jsx)(o,{children:(0,u.jsx)(uU,{translationString:l})},n)}}return e})})},uH=e=>{let{elements:t,i18nKey:n,t:a,variables:o}=e,l=a(n,o||{});return t?(0,u.jsx)(uU,{elements:t,translationString:l}):l},uq="folderBreadcrumbs";function uW(e){let{breadcrumbs:t,className:n}=e;return(0,u.jsx)("div",{className:"".concat(uq," ").concat(n||"").trim(),children:null==t?void 0:t.map((e,n)=>(0,u.jsxs)("div",{className:"".concat(uq,"__crumb"),children:[e.onClick?(0,u.jsx)(uK,{className:"".concat(uq,"__crumb-item"),id:e.id,onClick:e.onClick,children:e.name}):e.name,t.length>0&&n!==t.length-1&&(0,u.jsx)(eq,{className:"".concat(uq,"__crumb-chevron"),direction:"right"})]},n))})}function uK(e){let t,n=(0,h.c)(13),{id:a,children:o,className:l,onClick:r}=e,i="folder-".concat(a),s;n[0]!==a?(s={id:a,type:"folder"},n[0]=a,n[1]=s):s=n[1],n[2]!==i||n[3]!==s?(t={id:i,data:s},n[2]=i,n[3]=s,n[4]=t):t=n[4];let{isOver:c,setNodeRef:d}=(0,g.zM)(t),p=c&&"droppable-button--hover",f;n[5]!==l||n[6]!==p?(f=["droppable-button",l,p].filter(Boolean),n[5]=l,n[6]=p,n[7]=f):f=n[7];let m=f.join(" "),v;return n[8]!==o||n[9]!==r||n[10]!==d||n[11]!==m?(v=(0,u.jsx)("button",{className:m,onClick:r,ref:d,type:"button",children:o}),n[8]=o,n[9]=r,n[10]=d,n[11]=m,n[12]=v):v=n[12],v}function uY(){return(0,u.jsx)(uD,{className:"colored-folder-icon"})}var uG="move-folder-drawer",u$="".concat("move-folder-drawer","-confirm-move");function uX(e){return(0,u.jsx)(nC,{gutter:!1,Header:null,slug:e.drawerSlug,children:(0,u.jsx)(uZ,{...e})})}function uZ(e){var t;let{permissions:n}=nO(),[a,o]=l.useState([]),[r,i]=l.useState([]),[s,c]=l.useState([]),[d,p]=l.useState(null),[f,h]=l.useState(!1),[m,g]=l.useState(e.fromFolderID||null),v=l.useRef(!1),{getFolderResultsComponentAndData:b}=sn(),y=l.useCallback(async t=>{try{let n=await b({browseByFolder:!1,collectionsToDisplay:[e.folderCollectionSlug],displayAs:"grid",folderAssignedCollections:e.folderAssignedCollections,folderID:t,sort:"name"});c(n.breadcrumbs||[]),o((null==n?void 0:n.subfolders)||[]),i((null==n?void 0:n.documents)||[]),p(n.FolderResultsComponent||null),g(t),h(!0)}catch(e){c([]),o([]),i([])}v.current=!0},[b,e.folderAssignedCollections,e.folderCollectionSlug]);return l.useEffect(()=>{v.current||y(e.fromFolderID)},[y,e.fromFolderID]),f?(0,u.jsx)(uO,{allCollectionFolderSlugs:[e.folderCollectionSlug],allowCreateCollectionSlugs:(null==(t=n.collections[e.folderCollectionSlug])?void 0:t.create)?[e.folderCollectionSlug]:[],allowMultiSelection:!1,breadcrumbs:s,documents:r,folderFieldName:e.folderFieldName,folderID:m,FolderResultsComponent:d,onItemClick:async e=>{await y(e.value.id)},subfolders:a,children:(0,u.jsx)(uQ,{...e,populateMoveToFolderDrawer:y})},m):(0,u.jsx)(sd,{})}function uQ(e){var t,n,a;let o,r,i,c,p=(0,h.c)(34),{drawerSlug:f,fromFolderID:m,fromFolderName:g,itemsToMove:v,onConfirm:b,populateMoveToFolderDrawer:y,skipConfirmModal:x,...w}=e,{clearRouteCache:C}=(0,l.use)(uR),{closeModal:j,isModalOpen:S,openModal:_}=ne(),k;p[0]!==v?(k=()=>v.length,p[0]=v,p[1]=k):k=p[1];let[E]=l.useState(k),[N,D]=l.useState(!1),{i18n:P,t:O}=(0,s.d)(),{breadcrumbs:T,folderCollectionConfig:R,folderCollectionSlug:I,folderFieldName:F,folderID:A,FolderResultsComponent:M,folderType:L,getSelectedItems:B,subfolders:V}=uT(),U;p[2]!==I?(U={collectionSlug:I},p[2]=I,p[3]=U):U=p[3];let[H,,q]=sx(U),{closeDrawer:W,openDrawer:K}=q,Y;p[4]!==T||p[5]!==B?(Y=()=>{let e=B();if(0!==e.length)return{id:e[0].value.id,name:e[0].value._folderOrDocumentTitle};{let e=null==T?void 0:T[T.length-1];return{id:(null==e?void 0:e.id)||null,name:(null==e?void 0:e.name)||null}}},p[4]=T,p[5]=B,p[6]=Y):Y=p[6];let G=Y,$;p[7]!==I||p[8]!==A||p[9]!==m||p[10]!==y?($=async e=>{let{collectionSlug:t,doc:n}=e;await y(A),t!==I||(null==n||!n.folder||m!==(0,z.r)(null==n?void 0:n.folder))&&(m||(null==n?void 0:n.folder))||D(!0)},p[7]=I,p[8]=A,p[9]=m,p[10]=y,p[11]=$):$=p[11];let X=$,Z;p[12]!==G||p[13]!==b?(Z=()=>{"function"==typeof b&&b(G())},p[12]=G,p[13]=b,p[14]=Z):Z=p[14];let Q=Z,J,ee;return p[15]!==C||p[16]!==f||p[17]!==N||p[18]!==S?(J=()=>{!S(f)&&N&&(D(!1),C())},ee=[f,S,C,N],p[15]=C,p[16]=f,p[17]=N,p[18]=S,p[19]=J,p[20]=ee):(J=p[19],ee=p[20]),l.useEffect(J,ee),p[21]!==j||p[22]!==f?(o=()=>{j(f)},p[21]=j,p[22]=f,p[23]=o):o=p[23],p[24]!==Q||p[25]!==_||p[26]!==x?(r=()=>{x?Q():_(u$)},p[24]=Q,p[25]=_,p[26]=x,p[27]=r):r=p[27],p[28]!==T.length||p[29]!==y?(i=T.length?()=>{y(null)}:void 0,p[28]=T.length,p[29]=y,p[30]=i):i=p[30],p[31]!==T.length||p[32]!==y?(c=(e,t)=>({id:e.id,name:e.name,onClick:t!==T.length-1?()=>{y(e.id)}:void 0}),p[31]=T.length,p[32]=y,p[33]=c):c=p[33],(0,u.jsxs)("div",{className:uG,children:[(0,u.jsx)(uA,{onCancel:o,onSave:r,saveLabel:O("general:select"),title:(0,u.jsx)(uJ,{action:w.action,count:E,fromFolderName:m?g:void 0,title:"moveItemToFolder"===w.action?w.title:void 0})}),(0,u.jsxs)("div",{className:"".concat(uG,"__breadcrumbs-section"),children:[(0,u.jsx)(uW,{breadcrumbs:[{id:null,name:(0,u.jsxs)("span",{className:"".concat(uG,"__folder-breadcrumbs-root"),children:[(0,u.jsx)(uY,{}),O("folder:folders")]}),onClick:i},...T.map(c)]}),V.length>0&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(to,{buttonStyle:"pill",className:"".concat(uG,"__add-folder-button"),margin:!1,onClick:()=>{K()},children:O("fields:addLabel",{label:(0,d.s)(null==(t=R.labels)?void 0:t.singular,P)})}),(0,u.jsx)(H,{initialData:{[F]:A,folderType:L},onSave:e=>{X({collectionSlug:R.slug,doc:e.doc}),W()},redirectAfterCreate:!1})]})]}),(0,u.jsx)(uM,{className:"".concat(uG,"__body-section"),children:V.length>0?M:(0,u.jsx)(uz,{Actions:[(0,u.jsx)(uB,{buttonLabel:"".concat(O("general:create")," ").concat((0,d.s)(null==(n=R.labels)?void 0:n.singular,P).toLowerCase()),collectionSlugs:[I],folderAssignedCollections:w.folderAssignedCollections,onCreateSuccess:X,slugPrefix:"create-new-folder-from-drawer--no-results"},"create-folder")],Message:(0,u.jsx)("p",{children:P.t("general:noResults",{label:"".concat((0,d.s)(null==(a=R.labels)?void 0:a.plural,P))})})})}),!x&&(0,u.jsx)(nE,{body:(0,u.jsx)(u0,{action:w.action,count:E,fromFolderName:g,title:"moveItemToFolder"===w.action?w.title:void 0,toFolderName:G().name}),confirmingLabel:O("general:moving"),confirmLabel:O("general:move"),heading:O("general:confirmMove"),modalSlug:u$,onConfirm:Q})]})}function uJ(e){let t=(0,h.c)(14),{t:n}=(0,s.d)();switch(e.action){case"moveItemToFolder":if(e.fromFolderName){let a;return t[0]!==e.fromFolderName||t[1]!==e.title||t[2]!==n?(a=n("folder:movingFromFolder",{fromFolder:e.fromFolderName,title:e.title}),t[0]=e.fromFolderName,t[1]=e.title,t[2]=n,t[3]=a):a=t[3],a}{let a;return t[4]!==e.title||t[5]!==n?(a=n("folder:selectFolderForItem",{title:e.title}),t[4]=e.title,t[5]=n,t[6]=a):a=t[6],a}case"moveItemsToFolder":if(e.fromFolderName){let a="".concat(e.count," ").concat(n(e.count>1?"general:items":"general:item")),o;return t[7]!==e.fromFolderName||t[8]!==n||t[9]!==a?(o=n("folder:movingFromFolder",{fromFolder:e.fromFolderName,title:a}),t[7]=e.fromFolderName,t[8]=n,t[9]=a,t[10]=o):o=t[10],o}{let a="".concat(e.count," ").concat(n(e.count>1?"general:items":"general:item")),o;return t[11]!==n||t[12]!==a?(o=n("folder:selectFolderForItem",{title:a}),t[11]=n,t[12]=a,t[13]=o):o=t[13],o}}}function u0(e){let t=(0,h.c)(14),{t:n}=(0,s.d)();switch(e.action){case"moveItemToFolder":if(e.toFolderName){let a;return t[0]!==e.title||t[1]!==e.toFolderName||t[2]!==n?(a=(0,u.jsx)(uH,{elements:{1:u4,2:u5},i18nKey:"folder:moveItemToFolderConfirmation",t:n,variables:{title:e.title,toFolder:e.toFolderName}}),t[0]=e.title,t[1]=e.toFolderName,t[2]=n,t[3]=a):a=t[3],a}{let a;return t[4]!==e.title||t[5]!==n?(a=(0,u.jsx)(uH,{elements:{1:u6},i18nKey:"folder:moveItemToRootConfirmation",t:n,variables:{title:e.title}}),t[4]=e.title,t[5]=n,t[6]=a):a=t[6],a}case"moveItemsToFolder":if(e.toFolderName){let a;return t[7]!==e.count||t[8]!==e.toFolderName||t[9]!==n?(a=(0,u.jsx)(uH,{elements:{1:u2,2:u3},i18nKey:"folder:moveItemsToFolderConfirmation",t:n,variables:{count:e.count,label:n(e.count>1?"general:items":"general:item"),toFolder:e.toFolderName}}),t[7]=e.count,t[8]=e.toFolderName,t[9]=n,t[10]=a):a=t[10],a}{let a;return t[11]!==e.count||t[12]!==n?(a=(0,u.jsx)(uH,{elements:{1:u1},i18nKey:"folder:moveItemsToRootConfirmation",t:n,variables:{count:e.count,label:n(e.count>1?"general:items":"general:item")}}),t[11]=e.count,t[12]=n,t[13]=a):a=t[13],a}}}function u1(e){let{children:t}=e;return(0,u.jsx)("strong",{children:t})}function u3(e){let{children:t}=e;return(0,u.jsx)("strong",{children:t})}function u2(e){let{children:t}=e;return(0,u.jsx)("strong",{children:t})}function u6(e){let{children:t}=e;return(0,u.jsx)("strong",{children:t})}function u5(e){let{children:t}=e;return(0,u.jsx)("strong",{children:t})}function u4(e){let{children:t}=e;return(0,u.jsx)("strong",{children:t})}function u9(e){let t=(0,h.c)(29),{buttonProps:n,className:a,folderCollectionSlug:o,folderFieldName:r}=e,c=void 0===a?"":a,{t:d}=(0,s.d)(),p=eE(u8),f;t[0]!==r?(f=e=>{let[t]=e;return t&&(null==t?void 0:t[r])||null},t[0]=r,t[1]=f):f=t[1];let m=eE(f),g=null==m?void 0:m.value,{id:v,collectionSlug:b,initialData:y,title:x}=aE(),{setModified:w}=eC(),C;t[2]!==d?(C=()=>"".concat(d("general:loading"),"..."),t[2]=d,t[3]=C):C=t[3];let[j,S]=l.useState(C),{config:_}=(0,i.c)(),k=(0,l.useId)(),E,N;t[4]!==_.routes.api||t[5]!==o||t[6]!==g||t[7]!==d?(E=()=>{!async function(){if(g&&("string"==typeof g||"number"==typeof g)){let e=await (await fetch("".concat(_.routes.api,"/").concat(o,"/").concat(g))).json();S((null==e?void 0:e.name)||d("folder:noFolder"))}else S(d("folder:noFolder"))}()},N=[o,_.routes.api,g,d],t[4]=_.routes.api,t[5]=o,t[6]=g,t[7]=d,t[8]=E,t[9]=N):(E=t[8],N=t[9]),l.useEffect(E,N);let D="move-to-folder-".concat(k),P;t[10]!==m||t[11]!==p||t[12]!==r||t[13]!==w?(P=e=>{let{id:t}=e;m.value!==t&&(p({type:"UPDATE",path:r,value:t}),w(!0))},t[10]=m,t[11]=p,t[12]=r,t[13]=w,t[14]=P):P=t[14];let O=!(null==m?void 0:m.value),T;return t[15]!==n||t[16]!==c||t[17]!==b||t[18]!==o||t[19]!==r||t[20]!==g||t[21]!==j||t[22]!==v||t[23]!==y||t[24]!==D||t[25]!==P||t[26]!==O||t[27]!==x?(T=(0,u.jsx)(u7,{buttonProps:n,className:c,collectionSlug:b,docData:y,docID:v,docTitle:x,folderCollectionSlug:o,folderFieldName:r,fromFolderID:g,fromFolderName:j,modalSlug:D,onConfirm:P,skipConfirmModal:O}),t[15]=n,t[16]=c,t[17]=b,t[18]=o,t[19]=r,t[20]=g,t[21]=j,t[22]=v,t[23]=y,t[24]=D,t[25]=P,t[26]=O,t[27]=x,t[28]=T):T=t[28],T}function u8(e){let[,t]=e;return t}var u7=e=>{let t=(0,h.c)(22),{buttonProps:n,className:a,collectionSlug:o,docData:l,docID:r,docTitle:c,folderCollectionSlug:p,folderFieldName:f,fromFolderID:m,fromFolderName:g,modalSlug:v,onConfirm:b,skipConfirmModal:y}=e,{getEntityConfig:x}=(0,i.c)(),{i18n:w,t:C}=(0,s.d)(),{closeModal:j,openModal:S}=ne(),_=n_(),k;if(t[0]!==n||t[1]!==a||t[2]!==j||t[3]!==o||t[4]!==l||t[5]!==r||t[6]!==c||t[7]!==_||t[8]!==p||t[9]!==f||t[10]!==m||t[11]!==g||t[12]!==x||t[13]!==w||t[14]!==v||t[15]!==b||t[16]!==S||t[17]!==y||t[18]!==C){let e=nx({slug:v,depth:_}),i=c||(0,d.s)(x({collectionSlug:o}).labels.singular,w),s;t[20]!==a?(s=["move-doc-to-folder",a].filter(Boolean),t[20]=a,t[21]=s):s=t[21],k=(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(to,{buttonStyle:"subtle",className:s.join(" "),icon:(0,u.jsx)(uD,{}),iconPosition:"left",onClick:()=>{S(e)},...n,children:g}),(0,u.jsx)(uX,{action:"moveItemToFolder",drawerSlug:e,folderAssignedCollections:[o],folderCollectionSlug:p,folderFieldName:f,fromFolderID:m,fromFolderName:g,itemsToMove:[{itemKey:"".concat(o,"-").concat(r),relationTo:o,value:{...l,id:r}}],onConfirm:async t=>{if(m!==t.id&&"function"==typeof b)try{await b(t),t.id?eF.success(C("folder:itemHasBeenMoved",{folderName:'"'.concat(t.name,'"'),title:i})):eF.success(C("folder:itemHasBeenMovedToRoot",{title:i}))}catch(e){}j(e)},skipConfirmModal:y,title:i})]}),t[0]=n,t[1]=a,t[2]=j,t[3]=o,t[4]=l,t[5]=r,t[6]=c,t[7]=_,t[8]=p,t[9]=f,t[10]=m,t[11]=g,t[12]=x,t[13]=w,t[14]=v,t[15]=b,t[16]=S,t[17]=y,t[18]=C,t[19]=k}else k=t[19];return k},de={x:0,y:0,width:0,height:0,unit:"px"},dt=(e,t,n)=>Math.min(Math.max(e,t),n),dn=function(){for(var e=arguments.length,t=Array(e),n=0;ne&&"string"==typeof e).join(" ")},da=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function dl(e,t,n){return"%"===e.unit?{...de,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/n*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/n*100:0}}function dr(e,t,n){return e.unit?"px"===e.unit?{...de,...e,unit:"px"}:{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*n/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*n/100:0}:{...de,...e,unit:"px"}}function di(e,t,n,a,o){let l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,i=arguments.length>7&&void 0!==arguments[7]?arguments[7]:a,s=arguments.length>8&&void 0!==arguments[8]?arguments[8]:o,c={...e},u=Math.min(l,a),d=Math.min(r,o),p=Math.min(i,a),f=Math.min(s,o);t&&(t>1?(d=(u=r?r*t:u)/t,p=i*t):(u=(d=l?l/t:d)*t,f=s/t)),c.yp&&(("sw"===n||"nw"==n)&&(c.x-=p-c.width),c.width=p),c.height>f&&(("nw"===n||"ne"==n)&&(c.y-=f-c.height),c.height=f),t){let e=c.width/c.height;if(et){let e=Math.max(c.height*t,u);("sw"===n||"nw"==n)&&(c.x-=e-c.width),c.width=e}}return c}var ds={capture:!0,passive:!1},dc=class e extends l.PureComponent{get document(){return document}getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:n,width:a,height:o}=e.getBoundingClientRect();return{x:t,y:n,width:a,height:o}}componentDidUpdate(e){let{crop:t,onComplete:n}=this.props;if(n&&!e.crop&&t){let{width:e,height:a}=this.getBox();e&&a&&n(dr(t,e,a),dl(t,e,a))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,ds),this.document.addEventListener("pointerup",this.onDocPointerDone,ds),this.document.addEventListener("pointercancel",this.onDocPointerDone,ds),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,ds),this.document.removeEventListener("pointerup",this.onDocPointerDone,ds),this.document.removeEventListener("pointercancel",this.onDocPointerDone,ds),this.docMoveBound=!1)}getCropStyle(){let{crop:e}=this.props;if(e)return{top:"".concat(e.y).concat(e.unit),left:"".concat(e.x).concat(e.unit),width:"".concat(e.width).concat(e.unit),height:"".concat(e.height).concat(e.unit)}}dragCrop(){let{evData:e}=this,t=this.getBox(),n=this.makePixelCrop(t),a=e.clientX-e.startClientX,o=e.clientY-e.startClientY;return n.x=dt(e.startCropX+a,0,t.width-n.width),n.y=dt(e.startCropY+o,0,t.height-n.height),n}getPointRegion(e,t,n,a){let{evData:o}=this,l=o.clientX-e.x,r=o.clientY-e.y,i;return i=a&&t?"nw"===t||"n"===t||"ne"===t:r2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=Math.min(n,e.width),l=Math.min(a,e.height);return t&&(o||l)?t>1?o?[o,o/t]:[l*t,l]:l?[l*t,l]:[o,o/t]:[o,l]}resizeCrop(){let{evData:t}=this,{aspect:n=0,maxWidth:a,maxHeight:o}=this.props,l=this.getBox(),[r,i]=this.resolveMinDimensions(l,n,this.props.minWidth,this.props.minHeight),s=this.makePixelCrop(l),c=this.getPointRegion(l,t.ord,r,i),u=t.ord||c,d=t.clientX-t.startClientX,p=t.clientY-t.startClientY;(r&&"nw"===u||"w"===u||"sw"===u)&&(d=Math.min(d,-r)),(i&&"nw"===u||"n"===u||"ne"===u)&&(p=Math.min(p,-i));let f={unit:"px",x:0,y:0,width:0,height:0};"ne"===c?(f.x=t.startCropX,f.width=d,n?f.height=f.width/n:f.height=Math.abs(p),f.y=t.startCropY-f.height):"se"===c?(f.x=t.startCropX,f.y=t.startCropY,f.width=d,n?f.height=f.width/n:f.height=p):"sw"===c?(f.x=t.startCropX+d,f.y=t.startCropY,f.width=Math.abs(d),n?f.height=f.width/n:f.height=p):"nw"===c&&(f.x=t.startCropX+d,f.width=Math.abs(d),n?(f.height=f.width/n,f.y=t.startCropY-f.height):(f.height=Math.abs(p),f.y=t.startCropY+p));let h=di(f,n,c,l.width,l.height,r,i,a,o);return n||e.xyOrds.indexOf(u)>-1?s=h:e.xOrds.indexOf(u)>-1?(s.x=h.x,s.width=h.width):e.yOrds.indexOf(u)>-1&&(s.y=h.y,s.height=h.height),s.x=dt(s.x,0,l.width-s.width),s.y=dt(s.y,0,l.height-s.height),s}createCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:n,locked:a,renderSelectionAddon:o,ruleOfThirds:r,crop:i}=this.props,s=this.getCropStyle();if(i)return l.createElement("div",{style:s,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!n&&!a&&l.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},l.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),l.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),l.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),l.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),l.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),l.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),l.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),l.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),l.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),l.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),l.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),l.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),o&&l.createElement("div",{className:"ReactCrop__selection-addon",onMouseDown:e=>e.stopPropagation()},o(this.state)),r&&l.createElement(l.Fragment,null,l.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),l.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return dr({...de,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:n,className:a,crop:o,disabled:r,locked:i,style:s,ruleOfThirds:c}=this.props,{cropIsActive:u,newCropIsBeingDrawn:d}=this.state,p=o?this.createCropSelection():null,f=dn("ReactCrop",a,u&&"ReactCrop--active",r&&"ReactCrop--disabled",i&&"ReactCrop--locked",d&&"ReactCrop--new-crop",o&&e&&"ReactCrop--fixed-aspect",o&&n&&"ReactCrop--circular-crop",o&&c&&"ReactCrop--rule-of-thirds",!this.dragStarted&&o&&!o.width&&!o.height&&"ReactCrop--invisible-crop",n&&"ReactCrop--no-animate");return l.createElement("div",{ref:this.componentRef,className:f,style:s},l.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),p)}constructor(){super(...arguments),this.docMoveBound=!1,this.mouseDownOnCrop=!1,this.dragStarted=!1,this.evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0},this.componentRef=(0,l.createRef)(),this.mediaRef=(0,l.createRef)(),this.initChangeCalled=!1,this.state={cropIsActive:!1,newCropIsBeingDrawn:!1},this.onCropPointerDown=e=>{let{crop:t,disabled:n}=this.props,a=this.getBox();if(!t)return;let o=dr(t,a.width,a.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.target.dataset.ord,r=e.clientX,i=e.clientY,s=o.x,c=o.y;if(l){let t=e.clientX-a.x,n=e.clientY-a.y,u=0,d=0;"ne"===l||"e"==l?(u=t-(o.x+o.width),d=n-o.y,s=o.x,c=o.y+o.height):"se"===l||"s"===l?(u=t-(o.x+o.width),d=n-(o.y+o.height),s=o.x,c=o.y):"sw"===l||"w"==l?(u=t-o.x,d=n-(o.y+o.height),s=o.x+o.width,c=o.y):("nw"===l||"n"==l)&&(u=t-o.x,d=n-o.y,s=o.x+o.width,c=o.y+o.height),r=s+a.x+u,i=c+a.y+d}this.evData={startClientX:r,startClientY:i,startCropX:s,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!!l,ord:l},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})},this.onComponentPointerDown=e=>{let{crop:t,disabled:n,locked:a,keepSelection:o,onChange:l}=this.props,r=this.getBox();if(n||a||o&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let i=e.clientX-r.x,s=e.clientY-r.y,c={unit:"px",x:i,y:s,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:i,startCropY:s,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,l(dr(c,r.width,r.height),dl(c,r.width,r.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})},this.onDocPointerMove=e=>{let t,{crop:n,disabled:a,onChange:o,onDragStart:l}=this.props,r=this.getBox();if(a||!n||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,l&&l(e));let{evData:i}=this;i.clientX=e.clientX,i.clientY=e.clientY,da(n,t=i.isResize?this.resizeCrop():this.dragCrop())||o(dr(t,r.width,r.height),dl(t,r.width,r.height))},this.onComponentKeyDown=t=>{let{crop:n,disabled:a,onChange:o,onComplete:l}=this.props;if(a)return;let r=t.key,i=!1;if(!n)return;let s=this.getBox(),c=this.makePixelCrop(s),u=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===r?(c.x-=u,i=!0):"ArrowRight"===r?(c.x+=u,i=!0):"ArrowUp"===r?(c.y-=u,i=!0):"ArrowDown"===r&&(c.y+=u,i=!0),i){t.cancelable&&t.preventDefault(),c.x=dt(c.x,0,s.width-c.width),c.y=dt(c.y,0,s.height-c.height);let e=dr(c,s.width,s.height),n=dl(c,s.width,s.height);o(e,n),l&&l(e,n)}},this.onHandlerKeyDown=(t,n)=>{let{aspect:a=0,crop:o,disabled:l,minWidth:r=0,minHeight:i=0,maxWidth:s,maxHeight:c,onChange:u,onComplete:d}=this.props,p=this.getBox();if(l||!o||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let f=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,h=di(function(e,t,n,a){let o={...e};return"ArrowLeft"===t?"nw"===a?(o.x-=n,o.y-=n,o.width+=n,o.height+=n):"w"===a?(o.x-=n,o.width+=n):"sw"===a?(o.x-=n,o.width+=n,o.height+=n):"ne"===a?(o.y+=n,o.width-=n,o.height-=n):"e"===a?o.width-=n:"se"===a&&(o.width-=n,o.height-=n):"ArrowRight"===t&&("nw"===a?(o.x+=n,o.y+=n,o.width-=n,o.height-=n):"w"===a?(o.x+=n,o.width-=n):"sw"===a?(o.x+=n,o.width-=n,o.height-=n):"ne"===a?(o.y-=n,o.width+=n,o.height+=n):"e"===a?o.width+=n:"se"===a&&(o.width+=n,o.height+=n)),"ArrowUp"===t?"nw"===a?(o.x-=n,o.y-=n,o.width+=n,o.height+=n):"n"===a?(o.y-=n,o.height+=n):"ne"===a?(o.y-=n,o.width+=n,o.height+=n):"sw"===a?(o.x+=n,o.width-=n,o.height-=n):"s"===a?o.height-=n:"se"===a&&(o.width-=n,o.height-=n):"ArrowDown"===t&&("nw"===a?(o.x+=n,o.y+=n,o.width-=n,o.height-=n):"n"===a?(o.y+=n,o.height-=n):"ne"===a?(o.y+=n,o.width-=n,o.height-=n):"sw"===a?(o.x-=n,o.width+=n,o.height+=n):"s"===a?o.height+=n:"se"===a&&(o.width+=n,o.height+=n)),o}(dr(o,p.width,p.height),t.key,f,n),a,n,p.width,p.height,r,i,s,c);if(!da(o,h)){let e=dl(h,p.width,p.height);u(h,e),d&&d(h,e)}},this.onDocPointerDone=e=>{let{crop:t,disabled:n,onComplete:a,onDragEnd:o}=this.props,l=this.getBox();this.unbindDocMove(),!(n||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,o&&o(e),a&&a(dr(t,l.width,l.height),dl(t,l.width,l.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))},this.onDragFocus=e=>{var t;null==(t=this.componentRef.current)||t.scrollTo(0,0)}}};dc.xOrds=["e","w"],dc.yOrds=["n","s"],dc.xyOrds=["nw","ne","se","sw"],dc.nudgeStep=1,dc.nudgeStepMedium=10,dc.nudgeStepLarge=100,dc.defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};var du="edit-upload",dd=e=>{let{name:t,onChange:n,ref:a,value:o}=e;return(0,u.jsxs)("div",{className:"".concat(du,"__input"),children:[t,(0,u.jsx)("input",{name:t,onChange:e=>n(e.target.value),ref:a,type:"number",value:o})]})},dp={height:100,unit:"%",width:100,x:0,y:0},df=e=>{let{fileName:t,fileSrc:n,imageCacheTag:a,initialCrop:o,initialFocalPoint:r,onSave:i,showCrop:c,showFocalPoint:d}=e,{closeModal:p}=ne(),{t:f}=(0,s.d)(),[h,m]=(0,l.useState)(()=>({...dp,...o||{}})),g={x:50,y:50},[v,b]=(0,l.useState)(()=>({...g,...r})),[y,x]=(0,l.useState)(!1),[w,C]=(0,l.useState)(0),[j,S]=(0,l.useState)(0),_=(0,l.useRef)(void 0),k=(0,l.useRef)(void 0),E=(0,l.useRef)(void 0),N=(0,l.useRef)(null),D=(0,l.useRef)(null),[P,O]=(0,l.useState)(!1),T=e=>{C(e.currentTarget.naturalHeight),S(e.currentTarget.naturalWidth),O(!0)},R=e=>{let{dimension:t,value:n}=e,a=parseInt(n);if("width"===t&&a>=j||"height"===t&&a>=w)return null;let o=a/("width"===t?j:w)*100;if(100===o||0===o)return null;m({...h,[t]:o})},I=e=>{let{coordinate:t,value:n}=e,a=parseInt(n);a>=0&&a({...e,[t]:a}))},F=l.useCallback(e=>{let{x:t,y:n}=e;b({x:t,y:n}),x(!1)},[]),A=a?"".concat(n,"?").concat(encodeURIComponent(a)):n;return(0,u.jsxs)("div",{className:du,children:[(0,u.jsxs)("div",{className:"".concat(du,"__header"),children:[(0,u.jsxs)("h2",{title:"".concat(f("general:editing")," ").concat(t),children:[f("general:editing")," ",t]}),(0,u.jsxs)("div",{className:"".concat(du,"__actions"),children:[(0,u.jsx)(to,{"aria-label":f("general:cancel"),buttonStyle:"secondary",className:"".concat(du,"__cancel"),onClick:()=>p(dN),children:f("general:cancel")}),(0,u.jsx)(to,{"aria-label":f("general:applyChanges"),buttonStyle:"primary",className:"".concat(du,"__save"),disabled:!P,onClick:()=>{var e,t,n,a;"function"==typeof i&&i({crop:h||void 0,focalPoint:v,heightInPixels:Number(null!=(n=null==N||null==(e=N.current)?void 0:e.value)?n:w),widthInPixels:Number(null!=(a=null==D||null==(t=D.current)?void 0:t.value)?a:j)}),p(dN)},children:f("general:applyChanges")})]})]}),(0,u.jsxs)("div",{className:"".concat(du,"__toolWrap"),children:[(0,u.jsx)("div",{className:"".concat(du,"__crop"),children:(0,u.jsxs)("div",{className:"".concat(du,"__focal-wrapper"),ref:_,style:{aspectRatio:"".concat(j/w)},children:[c?(0,u.jsx)(dc,{className:"".concat(du,"__reactCrop"),crop:h,onChange:(e,t)=>m(t),onComplete:()=>x(!0),renderSelectionAddon:()=>(0,u.jsx)("div",{className:"".concat(du,"__crop-window"),ref:E}),children:(0,u.jsx)("img",{alt:f("upload:setCropArea"),onLoad:T,ref:k,src:A})}):(0,u.jsx)("img",{alt:f("upload:setFocalPoint"),onLoad:T,ref:k,src:A}),d&&(0,u.jsx)(dh,{boundsRef:c?E:k,checkBounds:!!c&&y,className:"".concat(du,"__focalPoint"),containerRef:_,initialPosition:v,onDragEnd:F,setCheckBounds:!!c&&x,children:(0,u.jsx)(eK,{})})]})}),(c||d)&&(0,u.jsxs)("div",{className:"".concat(du,"__sidebar"),children:[c&&(0,u.jsxs)("div",{className:"".concat(du,"__groupWrap"),children:[(0,u.jsx)("div",{children:(0,u.jsxs)("div",{className:"".concat(du,"__titleWrap"),children:[(0,u.jsx)("h3",{children:f("upload:crop")}),(0,u.jsx)(to,{buttonStyle:"none",className:"".concat(du,"__reset"),onClick:()=>m({height:100,unit:"%",width:100,x:0,y:0}),children:f("general:reset")})]})}),(0,u.jsx)("span",{className:"".concat(du,"__description"),children:f("upload:cropToolDescription")}),(0,u.jsxs)("div",{className:"".concat(du,"__inputsWrap"),children:[(0,u.jsx)(dd,{name:"".concat(f("upload:width")," (px)"),onChange:e=>R({dimension:"width",value:e}),ref:D,value:(h.width/100*j).toFixed(0)}),(0,u.jsx)(dd,{name:"".concat(f("upload:height")," (px)"),onChange:e=>R({dimension:"height",value:e}),ref:N,value:(h.height/100*w).toFixed(0)})]})]}),d&&(0,u.jsxs)("div",{className:"".concat(du,"__groupWrap"),children:[(0,u.jsx)("div",{children:(0,u.jsxs)("div",{className:"".concat(du,"__titleWrap"),children:[(0,u.jsx)("h3",{children:f("upload:focalPoint")}),(0,u.jsx)(to,{buttonStyle:"none",className:"".concat(du,"__reset"),onClick:()=>{let e=_.current.getBoundingClientRect(),t=c?E.current.getBoundingClientRect():k.current.getBoundingClientRect();b({x:(t.left-e.left+t.width/2)/e.width*100,y:(t.top-e.top+t.height/2)/e.height*100})},children:f("general:reset")})]})}),(0,u.jsx)("span",{className:"".concat(du,"__description"),children:f("upload:focalPointDescription")}),(0,u.jsxs)("div",{className:"".concat(du,"__inputsWrap"),children:[(0,u.jsx)(dd,{name:"X %",onChange:e=>I({coordinate:"x",value:e}),value:v.x.toFixed(0)}),(0,u.jsx)(dd,{name:"Y %",onChange:e=>I({coordinate:"y",value:e}),value:v.y.toFixed(0)})]})]})]})]})]})},dh=e=>{let{boundsRef:t,checkBounds:n,children:a,className:o,containerRef:r,initialPosition:i={x:50,y:50},onDragEnd:s,setCheckBounds:c}=e,[d,p]=(0,l.useState)({x:i.x,y:i.y}),[f,h]=(0,l.useState)(!1),m=(0,l.useRef)(void 0),g=l.useCallback((e,n,a)=>{let o=r.current.getBoundingClientRect(),l=t.current.getBoundingClientRect(),i=null!=e?e:l.left,s=null!=n?n:l.top,c=il.right,u=sl.bottom,d=(i-o.left)/o.width*100,p=(s-o.top)/o.height*100,f=(l.left-o.left+l.width/2)/o.width*100,m=(l.top-o.top+l.height/2)/o.height*100;return(c||u)&&(h(!1),il.right&&(d=(o.width-(o.right-l.right))/o.width*100),sl.bottom&&(p=(o.height-(o.bottom-l.bottom))/o.height*100),a&&(d=c?f:d,p=u?m:p)),{x:d,y:p}},[t,r]);return l.useEffect(()=>{if(!(f||!m.current)&&n){let{height:e,left:t,top:n,width:a}=m.current.getBoundingClientRect(),{x:o,y:l}=g(t+a/2,n+e/2,!0);s({x:o,y:l}),p({x:o,y:l}),c(!1);return}},[g,f,n,c,d.x,d.y,s]),l.useEffect(()=>{p({x:i.x,y:i.y})},[i.x,i.y]),(0,u.jsxs)("div",{className:["".concat(du,"__draggable-container"),f&&"".concat(du,"__draggable-container--dragging")].filter(Boolean).join(" "),onMouseMove:e=>{if(!f)return null;let{x:t,y:n}=g(e.clientX,e.clientY);p({x:t,y:n})},children:[(0,u.jsx)("button",{className:["".concat(du,"__draggable"),o].filter(Boolean).join(" "),onMouseDown:e=>{e.preventDefault(),h(!0)},onMouseUp:()=>{h(!1),s(d)},ref:m,style:{left:"".concat(d.x,"%"),top:"".concat(d.y,"%")},type:"button",children:a}),(0,u.jsx)("div",{})]})},dm="file-details-draggable",dg=e=>{let t,n=(0,h.c)(20),{collectionSlug:a,doc:o,hideRemoveFile:l,imageCacheTag:r,isSortable:i,removeItem:s,rowIndex:c,uploadConfig:d}=e,{id:p,filename:f,thumbnailURL:m,url:g}=o,v;n[0]!==a||n[1]!==p?(v={id:p,collectionSlug:a},n[0]=a,n[1]=p,n[2]=v):v=n[2];let[b,y]=sx(v),x;return n[3]!==b||n[4]!==y||n[5]!==a||n[6]!==o||n[7]!==f||n[8]!==l||n[9]!==r||n[10]!==i||n[11]!==s||n[12]!==c||n[13]!==m||n[14]!==d||n[15]!==g?(x=e=>(0,u.jsxs)("div",{className:[dm,e&&i&&"".concat(dm,"--has-drag-handle")].filter(Boolean).join(" "),ref:e.setNodeRef,style:{transform:e.transform,transition:e.transition,zIndex:e.isDragging?1:void 0},children:[(0,u.jsxs)("div",{className:"".concat(dm,"--drag-wrapper"),children:[i&&e&&(0,u.jsx)("div",{className:"".concat(dm,"__drag"),...e.attributes,...e.listeners,children:(0,u.jsx)(aJ,{})}),(0,u.jsx)(sT,{className:"".concat(dm,"__thumbnail"),collectionSlug:a,doc:o,fileSrc:m||g,imageCacheTag:r,uploadConfig:d})]}),(0,u.jsx)("div",{className:"".concat(dm,"__main-detail"),children:f}),(0,u.jsxs)("div",{className:"".concat(dm,"__actions"),children:[(0,u.jsx)(b,{}),(0,u.jsx)(y,{children:(0,u.jsx)(eW,{})}),!l&&s&&(0,u.jsx)(to,{buttonStyle:"icon-label",className:"".concat(dm,"__remove"),icon:"x",iconStyle:"none",onClick:()=>s(c),round:!0})]})]}),n[3]=b,n[4]=y,n[5]=a,n[6]=o,n[7]=f,n[8]=l,n[9]=r,n[10]=i,n[11]=s,n[12]=c,n[13]=m,n[14]=d,n[15]=g,n[16]=x):x=n[16],n[17]!==p||n[18]!==x?(t=(0,u.jsx)(tA,{id:p,children:x},p),n[17]=p,n[18]=x,n[19]=t):t=n[19],t},dv=e=>{let t=(0,h.c)(11),{defaultMessage:n,successMessage:a,value:o}=e,[r,i]=(0,l.useState)(!1),[c,d]=(0,l.useState)(!1),{t:p}=(0,s.d)();if(o){let e,l,s,f;return t[0]!==o?(e=async()=>{await navigator.clipboard.writeText(o),i(!0)},t[0]=o,t[1]=e):e=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{d(!0),i(!1)},s=()=>{d(!1),i(!1)},t[2]=l,t[3]=s):(l=t[2],s=t[3]),t[4]!==r||t[5]!==n||t[6]!==c||t[7]!==a||t[8]!==p||t[9]!==e?(f=(0,u.jsxs)("button",{className:"copy-to-clipboard",onClick:e,onMouseEnter:l,onMouseLeave:s,type:"button",children:[(0,u.jsx)(tu,{}),(0,u.jsxs)(tt,{delay:r?0:void 0,show:c||r,children:[r&&(null!=a?a:p("general:copied")),!r&&(null!=n?n:p("general:copy"))]})]}),t[4]=r,t[5]=n,t[6]=c,t[7]=a,t[8]=p,t[9]=e,t[10]=f):f=t[10],f}return null},db="file-meta",dy=e=>{let{filename:t,filesize:n,height:a,mimeType:o,url:r,width:i}=e;return(0,u.jsxs)("div",{className:db,children:[(0,u.jsxs)("div",{className:"".concat(db,"__url"),children:[(0,u.jsx)("a",{href:r,rel:"noopener noreferrer",target:"_blank",children:t}),(0,u.jsx)(dv,{defaultMessage:"Copy URL",value:r})]}),(0,u.jsxs)("div",{className:"".concat(db,"__size-type"),children:[(0,H.B)(n),"number"==typeof i&&"number"==typeof a&&(0,u.jsxs)(l.Fragment,{children:["\xa0-\xa0",i,"x",a]}),o&&(0,u.jsxs)(l.Fragment,{children:["\xa0-\xa0",o]})]})]})},dx="file-details",dw=e=>{var t;let{customUploadActions:n,doc:a,enableAdjustments:o,handleRemove:l,hasImageSizes:r,hideRemoveFile:i,imageCacheTag:s,uploadConfig:c}=e,{filename:d,filesize:p,height:f,mimeType:h,thumbnailURL:m,url:g,width:v}=a,b=null==(t=c.displayPreview)||t;return(0,u.jsx)("div",{className:dx,children:(0,u.jsxs)("header",{children:[b&&(0,u.jsx)(sT,{className:"".concat(dx,"__thumbnail"),doc:a,fileSrc:m||g,imageCacheTag:s,uploadConfig:c}),(0,u.jsxs)("div",{className:"".concat(dx,"__main-detail"),children:[(0,u.jsx)(dy,{filename:d,filesize:p,height:f,mimeType:h,url:g,width:v}),(o||r&&a.filename||n)&&(0,u.jsx)(dO,{customActions:n,enableAdjustments:!!o,enablePreviewSizes:r&&a.filename,mimeType:h})]}),!i&&l&&(0,u.jsx)(to,{buttonStyle:"icon-label",className:"".concat(dx,"__remove"),icon:"x",iconStyle:"with-border",onClick:l,round:!0})]})})},dC=e=>{let{hasMany:t}=e;return t?(0,u.jsx)(dg,{...e}):(0,u.jsx)(dw,{...e})},dj="preview-sizes",dS=(e,t)=>{if(!t||0===t.length)return e;let n={};return t.forEach(t=>{let{name:a}=t;e[a]&&(n[a]=e[a])}),n},d_=e=>{let{name:t,active:n,meta:a,onClick:o,previewSrc:l}=e;return(0,u.jsxs)("div",{className:["".concat(dj,"__sizeOption"),n&&"".concat(dj,"--selected")].filter(Boolean).join(" "),onClick:"function"==typeof o?o:void 0,onKeyDown:e=>{"function"==typeof o&&"Enter"===e.key&&o()},role:"button",tabIndex:0,children:[(0,u.jsx)("div",{className:"".concat(dj,"__image"),children:(0,u.jsx)("img",{alt:a.filename,src:l})}),(0,u.jsxs)("div",{className:"".concat(dj,"__sizeMeta"),children:[(0,u.jsx)("div",{className:"".concat(dj,"__sizeName"),children:t}),(0,u.jsx)(dy,{...a})]})]})},dk=e=>{let{doc:t,imageCacheTag:n,uploadConfig:a}=e,{imageSizes:o}=a,{sizes:r}=t,[i,s]=(0,l.useState)(()=>dS(r,o)),[c,d]=(0,l.useState)(null),p=e=>e.filename?e.url?"".concat(e.url).concat(n?"?".concat(encodeURIComponent(n)):""):void 0:null;(0,l.useEffect)(()=>{s(dS(r,o))},[r,o,n]);let f=p(c?t.sizes[c]:t),h=(0,l.useMemo)(()=>({filename:t.filename,filesize:t.filesize,height:t.height,mimeType:t.mimeType,url:t.url,width:t.width}),[t]),m="Original";return(0,u.jsxs)("div",{className:dj,children:[(0,u.jsxs)("div",{className:"".concat(dj,"__imageWrap"),children:[(0,u.jsxs)("div",{className:"".concat(dj,"__meta"),children:[(0,u.jsx)("div",{className:"".concat(dj,"__sizeName"),children:c||m}),(0,u.jsx)(dy,{...c?i[c]:h})]}),(0,u.jsx)("img",{alt:t.filename,className:"".concat(dj,"__preview"),src:f})]}),(0,u.jsx)("div",{className:"".concat(dj,"__listWrap"),children:(0,u.jsxs)("div",{className:"".concat(dj,"__list"),children:[(0,u.jsx)(d_,{active:!c,meta:h,name:m,onClick:()=>d(null),previewSrc:p(t)}),Object.entries(i).map(e=>{let[t,n]=e,a=c===t,o=p(n);return o?(0,u.jsx)(d_,{active:a,meta:n,name:t,onClick:()=>d(t),previewSrc:o},t):null})]})})]})},dE="file-field",dN="edit-upload",dD="preview-sizes",dP=e=>e||void 0===e?!e||!!e.name&&""!==e.name||"A file name is required.":"A file is required.",dO=e=>{let t=(0,h.c)(8),{customActions:n,enableAdjustments:a,enablePreviewSizes:o,mimeType:r}=e,{t:i}=(0,s.d)(),{openModal:c}=ne(),d,p;if(t[0]!==n||t[1]!==a||t[2]!==o||t[3]!==r||t[4]!==c||t[5]!==i){p=Symbol.for("react.early_return_sentinel");e:{let e=(0,D.w)(r)&&"image/svg+xml"!==r&&"image/jxl"!==r;if(!e&&(!n||0===n.length)){p=null;break e}d=(0,u.jsxs)("div",{className:"".concat(dE,"__upload-actions"),children:[e&&(0,u.jsxs)(l.Fragment,{children:[o&&(0,u.jsx)(to,{buttonStyle:"pill",className:"".concat(dE,"__previewSizes"),margin:!1,onClick:()=>{c(dD)},size:"small",children:i("upload:previewSizes")}),a&&(0,u.jsx)(to,{buttonStyle:"pill",className:"".concat(dE,"__edit"),margin:!1,onClick:()=>{c(dN)},size:"small",children:i("upload:editImage")})]}),n&&n.map(dR)]})}t[0]=n,t[1]=a,t[2]=o,t[3]=r,t[4]=c,t[5]=i,t[6]=d,t[7]=p}else d=t[6],p=t[7];return p!==Symbol.for("react.early_return_sentinel")?p:d},dT=e=>{var t,n,a,o,r,c;let{collectionSlug:d,customActions:p,initialState:f,onChange:h,resetUploadEdits:m,updateUploadEdits:g,uploadConfig:v,UploadControls:b,uploadEdits:y}=e,{setUploadControlFile:x,setUploadControlFileName:w,setUploadControlFileUrl:C,uploadControlFile:j,uploadControlFileName:S,uploadControlFileUrl:_}=(()=>{let e=(0,l.use)(c9);if(!e)throw Error("useUploadControls must be used within an UploadControlsProvider");return e})(),{config:{routes:{api:k},serverURL:E}}=(0,i.c)(),{t:N}=(0,s.d)(),{setModified:P}=eC(),{id:O,data:T,docPermissions:R,setUploadStatus:I}=aE(),F=e_(),{errorMessage:A,setValue:M,showError:L,value:B}=aA({path:"file",validate:dP}),[V,z]=(0,l.useState)(null),[U,H]=(0,l.useState)(!1),[q,W]=(0,l.useState)((null==B?void 0:B.name)||""),[K,Y]=(0,l.useState)(!1),[G,$]=(0,l.useState)(""),X=(0,l.useRef)(null),Z=(0,l.useRef)(null),Q="object"==typeof(null==v?void 0:v.pasteURL)&&(null==(t=v.pasteURL.allowList)?void 0:t.length)>0,J=(0,l.useCallback)(e=>{let{file:t,isNewFile:n=!0}=e;n&&t instanceof File&&z(URL.createObjectURL(t)),M(t),Y(!1),C(""),w(null),x(null),"function"==typeof h&&h(t)},[h,M,x,w,C]),ee=l.useCallback(e=>{let t=e.target.value;B&&(J({file:((e,t)=>new File([e],t,{type:e.type,lastModified:e.lastModified}))(B,t),isNewFile:!1}),W(t))},[J,B]),et=(0,l.useCallback)(e=>{J({file:null==e?void 0:e[0]})},[J]),en=(0,l.useCallback)(()=>{H(!0),J({file:null}),z(""),$(""),m(),Y(!1),C(""),w(null),x(null)},[J,m,x,w,C]),ea=(0,l.useCallback)(e=>{P(!0),g(e)},[P,g]),eo=(0,l.useCallback)(async()=>{if(!(!G||(null==v?void 0:v.pasteURL)===!1)){I("uploading");try{let e=await fetch(G);if(!e.ok)throw Error("Fetch failed with status: ".concat(e.status));let t=await e.blob(),n=S||decodeURIComponent(G.split("/").pop()||""),a=new File([t],n,{type:t.type});J({file:a}),I("idle");return}catch(e){if(!Q){eF.error("Failed to fetch the file."),I("failed");return}}try{let e="/".concat(d,"/paste-url").concat(O?"/".concat(O,"?"):"?","src=").concat(encodeURIComponent(G)),t=await fetch("".concat(E).concat(k).concat(e));if(!t.ok)throw Error("Fetch failed with status: ".concat(t.status));let n=await t.blob(),a=decodeURIComponent(G.split("/").pop()||""),o=new File([n],a,{type:n.type});J({file:o}),I("idle")}catch(e){eF.error("The provided URL is not allowed."),I("failed")}}},[k,d,G,J,O,E,I,v,S,Q]);(0,l.useEffect)(()=>{var e;(null==f||null==(e=f.file)?void 0:e.value)instanceof File&&(z(URL.createObjectURL(f.file.value)),H(!1))},[f]),(0,l.useEffect)(()=>{K&&X.current},[K]),(0,l.useEffect)(()=>{F&&H(!1)},[F]);let el=null==R?void 0:R.update,er=(null==v||null==(n=v.imageSizes)?void 0:n.length)>0,ei=!!(null==v?void 0:v.resizeOptions),es=(null==v?void 0:v.focalPoint)===!0,{crop:ec=!0,focalPoint:eu=!0}=v,ed=eu&&(er||ei||es),ep=null==(a=v.mimeTypes)?void 0:a.join(", "),ef=(null==v?void 0:v.cacheTags)&&(null==T?void 0:T.updatedAt);return(0,l.useEffect)(()=>{(async()=>{_&&($(_),await eo())})()},[_,eo]),(0,l.useEffect)(()=>{j&&J({file:j})},[j,J]),(0,u.jsxs)("div",{className:[az,dE].filter(Boolean).join(" "),children:[(0,u.jsx)(tU,{message:A,showError:L}),T&&T.filename&&!U&&(0,u.jsx)(dC,{collectionSlug:d,customUploadActions:p,doc:T,enableAdjustments:ec||ed,handleRemove:el?en:void 0,hasImageSizes:er,hideRemoveFile:v.hideRemoveFile,imageCacheTag:ef,uploadConfig:v}),(!v.hideFileInputOnCreate&&!(null==T?void 0:T.filename)||U)&&(0,u.jsxs)("div",{className:"".concat(dE,"__upload"),children:[!B&&!K&&(0,u.jsx)(ue,{onChange:et,children:(0,u.jsxs)("div",{className:"".concat(dE,"__dropzoneContent"),children:[(0,u.jsxs)("div",{className:"".concat(dE,"__dropzoneButtons"),children:[(0,u.jsx)(to,{buttonStyle:"pill",onClick:()=>{Z.current&&Z.current.click()},size:"small",children:N("upload:selectFile")}),(0,u.jsx)("input",{accept:ep,"aria-hidden":"true",className:"".concat(dE,"__hidden-input"),hidden:!0,onChange:e=>{e.target.files&&e.target.files.length>0&&et(e.target.files)},ref:Z,type:"file"}),(null==v?void 0:v.pasteURL)!==!1&&(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)("span",{className:"".concat(dE,"__orText"),children:N("general:or")}),(0,u.jsx)(to,{buttonStyle:"pill",onClick:()=>{Y(!0),C(""),x(null),w(null)},size:"small",children:N("upload:pasteURL")})]}),b||null]}),(0,u.jsxs)("p",{className:"".concat(dE,"__dragAndDropText"),children:[N("general:or")," ",N("upload:dragAndDrop")]})]})}),K&&(0,u.jsxs)(l.Fragment,{children:[(0,u.jsxs)("div",{className:"".concat(dE,"__remote-file-wrap"),children:[(0,u.jsx)("input",{className:"".concat(dE,"__remote-file"),onChange:e=>{$(e.target.value)},ref:X,title:G,type:"text",value:G}),(0,u.jsx)("div",{className:"".concat(dE,"__add-file-wrap"),children:(0,u.jsx)("button",{className:"".concat(dE,"__add-file"),onClick:()=>{eo()},type:"button",children:N("upload:addFile")})})]}),(0,u.jsx)(to,{buttonStyle:"icon-label",className:"".concat(dE,"__remove"),icon:"x",iconStyle:"with-border",onClick:()=>{Y(!1),C(""),x(null),w(null)},round:!0,tooltip:N("general:cancel")})]}),B&&V&&(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)("div",{className:"".concat(dE,"__thumbnail-wrap"),children:(0,u.jsx)(sT,{collectionSlug:d,fileSrc:(0,D.w)(B.type)?V:null})}),(0,u.jsxs)("div",{className:"".concat(dE,"__file-adjustments"),children:[(0,u.jsx)("input",{className:"".concat(dE,"__filename"),onChange:ee,title:q||B.name,type:"text",value:q||B.name}),(0,u.jsx)(dO,{customActions:p,enableAdjustments:ec||ed,enablePreviewSizes:er&&(null==T?void 0:T.filename)&&!U,mimeType:B.type})]}),(0,u.jsx)(to,{buttonStyle:"icon-label",className:"".concat(dE,"__remove"),icon:"x",iconStyle:"with-border",onClick:en,round:!0,tooltip:N("general:cancel")})]})]}),(B||(null==T?void 0:T.filename))&&(0,u.jsx)(tq,{children:(0,u.jsx)(nC,{Header:null,slug:dN,children:(0,u.jsx)(df,{fileName:(null==B?void 0:B.name)||(null==T?void 0:T.filename),fileSrc:(null==T?void 0:T.url)||V,imageCacheTag:ef,initialCrop:null!=(c=null==y?void 0:y.crop)?c:void 0,initialFocalPoint:{x:(null==y||null==(o=y.focalPoint)?void 0:o.x)||(null==T?void 0:T.focalX)||50,y:(null==y||null==(r=y.focalPoint)?void 0:r.y)||(null==T?void 0:T.focalY)||50},onSave:ea,showCrop:ec,showFocalPoint:ed})})}),T&&er&&(0,u.jsx)(nC,{className:"".concat(dE,"__previewDrawer"),hoverTitle:!0,slug:dD,title:N("upload:sizesFor",{label:T.filename}),children:(0,u.jsx)(dk,{doc:T,imageCacheTag:ef,uploadConfig:v})})]})};function dR(e,t){return(0,u.jsx)(l.Fragment,{children:e},t)}function dI(e){let{resetUploadEdits:t,submitted:n,updateUploadEdits:a,uploadEdits:o}=e,{action:r,collectionSlug:s,docPermissions:c,getDocPreferences:d,hasSavePermission:p,initialState:f,isInitializing:h,Upload:m}=aE(),{drawerSlug:g,onSave:v}=(()=>{let e=(0,l.use)(sh);if(!e)throw Error("useDocumentDrawerContext must be used within a DocumentDrawerProvider");return e})(),{getFormState:b}=sn(),{config:{folders:y},getEntityConfig:x}=(0,i.c)(),w=l.useRef(null),C=x({collectionSlug:s}),{reportUpdate:j}=cc(),S=C.slug,[_]=l.useState(S),k=(0,l.useCallback)(e=>{var n;j({doc:(null==e?void 0:e.doc)||(null==e?void 0:e.result),drawerSlug:g,entitySlug:S,operation:"create",updatedAt:(null==e||null==(n=e.result)?void 0:n.updatedAt)||new Date().toISOString()}),"function"==typeof v&&v({...e,operation:"create"}),t()},[S,v,j,t,g]),E=(0,l.useCallback)(async e=>{let{formState:t,submitted:n}=e,a=sf(w),o=await d(),{state:l}=await b({collectionSlug:S,docPermissions:c,docPreferences:o,formState:t,operation:"create",schemaPath:_,signal:a.signal,skipValidation:!n});return w.current=null,l},[S,_,d,b,c]);return(0,l.useEffect)(()=>{let e=w.current;return()=>{sp(e)}},[]),(0,u.jsx)(aO,{operation:"create",children:(0,u.jsxs)(cq,{action:r,className:"".concat("collection-edit","__form"),disabled:h||!p,initialState:h?void 0:f,isInitializing:h,method:"POST",onChange:[E],onSuccess:k,submitted:n,children:[(0,u.jsx)(uN,{BeforeFields:(0,u.jsx)(l.Fragment,{children:m||(0,u.jsx)(dT,{collectionSlug:C.slug,customActions:[y&&C.folders&&(0,u.jsx)(u9,{buttonProps:{buttonStyle:"pill",size:"small"},folderCollectionSlug:y.slug,folderFieldName:y.fieldName},"move-doc-to-folder")].filter(Boolean),initialState:f,resetUploadEdits:t,updateUploadEdits:a,uploadConfig:C.upload,uploadEdits:o})}),docPermissions:c,fields:C.fields,schemaPathSegments:[C.slug]}),(0,u.jsx)(dA,{}),(0,u.jsx)(dF,{})]})})}function dF(){let e=(0,h.c)(4),{getFields:t}=eC(),{getFormDataRef:n}=ud(),a,o;return e[0]!==t||e[1]!==n?(a=()=>{n.current=t},o=[t,n],e[0]=t,e[1]=n,e[2]=a,e[3]=o):(a=e[2],o=e[3]),(0,l.useEffect)(a,o),null}function dA(){let{docConfig:e}=aE(),{activeIndex:t,setFormTotalErrorCount:n}=ud(),a=l.useRef(0),o=l.useCallback(e=>{e!==a.current&&(n({errorCount:e,index:t}),a.current=e)},[t,n]);return e?(0,u.jsx)(oD,{fields:e.fields,path:[],setErrorCount:o}):null}var dM="bulk-upload-drawer--add-more-files",dL="file-selections";function dB(){var e;let t=(0,h.c)(39),{activeIndex:n,addFiles:a,forms:o,isInitializing:r,removeFile:c,setActiveIndex:d,totalErrorCount:p}=ud(),{initialFiles:f,initialForms:m,maxFiles:g}=dJ(),{i18n:v,t:b}=(0,s.d)(),{closeModal:y,openModal:x}=ne(),[w,C]=l.useState(!1),{breakpoints:j}=e1(),S;t[0]!==c?(S=e=>{c(e)},t[0]=c,t[1]=S):S=t[1];let _=S,k;t[2]!==a||t[3]!==y?(k=e=>{a(e),y(dM)},t[2]=a,t[3]=y,t[4]=k):k=t[4];let E=k,N=r?null!=(e=null==f?void 0:f.length)?e:null==m?void 0:m.length:o.length,{collectionSlug:D,selectableCollections:P,setCollectionSlug:O}=dJ(),{getEntityConfig:T}=(0,i.c)(),R=w&&"".concat(dL,"__showingFiles"),I;t[5]!==R?(I=[dL,R].filter(Boolean),t[5]=R,t[6]=I):I=t[6];let F=I.join(" "),A;if(t[7]!==n||t[8]!==j.m||t[9]!==D||t[10]!==y||t[11]!==o||t[12]!==T||t[13]!==E||t[14]!==_||t[15]!==v||t[16]!==f||t[17]!==m||t[18]!==r||t[19]!==g||t[20]!==x||t[21]!==P||t[22]!==d||t[23]!==O||t[24]!==w||t[25]!==b||t[26]!==F||t[27]!==p||t[28]!==N){let e,a,l;t[30]===Symbol.for("react.memo_cache_sentinel")?(e=()=>C(dz),t[30]=e):e=t[30],t[31]!==y?(a=()=>y(dM),t[31]=y,t[32]=a):a=t[32],t[33]!==n||t[34]!==_||t[35]!==v||t[36]!==d||t[37]!==b?(l=(e,t)=>{var a;let{errorCount:o,formID:l,formState:r}=e,i=(null==r||null==(a=r.file)?void 0:a.value)||{};return(0,u.jsxs)("div",{className:["".concat(dL,"__fileRowContainer"),t===n&&"".concat(dL,"__fileRowContainer--active"),o&&o>0&&"".concat(dL,"__fileRowContainer--error")].filter(Boolean).join(" "),children:[(0,u.jsxs)("button",{className:"".concat(dL,"__fileRow"),onClick:()=>d(t),type:"button",children:[(0,u.jsx)(dU,{file:i,formID:l}),(0,u.jsx)("div",{className:"".concat(dL,"__fileDetails"),children:(0,u.jsx)("p",{className:"".concat(dL,"__fileName"),title:i.name,children:i.name||b("upload:noFile")})}),i instanceof File?(0,u.jsx)("p",{className:"".concat(dL,"__fileSize"),children:function(e){let t=e.size,n=0===t?0:Math.floor(Math.log(t)/Math.log(1024));return(t/Math.pow(1024,n)).toFixed(+(n>1))+" "+["B","kB","MB","GB","TB"][n]}(i)}):null,(0,u.jsx)("div",{className:"".concat(dL,"__remove ").concat(dL,"__remove--underlay"),children:(0,u.jsx)(s.a,{})}),o?(0,u.jsx)(tB,{className:"".concat(dL,"__errorCount"),count:o,i18n:v}):null]}),(0,u.jsx)("button",{"aria-label":b("general:remove"),className:"".concat(dL,"__remove ").concat(dL,"__remove--overlay"),onClick:()=>_(t),type:"button",children:(0,u.jsx)(s.a,{})})]},l)},t[33]=n,t[34]=_,t[35]=v,t[36]=d,t[37]=b,t[38]=l):l=t[38],A=(0,u.jsxs)("div",{className:F,children:[j.m&&w?(0,u.jsx)("div",{className:"".concat(dL,"__mobileBlur")}):null,(0,u.jsxs)("div",{className:"".concat(dL,"__header"),children:[(null==P?void 0:P.length)>1&&(0,u.jsx)(cP,{className:"".concat(dL,"__collectionSelect"),isClearable:!1,name:"groupBy",onChange:e=>{O("object"==typeof e&&"value"in e?null==e?void 0:e.value:e)},options:(null==P?void 0:P.map(e=>{let t=T({collectionSlug:e});return{label:t.labels.singular,value:t.slug}}))||[],path:"groupBy",required:!0,value:D}),(0,u.jsxs)("div",{className:"".concat(dL,"__headerTopRow"),children:[(0,u.jsxs)("div",{className:"".concat(dL,"__header__text"),children:[(0,u.jsx)(tB,{count:p,i18n:v,withMessage:!0}),(0,u.jsx)("p",{children:(0,u.jsxs)("strong",{title:"".concat(N," ").concat(b(N>1?"upload:filesToUpload":"upload:fileToUpload")),children:[N," ",b(N>1?"upload:filesToUpload":"upload:fileToUpload")]})})]}),(0,u.jsxs)("div",{className:"".concat(dL,"__header__actions"),children:["number"!=typeof g||Nx(dM),size:"small",children:b("upload:addFile")}):null,(0,u.jsxs)(to,{buttonStyle:"transparent",className:"".concat(dL,"__toggler"),onClick:e,children:[(0,u.jsx)("span",{className:"".concat(dL,"__toggler__label"),children:(0,u.jsxs)("strong",{title:"".concat(N," ").concat(b(N>1?"upload:filesToUpload":"upload:fileToUpload")),children:[N," ",b(N>1?"upload:filesToUpload":"upload:fileToUpload")]})}),(0,u.jsx)(eq,{direction:w?"down":"up"})]}),(0,u.jsx)(nC,{gutter:!1,Header:null,slug:dM,children:(0,u.jsx)(uo,{onCancel:a,onDrop:E})})]})]}),(0,u.jsx)("div",{className:"".concat(dL,"__header__mobileDocActions"),children:(0,u.jsx)(uC,{})})]}),(0,u.jsx)("div",{className:"".concat(dL,"__animateWrapper"),children:(0,u.jsx)(a0,{height:!j.m||w?"auto":0,children:(0,u.jsxs)("div",{className:"".concat(dL,"__filesContainer"),children:[r&&0===o.length&&((null==f?void 0:f.length)>0||(null==m?void 0:m.length)>0)?(f?Array.from(f):m).map(dV):null,o.map(l)]})})})]}),t[7]=n,t[8]=j.m,t[9]=D,t[10]=y,t[11]=o,t[12]=T,t[13]=E,t[14]=_,t[15]=v,t[16]=f,t[17]=m,t[18]=r,t[19]=g,t[20]=x,t[21]=P,t[22]=d,t[23]=O,t[24]=w,t[25]=b,t[26]=F,t[27]=p,t[28]=N,t[29]=A}else A=t[29];return A}function dV(e,t){return(0,u.jsx)(i.f,{animationDelay:"calc(".concat(t," * 60ms)"),height:"35px"},t)}function dz(e){return!e}function dU(e){let{file:t,formID:n}=e,[a,o]=l.useState(null),[r,s]=l.useState(!0);return l.useEffect(()=>{let e=!1;return async function(){s(!0),o(null);try{if((0,D.w)(t.type)){let n=await new Promise((e,n)=>{let a=new Image;a.src=URL.createObjectURL(t),a.onload=()=>{let o,l,r=a.width/a.height;r>1?(l=280,o=280/r):(l=280*r,o=280);let i=new OffscreenCanvas(l,o),s=i.getContext("2d"),c="image/png"===t.type?"image/png":"image/jpeg",u="image/png"===t.type?void 0:.8;s.drawImage(a,0,0,l,o),i.convertToBlob({type:c,...u&&{quality:u}}).then(t=>{URL.revokeObjectURL(a.src);let o=new FileReader;o.onload=()=>e(o.result),o.onerror=n,o.readAsDataURL(t)}).catch(n)},a.onerror=e=>{URL.revokeObjectURL(a.src),n(e)}});e||o(n)}else o(null)}catch(t){e||o(null)}finally{e||s(!1)}}(),()=>{e=!0}},[t]),r?(0,u.jsx)(i.f,{className:"".concat(dL,"__thumbnail-shimmer"),disableInlineStyles:!0}):(0,u.jsx)(sT,{className:"".concat(dL,"__thumbnail"),fileSrc:a},"".concat(n,"-").concat(a||"placeholder"))}var dH="bulk-upload--file-manager";function dq(){let e=(0,h.c)(18),{activeIndex:t,collectionSlug:n,docPermissions:a,documentSlots:o,forms:l,hasPublishPermission:r,hasSavePermission:c,hasSubmitted:p,resetUploadEdits:f,updateUploadEdits:m}=ud(),g=l[t],{getEntityConfig:v}=(0,i.c)(),{i18n:b}=(0,s.d)(),{user:y}=nO(),{openModal:x}=ne(),w;if(e[0]!==g||e[1]!==t||e[2]!==n||e[3]!==a||e[4]!==o||e[5]!==l.length||e[6]!==v||e[7]!==r||e[8]!==c||e[9]!==p||e[10]!==b||e[11]!==x||e[12]!==f||e[13]!==m||e[14]!==y){let i=v({collectionSlug:n}),s;e[16]!==x?(s=()=>x(uj),e[16]=x,e[17]=s):s=e[17],w=(0,u.jsxs)("div",{className:dH,children:[(0,u.jsx)(dB,{}),(0,u.jsxs)("div",{className:"".concat(dH,"__editView"),children:[(0,u.jsx)(un,{onClose:s,title:(0,d.s)(i.labels.singular,b)}),g?(0,u.jsxs)(aD,{collectionSlug:n,currentEditor:y,docPermissions:a,hasPublishedDoc:!1,hasPublishPermission:r,hasSavePermission:c,id:null,initialData:(0,F.r)(g.formState,!0),initialState:g.formState,isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,Upload:o.Upload,versionCount:0,children:[(0,u.jsx)(uw,{collectionConfig:i}),(0,u.jsx)(dI,{resetUploadEdits:f,submitted:p,updateUploadEdits:m,uploadEdits:null==g?void 0:g.uploadEdits})]},"".concat(t,"-").concat(l.length)):null]}),(0,u.jsx)(uS,{})]}),e[0]=g,e[1]=t,e[2]=n,e[3]=a,e[4]=o,e[5]=l.length,e[6]=v,e[7]=r,e[8]=c,e[9]=p,e[10]=b,e[11]=x,e[12]=f,e[13]=m,e[14]=y,e[15]=w}else w=e[15];return w}function dW(){var e,t;let{addFiles:n,forms:a,isInitializing:o}=ud(),{closeModal:r}=ne(),{collectionSlug:c,drawerSlug:d}=dJ(),{getEntityConfig:p}=(0,i.c)(),{t:f}=(0,s.d)(),h=null==(t=p({collectionSlug:c}))||null==(e=t.upload)?void 0:e.mimeTypes,m=l.useCallback(e=>{let t=new DataTransfer;for(let n of e)(void 0===h||0===h.length||(0,B.d)(n.type,h))&&t.items.add(n);0===t.files.length?eF.error(f("error:invalidFileType")):n(t.files)},[n,f,h]);return c?a.length||o?(0,u.jsx)(dq,{}):(0,u.jsx)(uo,{acceptMimeTypes:null==h?void 0:h.join(", "),onCancel:()=>r(d),onDrop:m}):null}function dK(){let e,t,n=(0,h.c)(17),{drawerSlug:a,onCancel:o,setInitialFiles:r,setInitialForms:i,setOnCancel:s,setOnSuccess:c,setSelectableCollections:d,setSuccessfullyUploaded:p,successfullyUploaded:f}=dJ(),{modalState:m}=ne(),g=l.useRef(m),v;n[0]!==a||n[1]!==o||n[2]!==r||n[3]!==i||n[4]!==s||n[5]!==c||n[6]!==d||n[7]!==p||n[8]!==f?(v=e=>{let t=g.current[a],n=e[a];typeof n>"u"&&typeof t>"u"||((null==t?void 0:t.isOpen)!==(null==n?void 0:n.isOpen)&&((null==n?void 0:n.isOpen)||(f||"function"==typeof o&&o(),r(void 0),i(void 0),s(d$),c(dY),d(null),p(!1))),g.current=e)},n[0]=a,n[1]=o,n[2]=r,n[3]=i,n[4]=s,n[5]=c,n[6]=d,n[7]=p,n[8]=f,n[9]=v):v=n[9];let b=nN(v),y;return n[10]!==m||n[11]!==b?(y=()=>{b(m)},n[10]=m,n[11]=b,n[12]=y):y=n[12],n[13]!==m?(e=[m],n[13]=m,n[14]=e):e=n[14],(0,l.useEffect)(y,e),n[15]!==a?(t=(0,u.jsx)(nC,{gutter:!1,Header:null,slug:a,children:(0,u.jsx)(uu,{children:(0,u.jsx)(c8,{children:(0,u.jsx)(tq,{children:(0,u.jsx)(dW,{})})})})}),n[15]=a,n[16]=t):t=n[16],t}function dY(){return dG}function dG(){return null}function d$(){return dX}function dX(){return null}var dZ=l.createContext({collectionSlug:"",drawerSlug:"",initialFiles:void 0,initialForms:[],maxFiles:void 0,onCancel:()=>null,onSuccess:()=>null,selectableCollections:null,setCollectionSlug:()=>null,setInitialFiles:()=>null,setInitialForms:()=>null,setMaxFiles:()=>null,setOnCancel:()=>null,setOnSuccess:()=>null,setSelectableCollections:()=>null,setSuccessfullyUploaded:()=>!1,successfullyUploaded:!1});function dQ(e){let t,n,a,o=(0,h.c)(17),{children:r,drawerSlugPrefix:i}=e,[s,c]=l.useState(null),[d,p]=l.useState(),[f,m]=l.useState(),[g,v]=l.useState(),[b,y]=l.useState(void 0),[x,w]=l.useState(void 0),[C,j]=l.useState(void 0),[S,_]=l.useState(!1),k="".concat(i?"".concat(i,"-"):"").concat((t=n_(),"".concat("bulk-upload-drawer-slug","-").concat(t||1))),E;o[0]===Symbol.for("react.memo_cache_sentinel")?(E=e=>{m(()=>e)},o[0]=E):E=o[0];let N=E,D;o[1]===Symbol.for("react.memo_cache_sentinel")?(D=e=>{v(()=>e)},o[1]=D):D=o[1];let P=D,O;return o[2]!==g?(O=()=>{"function"==typeof g&&g()},o[2]=g,o[3]=O):O=o[3],o[4]!==f?(n=(e,t)=>{"function"==typeof f&&f(e,t)},o[4]=f,o[5]=n):n=o[5],o[6]!==r||o[7]!==d||o[8]!==k||o[9]!==b||o[10]!==x||o[11]!==C||o[12]!==s||o[13]!==S||o[14]!==O||o[15]!==n?(a=(0,u.jsx)(dZ,{value:{collectionSlug:d,drawerSlug:k,initialFiles:b,initialForms:x,maxFiles:C,onCancel:O,onSuccess:n,selectableCollections:s,setCollectionSlug:p,setInitialFiles:y,setInitialForms:w,setMaxFiles:j,setOnCancel:P,setOnSuccess:N,setSelectableCollections:c,setSuccessfullyUploaded:_,successfullyUploaded:S},children:(0,u.jsxs)(l.Fragment,{children:[r,(0,u.jsx)(dK,{})]})}),o[6]=r,o[7]=d,o[8]=k,o[9]=b,o[10]=x,o[11]=C,o[12]=s,o[13]=S,o[14]=O,o[15]=n,o[16]=a):a=o[16],a}var dJ=()=>l.use(dZ),d0="upload-relationship-details";function d1(e){var t,n;let a=(0,h.c)(11),{id:o,allowEdit:l,allowRemove:r,alt:c,byteSize:p,className:f,collectionSlug:m,displayPreview:g,filename:v,mimeType:b,onRemove:y,reloadDoc:x,showCollectionSlug:w,src:C,thumbnailSrc:j,withMeta:S,x:_,y:k}=e,E=void 0===S||S,{config:N}=(0,i.c)(),{i18n:D}=(0,s.d)(),P="collections"in N?N.collections.find(e=>e.slug===m):void 0,O=C?o:void 0,T;a[0]!==m||a[1]!==O?(T={id:O,collectionSlug:m},a[0]=m,a[1]=O,a[2]=T):T=a[2];let[R,,I]=sx(T),{openDrawer:F}=I,A;a[3]!==m||a[4]!==x?(A=async e=>{let{doc:t}=e;return x(t.id,m)},a[3]=m,a[4]=x,a[5]=A):A=a[5];let M=A,L;a[6]!==_||a[7]!==k?(L=function(e,t){let n=[];return t&&n.push((0,H.B)(t)),_&&k&&n.push("".concat(_,"x").concat(k)),e&&n.push(e),n.join(" — ")},a[6]=_,a[7]=k,a[8]=L):L=a[8];let B=E?L(b,p):"",V=null==(n=null!=g?g:null==P||null==(t=P.upload)?void 0:t.displayPreview)||n,z;return a[9]!==f?(z=[d0,f].filter(Boolean),a[9]=f,a[10]=z):z=a[10],(0,u.jsxs)("div",{className:z.join(" "),children:[(0,u.jsxs)("div",{className:"".concat(d0,"__imageAndDetails"),children:[V&&(0,u.jsx)(sR,{alt:c,className:"".concat(d0,"__thumbnail"),filename:v,fileSrc:j,size:"small"}),void 0!==w&&w&&P?(0,u.jsx)(oe,{size:"small",children:(0,d.s)(P.labels.singular,D)}):null,(0,u.jsxs)("div",{className:"".concat(d0,"__details"),children:[(0,u.jsx)("p",{className:"".concat(d0,"__filename"),children:C?(0,u.jsx)("a",{href:C,target:"_blank",children:v}):v}),E?(0,u.jsx)("p",{className:"".concat(d0,"__meta"),children:B}):null]})]}),!1!==l||!1!==r?(0,u.jsxs)("div",{className:"".concat(d0,"__actions"),children:[!1!==l?(0,u.jsx)(to,{buttonStyle:"icon-label",className:"".concat(d0,"__edit"),icon:"edit",iconStyle:"none",onClick:F}):null,!1!==r?(0,u.jsx)(to,{buttonStyle:"icon-label",className:"".concat(d0,"__remove"),icon:"x",iconStyle:"none",onClick:()=>y()}):null,(0,u.jsx)(R,{onSave:M})]}):null]})}var d3="upload-field-card";function d2(e){let{children:t,className:n,size:a="medium"}=e;return(0,u.jsx)("div",{className:[d3,n,"".concat(d3,"--size-").concat(a)].filter(Boolean).join(" "),children:t})}var d6="upload upload--has-many";function d5(e){let t=(0,h.c)(29),{className:n,displayPreview:a,fileDocs:o,isSortable:l,onRemove:r,onReorder:i,readonly:s,reloadDoc:c,serverURL:d,showCollectionSlug:p}=e,f=void 0!==p&&p,m;t[0]!==o||t[1]!==i?(m=(e,t)=>{if(e===t)return;let n=[...o],[a]=n.splice(e,1);n.splice(t,0,a),i(n)},t[0]=o,t[1]=i,t[2]=m):m=t[2];let g=m,v;t[3]!==o||t[4]!==r?(v=e=>{let t=[...o||[]];t.splice(e,1),r(0===t.length?[]:t)},t[3]=o,t[4]=r,t[5]=v):v=t[5];let b=v,y;t[6]!==n?(y=[d6,n].filter(Boolean),t[6]=n,t[7]=y):y=t[7];let x=y.join(" "),w;if(t[8]!==a||t[9]!==o||t[10]!==l||t[11]!==g||t[12]!==s||t[13]!==c||t[14]!==b||t[15]!==d||t[16]!==f||t[17]!==x){let e,n;t[19]!==g?(e=e=>{let{moveFromIndex:t,moveToIndex:n}=e;return g(t,n)},t[19]=g,t[20]=e):e=t[20],t[21]!==a||t[22]!==l||t[23]!==s||t[24]!==c||t[25]!==b||t[26]!==d||t[27]!==f?(n=(e,t)=>{let{relationTo:n,value:o}=e,r=String(o.id),i,p;if(o.url)try{i=new URL(o.url,d).toString()}catch(e){i="".concat(d).concat(o.url)}if(o.thumbnailURL)try{p=new URL(o.thumbnailURL,d).toString()}catch(e){p="".concat(d).concat(o.thumbnailURL)}return(0,D.w)(o.mimeType)&&(p=(0,P.k)({sizes:o.sizes,thumbnailURL:p,url:i,width:o.width})),(0,u.jsx)(tA,{disabled:!l||s,id:r,children:e=>(0,u.jsx)("div",{className:["".concat(d6,"__dragItem"),e&&l&&"".concat(d6,"--has-drag-handle")].filter(Boolean).join(" "),ref:e.setNodeRef,style:{transform:e.transform,transition:e.transition,zIndex:e.isDragging?1:void 0},children:(0,u.jsxs)(d2,{size:"small",children:[e&&(0,u.jsx)("div",{className:"".concat(d6,"__drag"),...e.attributes,...e.listeners,children:(0,u.jsx)(aJ,{})}),(0,u.jsx)(d1,{allowEdit:!s,allowRemove:!s,alt:(null==o?void 0:o.alt)||(null==o?void 0:o.filename),byteSize:o.filesize,collectionSlug:n,displayPreview:a,filename:o.filename,id:r,mimeType:null==o?void 0:o.mimeType,onRemove:()=>b(t),reloadDoc:c,showCollectionSlug:f,src:i,thumbnailSrc:p,withMeta:!1,x:null==o?void 0:o.width,y:null==o?void 0:o.height})]})})},r)},t[21]=a,t[22]=l,t[23]=s,t[24]=c,t[25]=b,t[26]=d,t[27]=f,t[28]=n):n=t[28],w=(0,u.jsx)("div",{className:x,children:(0,u.jsx)(tM,{className:"".concat(d6,"__draggable-rows"),ids:null==o?void 0:o.map(d4),onDragEnd:e,children:o.map(n)})}),t[8]=a,t[9]=o,t[10]=l,t[11]=g,t[12]=s,t[13]=c,t[14]=b,t[15]=d,t[16]=f,t[17]=x,t[18]=w}else w=t[18];return w}function d4(e){let{value:t}=e;return String(t.id)}function d9(e){let{className:t,displayPreview:n,fileDoc:a,onRemove:o,readonly:l,reloadDoc:r,serverURL:i,showCollectionSlug:s=!1}=e,{relationTo:c,value:d}=a,p=String(null==d?void 0:d.id),f,h;if(d.url)try{f=new URL(d.url,i).toString()}catch(e){f="".concat(i).concat(d.url)}if(d.thumbnailURL)try{h=new URL(d.thumbnailURL,i).toString()}catch(e){h="".concat(i).concat(d.thumbnailURL)}return(0,D.w)(d.mimeType)&&(h=(0,P.k)({sizes:d.sizes,thumbnailURL:h,url:f,width:d.width})),(0,u.jsx)(d2,{className:["upload upload--has-one",t].filter(Boolean).join(" "),children:(0,u.jsx)(d1,{allowEdit:!l,allowRemove:!l,alt:(null==d?void 0:d.alt)||(null==d?void 0:d.filename),byteSize:d.filesize,collectionSlug:c,displayPreview:n,filename:d.filename,id:p,mimeType:null==d?void 0:d.mimeType,onRemove:o,reloadDoc:r,showCollectionSlug:s,src:f,thumbnailSrc:h,x:null==d?void 0:d.width,y:null==d?void 0:d.height})})}var d8="upload";function d7(e){var t;let{AfterInput:n,allowCreate:a,api:o,BeforeInput:r,className:c,Description:d,description:p,displayPreview:f,Error:h,filterOptions:m,hasMany:g,isSortable:b,Label:y,label:x,localized:w,maxRows:C,onChange:j,path:S,readOnly:_,relationTo:k,required:E,serverURL:N,showError:D,style:P,value:O}=e,[T,R]=l.useState(),[I]=l.useState(Array.isArray(k)?k[0]:k),{openModal:F}=ne(),{drawerSlug:A,setCollectionSlug:M,setInitialFiles:L,setMaxFiles:B,setOnSuccess:V,setSelectableCollections:z}=dJ(),{permissions:U}=nO(),{code:H}=nI(),{i18n:q,t:W}=(0,s.d)(),K=(0,l.useMemo)(()=>Array.isArray(k)?k.filter(e=>{var t,n;return(null==U?void 0:U.collections)&&(null==(n=U.collections)||null==(t=n[e])?void 0:t.create)}):[],[k,U]),Y=(0,l.useMemo)(()=>{let e=Array.isArray(k);if(!O)return m;let t={};for(let n of Array.isArray(O)?O:[O])if(e&&"object"==typeof n&&"relationTo"in n)t[n.relationTo]||(t[n.relationTo]=[]),t[n.relationTo].push(n.value);else if(!e){t[k]||(t[k]=[]);let e="object"==typeof n&&"value"in n?n.value:n;("string"==typeof e||"number"==typeof e)&&t[k].push(e)}let n={...m};return(e?k:[k]).forEach(e=>{var a,o,l;let r=t[e]||[];n[e]={...(null==m?void 0:m[e])||{},id:{...(null==m||null==(a=m[e])?void 0:a.id)||{},not_in:((null==m||null==(l=m[e])||null==(o=l.id)?void 0:o.not_in)||[]).concat(r)}}}),n},[O,m,k]),[G,,{closeDrawer:$,openDrawer:X}]=cl({collectionSlugs:"string"==typeof k?[k]:k,filterOptions:Y}),[Z,,{closeDrawer:Q,openDrawer:J}]=sx({collectionSlug:I}),ee=l.useRef(null),et=(0,l.useMemo)(()=>{var e,t;return!!a&&!!("string"==typeof I&&(null==U?void 0:U.collections)&&(null==(t=U.collections)||null==(e=t[I])?void 0:e.create))},[I,U,a]),en=l.useCallback(e=>{"function"==typeof j&&j(e)},[j]),ea=l.useCallback(async e=>{if(!(null==e?void 0:e.length))return[];let t={};e.forEach(e=>{let{relationTo:n,value:a}=e;t[n]||(t[n]=[]);let o=a;a&&"object"==typeof a&&"value"in a&&(o=a.value),t[n].push(o)});let n=Object.entries(t).map(async e=>{let[t,n]=e,a={depth:0,draft:!0,limit:n.length,locale:H,where:{and:[{id:{in:n}}]}},l=await fetch("".concat(N).concat(o,"/").concat(t),{body:v.A(a),credentials:"include",headers:{"Accept-Language":q.language,"Content-Type":"application/x-www-form-urlencoded","X-Payload-HTTP-Method-Override":"GET"},method:"POST"}),r=[];return l.ok&&(r=(await l.json()).docs),{collection:t,docsById:r.reduce((e,t)=>(e[t.id]=t,e),{})}}),a=await Promise.all(n),l={};return a.forEach(e=>{let{collection:t,docsById:n}=e;l[t]=n}),e.map(e=>{var t;let{relationTo:n,value:a}=e,o=(null==(t=l[n])?void 0:t[a])||{id:a,filename:"".concat(W("general:untitled")," - ID: ").concat(a),isPlaceholder:!0};return{relationTo:n,value:o}})},[N,o,H,q.language,W]),eo=(0,l.useCallback)(e=>(function(e,t){let n=Array.isArray(t);if("string"==typeof e||"number"==typeof e)return e;if(e&&"object"==typeof e&&"relationTo"in e&&"value"in e){let t=e.value;for(;t&&"object"==typeof t&&null!==t&&"value"in t;)t=t.value;return t&&"object"==typeof t&&null!==t&&"id"in t&&(t=t.id),n?{relationTo:e.relationTo,value:t}:t}return e&&"object"==typeof e&&"id"in e?e.id:e})(e,k),[k]),er=(0,l.useCallback)(e=>{let t=Array.isArray(k);if(g){let n=e.map(e=>t?{relationTo:e.collectionSlug,value:e.doc.id}:e.doc.id);en([...Array.isArray(O)?O.map(eo):[],...n]),R(t=>[...t||[],...e.map(e=>({relationTo:e.collectionSlug,value:e.doc}))])}else{let n=e[0];en(t?{relationTo:n.collectionSlug,value:n.doc.id}:n.doc.id),R([{relationTo:n.collectionSlug,value:n.doc}])}},[O,en,g,k,eo]),ei=l.useCallback(e=>{let t=e;if(!g&&e&&e.length>1){let n=new DataTransfer;n.items.add(e[0]),t=n.files}t&&L(t),M(Array.isArray(k)?I:k),Array.isArray(K)&&z(K),"number"==typeof C&&B(C),F(A)},[g,k,I,M,K,C,F,A,L,z,B]),es=l.useCallback(async e=>{let t=Array.isArray(k),n=[];for(let[t,a]of e)a&&n.push(t);let a=n.map(e=>({relationTo:I,value:e})),o=await ea(a);o&&R(e=>[...e||[],...o]);let l=n.map(e=>t?{relationTo:I,value:e}:e);en([...Array.isArray(O)?O.map(eo):[],...l]),$()},[I,$,en,ea,O,k,eo]),ec=l.useCallback(e=>{let t=Array.isArray(k);e.doc&&(R(t=>[...t||[],{relationTo:I,value:e.doc}]),en(t?{relationTo:I,value:e.doc.id}:e.doc.id)),Q()},[Q,I,en,k]),eu=(0,l.useCallback)(async e=>{var t;let{collectionSlug:n,doc:a}=e,o=Array.isArray(k),l=(null==(t=await ea([{relationTo:n,value:a.id}]))?void 0:t[0])||null;if(R(e=>l?g?[...e||[],l]:[l]:e),g){let e=o?{relationTo:n,value:a.id}:a.id;en([...Array.isArray(O)?O.map(eo):[],e])}else en(o?{relationTo:n,value:a.id}:a.id);$()},[$,g,ea,en,O,k,eo]),ed=l.useCallback(async(e,t)=>{let n=await ea([{relationTo:t,value:e}]);if(n[0]){let e=[];R(a=>{let o=null==a?void 0:a.findIndex(e=>{var a,o;return((null==(a=e.value)?void 0:a.id)===n[0].value.id||(null==(o=e.value)?void 0:o.isPlaceholder))&&e.relationTo===t});if(o>-1){let t=[...a];return t[o]=n[0],e=t,t}return a}),e.length&&g&&en(e.map(e=>{var t;return null==(t=e.value)?void 0:t.id}))}},[ea,en,g]),ep=l.useCallback(e=>{let t=Array.isArray(k);en(e.map(e=>{let{relationTo:n,value:a}=e;return t?{relationTo:n,value:a.id}:a.id})),R(e)},[en,k]),ef=l.useCallback(e=>{let t=Array.isArray(k);if(!e||0===e.length){en(g?[]:null),R(g?[]:null);return}let n=e.map(e=>{let{relationTo:n,value:a}=e;return t?{relationTo:n,value:a.id}:a.id});en(g?n:n[0]),R(e)},[en,g,k]);(0,l.useEffect)(()=>{async function e(){if(O){let e=[];if(Array.isArray(k)&&("object"==typeof O&&"relationTo"in O||Array.isArray(O)&&O.length>0&&"object"==typeof O[0]&&"relationTo"in O[0])?e=(Array.isArray(O)?O:[O]).filter(e=>"object"==typeof e&&"relationTo"in e).map(e=>{let t=e.value;for(;t&&"object"==typeof t&&null!==t&&"value"in t;)t=t.value;return{relationTo:e.relationTo,value:t}}):Array.isArray(k)||(e=(Array.isArray(O)?O:[O]).map(e=>{let t=e;for(;t&&"object"==typeof t&&null!==t&&"value"in t;)t=t.value;return{relationTo:k,value:t}})),e.length>0){let t=await ea(e);t&&(R(t),ee.current=O)}}else R([]),ee.current=null}ee.current!==O&&e()},[ea,O,k]),(0,l.useEffect)(()=>{V(er)},[O,S,er,V]);let eh=!O||g&&Array.isArray(O)&&("number"!=typeof C||O.length"u";return(0,u.jsxs)("div",{className:[az,d8,c,D&&"error",_&&"read-only"].filter(Boolean).join(" "),id:"field-".concat(null==S?void 0:S.replace(/\./g,"__")),style:P,children:[(0,u.jsx)(el,{CustomComponent:y,Fallback:(0,u.jsx)(nA,{label:x,localized:w,path:S,required:E})}),(0,u.jsx)("div",{className:"".concat(d8,"__wrap"),children:(0,u.jsx)(el,{CustomComponent:h,Fallback:(0,u.jsx)(tU,{path:S,showError:D})})}),r,(0,u.jsxs)("div",{className:"".concat(d8,"__dropzoneAndUpload"),children:[g&&Array.isArray(O)&&O.length>0?(0,u.jsx)(u.Fragment,{children:T&&(null==T?void 0:T.length)>0?(0,u.jsx)(d5,{displayPreview:f,fileDocs:T,isSortable:b&&!_,onRemove:ef,onReorder:ep,readonly:_,reloadDoc:ed,serverURL:N,showCollectionSlug:Array.isArray(k)}):(0,u.jsx)("div",{className:"".concat(d8,"__loadingRows"),children:O.map(e=>(0,u.jsx)(i.f,{height:"40px"},"object"==typeof e?e.value:e))})}):null,!g&&O?(0,u.jsx)(u.Fragment,{children:T&&(null==T?void 0:T.length)>0&&T[0].value?(0,u.jsx)(d9,{displayPreview:f,fileDoc:T[0],onRemove:ef,readonly:_,reloadDoc:ed,serverURL:N,showCollectionSlug:Array.isArray(k)}):!T||!O||(null==T||null==(t=T[0])?void 0:t.value)?(0,u.jsx)(i.f,{height:"62px"}):(0,u.jsxs)(u.Fragment,{children:[W("general:untitled")," - ID: ",O]})}):null,eh?(0,u.jsx)(ue,{disabled:_||!et,multipleFiles:g,onChange:ei,children:(0,u.jsxs)("div",{className:"".concat(d8,"__dropzoneContent"),children:[(0,u.jsxs)("div",{className:"".concat(d8,"__dropzoneContent__buttons"),children:[et&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(to,{buttonStyle:"pill",className:"".concat(d8,"__createNewToggler"),disabled:_||!et,onClick:()=>{_||(g?ei():J())},size:"small",children:W("general:createNew")}),(0,u.jsx)("span",{className:"".concat(d8,"__dropzoneContent__orText"),children:W("general:or")})]}),(0,u.jsx)(to,{buttonStyle:"pill",className:"".concat(d8,"__listToggler"),disabled:_,onClick:X,size:"small",children:W("fields:chooseFromExisting")}),(0,u.jsx)(Z,{onSave:ec}),(0,u.jsx)(G,{allowCreate:et,enableRowSelections:g,onBulkSelect:es,onSelect:eu})]}),et&&!_&&(0,u.jsxs)("p",{className:"".concat(d8,"__dragAndDropText"),children:[W("general:or")," ",W("upload:dragAndDrop")]})]})}):(0,u.jsx)(u.Fragment,{children:!_&&!T&&(!O||"number"!=typeof C||Array.isArray(O)&&O.length{if("function"==typeof v)return v(e,{...t,required:h})},[v,h])}),O=Array.isArray(f),T=l.useMemo(()=>!0===s&&Array.isArray(P)?P.map(e=>O?e:{relationTo:Array.isArray(f)?f[0]:f,value:e}):P,[s,P,O,f]),R=(0,l.useMemo)(()=>aV(t),[t]);return(0,u.jsx)(dQ,{drawerSlugPrefix:m,children:(0,u.jsx)(d7,{AfterInput:x,allowCreate:!1!==n,api:b.routes.api,BeforeInput:w,className:a,Description:C,description:o,displayPreview:y,Error:j,filterOptions:k,hasMany:s,isSortable:r,label:c,Label:S,localized:d,maxRows:p,onChange:N,path:E,readOnly:g||_,relationTo:f,required:h,serverURL:b.serverURL,showError:D,style:R,value:T})})});function pt(e){let t=(0,h.c)(13),{clientFieldConfig:n,forceRender:a,indexPath:o,parentPath:l,parentSchemaPath:r,path:i,permissions:s,readOnly:c,schemaPath:d}=e,p;t[0]!==i?(p=e=>{var t,n;let[a]=e;return a&&(null==a||null==(n=a[i])||null==(t=n.customComponents)?void 0:t.Field)},t[0]=i,t[1]=p):p=t[1];let f=eE(p),m;if(t[2]!==f||t[3]!==n||t[4]!==a||t[5]!==o||t[6]!==l||t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==c||t[11]!==d){m=Symbol.for("react.early_return_sentinel");e:{var g;let e={forceRender:a,permissions:s,readOnly:c,schemaPath:d};if(null==(g=n.admin)?void 0:g.hidden){m=(0,u.jsx)(i1,{...e,path:i});break e}if(void 0!==f){m=f||null;break e}let t={...e,indexPath:o,parentPath:l,parentSchemaPath:r};switch(n.type){case"array":m=(0,u.jsx)(pi,{...t,field:n,path:i});break e;case"blocks":m=(0,u.jsx)(oj,{...t,field:n,path:i});break e;case"checkbox":m=(0,u.jsx)(aG,{...e,field:n,path:i});break e;case"code":m=(0,u.jsx)(oE,{...e,field:n,path:i});break e;case"collapsible":m=(0,u.jsx)(oO,{...t,field:n,path:i});break e;case"date":m=(0,u.jsx)(iW,{...e,field:n,path:i});break e;case"email":m=(0,u.jsx)(iK,{...e,field:n,path:i});break e;case"group":m=(0,u.jsx)(i0,{...t,field:n,path:i});break e;case"join":m=(0,u.jsx)(s0,{...e,field:n,path:i});break e;case"json":m=(0,u.jsx)(s1,{...e,field:n,path:i});break e;case"number":m=(0,u.jsx)(s3,{...e,field:n,path:i});break e;case"point":m=(0,u.jsx)(s6,{...e,field:n,path:i});break e;case"radio":m=(0,u.jsx)(s8,{...e,field:n,path:i});break e;case"relationship":m=(0,u.jsx)(cE,{...e,field:n,path:i});break e;case"richText":m=(0,u.jsx)(cN,{...e,field:n,path:i});break e;case"row":m=(0,u.jsx)(cD,{...t,field:n});break e;case"select":m=(0,u.jsx)(cO,{...e,field:n,path:i});break e;case"tabs":m=(0,u.jsx)(c$,{...t,field:n,path:i});break e;case"text":m=(0,u.jsx)(c2,{...e,field:n,path:i});break e;case"textarea":m=(0,u.jsx)(c5,{...e,field:n,path:i});break e;case"ui":m=(0,u.jsx)(c4,{});break e;case"upload":m=(0,u.jsx)(pe,{...e,field:n,path:i});break e}}t[2]=f,t[3]=n,t[4]=a,t[5]=o,t[6]=l,t[7]=r,t[8]=i,t[9]=s,t[10]=c,t[11]=d,t[12]=m}else m=t[12];if(m!==Symbol.for("react.early_return_sentinel"))return m}var pn="render-fields",pa=e=>{let t=(0,h.c)(22),{className:n,fields:a,forceRender:o,margins:l,parentIndexPath:r,parentPath:i,parentSchemaPath:s,permissions:c,readOnly:d}=e,p=aT();if(a&&a.length>0){let e=l&&"".concat(pn,"--margins-").concat(l),f=!1===l&&"".concat(pn,"--margins-none"),h;t[0]!==n||t[1]!==e||t[2]!==f?(h=[pn,n,e,f].filter(Boolean),t[0]=n,t[1]=e,t[2]=f,t[3]=h):h=t[3];let g=h.join(" "),v;if(t[4]!==a||t[5]!==o||t[6]!==p||t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==c||t[11]!==d||t[12]!==g){let e;t[14]!==o||t[15]!==p||t[16]!==r||t[17]!==i||t[18]!==s||t[19]!==c||t[20]!==d?(e=(e,t)=>{var n,a;if(!e||(0,m.I2)(e))return null;let{operation:l,permissions:f,read:h}=(0,x.P)({field:e,operation:p,parentName:(null==i?void 0:i.includes("."))?i.split(".")[i.split(".").length-1]:i,permissions:c});if("name"in e&&!h)return null;let g=d||(null==e||null==(n=e.admin)?void 0:n.readOnly);g&&(null==(a=e.admin)?void 0:a.readOnly)===!1&&(g=!1),"name"in e&&!l&&(g=!0);let{indexPath:v,path:b,schemaPath:y}=(0,w.Z)({field:e,index:t,parentIndexPath:r,parentPath:i,parentSchemaPath:s});return(0,u.jsx)(aR,{value:b,children:(0,u.jsx)(pt,{clientFieldConfig:e,forceRender:o,indexPath:v,parentPath:i,parentSchemaPath:s,path:b,permissions:f,readOnly:g,schemaPath:y})},"".concat(b,"-").concat(t))},t[14]=o,t[15]=p,t[16]=r,t[17]=i,t[18]=s,t[19]=c,t[20]=d,t[21]=e):e=t[21],v=(0,u.jsx)(a4,{className:g,forceRender:o,children:a.map(e)}),t[4]=a,t[5]=o,t[6]=p,t[7]=r,t[8]=i,t[9]=s,t[10]=c,t[11]=d,t[12]=g,t[13]=v}else v=t[13];return v}return null},po="array-field",pl=e=>{let t=(0,h.c)(40),{addRow:n,attributes:a,copyRow:o,CustomRowLabel:l,duplicateRow:r,errorCount:c,fields:p,forceRender:f,hasMaxRows:m,isDragging:g,isLoading:v,isSortable:b,labels:y,listeners:x,moveRow:w,parentPath:C,pasteRow:j,path:S,permissions:_,readOnly:k,removeRow:E,row:N,rowCount:D,rowIndex:P,schemaPath:O,setCollapse:T,setNodeRef:R,transform:I,transition:F}=e,A=void 0!==f&&f,M=ot(v,500),{i18n:L}=(0,s.d)(),B=eS(),V="".concat((0,d.s)(y.singular,L)," ").concat(String(P+1).padStart(2,"0")),z=c>0&&B,U=z?"".concat(po,"__row--has-errors"):"".concat(po,"__row--no-errors"),H;t[0]!==U?(H=["".concat(po,"__row"),U].filter(Boolean),t[0]=U,t[1]=H):H=t[1];let q=H.join(" "),W="".concat(C.split(".").join("-"),"-row-").concat(P),K=g?1:void 0,Y;if(t[2]!==l||t[3]!==n||t[4]!==a||t[5]!==q||t[6]!==o||t[7]!==r||t[8]!==c||t[9]!==V||t[10]!==z||t[11]!==p||t[12]!==A||t[13]!==m||t[14]!==L||t[15]!==M||t[16]!==b||t[17]!==x||t[18]!==w||t[19]!==C||t[20]!==j||t[21]!==S||t[22]!==_||t[23]!==k||t[24]!==E||t[25]!==N.collapsed||t[26]!==N.id||t[27]!==D||t[28]!==P||t[29]!==O||t[30]!==T||t[31]!==R||t[32]!==W||t[33]!==K||t[34]!==I||t[35]!==F){let e;t[37]!==N.id||t[38]!==T?(e=e=>T(N.id,e),t[37]=N.id,t[38]=T,t[39]=e):e=t[39],Y=(0,u.jsx)("div",{id:W,ref:R,style:{transform:I,transition:F,zIndex:K},children:(0,u.jsx)(a5,{actions:k?void 0:(0,u.jsx)(aQ,{addRow:n,copyRow:o,duplicateRow:r,hasMaxRows:m,index:P,isSortable:b,moveRow:w,pasteRow:j,removeRow:E,rowCount:D}),className:q,collapsibleStyle:z?"error":"default",dragHandleProps:b?{id:N.id,attributes:a,listeners:x}:void 0,header:(0,u.jsxs)("div",{className:"".concat(po,"__row-header"),children:[M?(0,u.jsx)(i.f,{height:"1rem",width:"8rem"}):(0,u.jsx)(eO,{CustomComponent:l,label:V,path:S,rowNumber:P}),z&&(0,u.jsx)(tB,{count:c,i18n:L,withMessage:!0})]}),isCollapsed:N.collapsed,onToggle:e,children:M?(0,u.jsx)(i.f,{}):(0,u.jsx)(pa,{className:"".concat(po,"__fields"),fields:p,forceRender:A,margins:"small",parentIndexPath:"",parentPath:S,parentSchemaPath:O,permissions:!0===_?_:null==_?void 0:_.fields,readOnly:k})})},"".concat(C,"-row-").concat(N.id)),t[2]=l,t[3]=n,t[4]=a,t[5]=q,t[6]=o,t[7]=r,t[8]=c,t[9]=V,t[10]=z,t[11]=p,t[12]=A,t[13]=m,t[14]=L,t[15]=M,t[16]=b,t[17]=x,t[18]=w,t[19]=C,t[20]=j,t[21]=S,t[22]=_,t[23]=k,t[24]=E,t[25]=N.collapsed,t[26]=N.id,t[27]=D,t[28]=P,t[29]=O,t[30]=T,t[31]=R,t[32]=W,t[33]=K,t[34]=I,t[35]=F,t[36]=Y}else Y=t[36];return Y},pr="array-field",pi=aB(e=>{let{field:t,field:{name:n,type:a,admin:{className:o,description:r,isSortable:c=!0}={},fields:p,label:f,localized:h,maxRows:m,minRows:g,required:v},forceRender:b=!1,path:y,permissions:x,readOnly:w,schemaPath:C,validate:j}=e,S=null!=C?C:n,_=+(null!=g?!!g:!!v),{setDocFieldPreferences:k}=aE(),{addFieldRow:E,dispatchFields:N,getFields:D,moveFieldRow:P,removeFieldRow:O,replaceState:T,setModified:R}=eC(),I=eS(),{code:F}=nI(),{i18n:A,t:M}=(0,s.d)(),{config:{localization:L}}=(0,i.c)(),B=!L||!L.fallback||F===L.defaultLocale,V=(e=>{var t,n;return"labels"in e&&(null==e?void 0:e.labels)?e.labels:"labels"in e.field&&e.field.labels?{plural:null==(t=e.field.labels)?void 0:t.plural,singular:null==(n=e.field.labels)?void 0:n.singular}:"label"in e.field&&e.field.label?{plural:void 0,singular:e.field.label}:{plural:M("general:rows"),singular:M("general:row")}})(e),{customComponents:{AfterInput:z,BeforeInput:U,Description:H,Error:q,Label:W}={},disabled:K,errorPaths:Y,path:G,rows:$=[],showError:X,valid:Z,value:Q}=aA({hasRows:!0,potentiallyStalePath:y,validate:(0,l.useCallback)((e,t)=>!B&&null===e||("function"==typeof j?j(e,{...t,maxRows:m,minRows:_,required:v}):void 0),[m,_,v,j,B])}),J=(0,l.useCallback)(e=>{E({path:G,rowIndex:e,schemaPath:S}),setTimeout(()=>{aX("".concat(G,"-row-").concat(e))},0)},[E,G,S]),ee=(0,l.useCallback)(e=>{N({type:"DUPLICATE_ROW",path:G,rowIndex:e}),R(!0),setTimeout(()=>{aX("".concat(G,"-row-").concat(e))},0)},[N,G,R]),et=(0,l.useCallback)(e=>{O({path:G,rowIndex:e})},[O,G]),en=(0,l.useCallback)((e,t)=>{P({moveFromIndex:e,moveToIndex:t,path:G})},[G,P]),ea=(0,l.useCallback)(e=>{let{collapsedIDs:t,updatedRows:n}=nL({collapsed:e,rows:$});k(G,{collapsed:t}),N({type:"SET_ALL_ROWS_COLLAPSED",path:G,updatedRows:n})},[N,G,$,k]),eo=(0,l.useCallback)((e,t)=>{let{collapsedIDs:n,updatedRows:a}=nM({collapsed:t,rowID:e,rows:$});N({type:"SET_ROW_COLLAPSED",path:G,updatedRows:a}),k(G,{collapsed:n})},[N,G,$,k]),er=(0,l.useCallback)(e=>{let t={...D()},n=ti({type:a,fields:p,getDataToCopy:()=>tf({formState:t,path:G,rowIndex:e}),path:G,rowIndex:e,t:M});"string"==typeof n?eF.error(n):eF.success(M("general:copied"))},[p,D,G,M,a]),ei=(0,l.useCallback)(e=>{let t={...D()},n=ts({onPaste:n=>{T(th({dataFromClipboard:n,formState:t,path:G,rowIndex:e})),R(!0)},path:G,schemaFields:p,t:M});"string"==typeof n&&eF.error(n)},[p,D,G,T,R,M]),es=(0,l.useCallback)(e=>{T(th({dataFromClipboard:e,formState:{...D()},path:G})),R(!0)},[D,G,T,R]),ec=(0,l.useCallback)(()=>tf({formState:{...D()},path:G}),[D,G]),eu=m&&$.length>=m,ed=Y.length,ep=I&&Y.length>0,ef=(w||K)&&0===$.length,eh=$.length&&$.length<_>aV(t),[t]);return(0,u.jsxs)("div",{className:[az,pr,o,ep?"".concat(pr,"--has-error"):"".concat(pr,"--has-no-error")].filter(Boolean).join(" "),id:"field-".concat(G.replace(/\./g,"__")),style:em,children:[X&&(0,u.jsx)(el,{CustomComponent:q,Fallback:(0,u.jsx)(tU,{path:G,showError:X})}),(0,u.jsxs)("header",{className:"".concat(pr,"__header"),children:[(0,u.jsxs)("div",{className:"".concat(pr,"__header-wrap"),children:[(0,u.jsxs)("div",{className:"".concat(pr,"__header-content"),children:[(0,u.jsx)("h3",{className:"".concat(pr,"__title"),children:(0,u.jsx)(el,{CustomComponent:W,Fallback:(0,u.jsx)(nA,{as:"span",label:f,localized:h,path:G,required:v})})}),ep&&ed>0&&(0,u.jsx)(tB,{count:ed,i18n:A,withMessage:!0})]}),(0,u.jsxs)("ul",{className:"".concat(pr,"__header-actions"),children:[(null==$?void 0:$.length)>0&&(0,u.jsxs)(l.Fragment,{children:[(0,u.jsx)("li",{children:(0,u.jsx)("button",{className:"".concat(pr,"__header-action"),onClick:()=>ea(!0),type:"button",children:M("fields:collapseAll")})}),(0,u.jsx)("li",{children:(0,u.jsx)("button",{className:"".concat(pr,"__header-action"),onClick:()=>ea(!1),type:"button",children:M("fields:showAll")})})]}),(0,u.jsx)("li",{children:(0,u.jsx)(tp,{allowCopy:(null==$?void 0:$.length)>0,allowPaste:!w,className:"".concat(pr,"__header-action"),disabled:K,fields:p,getDataToCopy:ec,onPaste:es,path:G,type:a})})]})]}),(0,u.jsx)(el,{CustomComponent:H,Fallback:(0,u.jsx)(tz,{description:r,path:G})})]}),(0,u.jsx)(a$,{fieldValue:Q,localized:h,path:G,readOnly:w}),U,((null==$?void 0:$.length)>0||!Z&&(ef||eh))&&(0,u.jsxs)(tM,{className:"".concat(pr,"__draggable-rows"),ids:$.map(e=>e.id),onDragEnd:e=>{let{moveFromIndex:t,moveToIndex:n}=e;return en(t,n)},children:[$.map((e,t)=>{let{id:n,isLoading:a}=e,o="".concat(G,".").concat(t),l=null==Y?void 0:Y.filter(e=>e.startsWith(o+".")).length;return(0,u.jsx)(tA,{disabled:w||K||!c,id:n,children:n=>{var r,i;return(0,u.jsx)(pl,{...n,addRow:J,copyRow:er,CustomRowLabel:null==$||null==(i=$[t])||null==(r=i.customComponents)?void 0:r.RowLabel,duplicateRow:ee,errorCount:l,fields:p,forceRender:b,hasMaxRows:eu,isLoading:a,isSortable:c,labels:V,moveRow:en,parentPath:G,pasteRow:ei,path:o,permissions:x,readOnly:w||K,removeRow:et,row:e,rowCount:null==$?void 0:$.length,rowIndex:t,schemaPath:S,setCollapse:eo})}},n)}),!Z&&(0,u.jsxs)(l.Fragment,{children:[ef&&(0,u.jsx)(eH,{children:M("validation:fieldHasNo",{label:(0,d.s)(V.plural,A)})}),eh&&(0,u.jsx)(eH,{type:"error",children:M("validation:requiresAtLeast",{count:_,label:(0,d.s)(_>1?V.plural:V.singular,A)||M(_>1?"general:rows":"general:row")})})]})]}),!eu&&!w&&(0,u.jsx)(to,{buttonStyle:"icon-label",className:"".concat(pr,"__add-row"),disabled:K,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:()=>{J(Q||0)},children:M("fields:addLabel",{label:(0,d.s)(V.singular,A)})}),z]})}),ps=e=>{let t=(0,h.c)(28),{AfterInput:n,autoComplete:a,BeforeInput:o,className:l,description:r,Description:i,Error:c,inputRef:p,Label:f,label:m,localized:g,onChange:v,onKeyDown:b,path:y,placeholder:x,readOnly:w,required:C,rtl:j,showError:S,style:_,value:k,width:E}=e,N=void 0===a?"off":a,{i18n:D}=(0,s.d)(),P=S&&"error",O=w&&"read-only",T;t[0]!==l||t[1]!==P||t[2]!==O?(T=[az,"password",l,P,O].filter(Boolean),t[0]=l,t[1]=P,t[2]=O,t[3]=T):T=t[3];let R=T.join(" "),I;return t[4]!==n||t[5]!==o||t[6]!==i||t[7]!==c||t[8]!==f||t[9]!==N||t[10]!==r||t[11]!==D||t[12]!==p||t[13]!==m||t[14]!==g||t[15]!==v||t[16]!==b||t[17]!==y||t[18]!==x||t[19]!==w||t[20]!==C||t[21]!==j||t[22]!==S||t[23]!==_||t[24]!==R||t[25]!==k||t[26]!==E?(I=(0,u.jsxs)("div",{className:R,style:{..._,width:E},children:[(0,u.jsx)(el,{CustomComponent:f,Fallback:(0,u.jsx)(nA,{label:m,localized:g,path:y,required:C})}),(0,u.jsxs)("div",{className:"".concat(az,"__wrap"),children:[(0,u.jsx)(el,{CustomComponent:c,Fallback:(0,u.jsx)(tU,{path:y,showError:S})}),(0,u.jsxs)("div",{children:[o,(0,u.jsx)("input",{"aria-label":(0,d.s)(m,D),autoComplete:N,"data-rtl":j,disabled:w,id:"field-".concat(y.replace(/\./g,"__")),name:y,onChange:v,onKeyDown:b,placeholder:(0,d.s)(x,D),ref:p,type:"password",value:k||""}),n]}),(0,u.jsx)(el,{CustomComponent:i,Fallback:(0,u.jsx)(tz,{description:r,path:y})})]})]}),t[4]=n,t[5]=o,t[6]=i,t[7]=c,t[8]=f,t[9]=N,t[10]=r,t[11]=D,t[12]=p,t[13]=m,t[14]=g,t[15]=v,t[16]=b,t[17]=y,t[18]=x,t[19]=w,t[20]=C,t[21]=j,t[22]=S,t[23]=_,t[24]=R,t[25]=k,t[26]=E,t[27]=I):I=t[27],I};aB(e=>{let{autoComplete:t,field:n,field:{admin:{className:a,disabled:o,placeholder:r,rtl:c}={},label:d,localized:p,required:f}={},inputRef:h,path:m,validate:g}=e,{t:v}=(0,s.d)(),b=nI(),{config:y}=(0,i.c)(),x=(0,l.useCallback)((e,t)=>{let n=m?m.split("."):[];return"function"==typeof g?g(e,{...t,required:f}):(0,q.wJ)(e,{name:"password",type:"text",blockData:{},data:{},event:"onChange",path:n,preferences:{fields:{}},req:{payload:{config:y},t:v},required:!0,siblingData:{}})},[g,y,v,f,m]),{customComponents:{AfterInput:w,BeforeInput:C,Description:j,Error:S,Label:_}={},disabled:k,setValue:E,showError:N,value:D}=aA({path:m,validate:x}),P=aU({fieldLocalized:!1,fieldRTL:c,locale:b,localizationConfig:y.localization||void 0}),O=(0,l.useMemo)(()=>aV(n),[n]);return(0,u.jsx)(ps,{AfterInput:w,autoComplete:t,BeforeInput:C,className:a,Description:j,Error:S,inputRef:h,Label:_,label:d,localized:p,onChange:e=>{E(e.target.value)},path:m,placeholder:r,readOnly:k||o,required:f,rtl:P,showError:N,style:O,value:D||""})});var pc=(e,t)=>{let n,a,o,r,i,c,u=(0,h.c)(30),d;u[0]!==t?(d=void 0===t?{}:t,u[0]=t,u[1]=d):d=u[1];let{initialData:p,initialParams:f}=d,m;u[2]!==f?(m=void 0===f?{}:f,u[2]=f,u[3]=m):m=u[3];let g=m,{i18n:b}=(0,s.d)(),y;u[4]!==p?(y=p||{},u[4]=p,u[5]=y):y=u[5];let[x,w]=(0,l.useState)(y),[C,j]=(0,l.useState)(g),[S,_]=(0,l.useState)(!p),[k,E]=(0,l.useState)(!1),{code:N}=nI(),D=(0,l.useRef)(!1),P;u[6]!==N||u[7]!==C?(P=v.A({locale:N,..."object"==typeof C?C:{}},{addQueryPrefix:!0}),u[6]=N,u[7]=C,u[8]=P):P=u[8];let O=P,T;return u[9]!==b.language||u[10]!==p||u[11]!==O||u[12]!==e?(T=()=>{if(p&&!D.current){D.current=!0;return}let t=new AbortController;return e?(async()=>{E(!1),_(!0);try{let n=await nD.get("".concat(e).concat(O),{headers:{"Accept-Language":b.language},signal:t.signal});n.status>201&&E(!0);let a=await n.json();w(a),_(!1)}catch(e){t.signal.aborted||(E(!0),_(!1))}})():(E(!1),_(!1)),()=>{try{t.abort()}catch(e){}}},u[9]=b.language,u[10]=p,u[11]=O,u[12]=e,u[13]=T):T=u[13],u[14]!==b.language||u[15]!==p||u[16]!==N||u[17]!==O||u[18]!==e?(n=[e,N,O,b.language,p],u[14]=b.language,u[15]=p,u[16]=N,u[17]=O,u[18]=e,u[19]=n):n=u[19],(0,l.useEffect)(T,n),u[20]!==p?(a=()=>{p&&D.current&&w(p)},o=[p],u[20]=p,u[21]=a,u[22]=o):(a=u[21],o=u[22]),(0,l.useEffect)(a,o),u[23]!==x||u[24]!==k||u[25]!==S?(r={data:x,isError:k,isLoading:S},u[23]=x,u[24]=k,u[25]=S,u[26]=r):r=u[26],u[27]===Symbol.for("react.memo_cache_sentinel")?(i={setParams:j},u[27]=i):i=u[27],u[28]!==r?(c=[r,i],u[28]=r,u[29]=c):c=u[29],c};(0,c.e)(eo(),1);var pu=()=>(0,u.jsx)("svg",{className:"icon icon--close-menu",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{className:"stroke",d:"M14 6L6 14M6 6L14 14",strokeLinecap:"square"})});!function(e){e.AllAvailable="allAvailable",e.AllInPage="allInPage",e.None="none",e.Some="some"}({});var pd=e=>{let{className:t}=e;return(0,u.jsx)("svg",{className:[t,"icon icon--externalLink"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,u.jsx)("path",{className:"stroke",d:"M16 10.6667V14.6667C16 15.0203 15.8595 15.3594 15.6095 15.6095C15.3594 15.8595 15.0203 16 14.6667 16H5.33333C4.97971 16 4.64057 15.8595 4.39052 15.6095C4.14048 15.3594 4 15.0203 4 14.6667V5.33333C4 4.97971 4.14048 4.64057 4.39052 4.39052C4.64057 4.14048 4.97971 4 5.33333 4H9.33333M16 4L10 10M16 4H12M16 4V8",strokeLinecap:"square"})})};RegExp("^[^\\s/>]+)[^>]*>$"),RegExp("^\\/)?(?[^\\s>]+)[^>]*>$"),RegExp("^