autoforma 1.0.68 → 1.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -14,12 +14,12 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ba;function Nh(){return ba||(ba=1,process.env.NODE_ENV!=="production"&&(function(){function n(S){if(S==null)return null;if(typeof S=="function")return S.$$typeof===P?null:S.displayName||S.name||null;if(typeof S=="string")return S;switch(S){case y:return"Fragment";case k:return"Profiler";case b:return"StrictMode";case C:return"Suspense";case w:return"SuspenseList";case z:return"Activity"}if(typeof S=="object")switch(typeof S.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),S.$$typeof){case g:return"Portal";case E:return S.displayName||"Context";case M:return(S._context.displayName||"Context")+".Consumer";case v:var A=S.render;return S=S.displayName,S||(S=A.displayName||A.name||"",S=S!==""?"ForwardRef("+S+")":"ForwardRef"),S;case O:return A=S.displayName||null,A!==null?A:n(S.type)||"Memo";case L:A=S._payload,S=S._init;try{return n(S(A))}catch{}}return null}function e(S){return""+S}function t(S){try{e(S);var A=!1}catch{A=!0}if(A){A=console;var D=A.error,_=typeof Symbol=="function"&&Symbol.toStringTag&&S[Symbol.toStringTag]||S.constructor.name||"Object";return D.call(A,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",_),e(S)}}function r(S){if(S===y)return"<>";if(typeof S=="object"&&S!==null&&S.$$typeof===L)return"<...>";try{var A=n(S);return A?"<"+A+">":"<...>"}catch{return"<...>"}}function s(){var S=$.A;return S===null?null:S.getOwner()}function o(){return Error("react-stack-top-frame")}function i(S){if(B.call(S,"key")){var A=Object.getOwnPropertyDescriptor(S,"key").get;if(A&&A.isReactWarning)return!1}return S.key!==void 0}function l(S,A){function D(){K||(K=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",A))}D.isReactWarning=!0,Object.defineProperty(S,"key",{get:D,configurable:!0})}function a(){var S=n(this.type);return X[S]||(X[S]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),S=this.props.ref,S!==void 0?S:null}function c(S,A,D,_,J,de){var N=D.ref;return S={$$typeof:p,type:S,key:A,props:D,_owner:_},(N!==void 0?N:null)!==null?Object.defineProperty(S,"ref",{enumerable:!1,get:a}):Object.defineProperty(S,"ref",{enumerable:!1,value:null}),S._store={},Object.defineProperty(S._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(S,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(S,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(S,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:de}),Object.freeze&&(Object.freeze(S.props),Object.freeze(S)),S}function u(S,A,D,_,J,de){var N=A.children;if(N!==void 0)if(_)if(H(N)){for(_=0;_<N.length;_++)d(N[_]);Object.freeze&&Object.freeze(N)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(N);if(B.call(A,"key")){N=n(S);var Q=Object.keys(A).filter(function(te){return te!=="key"});_=0<Q.length?"{key: someKey, "+Q.join(": ..., ")+": ...}":"{key: someKey}",j[N+_]||(Q=0<Q.length?"{"+Q.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var ba;function Nh(){return ba||(ba=1,process.env.NODE_ENV!=="production"&&(function(){function n(S){if(S==null)return null;if(typeof S=="function")return S.$$typeof===P?null:S.displayName||S.name||null;if(typeof S=="string")return S;switch(S){case y:return"Fragment";case k:return"Profiler";case b:return"StrictMode";case C:return"Suspense";case w:return"SuspenseList";case z:return"Activity"}if(typeof S=="object")switch(typeof S.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),S.$$typeof){case g:return"Portal";case E:return S.displayName||"Context";case M:return(S._context.displayName||"Context")+".Consumer";case v:var A=S.render;return S=S.displayName,S||(S=A.displayName||A.name||"",S=S!==""?"ForwardRef("+S+")":"ForwardRef"),S;case O:return A=S.displayName||null,A!==null?A:n(S.type)||"Memo";case L:A=S._payload,S=S._init;try{return n(S(A))}catch{}}return null}function e(S){return""+S}function t(S){try{e(S);var A=!1}catch{A=!0}if(A){A=console;var D=A.error,_=typeof Symbol=="function"&&Symbol.toStringTag&&S[Symbol.toStringTag]||S.constructor.name||"Object";return D.call(A,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",_),e(S)}}function r(S){if(S===y)return"<>";if(typeof S=="object"&&S!==null&&S.$$typeof===L)return"<...>";try{var A=n(S);return A?"<"+A+">":"<...>"}catch{return"<...>"}}function s(){var S=$.A;return S===null?null:S.getOwner()}function o(){return Error("react-stack-top-frame")}function i(S){if(B.call(S,"key")){var A=Object.getOwnPropertyDescriptor(S,"key").get;if(A&&A.isReactWarning)return!1}return S.key!==void 0}function l(S,A){function D(){K||(K=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",A))}D.isReactWarning=!0,Object.defineProperty(S,"key",{get:D,configurable:!0})}function a(){var S=n(this.type);return X[S]||(X[S]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),S=this.props.ref,S!==void 0?S:null}function c(S,A,D,_,J,de){var N=D.ref;return S={$$typeof:p,type:S,key:A,props:D,_owner:_},(N!==void 0?N:null)!==null?Object.defineProperty(S,"ref",{enumerable:!1,get:a}):Object.defineProperty(S,"ref",{enumerable:!1,value:null}),S._store={},Object.defineProperty(S._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(S,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(S,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.defineProperty(S,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:de}),Object.freeze&&(Object.freeze(S.props),Object.freeze(S)),S}function u(S,A,D,_,J,de){var N=A.children;if(N!==void 0)if(_)if(V(N)){for(_=0;_<N.length;_++)d(N[_]);Object.freeze&&Object.freeze(N)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else d(N);if(B.call(A,"key")){N=n(S);var Q=Object.keys(A).filter(function(te){return te!=="key"});_=0<Q.length?"{key: someKey, "+Q.join(": ..., ")+": ...}":"{key: someKey}",j[N+_]||(Q=0<Q.length?"{"+Q.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,_,N,Q,N),j[N+_]=!0)}if(N=null,D!==void 0&&(t(D),N=""+D),i(A)&&(t(A.key),N=""+A.key),"key"in A){D={};for(var oe in A)oe!=="key"&&(D[oe]=A[oe])}else D=A;return N&&l(D,typeof S=="function"?S.displayName||S.name||"Unknown":S),c(S,N,D,s(),J,de)}function d(S){f(S)?S._store&&(S._store.validated=1):typeof S=="object"&&S!==null&&S.$$typeof===L&&(S._payload.status==="fulfilled"?f(S._payload.value)&&S._payload.value._store&&(S._payload.value._store.validated=1):S._store&&(S._store.validated=1))}function f(S){return typeof S=="object"&&S!==null&&S.$$typeof===p}var h=T,p=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),E=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),P=Symbol.for("react.client.reference"),$=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=Object.prototype.hasOwnProperty,H=Array.isArray,G=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(S){return S()}};var K,X={},q=h.react_stack_bottom_frame.bind(h,o)(),U=G(r(o)),j={};Qn.Fragment=y,Qn.jsx=function(S,A,D){var _=1e4>$.recentlyCreatedOwnerStacks++;return u(S,A,D,!1,_?Error("react-stack-top-frame"):q,_?G(r(S)):U)},Qn.jsxs=function(S,A,D){var _=1e4>$.recentlyCreatedOwnerStacks++;return u(S,A,D,!0,_?Error("react-stack-top-frame"):q,_?G(r(S)):U)}})()),Qn}var ka;function Rh(){return ka||(ka=1,process.env.NODE_ENV==="production"?Br.exports=Dh():Br.exports=Nh()),Br.exports}var m=Rh();function Lh(n){if(!/^[0-9a-zA-Z-]+$/.test(n))throw new Error(`[@mantine/use-form] Form name "${n}" is invalid, it should contain only letters, numbers and dashes`)}const Ih=typeof window<"u"?T.useLayoutEffect:T.useEffect;function _e(n,e){Ih(()=>{if(n)return window.addEventListener(n,e),()=>window.removeEventListener(n,e)},[n])}function jh(n,e){n&&Lh(n),_e(`mantine-form:${n}:set-field-value`,t=>e.setFieldValue(t.detail.path,t.detail.value)),_e(`mantine-form:${n}:set-values`,t=>e.setValues(t.detail)),_e(`mantine-form:${n}:set-initial-values`,t=>e.setInitialValues(t.detail)),_e(`mantine-form:${n}:set-errors`,t=>e.setErrors(t.detail)),_e(`mantine-form:${n}:set-field-error`,t=>e.setFieldError(t.detail.path,t.detail.error)),_e(`mantine-form:${n}:clear-field-error`,t=>e.clearFieldError(t.detail)),_e(`mantine-form:${n}:clear-errors`,e.clearErrors),_e(`mantine-form:${n}:reset`,e.reset),_e(`mantine-form:${n}:validate`,e.validate),_e(`mantine-form:${n}:validate-field`,t=>e.validateField(t.detail)),_e(`mantine-form:${n}:reorder-list-item`,t=>e.reorderListItem(t.detail.path,t.detail.payload)),_e(`mantine-form:${n}:remove-list-item`,t=>e.removeListItem(t.detail.path,t.detail.index)),_e(`mantine-form:${n}:insert-list-item`,t=>e.insertListItem(t.detail.path,t.detail.item,t.detail.index)),_e(`mantine-form:${n}:set-dirty`,t=>e.setDirty(t.detail)),_e(`mantine-form:${n}:set-touched`,t=>e.setTouched(t.detail)),_e(`mantine-form:${n}:reset-dirty`,t=>e.resetDirty(t.detail)),_e(`mantine-form:${n}:reset-touched`,e.resetTouched)}function Ph(n){return e=>{if(!e)n(e);else if(typeof e=="function")n(e);else if(typeof e=="object"&&"nativeEvent"in e){const{currentTarget:t}=e;t instanceof HTMLInputElement?t.type==="checkbox"?n(t.checked):n(t.value):(t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)&&n(t.value)}else n(e)}}function wi(n){return n===null||typeof n!="object"?{}:Object.keys(n).reduce((e,t)=>{const r=n[t];return r!=null&&r!==!1&&(e[t]=r),e},{})}function _h(n){const[e,t]=T.useState(wi(n)),r=T.useRef(e),s=T.useCallback(a=>{t(c=>{const u=wi(typeof a=="function"?a(c):a);return r.current=u,u})},[]),o=T.useCallback(()=>s({}),[]),i=T.useCallback(a=>{r.current[a]!==void 0&&s(c=>{const u={...c};return delete u[a],u})},[e]),l=T.useCallback((a,c)=>{c==null||c===!1?i(a):r.current[a]!==c&&s(u=>({...u,[a]:c}))},[e]);return{errorsState:e,setErrors:s,clearErrors:o,setFieldError:l,clearFieldError:i}}function Ti(n,e){if(e===null||typeof e!="object")return{};const t={...e};return Object.keys(e).forEach(r=>{r.includes(`${String(n)}.`)&&delete t[r]}),t}function xa(n,e){const t=n.substring(e.length+1).split(".")[0];return parseInt(t,10)}function va(n,e,t,r){if(e===void 0)return t;const s=`${String(n)}`;let o=t;r===-1&&(o=Ti(`${s}.${e}`,o));const i={...o},l=new Set;return Object.entries(o).filter(([a])=>{if(!a.startsWith(`${s}.`))return!1;const c=xa(a,s);return Number.isNaN(c)?!1:c>=e}).forEach(([a,c])=>{const u=xa(a,s),d=a.replace(`${s}.${u}`,`${s}.${u+r}`);i[d]=c,l.add(d),l.has(a)||delete i[a]}),i}function Bh(n,{from:e,to:t},r){const s=`${n}.${e}`,o=`${n}.${t}`,i={...r},l=new Set;return Object.keys(r).forEach(a=>{if(l.has(a))return;let c,u;if(a.startsWith(s)?(c=a,u=a.replace(s,o)):a.startsWith(o)&&(c=a.replace(o,s),u=a),c&&u){const d=i[c],f=i[u];f===void 0?delete i[c]:i[c]=f,d===void 0?delete i[u]:i[u]=d,l.add(c),l.add(u)}}),i}function Sa(n,e,t){typeof t.value=="object"&&(t.value=Bn(t.value)),!t.enumerable||t.get||t.set||!t.configurable||!t.writable||e==="__proto__"?Object.defineProperty(n,e,t):n[e]=t.value}function Bn(n){if(typeof n!="object")return n;var e=0,t,r,s,o=Object.prototype.toString.call(n);if(o==="[object Object]"?s=Object.create(n.__proto__||null):o==="[object Array]"?s=Array(n.length):o==="[object Set]"?(s=new Set,n.forEach(function(i){s.add(Bn(i))})):o==="[object Map]"?(s=new Map,n.forEach(function(i,l){s.set(Bn(l),Bn(i))})):o==="[object Date]"?s=new Date(+n):o==="[object RegExp]"?s=new RegExp(n.source,n.flags):o==="[object DataView]"?s=new n.constructor(Bn(n.buffer)):o==="[object ArrayBuffer]"?s=n.slice(0):o.slice(-6)==="Array]"&&(s=new n.constructor(n)),s){for(r=Object.getOwnPropertySymbols(n);e<r.length;e++)Sa(s,r[e],Object.getOwnPropertyDescriptor(n,r[e]));for(e=0,r=Object.getOwnPropertyNames(n);e<r.length;e++)Object.hasOwnProperty.call(s,t=r[e])&&s[t]===n[t]||Sa(s,t,Object.getOwnPropertyDescriptor(n,t))}return s||n}function uu(n){return typeof n!="string"?[]:n.split(".")}function De(n,e){const t=uu(n);if(t.length===0||typeof e!="object"||e===null)return;let r=e[t[0]];for(let s=1;s<t.length&&r!=null;s+=1)r=r[t[s]];return r}function Nr(n,e,t){const r=uu(n);if(r.length===0)return t;const s=Bn(t);if(r.length===1)return s[r[0]]=e,s;let o=s[r[0]];for(let i=1;i<r.length-1;i+=1){if(o===void 0)return s;o=o[r[i]]}return o[r[r.length-1]]=e,s}function Fh(n,{from:e,to:t},r){const s=De(n,r);if(!Array.isArray(s))return r;const o=[...s],i=s[e];return o.splice(e,1),o.splice(t,0,i),Nr(n,o,r)}function zh(n,e,t,r){const s=De(n,r);if(!Array.isArray(s))return r;const o=[...s];return o.splice(typeof t=="number"?t:o.length,0,e),Nr(n,o,r)}function $h(n,e,t){const r=De(n,t);return Array.isArray(r)?Nr(n,r.filter((s,o)=>o!==e),t):t}function Vh(n,e,t,r){const s=De(n,r);if(!Array.isArray(s)||s.length<=t)return r;const o=[...s];return o[t]=e,Nr(n,o,r)}function Hh({$values:n,$errors:e,$status:t}){const r=T.useCallback((l,a)=>{t.clearFieldDirty(l),e.setErrors(c=>Bh(l,a,c)),n.setValues({values:Fh(l,a,n.refValues.current),updateState:!0})},[]),s=T.useCallback((l,a)=>{t.clearFieldDirty(l),e.setErrors(c=>va(l,a,c,-1)),n.setValues({values:$h(l,a,n.refValues.current),updateState:!0})},[]),o=T.useCallback((l,a,c)=>{t.clearFieldDirty(l),e.setErrors(u=>va(l,c,u,1)),n.setValues({values:zh(l,a,c,n.refValues.current),updateState:!0})},[]),i=T.useCallback((l,a,c)=>{t.clearFieldDirty(l),n.setValues({values:Vh(l,c,a,n.refValues.current),updateState:!0})},[]);return{reorderListItem:r,removeListItem:s,insertListItem:o,replaceListItem:i}}var Ho,Ca;function Wh(){return Ca||(Ca=1,Ho=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}),Ho}var Yh=Wh();const Fr=ll(Yh);function Zn(n,e){const t=Object.keys(n);if(typeof e=="string"){const r=t.filter(s=>s.startsWith(`${e}.`));return n[e]||r.some(s=>n[s])||!1}return t.some(r=>n[r])}function qh({initialDirty:n,initialTouched:e,mode:t,$values:r}){const[s,o]=T.useState(e),[i,l]=T.useState(n),a=T.useRef(e),c=T.useRef(n),u=T.useCallback(C=>{const w=typeof C=="function"?C(a.current):C;a.current=w,t==="controlled"&&o(w)},[]),d=T.useCallback((C,w=!1)=>{const O=typeof C=="function"?C(c.current):C;c.current=O,(t==="controlled"||w)&&l(O)},[]),f=T.useCallback(()=>u({}),[]),h=T.useCallback(C=>{const w=C?{...r.refValues.current,...C}:r.refValues.current;r.setValuesSnapshot(w),d({})},[]),p=T.useCallback((C,w)=>{u(O=>Zn(O,C)===w?O:{...O,[C]:w})},[]),g=T.useCallback((C,w,O)=>{d(L=>Zn(L,C)===w?L:{...L,[C]:w},O)},[]),y=T.useCallback((C,w)=>{const O=Zn(c.current,C),L=!Fr(De(C,r.getValuesSnapshot()),w),z=Ti(C,c.current);z[C]=L,d(z,O!==L)},[]),b=T.useCallback(C=>Zn(a.current,C),[]),k=T.useCallback(C=>d(w=>{if(typeof C!="string")return w;const O=Ti(C,w);return delete O[C],Fr(O,w)?w:O}),[]),M=T.useCallback(C=>{if(C){const O=De(C,c.current);if(typeof O=="boolean")return O;const L=De(C,r.refValues.current),z=De(C,r.valuesSnapshot.current);return!Fr(L,z)}return Object.keys(c.current).length>0?Zn(c.current):!Fr(r.refValues.current,r.valuesSnapshot.current)},[]),E=T.useCallback(()=>c.current,[]),v=T.useCallback(()=>a.current,[]);return{touchedState:s,dirtyState:i,touchedRef:a,dirtyRef:c,setTouched:u,setDirty:d,resetDirty:h,resetTouched:f,isTouched:b,setFieldTouched:p,setFieldDirty:g,setTouchedState:o,setDirtyState:l,clearFieldDirty:k,isDirty:M,getDirty:E,getTouched:v,setCalculatedFieldDirty:y}}function Uh({initialValues:n,onValuesChange:e,mode:t}){const r=T.useRef(!1),[s,o]=T.useState(n||{}),i=T.useRef(s),l=T.useRef(s),a=T.useCallback(({values:y,subscribers:b,updateState:k=!0,mergeWithPreviousValues:M=!0})=>{const E=i.current,v=y instanceof Function?y(i.current):y,C=M?{...E,...v}:v;i.current=C,k&&(o(C),t==="uncontrolled"&&(i.current=C)),e==null||e(C,E),b==null||b.filter(Boolean).forEach(w=>w({updatedValues:C,previousValues:E}))},[e]),c=T.useCallback(y=>{var M;const b=De(y.path,i.current),k=y.value instanceof Function?y.value(b):y.value;if(b!==k){const E=i.current,v=Nr(y.path,k,i.current);a({values:v,updateState:y.updateState}),(M=y.subscribers)==null||M.filter(Boolean).forEach(C=>C({path:y.path,updatedValues:v,previousValues:E}))}},[a]),u=T.useCallback(y=>{l.current=y},[]),d=T.useCallback((y,b)=>{r.current||(r.current=!0,a({values:y,updateState:t==="controlled"}),u(y),b())},[a]),f=T.useCallback(()=>{a({values:l.current,updateState:!0,mergeWithPreviousValues:!1})},[a]),h=T.useCallback(()=>i.current,[]),p=T.useCallback(()=>l.current,[]),g=T.useCallback((y,b)=>{const k=De(y,l.current);typeof k>"u"||c({path:y,value:k,updateState:t==="controlled",subscribers:b})},[c,t]);return{initialized:r,stateValues:s,refValues:i,valuesSnapshot:l,setValues:a,setFieldValue:c,resetValues:f,setValuesSnapshot:u,initialize:d,getValues:h,getValuesSnapshot:p,resetField:g}}function Kh({$status:n,cascadeUpdates:e}){const t=T.useRef({}),r=T.useCallback((o,i)=>{T.useEffect(()=>(t.current[o]=t.current[o]||[],t.current[o].push(i),()=>{t.current[o]=t.current[o].filter(l=>l!==i)}),[i])},[]),s=T.useCallback(o=>{var l;const i=((l=t.current[o])==null?void 0:l.map(a=>c=>a({previousValue:De(o,c.previousValues),value:De(o,c.updatedValues),touched:n.isTouched(o),dirty:n.isDirty(o)})))??[];if(e)for(const a in t.current)(a.startsWith(`${o}.`)||o.startsWith(`${a}.`))&&i.push(...t.current[a].map(c=>u=>c({previousValue:De(a,u.previousValues),value:De(a,u.updatedValues),touched:n.isTouched(a),dirty:n.isDirty(a)})));return i},[]);return{subscribers:t,watch:r,getFieldSubscribers:s}}function Ma(n,e){return n?`${n}-${e.toString()}`:e.toString()}const zr=Symbol("root-rule");function wa(n){const e=wi(n);return{hasErrors:Object.keys(e).length>0,errors:e}}function Ei(n,e,t="",r={}){return typeof n!="object"||n===null?r:Object.keys(n).reduce((s,o)=>{const i=n[o],l=`${t===""?"":`${t}.`}${o}`,a=De(l,e);let c=!1;return typeof i=="function"&&(s[l]=i(a,e,l)),typeof i=="object"&&Array.isArray(a)&&(c=!0,a.forEach((u,d)=>Ei(i,e,`${l}.${d}`,s)),zr in i&&(s[l]=i[zr](a,e,l))),typeof i=="object"&&typeof a=="object"&&a!==null&&(c||Ei(i,e,l,s),zr in i&&(s[l]=i[zr](a,e,l))),s},r)}function Ai(n,e){return wa(typeof n=="function"?n(e):Ei(n,e))}function $r(n,e,t){if(typeof n!="string")return{hasError:!1,error:null};const r=Ai(e,t),s=Object.keys(r.errors).find(o=>n.split(".").every((i,l)=>i===o.split(".")[l]));return{hasError:!!s,error:s?r.errors[s]:null}}const Jh="__MANTINE_FORM_INDEX__";function Ta(n,e){return e?typeof e=="boolean"?e:Array.isArray(e)?e.includes(n.replace(/[.][0-9]+/g,`.${Jh}`)):!1:!1}function Gh({name:n,mode:e="controlled",initialValues:t,initialErrors:r={},initialDirty:s={},initialTouched:o={},clearInputErrorOnChange:i=!0,validateInputOnChange:l=!1,validateInputOnBlur:a=!1,onValuesChange:c,transformValues:u=(y=>y),enhanceGetInputProps:d,validate:f,onSubmitPreventDefault:h="always",touchTrigger:p="change",cascadeUpdates:g=!1}={}){const y=_h(r),b=Uh({initialValues:t,onValuesChange:c,mode:e}),k=qh({initialDirty:s,initialTouched:o,$values:b,mode:e}),M=Hh({$values:b,$errors:y,$status:k}),E=Kh({$status:k,cascadeUpdates:g}),[v,C]=T.useState(0),[w,O]=T.useState({}),[L,z]=T.useState(!1),P=T.useCallback(()=>{b.resetValues(),y.clearErrors(),k.resetDirty(),k.resetTouched(),e==="uncontrolled"&&C(N=>N+1)},[]),$=T.useCallback(N=>{i&&y.clearErrors(),e==="uncontrolled"&&C(Q=>Q+1),Object.keys(E.subscribers.current).forEach(Q=>{const oe=De(Q,b.refValues.current),te=De(Q,N);oe!==te&&E.getFieldSubscribers(Q).forEach(pe=>pe({previousValues:N,updatedValues:b.refValues.current}))})},[i]),B=T.useCallback(N=>{const Q=b.refValues.current;b.initialize(N,()=>e==="uncontrolled"&&C(oe=>oe+1)),$(Q)},[$]),H=T.useCallback((N,Q,oe)=>{const te=Ta(N,l),pe=Q instanceof Function?Q(De(N,b.refValues.current)):Q;k.setCalculatedFieldDirty(N,pe),p==="change"&&k.setFieldTouched(N,!0),!te&&i&&y.clearFieldError(N),b.setFieldValue({path:N,value:Q,updateState:e==="controlled",subscribers:[...E.getFieldSubscribers(N),te?he=>{const ae=$r(N,f,he.updatedValues);ae.hasError?y.setFieldError(N,ae.error):y.clearFieldError(N)}:null,(oe==null?void 0:oe.forceUpdate)!==!1&&e!=="controlled"?()=>O(he=>({...he,[N]:(he[N]||0)+1})):null]})},[c,f]),G=T.useCallback(N=>{const Q=b.refValues.current;b.setValues({values:N,updateState:e==="controlled"}),$(Q)},[c,$]),K=T.useCallback(()=>{const N=Ai(f,b.refValues.current);return y.setErrors(N.errors),N},[f]),X=T.useCallback(N=>{const Q=$r(N,f,b.refValues.current);return Q.hasError?y.setFieldError(N,Q.error):y.clearFieldError(N),Q},[f]),q=(N,{type:Q="input",withError:oe=!0,withFocus:te=!0,...pe}={})=>{const ae={onChange:Ph(se=>H(N,se,{forceUpdate:!1})),"data-path":Ma(n,N)};return oe&&(ae.error=y.errorsState[N]),Q==="checkbox"?ae[e==="controlled"?"checked":"defaultChecked"]=De(N,b.refValues.current):ae[e==="controlled"?"value":"defaultValue"]=De(N,b.refValues.current),te&&(ae.onFocus=()=>k.setFieldTouched(N,!0),ae.onBlur=()=>{if(Ta(N,a)){const se=$r(N,f,b.refValues.current);se.hasError?y.setFieldError(N,se.error):y.clearFieldError(N)}}),Object.assign(ae,d==null?void 0:d({inputProps:ae,field:N,options:{type:Q,withError:oe,withFocus:te,...pe},form:de}))},U=(N,Q)=>oe=>{h==="always"&&(oe==null||oe.preventDefault());const te=K();if(te.hasErrors)h==="validation-failed"&&(oe==null||oe.preventDefault()),Q==null||Q(te.errors,b.refValues.current,oe);else{const pe=N==null?void 0:N(u(b.refValues.current),oe);pe instanceof Promise&&(z(!0),pe.finally(()=>z(!1)))}},j=N=>u(N||b.refValues.current),S=T.useCallback(N=>{N.preventDefault(),P()},[]),A=T.useCallback(N=>N?!$r(N,f,b.refValues.current).hasError:!Ai(f,b.refValues.current).hasErrors,[f]),D=N=>`${v}-${String(N)}-${w[String(N)]||0}`,_=T.useCallback(N=>document.querySelector(`[data-path="${Ma(n,N)}"]`),[]),J=T.useCallback(N=>{b.resetField(N,[e!=="controlled"?()=>O(Q=>({...Q,[N]:(Q[N]||0)+1})):null])},[b.resetField,e,O]),de={watch:E.watch,initialized:b.initialized.current,values:e==="uncontrolled"?b.refValues.current:b.stateValues,getValues:b.getValues,getInitialValues:b.getValuesSnapshot,setInitialValues:b.setValuesSnapshot,resetField:J,initialize:B,setValues:G,setFieldValue:H,submitting:L,setSubmitting:z,errors:y.errorsState,setErrors:y.setErrors,setFieldError:y.setFieldError,clearFieldError:y.clearFieldError,clearErrors:y.clearErrors,resetDirty:k.resetDirty,setTouched:k.setTouched,setDirty:k.setDirty,isTouched:k.isTouched,resetTouched:k.resetTouched,isDirty:k.isDirty,getTouched:k.getTouched,getDirty:k.getDirty,reorderListItem:M.reorderListItem,insertListItem:M.insertListItem,removeListItem:M.removeListItem,replaceListItem:M.replaceListItem,reset:P,validate:K,validateField:X,getInputProps:q,onSubmit:U,onReset:S,isValid:A,getTransformedValues:j,key:D,getInputNode:_};return jh(n,de),de}const du=T.createContext(null),Xh=({children:n,value:e})=>m.jsx(du.Provider,{value:e,children:n}),al=()=>{const n=T.useContext(du);if(!n)throw new Error("useRenderers must be used inside <RenderersProvider>");return n};function oo({field:n,layout:e,children:t}){if(e==="grid"){const r=n.column??6;return m.jsx(x.Grid.Col,{span:{base:12,md:r},children:t})}return e==="horizontal"?m.jsx(x.Box,{style:{display:"flex",alignItems:"center",gap:12},children:t}):m.jsx(x.Stack,{gap:"xs",children:t})}const cl={vertical:n=>m.jsx(x.Stack,{gap:"md",children:n}),horizontal:n=>m.jsx(x.Group,{wrap:"wrap",gap:"md",children:n}),grid:n=>m.jsx(x.Grid,{gutter:"md",children:n})},Oi=n=>{switch(n){case"number":return 0;case"array":return[];case"checkbox":return!1;case"object":return{};case"select":case"date":case"datetime":return null;default:return""}};function ul(n,e={}){const t={};for(const r of n)r.type==="object"&&r.fields?t[r.name]=ul(r.fields,e==null?void 0:e[r.name]):t[r.name]=(e==null?void 0:e[r.name])??r.initialValue??Oi(r.type);return t}function Di(n,e){const t={};for(const r of n){const s=(e==null?void 0:e[r.name])??Oi(r.type);if(r.required)if(r.type==="object"){Object.values(s).length||(t[r.name]=`${r.label||r.name} is required`);const o=Di(r.fields,s);for(const[i,l]of Object.entries(o))t[`${r.name}.${i}`]=l}else r.type==="array"?(s.length||(t[r.name]=`${r.label||r.name} is required`),s.forEach((o,i)=>{const l=Di(r.fields,o);for(const[a,c]of Object.entries(l))t[`${r.name}.${i}.${a}`]=c})):s===Oi(r.type)&&(t[r.name]=`${r.label||r.name} is required`)}return t}function Qh({field:n,form:e,layout:t="grid"}){const r=n,s=al(),o=e.getInputProps(r.name),i=o.value??[],l=r.readOnly===!0,a=r.disabled===!0;function c(){o.onFieldChange([...i,ul(r.fields)])}function u(d){o.onFieldChange(i.filter((f,h)=>h!==d))}return m.jsxs(x.Stack,{gap:"md",children:[i.map((d,f)=>{var h;return m.jsxs(x.Paper,{withBorder:!0,radius:"md",p:"md",shadow:"xs",children:[cl[t]((h=r.fields)==null?void 0:h.map(p=>m.jsx(oo,{field:p,layout:t,children:m.jsx(Po,{field:{...p,name:`${n.name}.${f}.${p.name}`,disabled:a||p.disabled,readOnly:l||p.readOnly},form:e,layout:t,...s})},`${n.name}.${f}.${p.name}`))),!l&&!a&&m.jsx(x.Group,{justify:"flex-end",mt:"xs",children:m.jsx(x.Button,{color:"red",variant:"light",onClick:()=>u(f),children:"Remove"})})]},`${r.name}.${f}`)}),!l&&!a&&m.jsxs(m.Fragment,{children:[i.length>0&&m.jsx(x.Divider,{my:"sm"}),m.jsx(x.Button,{onClick:c,variant:"default",children:"Add Row"})]})]})}function Zh({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?m.jsx(x.Checkbox,{value:t.value,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0,checked:t.value}):m.jsx(x.Checkbox,{...t,checked:t.value,onChange:o=>t.onFieldChange(o.target.checked),required:n.required,placeholder:n.placeholder,error:void 0})}function ep({direction:n,levelIndex:e,rowIndex:t,cellIndex:r,size:s}){switch(n){case"up":return e===0&&t===0?null:t===0?{levelIndex:e-1,rowIndex:r<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:r}:{levelIndex:e,rowIndex:t-1,cellIndex:r};case"down":return t===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:r}:t===s[e].length-2&&r>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:r}:{levelIndex:e,rowIndex:t+1,cellIndex:r};case"left":return e===0&&t===0&&r===0?null:t===0&&r===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:r===0?{levelIndex:e,rowIndex:t-1,cellIndex:s[e][t-1]-1}:{levelIndex:e,rowIndex:t,cellIndex:r-1};case"right":return t===s[e].length-1&&r===s[e][t]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:r===s[e][t]-1?{levelIndex:e,rowIndex:t+1,cellIndex:0}:{levelIndex:e,rowIndex:t,cellIndex:r+1};default:return{levelIndex:e,rowIndex:t,cellIndex:r}}}function fu({controlsRef:n,direction:e,levelIndex:t,rowIndex:r,cellIndex:s,size:o}){var a,c,u;const i=ep({direction:e,size:o,rowIndex:r,cellIndex:s,levelIndex:t});if(!i)return;const l=(u=(c=(a=n.current)==null?void 0:a[i.levelIndex])==null?void 0:c[i.rowIndex])==null?void 0:u[i.cellIndex];l&&(l.disabled||l.getAttribute("data-hidden")||l.getAttribute("data-outside")?fu({controlsRef:n,direction:e,levelIndex:i.levelIndex,cellIndex:i.cellIndex,rowIndex:i.rowIndex,size:o}):l.focus())}function tp(n){switch(n){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function np(n){var e;return(e=n.current)==null?void 0:e.map(t=>t.map(r=>r.length))}function dl({controlsRef:n,levelIndex:e,rowIndex:t,cellIndex:r,event:s}){const o=tp(s.key);if(o){s.preventDefault();const i=np(n);fu({controlsRef:n,direction:o,levelIndex:e,rowIndex:t,cellIndex:r,size:i})}}function Ea(n,e){let t=n?R(n):R();if(e==="")return t.format("YYYY-MM-DD HH:mm:ss");const[r,s,o=0]=e.split(":").map(Number);return t=t.set("hour",r),t=t.set("minute",s),t=t.set("second",o),t=t.set("millisecond",0),t.format("YYYY-MM-DD HH:mm:ss")}function He(n){return n==null||n===""?n:R(n).format("YYYY-MM-DD")}function Fn(n){return n==null||n===""?n:R(n).format("YYYY-MM-DD HH:mm:ss")}function rp({minDate:n,maxDate:e}){const t=R();return!n&&!e?He(t):n&&R(t).isBefore(n)?He(n):e&&R(t).isAfter(e)?He(e):He(t)}function Wo(n,e,t){return!n&&!e?Fn(t):n&&R(t).isBefore(n)?Fn(n):e&&R(t).isAfter(e)?Fn(e):Fn(t)}const sp={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},op=T.createContext(sp);function Rt(){const n=T.useContext(op),e=T.useCallback(o=>o||n.locale,[n.locale]),t=T.useCallback(o=>typeof o=="number"?o:n.firstDayOfWeek,[n.firstDayOfWeek]),r=T.useCallback(o=>Array.isArray(o)?o:n.weekendDays,[n.weekendDays]),s=T.useCallback(o=>typeof o=="string"?o:n.labelSeparator,[n.labelSeparator]);return{...n,getLocale:e,getFirstDayOfWeek:t,getWeekendDays:r,getLabelSeparator:s}}function ip({value:n,type:e,withTime:t}){const r=t?Fn:He;if(e==="range"&&Array.isArray(n)){const s=r(n[0]),o=r(n[1]);return s?o?`${s} – ${o}`:`${s} –`:""}return e==="multiple"&&Array.isArray(n)?n.filter(Boolean).join(", "):!Array.isArray(n)&&n?r(n):""}function fl({value:n,type:e,name:t,form:r,withTime:s=!1}){return m.jsx("input",{type:"hidden",value:ip({value:n,type:e,withTime:s}),name:t,form:r})}fl.displayName="@mantine/dates/HiddenDatesInput";function hu(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(e=0;e<s;e++)n[e]&&(t=hu(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function pu(){for(var n,e,t=0,r="",s=arguments.length;t<s;t++)(n=arguments[t])&&(e=hu(n))&&(r&&(r+=" "),r+=e);return r}var lp={input:"m_468e7eda"};const fs=x.factory((n,e)=>{const t=x.useProps("TimeInput",null,n),{classNames:r,styles:s,unstyled:o,vars:i,withSeconds:l,minTime:a,maxTime:c,value:u,onChange:d,step:f,...h}=t,{resolvedClassNames:p,resolvedStyles:g}=x.useResolvedStylesApi({classNames:r,styles:s,props:t}),y=k=>{if(a!==void 0||c!==void 0){const[M,E,v]=k.split(":").map(Number);if(a){const[C,w,O]=a.split(":").map(Number);if(M<C||M===C&&E<w||l&&M===C&&E===w&&v<O)return-1}if(c){const[C,w,O]=c.split(":").map(Number);if(M>C||M===C&&E>w||l&&M===C&&E===w&&v>O)return 1}}return 0},b=k=>{var M,E,v;if((M=t.onBlur)==null||M.call(t,k),a!==void 0||c!==void 0){const C=k.currentTarget.value;if(C){const w=y(C);w===1?(c&&(k.currentTarget.value=c),(E=t.onChange)==null||E.call(t,k)):w===-1&&(a&&(k.currentTarget.value=a),(v=t.onChange)==null||v.call(t,k))}}};return m.jsx(x.InputBase,{classNames:{...p,input:pu(lp.input,p==null?void 0:p.input)},styles:g,unstyled:o,ref:e,value:u,step:f??(l?1:60),...h,onChange:d,onBlur:b,type:"time",__staticSelector:"TimeInput"})});fs.classes=x.InputBase.classes;fs.displayName="@mantine/dates/TimeInput";function ts(n,e,t){return e===void 0&&t===void 0?n:e!==void 0&&t===void 0?Math.max(n,e):Math.min(e===void 0&&t!==void 0?n:Math.max(n,e),t)}function ap(n="mantine-"){return`${n}${Math.random().toString(36).slice(2,11)}`}const cp=["mousedown","touchstart"];function up(n,e,t){const r=T.useRef(null),s=cp;return T.useEffect(()=>{const o=i=>{const{target:l}=i??{};if(Array.isArray(t)){const a=!document.body.contains(l)&&(l==null?void 0:l.tagName)!=="HTML";t.every(u=>!!u&&!i.composedPath().includes(u))&&!a&&n(i)}else r.current&&!r.current.contains(l)&&n(i)};return s.forEach(i=>document.addEventListener(i,o)),()=>{s.forEach(i=>document.removeEventListener(i,o))}},[r,n,t]),r}const dp=typeof document<"u"?T.useLayoutEffect:T.useEffect;function hs(n,e){const t=T.useRef(!1);T.useEffect(()=>()=>{t.current=!1},[]),T.useEffect(()=>{if(t.current)return n();t.current=!0},e)}const fp=T.useId||(()=>{});function hp(){const n=fp();return n?`mantine-${n.replace(/:/g,"")}`:""}function pp(n){const e=hp(),[t,r]=T.useState(e);return dp(()=>{r(ap())},[]),typeof window>"u"?e:t}function mp(n,e,t){T.useEffect(()=>(window.addEventListener(n,e,t),()=>window.removeEventListener(n,e,t)),[n,e])}function Aa(n,e){if(typeof n=="function")return n(e);typeof n=="object"&&n!==null&&"current"in n&&(n.current=e)}function gp(...n){const e=new Map;return t=>{if(n.forEach(r=>{const s=Aa(r,t);s&&e.set(r,s)}),e.size>0)return()=>{n.forEach(r=>{const s=e.get(r);s&&typeof s=="function"?s():Aa(r,null)}),e.clear()}}}function rr(...n){return T.useCallback(gp(...n),n)}function mu({value:n,defaultValue:e,finalValue:t,onChange:r=()=>{}}){const[s,o]=T.useState(e!==void 0?e:t),i=(l,...a)=>{o(l),r==null||r(l,...a)};return n!==void 0?[n,r,!0]:[s,i,!1]}function yp(n){return e=>{if(!e)n(e);else if(typeof e=="function")n(e);else if(typeof e=="object"&&"nativeEvent"in e){const{currentTarget:t}=e;t.type==="checkbox"?n(t.checked):n(t.value)}else n(e)}}function bp(n){const[e,t]=T.useState(n);return[e,yp(t)]}function hl(n=!1,e={}){const[t,r]=T.useState(n),s=T.useCallback(()=>{r(l=>{var a;return l||((a=e.onOpen)==null||a.call(e),!0)})},[e.onOpen]),o=T.useCallback(()=>{r(l=>{var a;return l&&((a=e.onClose)==null||a.call(e),!1)})},[e.onClose]),i=T.useCallback(()=>{t?o():s()},[o,s,t]);return[t,{open:s,close:o,toggle:i}]}function Ve(n){return n<10?`0${n}`:`${n}`}const kp=n=>Number(n.toFixed(0)[0]),ns=T.forwardRef(({value:n,min:e,max:t,onChange:r,focusable:s,step:o,onNextInput:i,onPreviousInput:l,onFocus:a,readOnly:c,allowTemporaryZero:u=!1,placeholder:d="--",...f},h)=>{const p=kp(t),g=t+1-o,y=k=>{if(c)return;const M=k.replace(/\D/g,"");if(M!==""){const E=parseInt(M,10),v=u&&E===0&&e>0?0:ts(E,e,t);r(v),(v>p||k.startsWith("00"))&&(i==null||i())}},b=k=>{if(!c){if((k.key==="0"||k.key==="Num0")&&n===0&&(k.preventDefault(),i==null||i()),k.key==="Home"&&(k.preventDefault(),r(e)),k.key==="End"&&(k.preventDefault(),r(t)),(k.key==="Backspace"||k.key==="Delete")&&(k.preventDefault(),n!==null?r(null):l==null||l()),k.key==="ArrowRight"&&(k.preventDefault(),i==null||i()),k.key==="ArrowLeft"&&(k.preventDefault(),l==null||l()),k.key==="ArrowUp"){k.preventDefault();const M=n===null?e:ts(n+o,e,g);r(M)}if(k.key==="ArrowDown"){k.preventDefault();const M=n===null?g:ts(n-o,e,g);r(M)}}};return m.jsx("input",{ref:h,type:"text",role:"spinbutton","aria-valuemin":e,"aria-valuemax":t,"aria-valuenow":n===null?0:n,"data-empty":n===null||void 0,inputMode:"numeric",placeholder:d,value:n===null?"":Ve(n),onChange:k=>y(k.currentTarget.value),onKeyDown:b,onFocus:k=>{k.currentTarget.select(),a==null||a(k)},onClick:k=>{k.stopPropagation(),k.currentTarget.select()},onMouseDown:k=>k.stopPropagation(),...f})});ns.displayName="@mantine/dates/SpinInput";const[xp,Tn]=x.createSafeContext("TimeInput component was not found in the component tree"),gu=T.forwardRef(({labels:n,value:e,onChange:t,className:r,style:s,onPreviousInput:o,readOnly:i,onMouseDown:l,onTouchStart:a,inputType:c,...u},d)=>{const f=Tn(),h=p=>{i||(p.key==="Home"&&(p.preventDefault(),t(n.am)),p.key==="End"&&(p.preventDefault(),t(n.pm)),(p.key==="Backspace"||p.key==="Delete")&&(p.preventDefault(),e===null?o==null||o():t(null)),p.key==="ArrowLeft"&&(p.preventDefault(),o==null||o()),(p.key==="ArrowUp"||p.key==="ArrowDown")&&(p.preventDefault(),t(e===n.am?n.pm:n.am)),p.code==="KeyA"&&(p.preventDefault(),t(n.am)),p.code==="KeyP"&&(p.preventDefault(),t(n.pm)))};if(c==="input"){const p=e||"--",g=p.length+1;return m.jsx("input",{...f.getStyles("field",{className:r,style:s}),ref:d,value:p,size:g,onChange:y=>!i&&t(y.target.value||null),onClick:(y=>y.stopPropagation()),onKeyDown:h,onMouseDown:y=>{y.stopPropagation(),l==null||l(y)},"data-am-pm":!0,...u})}return m.jsxs("select",{...f.getStyles("field",{className:r,style:s}),ref:d,value:e||"",onChange:p=>!i&&t(p.target.value||null),onClick:p=>p.stopPropagation(),onKeyDown:h,onMouseDown:p=>{p.stopPropagation(),l==null||l(p)},"data-am-pm":!0,...u,children:[m.jsx("option",{value:"",children:"--"}),m.jsx("option",{value:n.am,children:n.am}),m.jsx("option",{value:n.pm,children:n.pm})]})});gu.displayName="@mantine/dates/AmPmInput";function pl({value:n,active:e,onSelect:t}){const r=Tn();return m.jsx(x.UnstyledButton,{mod:{active:e},onClick:()=>t(n),onMouseDown:s=>s.preventDefault(),"data-value":n,tabIndex:-1,...r.getStyles("control"),children:typeof n=="number"?Ve(n):n})}pl.displayName="@mantine/dates/TimeControl";function yu({labels:n,value:e,onSelect:t}){const r=Tn(),s=[n.am,n.pm].map(o=>m.jsx(pl,{value:o,active:e===o,onSelect:t},o));return m.jsx("div",{...r.getStyles("controlsList"),children:s})}yu.displayName="@mantine/dates/AmPmControlsList";function vp(n,e){if(!n||!e)return!1;const t=n.getBoundingClientRect(),r=e.getBoundingClientRect();return t.top>=r.top&&t.bottom<=r.bottom&&t.left>=r.left&&t.right<=r.right}function Sp(n,e,t){const r=[];for(let s=n;s<=e;s+=t)r.push(s);return r}function rs({min:n,max:e,step:t,value:r,onSelect:s,reversed:o}){const i=Tn(),l=T.useRef(null),a=Sp(n,e,t),c=(o?a.reverse():a).map(u=>m.jsx(pl,{value:u,active:r===u,onSelect:s},u));return T.useEffect(()=>{r!==null&&requestAnimationFrame(()=>{var f;const d=(f=l.current)==null?void 0:f.querySelector(`[data-value="${r}"]`);vp(d,l.current)||d==null||d.scrollIntoView({block:"nearest"})})},[r]),m.jsx(x.ScrollArea,{h:i.maxDropdownContentHeight,type:"never",viewportRef:l,...i.getStyles("scrollarea"),...i.scrollAreaProps,children:m.jsx("div",{...i.getStyles("controlsList"),children:c})})}rs.displayName="@mantine/dates/TimeControlsList";function ps(n){const[e=null,t=null,r=null]=n.split(":").map(Number);return{hours:e,minutes:t,seconds:r}}function bu({time:n,compare:e,withSeconds:t}){const r=ps(n),s=ps(e);return t?r.hours===s.hours&&r.minutes===s.minutes&&r.seconds===s.seconds:r.hours===s.hours&&r.minutes===s.minutes}function Cp(n,e){return`${n.getHours()}:${n.getMinutes()}${e?`:${n.getSeconds()}`:""}`}function Mp({value:n,format:e,amPmLabels:t,withSeconds:r}){const s=ps(typeof n=="string"?n:Cp(n,r));if(s.hours===null||s.minutes===null)return null;if(e==="24h")return`${Ve(s.hours)}:${Ve(s.minutes)}${r?`:${Ve(s.seconds||0)}`:""}`;const o=s.hours>=12;return`${s.hours%12===0?12:s.hours%12}:${Ve(s.minutes)}${r?`:${Ve(s.seconds||0)}`:""} ${o?t.pm:t.am}`}function ku({value:n,format:e="24h",amPmLabels:t={am:"AM",pm:"PM"},withSeconds:r=!1}){return m.jsx(m.Fragment,{children:Mp({value:n,format:e,amPmLabels:t,withSeconds:r})})}ku.displayName="@mantine/dates/TimeValue";function ml({value:n,active:e,onChange:t,format:r,amPmLabels:s,withSeconds:o}){const i=Tn();return m.jsx(x.UnstyledButton,{mod:{active:e},onClick:()=>t(n),...i.getStyles("presetControl"),children:m.jsx(ku,{withSeconds:o,value:n,format:r,amPmLabels:s})})}ml.displayName="@mantine/dates/TimePresetControl";function xu({value:n,data:e,onChange:t,format:r,amPmLabels:s,withSeconds:o}){const i=Tn(),l=e.values.map(a=>m.jsx(ml,{value:a,format:r,amPmLabels:s,withSeconds:o,active:bu({time:a,compare:n,withSeconds:o}),onChange:t},a));return m.jsxs("div",{...i.getStyles("presetsGroup"),children:[m.jsx("div",{...i.getStyles("presetsGroupLabel"),children:e.label}),m.jsx(x.SimpleGrid,{cols:o?2:3,spacing:4,children:l})]})}xu.displayName="@mantine/dates/TimePresetGroup";function vu({presets:n,format:e,amPmLabels:t,withSeconds:r,value:s,onChange:o}){const i=Tn();if(n.length===0)return null;if(typeof n[0]=="string"){const a=n.map(c=>m.jsx(ml,{value:c,format:e,amPmLabels:t,withSeconds:r,active:bu({time:c,compare:s,withSeconds:r}),onChange:o},c));return m.jsx(x.ScrollArea.Autosize,{mah:i.maxDropdownContentHeight,type:"never",...i.getStyles("scrollarea"),...i.scrollAreaProps,children:m.jsx("div",{...i.getStyles("presetsRoot"),children:m.jsx(x.SimpleGrid,{cols:r?2:3,spacing:4,children:a})})})}const l=n.map((a,c)=>m.jsx(xu,{data:a,value:s,format:e,amPmLabels:t,withSeconds:r,onChange:o},c));return m.jsx(x.ScrollArea.Autosize,{mah:i.maxDropdownContentHeight,type:"never",...i.getStyles("scrollarea"),...i.scrollAreaProps,children:m.jsx("div",{...i.getStyles("presetsRoot"),children:l})})}vu.displayName="@mantine/dates/TimePresets";function Yo(n){const[e=0,t=0,r=0]=n.split(":").map(Number);return e*3600+t*60+r}function wp(n){const e=Math.floor(n/3600),t=Math.floor(n%3600/60),r=n%60;return{timeString:`${Ve(e)}:${Ve(t)}:${Ve(r)}`,hours:e,minutes:t,seconds:r}}function Su(n,e,t){const r=Yo(n),s=e?Yo(e):-1/0,o=t?Yo(t):1/0,i=Math.max(s,Math.min(r,o));return wp(i)}function Tp({hours:n,minutes:e,seconds:t,amPmLabels:r}){if(n===null)return{hours:null,minutes:null,seconds:null,amPm:null};const s=n>=12?r.pm:r.am;return{hours:n%12===0?12:n%12,minutes:typeof e=="number"?e:null,seconds:typeof t=="number"?t:null,amPm:s}}function sr({time:n,format:e,amPmLabels:t}){if(n==="")return{hours:null,minutes:null,seconds:null,amPm:null};const{hours:r,minutes:s,seconds:o}=ps(n),i={hours:r,minutes:s,seconds:o};return e==="12h"?Tp({...i,amPmLabels:t}):{...i,amPm:null}}function Ep({hours:n,minutes:e,seconds:t,amPm:r,amPmLabels:s,withSeconds:o}){let i=n;return r===s.pm&&n!==12?i+=12:r===s.am&&n===12&&(i=0),`${Ve(i)}:${Ve(e)}${o?`:${Ve(t||0)}`:""}`}function ss({hours:n,minutes:e,seconds:t,format:r,withSeconds:s,amPm:o,amPmLabels:i}){return n===null||e===null?{valid:!1,value:""}:s&&t===null?{valid:!1,value:""}:r==="24h"?{valid:!0,value:`${Ve(n)}:${Ve(e)}${s?`:${Ve(t)}`:""}`}:o===null?{valid:!1,value:""}:{valid:!0,value:Ep({hours:n,minutes:e,seconds:t,amPm:o,amPmLabels:i,withSeconds:s})}}function Ap({value:n,defaultValue:e,onChange:t,format:r,amPmLabels:s,withSeconds:o=!1,min:i,max:l,clearable:a,readOnly:c,disabled:u,pasteSplit:d}){const f=sr({time:n||e||"",amPmLabels:s,format:r}),h=T.useRef(!0),[p,g]=T.useState(f.hours),[y,b]=T.useState(f.minutes),[k,M]=T.useState(f.seconds),[E,v]=T.useState(f.amPm),C=a&&!c&&!u&&(p!==null||y!==null||k!==null||E!==null),w=T.useRef(null),O=T.useRef(null),L=T.useRef(null),z=T.useRef(null),P=S=>{var A,D,_,J;S==="hours"&&((A=w.current)==null||A.focus()),S==="minutes"&&((D=O.current)==null||D.focus()),S==="seconds"&&((_=L.current)==null||_.focus()),S==="amPm"&&((J=z.current)==null||J.focus())},$=(S,A)=>{const D={hours:p,minutes:y,seconds:k,amPm:E,[S]:A},_=ss({...D,format:r,withSeconds:o,amPmLabels:s});_.valid?(h.current=!1,S==="hours"&&g(A),S==="minutes"&&b(A),S==="seconds"&&M(A),S==="amPm"&&v(A),t==null||t(_.value)):(h.current=!1,typeof n=="string"&&n!==""&&(t==null||t("")))},B=S=>{h.current=!1;const A=sr({time:S,amPmLabels:s,format:r});g(A.hours),b(A.minutes),M(A.seconds),v(A.amPm),t==null||t(S)},H=S=>{let A=S;r==="12h"&&typeof S=="number"&&S>12&&(A=(S-1)%12+1),g(A),$("hours",A),P("hours")},G=S=>{b(S),$("minutes",S),P("minutes")},K=S=>{M(S),$("seconds",S),P("seconds")},X=S=>{v(S),$("amPm",S),P("amPm")},q=()=>{h.current=!1,g(null),b(null),M(null),v(null),t==null||t(""),P("hours")},U=S=>{S.preventDefault();const A=S.clipboardData.getData("text"),D=(d||sr)({time:A,format:r,amPmLabels:s}),_=ss({...D,format:r,withSeconds:o,amPmLabels:s});if(_.valid){h.current=!1;const J=Su(_.value,i||"00:00:00",l||"23:59:59");t==null||t(J.timeString),g(D.hours),b(D.minutes),M(D.seconds),v(D.amPm)}},j=ss({hours:p,minutes:y,seconds:k,format:r,withSeconds:o,amPm:E,amPmLabels:s});return hs(()=>{if(n===""){h.current=!1,g(null),b(null),M(null),v(null),h.current=!0;return}if(h.current&&typeof n=="string"){const S=sr({time:n||"",amPmLabels:s,format:r});g(S.hours),b(S.minutes),M(S.seconds),v(S.amPm)}h.current=!0},[n]),{refs:{hours:w,minutes:O,seconds:L,amPm:z},values:{hours:p,minutes:y,seconds:k,amPm:E},setHours:H,setMinutes:G,setSeconds:K,setAmPm:X,focus:P,clear:q,onPaste:U,setTimeString:B,isClearable:C,hiddenInputValue:j.value}}var Cu={fieldsRoot:"m_7a8f1e6d",fieldsGroup:"m_d6bb0a54",controlsList:"m_b97ecb26",controlsListGroup:"m_31fe42f9",dropdown:"m_9c4817c3",control:"m_154c536b",presetControl:"m_7be09d0c",presetsGroup:"m_7d00001d",presetsGroupLabel:"m_d8d918d7",field:"m_6b43ba88"};const Op={hoursStep:1,minutesStep:1,secondsStep:1,format:"24h",amPmLabels:{am:"AM",pm:"PM"},pasteSplit:sr,maxDropdownContentHeight:200,hoursPlaceholder:"--",minutesPlaceholder:"--",secondsPlaceholder:"--"},Dp=x.createVarsResolver((n,{size:e})=>({dropdown:{"--control-font-size":x.getFontSize(e)}})),gl=x.factory((n,e)=>{const t=x.useProps("TimePicker",Op,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,onClick:c,format:u,value:d,defaultValue:f,onChange:h,hoursStep:p,minutesStep:g,secondsStep:y,withSeconds:b,hoursInputLabel:k,minutesInputLabel:M,secondsInputLabel:E,amPmInputLabel:v,amPmLabels:C,clearable:w,onMouseDown:O,onFocusCapture:L,onBlurCapture:z,min:P,max:$,popoverProps:B,withDropdown:H,rightSection:G,onFocus:K,onBlur:X,clearButtonProps:q,hoursInputProps:U,minutesInputProps:j,secondsInputProps:S,amPmSelectProps:A,readOnly:D,disabled:_,size:J,name:de,form:N,hiddenInputProps:Q,labelProps:oe,pasteSplit:te,hoursRef:pe,minutesRef:he,secondsRef:ae,amPmRef:se,presets:Oe,maxDropdownContentHeight:ue,scrollAreaProps:ke,attributes:ce,reverseTimeControlsList:Ee,hoursPlaceholder:Dn,minutesPlaceholder:rn,secondsPlaceholder:sn,...on}=t,{resolvedClassNames:ln,resolvedStyles:an}=x.useResolvedStylesApi({classNames:r,styles:i,props:t}),Xe=x.useStyles({name:"TimePicker",classes:Cu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:ce,vars:a,varsResolver:Dp}),V=Ap({value:d,defaultValue:f,onChange:h,format:u,amPmLabels:C,withSeconds:b,min:P,max:$,clearable:w,disabled:_,readOnly:D,pasteSplit:te}),Qe=rr(V.refs.hours,pe),Ze=rr(V.refs.minutes,he),cn=rr(V.refs.seconds,ae),Nn=rr(V.refs.amPm,se),Pr=pp(),Gn=T.useRef(!1),[_o,It]=T.useState(!1),ft=ne=>{Gn.current||(Gn.current=!0,K==null||K(ne))},Bo=ne=>{if(!ne.currentTarget.contains(ne.relatedTarget)){const xe=V.values,ot=ss({...xe,format:u,amPmLabels:C,withSeconds:!!b});if(ot.valid&&(P||$)){const jt=Su(ot.value,P,$);jt.timeString!==ot.value&&V.setTimeString(jt.timeString)}Gn.current=!1,X==null||X(ne)}};return m.jsx(xp,{value:{getStyles:Xe,scrollAreaProps:ke,maxDropdownContentHeight:ue},children:m.jsxs(x.Popover,{opened:_o,transitionProps:{duration:0},position:"bottom-start",withRoles:!1,disabled:_||D||!H,...B,children:[m.jsx(x.Popover.Target,{children:m.jsxs(x.InputBase,{component:"div",size:J,disabled:_,ref:e,onClick:ne=>{c==null||c(ne),V.focus("hours")},onMouseDown:ne=>{ne.preventDefault(),O==null||O(ne)},onFocusCapture:ne=>{It(!0),L==null||L(ne)},onBlurCapture:ne=>{It(!1),z==null||z(ne)},rightSection:G||V.isClearable&&m.jsx(x.CloseButton,{...q,size:J,onClick:ne=>{var xe;V.clear(),(xe=q==null?void 0:q.onClick)==null||xe.call(q,ne)},onMouseDown:ne=>{var xe;ne.preventDefault(),(xe=q==null?void 0:q.onMouseDown)==null||xe.call(q,ne)}}),labelProps:{htmlFor:Pr,...oe},style:o,className:s,classNames:ln,styles:an,__staticSelector:"TimePicker",...on,children:[m.jsx("div",{...Xe("fieldsRoot"),dir:"ltr",children:m.jsxs("div",{...Xe("fieldsGroup"),onBlur:Bo,children:[m.jsx(ns,{id:Pr,...U,...Xe("field",{className:U==null?void 0:U.className,style:U==null?void 0:U.style}),value:V.values.hours,onChange:V.setHours,onNextInput:()=>V.focus("minutes"),min:u==="12h"?1:0,max:u==="12h"?12:23,allowTemporaryZero:u==="12h",focusable:!0,step:p,ref:Qe,"aria-label":k,readOnly:D,disabled:_,onPaste:V.onPaste,onFocus:ne=>{var xe;ft(ne),(xe=U==null?void 0:U.onFocus)==null||xe.call(U,ne)},onBlur:ne=>{var jt;const xe=ne.currentTarget.value,ot=xe?parseInt(xe,10):null;u==="12h"&&ot===0&&V.setHours(12),(jt=U==null?void 0:U.onBlur)==null||jt.call(U,ne)},placeholder:Dn}),m.jsx("span",{children:":"}),m.jsx(ns,{...j,...Xe("field",{className:j==null?void 0:j.className,style:j==null?void 0:j.style}),value:V.values.minutes,onChange:V.setMinutes,min:0,max:59,focusable:!0,step:g,ref:Ze,onPreviousInput:()=>V.focus("hours"),onNextInput:()=>b?V.focus("seconds"):V.focus("amPm"),"aria-label":M,tabIndex:-1,readOnly:D,disabled:_,onPaste:V.onPaste,onFocus:ne=>{var xe;ft(ne),(xe=j==null?void 0:j.onFocus)==null||xe.call(j,ne)},placeholder:rn}),b&&m.jsxs(m.Fragment,{children:[m.jsx("span",{children:":"}),m.jsx(ns,{...S,...Xe("field",{className:S==null?void 0:S.className,style:S==null?void 0:S.style}),value:V.values.seconds,onChange:V.setSeconds,min:0,max:59,focusable:!0,step:y,ref:cn,onPreviousInput:()=>V.focus("minutes"),onNextInput:()=>V.focus("amPm"),"aria-label":E,tabIndex:-1,readOnly:D,disabled:_,onPaste:V.onPaste,onFocus:ne=>{var xe;ft(ne),(xe=S==null?void 0:S.onFocus)==null||xe.call(S,ne)},placeholder:sn})]}),u==="12h"&&m.jsx(gu,{...A,inputType:H?"input":"select",labels:C,value:V.values.amPm,onChange:V.setAmPm,ref:Nn,"aria-label":v,onPreviousInput:()=>b?V.focus("seconds"):V.focus("minutes"),readOnly:D,disabled:_,tabIndex:-1,onPaste:V.onPaste,onFocus:ne=>{var xe;ft(ne),(xe=A==null?void 0:A.onFocus)==null||xe.call(A,ne)}})]})}),m.jsx("input",{type:"hidden",name:de,form:N,value:V.hiddenInputValue,...Q})]})}),m.jsx(x.Popover.Dropdown,{...Xe("dropdown"),onMouseDown:ne=>ne.preventDefault(),children:Oe?m.jsx(vu,{value:V.hiddenInputValue,onChange:V.setTimeString,format:u,presets:Oe,amPmLabels:C,withSeconds:b||!1}):m.jsxs("div",{...Xe("controlsListGroup"),children:[m.jsx(rs,{min:u==="12h"?1:0,max:u==="12h"?12:23,step:p,value:V.values.hours,onSelect:V.setHours,reversed:Ee}),m.jsx(rs,{min:0,max:59,step:g,value:V.values.minutes,onSelect:V.setMinutes,reversed:Ee}),b&&m.jsx(rs,{min:0,max:59,step:y,value:V.values.seconds,onSelect:V.setSeconds,reversed:Ee}),u==="12h"&&m.jsx(yu,{labels:C,value:V.values.amPm,onSelect:V.setAmPm})]})})]})})});gl.displayName="@mantine/dates/TimePicker";gl.classes=Cu;var Mu={day:"m_396ce5cb"};const Np=x.createVarsResolver((n,{size:e})=>({day:{"--day-size":x.getSize(e,"day-size")}})),yl=x.factory((n,e)=>{const t=x.useProps("Day",null,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,date:c,disabled:u,__staticSelector:d,weekend:f,outside:h,selected:p,renderDay:g,inRange:y,firstInRange:b,lastInRange:k,hidden:M,static:E,highlightToday:v,attributes:C,...w}=t,O=x.useStyles({name:d||"Day",classes:Mu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:C,vars:a,varsResolver:Np,rootSelector:"day"});return m.jsx(x.UnstyledButton,{...O("day",{style:M?{display:"none"}:void 0}),component:E?"div":"button",ref:e,disabled:u,"data-today":R(c).isSame(new Date,"day")||void 0,"data-hidden":M||void 0,"data-highlight-today":v||void 0,"data-disabled":u||void 0,"data-weekend":!u&&!h&&f||void 0,"data-outside":!u&&h||void 0,"data-selected":!u&&p||void 0,"data-in-range":y&&!u||void 0,"data-first-in-range":b&&!u||void 0,"data-last-in-range":k&&!u||void 0,"data-static":E||void 0,unstyled:l,...w,children:(g==null?void 0:g(c))||R(c).date()})});yl.classes=Mu;yl.displayName="@mantine/dates/Day";function Rp({locale:n,format:e="dd",firstDayOfWeek:t=1}){const r=R().day(t),s=[];for(let o=0;o<7;o+=1)typeof e=="string"?s.push(R(r).add(o,"days").locale(n).format(e)):s.push(e(R(r).add(o,"days").format("YYYY-MM-DD")));return s}var wu={weekday:"m_18a3eca"};const Lp=x.createVarsResolver((n,{size:e})=>({weekdaysRow:{"--wr-fz":x.getFontSize(e),"--wr-spacing":x.getSpacing(e)}})),bl=x.factory((n,e)=>{const t=x.useProps("WeekdaysRow",null,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,locale:c,firstDayOfWeek:u,weekdayFormat:d,cellComponent:f="th",__staticSelector:h,withWeekNumbers:p,attributes:g,...y}=t,b=x.useStyles({name:h||"WeekdaysRow",classes:wu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:g,vars:a,varsResolver:Lp,rootSelector:"weekdaysRow"}),k=Rt(),M=Rp({locale:k.getLocale(c),format:d,firstDayOfWeek:k.getFirstDayOfWeek(u)}).map((E,v)=>m.jsx(f,{...b("weekday"),children:E},v));return m.jsxs(x.Box,{component:"tr",ref:e,...b("weekdaysRow"),...y,children:[p&&m.jsx(f,{...b("weekday"),children:"#"}),M]})});bl.classes=wu;bl.displayName="@mantine/dates/WeekdaysRow";function Ip(n,e=1){let t=R(n);if(!t.isValid())return t;const r=e===0?6:e-1;for(;t.day()!==r;)t=t.add(1,"day");return t.format("YYYY-MM-DD")}function jp(n,e=1){let t=R(n);for(;t.day()!==e;)t=t.subtract(1,"day");return t.format("YYYY-MM-DD")}function Pp({month:n,firstDayOfWeek:e=1,consistentWeeks:t}){const r=R(n).subtract(R(n).date()-1,"day"),s=R(r.format("YYYY-M-D")),o=s.format("YYYY-MM-DD"),i=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),l=Ip(i,e),a=[];let c=R(jp(o,e));for(;R(c).isBefore(l,"day");){const u=[];for(let d=0;d<7;d+=1)u.push(c.format("YYYY-MM-DD")),c=c.add(1,"day");a.push(u)}if(t&&a.length<6){const u=a[a.length-1],d=u[u.length-1];let f=R(d).add(1,"day");for(;a.length<6;){const h=[];for(let p=0;p<7;p+=1)h.push(f.format("YYYY-MM-DD")),f=f.add(1,"day");a.push(h)}}return a}function io(n,e){return R(n).format("YYYY-MM")===R(e).format("YYYY-MM")}function Tu(n,e){return e?R(n).isAfter(R(e).subtract(1,"day"),"day"):!0}function Eu(n,e){return e?R(n).isBefore(R(e).add(1,"day"),"day"):!0}function _p({dates:n,minDate:e,maxDate:t,getDayProps:r,excludeDate:s,hideOutsideDates:o,month:i}){const l=n.flat().filter(u=>{var d;return Eu(u,t)&&Tu(u,e)&&!(s!=null&&s(u))&&!((d=r==null?void 0:r(u))!=null&&d.disabled)&&(!o||io(u,i))}),a=l.find(u=>{var d;return(d=r==null?void 0:r(u))==null?void 0:d.selected});if(a)return a;const c=l.find(u=>R().isSame(u,"date"));return c||l[0]}var is={exports:{}},Bp=is.exports,Oa;function Fp(){return Oa||(Oa=1,(function(n,e){(function(t,r){n.exports=r()})(Bp,(function(){var t="day";return function(r,s,o){var i=function(c){return c.add(4-c.isoWeekday(),t)},l=s.prototype;l.isoWeekYear=function(){return i(this).year()},l.isoWeek=function(c){if(!this.$utils().u(c))return this.add(7*(c-this.isoWeek()),t);var u,d,f,h,p=i(this),g=(u=this.isoWeekYear(),d=this.$u,f=(d?o.utc:o)().year(u).startOf("year"),h=4-f.isoWeekday(),f.isoWeekday()>4&&(h+=7),f.add(h,t));return p.diff(g,"week")+1},l.isoWeekday=function(c){return this.$utils().u(c)?this.day()||7:this.day(this.day()%7?c:c-7)};var a=l.startOf;l.startOf=function(c,u){var d=this.$utils(),f=!!d.u(u)||u;return d.p(c)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):a.bind(this)(c,u)}}}))})(is)),is.exports}var zp=Fp();const $p=ll(zp);R.extend($p);function Vp(n){const e=n.find(t=>R(t).day()===1);return R(e).isoWeek()}var Au={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Hp={withCellSpacing:!0},Wp=x.createVarsResolver((n,{size:e})=>({weekNumber:{"--wn-fz":x.getFontSize(e),"--wn-size":x.getSize(e,"wn-size")}})),lo=x.factory((n,e)=>{const t=x.useProps("Month",Hp,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,__staticSelector:c,locale:u,firstDayOfWeek:d,weekdayFormat:f,month:h,weekendDays:p,getDayProps:g,excludeDate:y,minDate:b,maxDate:k,renderDay:M,hideOutsideDates:E,hideWeekdays:v,getDayAriaLabel:C,static:w,__getDayRef:O,__onDayKeyDown:L,__onDayClick:z,__onDayMouseEnter:P,__preventFocus:$,__stopPropagation:B,withCellSpacing:H,size:G,highlightToday:K,withWeekNumbers:X,attributes:q,...U}=t,j=x.useStyles({name:c||"Month",classes:Au,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:q,vars:a,varsResolver:Wp,rootSelector:"month"}),S=Rt(),A=Pp({month:h,firstDayOfWeek:S.getFirstDayOfWeek(d),consistentWeeks:S.consistentWeeks}),D=_p({dates:A,minDate:He(b),maxDate:He(k),getDayProps:g,excludeDate:y,hideOutsideDates:E,month:h}),{resolvedClassNames:_,resolvedStyles:J}=x.useResolvedStylesApi({classNames:r,styles:i,props:t}),de=A.map((N,Q)=>{const oe=N.map((te,pe)=>{const he=!io(te,h),ae=(C==null?void 0:C(te))||R(te).locale(u||S.locale).format("D MMMM YYYY"),se=g==null?void 0:g(te),Oe=R(te).isSame(D,"date");return m.jsx("td",{...j("monthCell"),"data-with-spacing":H||void 0,children:m.jsx(yl,{__staticSelector:c||"Month",classNames:_,styles:J,unstyled:l,"data-mantine-stop-propagation":B||void 0,highlightToday:K,renderDay:M,date:te,size:G,weekend:S.getWeekendDays(p).includes(R(te).get("day")),outside:he,hidden:E?he:!1,"aria-label":ae,static:w,disabled:(y==null?void 0:y(te))||!Eu(te,He(k))||!Tu(te,He(b)),ref:ue=>{ue&&(O==null||O(Q,pe,ue))},...se,onKeyDown:ue=>{var ke;(ke=se==null?void 0:se.onKeyDown)==null||ke.call(se,ue),L==null||L(ue,{rowIndex:Q,cellIndex:pe,date:te})},onMouseEnter:ue=>{var ke;(ke=se==null?void 0:se.onMouseEnter)==null||ke.call(se,ue),P==null||P(ue,te)},onClick:ue=>{var ke;(ke=se==null?void 0:se.onClick)==null||ke.call(se,ue),z==null||z(ue,te)},onMouseDown:ue=>{var ke;(ke=se==null?void 0:se.onMouseDown)==null||ke.call(se,ue),$&&ue.preventDefault()},tabIndex:$||!Oe?-1:0})},te.toString())});return m.jsxs("tr",{...j("monthRow"),children:[X&&m.jsx("td",{...j("weekNumber"),children:Vp(N)}),oe]},Q)});return m.jsxs(x.Box,{component:"table",...j("month"),size:G,ref:e,...U,children:[!v&&m.jsx("thead",{...j("monthThead"),children:m.jsx(bl,{__staticSelector:c||"Month",locale:u,firstDayOfWeek:d,weekdayFormat:f,size:G,classNames:_,styles:J,unstyled:l,withWeekNumbers:X})}),m.jsx("tbody",{...j("monthTbody"),children:de})]})});lo.classes=Au;lo.displayName="@mantine/dates/Month";var Ou={pickerControl:"m_dc6a3c71"};const Yp=x.createVarsResolver((n,{size:e})=>({pickerControl:{"--dpc-fz":x.getFontSize(e),"--dpc-size":x.getSize(e,"dpc-size")}})),ao=x.factory((n,e)=>{const t=x.useProps("PickerControl",null,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,firstInRange:c,lastInRange:u,inRange:d,__staticSelector:f,selected:h,disabled:p,attributes:g,...y}=t,b=x.useStyles({name:f||"PickerControl",classes:Ou,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:g,vars:a,varsResolver:Yp,rootSelector:"pickerControl"});return m.jsx(x.UnstyledButton,{...b("pickerControl"),ref:e,unstyled:l,"data-picker-control":!0,"data-selected":h&&!p||void 0,"data-disabled":p||void 0,"data-in-range":d&&!p&&!h||void 0,"data-first-in-range":c&&!p||void 0,"data-last-in-range":u&&!p||void 0,disabled:p,...y})});ao.classes=Ou;ao.displayName="@mantine/dates/PickerControl";function Du({year:n,minDate:e,maxDate:t}){return!e&&!t?!1:!!(e&&R(n).isBefore(e,"year")||t&&R(n).isAfter(t,"year"))}function qp({years:n,minDate:e,maxDate:t,getYearControlProps:r}){const s=n.flat().filter(l=>{var a;return!Du({year:l,minDate:e,maxDate:t})&&!((a=r==null?void 0:r(l))!=null&&a.disabled)}),o=s.find(l=>{var a;return(a=r==null?void 0:r(l))==null?void 0:a.selected});if(o)return o;const i=s.find(l=>R().isSame(l,"year"));return i||s[0]}function Nu(n){const e=R(n).year(),t=e-e%10;let r=0;const s=[[],[],[],[]];for(let o=0;o<4;o+=1){const i=o===3?1:3;for(let l=0;l<i;l+=1)s[o].push(R(new Date(t+r,0)).format("YYYY-MM-DD")),r+=1}return s}var Ru={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Up={yearsListFormat:"YYYY",withCellSpacing:!0},co=x.factory((n,e)=>{const t=x.useProps("YearsList",Up,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,decade:c,yearsListFormat:u,locale:d,minDate:f,maxDate:h,getYearControlProps:p,__staticSelector:g,__getControlRef:y,__onControlKeyDown:b,__onControlClick:k,__onControlMouseEnter:M,__preventFocus:E,__stopPropagation:v,withCellSpacing:C,size:w,attributes:O,...L}=t,z=x.useStyles({name:g||"YearsList",classes:Ru,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:O,vars:a,rootSelector:"yearsList"}),P=Rt(),$=Nu(c),B=qp({years:$,minDate:f,maxDate:h,getYearControlProps:p}),H=$.map((G,K)=>{const X=G.map((q,U)=>{const j=p==null?void 0:p(q),S=R(q).isSame(B,"year");return m.jsx("td",{...z("yearsListCell"),"data-with-spacing":C||void 0,children:m.jsx(ao,{...z("yearsListControl"),size:w,unstyled:l,"data-mantine-stop-propagation":v||void 0,disabled:Du({year:q,minDate:f,maxDate:h}),ref:A=>{A&&(y==null||y(K,U,A))},...j,onKeyDown:A=>{var D;(D=j==null?void 0:j.onKeyDown)==null||D.call(j,A),b==null||b(A,{rowIndex:K,cellIndex:U,date:q})},onClick:A=>{var D;(D=j==null?void 0:j.onClick)==null||D.call(j,A),k==null||k(A,q)},onMouseEnter:A=>{var D;(D=j==null?void 0:j.onMouseEnter)==null||D.call(j,A),M==null||M(A,q)},onMouseDown:A=>{var D;(D=j==null?void 0:j.onMouseDown)==null||D.call(j,A),E&&A.preventDefault()},tabIndex:E||!S?-1:0,children:R(q).locale(P.getLocale(d)).format(u)})},U)});return m.jsx("tr",{...z("yearsListRow"),children:X},K)});return m.jsx(x.Box,{component:"table",ref:e,size:w,...z("yearsList"),...L,children:m.jsx("tbody",{children:H})})});co.classes=Ru;co.displayName="@mantine/dates/YearsList";function Lu({month:n,minDate:e,maxDate:t}){return!e&&!t?!1:!!(e&&R(n).isBefore(e,"month")||t&&R(n).isAfter(t,"month"))}function Kp({months:n,minDate:e,maxDate:t,getMonthControlProps:r}){const s=n.flat().filter(l=>{var a;return!Lu({month:l,minDate:e,maxDate:t})&&!((a=r==null?void 0:r(l))!=null&&a.disabled)}),o=s.find(l=>{var a;return(a=r==null?void 0:r(l))==null?void 0:a.selected});if(o)return o;const i=s.find(l=>R().isSame(l,"month"));return i||s[0]}function Jp(n){const e=R(n).startOf("year").toDate(),t=[[],[],[],[]];let r=0;for(let s=0;s<4;s+=1)for(let o=0;o<3;o+=1)t[s].push(R(e).add(r,"months").format("YYYY-MM-DD")),r+=1;return t}var Iu={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Gp={monthsListFormat:"MMM",withCellSpacing:!0},uo=x.factory((n,e)=>{const t=x.useProps("MonthsList",Gp,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,__staticSelector:c,year:u,monthsListFormat:d,locale:f,minDate:h,maxDate:p,getMonthControlProps:g,__getControlRef:y,__onControlKeyDown:b,__onControlClick:k,__onControlMouseEnter:M,__preventFocus:E,__stopPropagation:v,withCellSpacing:C,size:w,attributes:O,...L}=t,z=x.useStyles({name:c||"MonthsList",classes:Iu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:O,vars:a,rootSelector:"monthsList"}),P=Rt(),$=Jp(u),B=Kp({months:$,minDate:He(h),maxDate:He(p),getMonthControlProps:g}),H=$.map((G,K)=>{const X=G.map((q,U)=>{const j=g==null?void 0:g(q),S=R(q).isSame(B,"month");return m.jsx("td",{...z("monthsListCell"),"data-with-spacing":C||void 0,children:m.jsx(ao,{...z("monthsListControl"),size:w,unstyled:l,__staticSelector:c||"MonthsList","data-mantine-stop-propagation":v||void 0,disabled:Lu({month:q,minDate:He(h),maxDate:He(p)}),ref:A=>{A&&(y==null||y(K,U,A))},...j,onKeyDown:A=>{var D;(D=j==null?void 0:j.onKeyDown)==null||D.call(j,A),b==null||b(A,{rowIndex:K,cellIndex:U,date:q})},onClick:A=>{var D;(D=j==null?void 0:j.onClick)==null||D.call(j,A),k==null||k(A,q)},onMouseEnter:A=>{var D;(D=j==null?void 0:j.onMouseEnter)==null||D.call(j,A),M==null||M(A,q)},onMouseDown:A=>{var D;(D=j==null?void 0:j.onMouseDown)==null||D.call(j,A),E&&A.preventDefault()},tabIndex:E||!S?-1:0,children:R(q).locale(P.getLocale(f)).format(d)})},U)});return m.jsx("tr",{...z("monthsListRow"),children:X},K)});return m.jsx(x.Box,{component:"table",ref:e,size:w,...z("monthsList"),...L,children:m.jsx("tbody",{children:H})})});uo.classes=Iu;uo.displayName="@mantine/dates/MonthsList";var ju={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const Xp={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},Qp=x.createVarsResolver((n,{size:e})=>({calendarHeader:{"--dch-control-size":x.getSize(e,"dch-control-size"),"--dch-fz":x.getFontSize(e)}})),Zt=x.factory((n,e)=>{const t=x.useProps("CalendarHeader",Xp,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,nextIcon:c,previousIcon:u,nextLabel:d,previousLabel:f,onNext:h,onPrevious:p,onLevelClick:g,label:y,nextDisabled:b,previousDisabled:k,hasNextLevel:M,levelControlAriaLabel:E,withNext:v,withPrevious:C,headerControlsOrder:w,__staticSelector:O,__preventFocus:L,__stopPropagation:z,attributes:P,...$}=t,B=x.useStyles({name:O||"CalendarHeader",classes:ju,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:P,vars:a,varsResolver:Qp,rootSelector:"calendarHeader"}),H=L?U=>U.preventDefault():void 0,G=C&&T.createElement(x.UnstyledButton,{...B("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":f,onClick:p,unstyled:l,onMouseDown:H,disabled:k,"data-disabled":k||void 0,tabIndex:L||k?-1:0,"data-mantine-stop-propagation":z||void 0},u||m.jsx(x.AccordionChevron,{...B("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),K=T.createElement(x.UnstyledButton,{component:M?"button":"div",...B("calendarHeaderLevel"),key:"level",onClick:M?g:void 0,unstyled:l,onMouseDown:M?H:void 0,disabled:!M,"data-static":!M||void 0,"aria-label":E,tabIndex:L||!M?-1:0,"data-mantine-stop-propagation":z||void 0},y),X=v&&T.createElement(x.UnstyledButton,{...B("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":d,onClick:h,unstyled:l,onMouseDown:H,disabled:b,"data-disabled":b||void 0,tabIndex:L||b?-1:0,"data-mantine-stop-propagation":z||void 0},c||m.jsx(x.AccordionChevron,{...B("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),q=w.map(U=>U==="previous"?G:U==="level"?K:U==="next"?X:null);return m.jsx(x.Box,{...B("calendarHeader"),ref:e,...$,children:q})});Zt.classes=ju;Zt.displayName="@mantine/dates/CalendarHeader";function Zp(n){const e=Nu(n);return[e[0][0],e[3][0]]}const em={decadeLabelFormat:"YYYY"},fo=x.factory((n,e)=>{const t=x.useProps("DecadeLevel",em,n),{decade:r,locale:s,minDate:o,maxDate:i,yearsListFormat:l,getYearControlProps:a,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,withCellSpacing:h,__preventFocus:p,nextIcon:g,previousIcon:y,nextLabel:b,previousLabel:k,onNext:M,onPrevious:E,nextDisabled:v,previousDisabled:C,levelControlAriaLabel:w,withNext:O,withPrevious:L,headerControlsOrder:z,decadeLabelFormat:P,classNames:$,styles:B,unstyled:H,__staticSelector:G,__stopPropagation:K,size:X,attributes:q,...U}=t,j=Rt(),[S,A]=Zp(r),D={__staticSelector:G||"DecadeLevel",classNames:$,styles:B,unstyled:H,size:X,attributes:q},_=typeof v=="boolean"?v:i?!R(A).endOf("year").isBefore(i):!1,J=typeof C=="boolean"?C:o?!R(S).startOf("year").isAfter(o):!1,de=(N,Q)=>R(N).locale(s||j.locale).format(Q);return m.jsxs(x.Box,{"data-decade-level":!0,size:X,ref:e,...U,children:[m.jsx(Zt,{label:typeof P=="function"?P(S,A):`${de(S,P)} – ${de(A,P)}`,__preventFocus:p,__stopPropagation:K,nextIcon:g,previousIcon:y,nextLabel:b,previousLabel:k,onNext:M,onPrevious:E,nextDisabled:_,previousDisabled:J,hasNextLevel:!1,levelControlAriaLabel:w,withNext:O,withPrevious:L,headerControlsOrder:z,...D}),m.jsx(co,{decade:r,locale:s,minDate:o,maxDate:i,yearsListFormat:l,getYearControlProps:a,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,__preventFocus:p,__stopPropagation:K,withCellSpacing:h,...D})]})});fo.classes={...co.classes,...Zt.classes};fo.displayName="@mantine/dates/DecadeLevel";const tm={yearLabelFormat:"YYYY"},ho=x.factory((n,e)=>{const t=x.useProps("YearLevel",tm,n),{year:r,locale:s,minDate:o,maxDate:i,monthsListFormat:l,getMonthControlProps:a,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,withCellSpacing:h,__preventFocus:p,nextIcon:g,previousIcon:y,nextLabel:b,previousLabel:k,onNext:M,onPrevious:E,onLevelClick:v,nextDisabled:C,previousDisabled:w,hasNextLevel:O,levelControlAriaLabel:L,withNext:z,withPrevious:P,headerControlsOrder:$,yearLabelFormat:B,__staticSelector:H,__stopPropagation:G,size:K,classNames:X,styles:q,unstyled:U,attributes:j,...S}=t,A=Rt(),D={__staticSelector:H||"YearLevel",classNames:X,styles:q,unstyled:U,size:K,attributes:j},_=typeof C=="boolean"?C:i?!R(r).endOf("year").isBefore(i):!1,J=typeof w=="boolean"?w:o?!R(r).startOf("year").isAfter(o):!1;return m.jsxs(x.Box,{"data-year-level":!0,size:K,ref:e,...S,children:[m.jsx(Zt,{label:typeof B=="function"?B(r):R(r).locale(s||A.locale).format(B),__preventFocus:p,__stopPropagation:G,nextIcon:g,previousIcon:y,nextLabel:b,previousLabel:k,onNext:M,onPrevious:E,onLevelClick:v,nextDisabled:_,previousDisabled:J,hasNextLevel:O,levelControlAriaLabel:L,withNext:z,withPrevious:P,headerControlsOrder:$,...D}),m.jsx(uo,{year:r,locale:s,minDate:o,maxDate:i,monthsListFormat:l,getMonthControlProps:a,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,__preventFocus:p,__stopPropagation:G,withCellSpacing:h,...D})]})});ho.classes={...Zt.classes,...uo.classes};ho.displayName="@mantine/dates/YearLevel";const nm={monthLabelFormat:"MMMM YYYY"},po=x.factory((n,e)=>{const t=x.useProps("MonthLevel",nm,n),{month:r,locale:s,firstDayOfWeek:o,weekdayFormat:i,weekendDays:l,getDayProps:a,excludeDate:c,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:h,hideWeekdays:p,getDayAriaLabel:g,__getDayRef:y,__onDayKeyDown:b,__onDayClick:k,__onDayMouseEnter:M,withCellSpacing:E,highlightToday:v,withWeekNumbers:C,__preventFocus:w,__stopPropagation:O,nextIcon:L,previousIcon:z,nextLabel:P,previousLabel:$,onNext:B,onPrevious:H,onLevelClick:G,nextDisabled:K,previousDisabled:X,hasNextLevel:q,levelControlAriaLabel:U,withNext:j,withPrevious:S,headerControlsOrder:A,monthLabelFormat:D,classNames:_,styles:J,unstyled:de,__staticSelector:N,size:Q,static:oe,attributes:te,...pe}=t,he=Rt(),ae={__staticSelector:N||"MonthLevel",classNames:_,styles:J,unstyled:de,size:Q,attributes:te},se=typeof K=="boolean"?K:d?!R(r).endOf("month").isBefore(d):!1,Oe=typeof X=="boolean"?X:u?!R(r).startOf("month").isAfter(u):!1;return m.jsxs(x.Box,{"data-month-level":!0,size:Q,ref:e,...pe,children:[m.jsx(Zt,{label:typeof D=="function"?D(r):R(r).locale(s||he.locale).format(D),__preventFocus:w,__stopPropagation:O,nextIcon:L,previousIcon:z,nextLabel:P,previousLabel:$,onNext:B,onPrevious:H,onLevelClick:G,nextDisabled:se,previousDisabled:Oe,hasNextLevel:q,levelControlAriaLabel:U,withNext:j,withPrevious:S,headerControlsOrder:A,...ae}),m.jsx(lo,{month:r,locale:s,firstDayOfWeek:o,weekdayFormat:i,weekendDays:l,getDayProps:a,excludeDate:c,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:h,hideWeekdays:p,getDayAriaLabel:g,__getDayRef:y,__onDayKeyDown:b,__onDayClick:k,__onDayMouseEnter:M,__preventFocus:w,__stopPropagation:O,static:oe,withCellSpacing:E,highlightToday:v,withWeekNumbers:C,...ae})]})});po.classes={...lo.classes,...Zt.classes};po.displayName="@mantine/dates/MonthLevel";var Pu={levelsGroup:"m_30b26e33"};const en=x.factory((n,e)=>{const t=x.useProps("LevelsGroup",null,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,__staticSelector:c,attributes:u,...d}=t,f=x.useStyles({name:c||"LevelsGroup",classes:Pu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:u,vars:a,rootSelector:"levelsGroup"});return m.jsx(x.Box,{ref:e,...f("levelsGroup"),...d})});en.classes=Pu;en.displayName="@mantine/dates/LevelsGroup";const rm={numberOfColumns:1},mo=x.factory((n,e)=>{const t=x.useProps("DecadeLevelGroup",rm,n),{decade:r,locale:s,minDate:o,maxDate:i,yearsListFormat:l,getYearControlProps:a,__onControlClick:c,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:f,nextIcon:h,previousIcon:p,nextLabel:g,previousLabel:y,onNext:b,onPrevious:k,nextDisabled:M,previousDisabled:E,headerControlsOrder:v,classNames:C,styles:w,unstyled:O,__staticSelector:L,__stopPropagation:z,numberOfColumns:P,levelControlAriaLabel:$,decadeLabelFormat:B,size:H,vars:G,attributes:K,...X}=t,q=T.useRef([]),U=Array(P).fill(0).map((j,S)=>{const A=R(r).add(S*10,"years").format("YYYY-MM-DD");return m.jsx(fo,{size:H,yearsListFormat:l,decade:A,withNext:S===P-1,withPrevious:S===0,decadeLabelFormat:B,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(D,_)=>dl({levelIndex:S,rowIndex:_.rowIndex,cellIndex:_.cellIndex,event:D,controlsRef:q}),__getControlRef:(D,_,J)=>{Array.isArray(q.current[S])||(q.current[S]=[]),Array.isArray(q.current[S][D])||(q.current[S][D]=[]),q.current[S][D][_]=J},levelControlAriaLabel:typeof $=="function"?$(A):$,locale:s,minDate:o,maxDate:i,__preventFocus:f,__stopPropagation:z,nextIcon:h,previousIcon:p,nextLabel:g,previousLabel:y,onNext:b,onPrevious:k,nextDisabled:M,previousDisabled:E,getYearControlProps:a,__staticSelector:L||"DecadeLevelGroup",classNames:C,styles:w,unstyled:O,withCellSpacing:d,headerControlsOrder:v,attributes:K},S)});return m.jsx(en,{classNames:C,styles:w,__staticSelector:L||"DecadeLevelGroup",ref:e,size:H,unstyled:O,attributes:K,...X,children:U})});mo.classes={...en.classes,...fo.classes};mo.displayName="@mantine/dates/DecadeLevelGroup";const sm={numberOfColumns:1},go=x.factory((n,e)=>{const t=x.useProps("YearLevelGroup",sm,n),{year:r,locale:s,minDate:o,maxDate:i,monthsListFormat:l,getMonthControlProps:a,__onControlClick:c,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:f,nextIcon:h,previousIcon:p,nextLabel:g,previousLabel:y,onNext:b,onPrevious:k,onLevelClick:M,nextDisabled:E,previousDisabled:v,hasNextLevel:C,headerControlsOrder:w,classNames:O,styles:L,unstyled:z,__staticSelector:P,__stopPropagation:$,numberOfColumns:B,levelControlAriaLabel:H,yearLabelFormat:G,size:K,vars:X,attributes:q,...U}=t,j=T.useRef([]),S=Array(B).fill(0).map((A,D)=>{const _=R(r).add(D,"years").format("YYYY-MM-DD");return m.jsx(ho,{size:K,monthsListFormat:l,year:_,withNext:D===B-1,withPrevious:D===0,yearLabelFormat:G,__stopPropagation:$,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(J,de)=>dl({levelIndex:D,rowIndex:de.rowIndex,cellIndex:de.cellIndex,event:J,controlsRef:j}),__getControlRef:(J,de,N)=>{Array.isArray(j.current[D])||(j.current[D]=[]),Array.isArray(j.current[D][J])||(j.current[D][J]=[]),j.current[D][J][de]=N},levelControlAriaLabel:typeof H=="function"?H(_):H,locale:s,minDate:o,maxDate:i,__preventFocus:f,nextIcon:h,previousIcon:p,nextLabel:g,previousLabel:y,onNext:b,onPrevious:k,onLevelClick:M,nextDisabled:E,previousDisabled:v,hasNextLevel:C,getMonthControlProps:a,classNames:O,styles:L,unstyled:z,__staticSelector:P||"YearLevelGroup",withCellSpacing:d,headerControlsOrder:w,attributes:q},D)});return m.jsx(en,{classNames:O,styles:L,__staticSelector:P||"YearLevelGroup",ref:e,size:K,unstyled:z,attributes:q,...U,children:S})});go.classes={...ho.classes,...en.classes};go.displayName="@mantine/dates/YearLevelGroup";const om={numberOfColumns:1},yo=x.factory((n,e)=>{const t=x.useProps("MonthLevelGroup",om,n),{month:r,locale:s,firstDayOfWeek:o,weekdayFormat:i,weekendDays:l,getDayProps:a,excludeDate:c,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:h,hideWeekdays:p,getDayAriaLabel:g,__onDayClick:y,__onDayMouseEnter:b,withCellSpacing:k,highlightToday:M,withWeekNumbers:E,__preventFocus:v,nextIcon:C,previousIcon:w,nextLabel:O,previousLabel:L,onNext:z,onPrevious:P,onLevelClick:$,nextDisabled:B,previousDisabled:H,hasNextLevel:G,headerControlsOrder:K,classNames:X,styles:q,unstyled:U,numberOfColumns:j,levelControlAriaLabel:S,monthLabelFormat:A,__staticSelector:D,__stopPropagation:_,size:J,static:de,vars:N,attributes:Q,...oe}=t,te=T.useRef([]),pe=Array(j).fill(0).map((he,ae)=>{const se=R(r).add(ae,"months").format("YYYY-MM-DD");return m.jsx(po,{month:se,withNext:ae===j-1,withPrevious:ae===0,monthLabelFormat:A,__stopPropagation:_,__onDayClick:y,__onDayMouseEnter:b,__onDayKeyDown:(Oe,ue)=>dl({levelIndex:ae,rowIndex:ue.rowIndex,cellIndex:ue.cellIndex,event:Oe,controlsRef:te}),__getDayRef:(Oe,ue,ke)=>{Array.isArray(te.current[ae])||(te.current[ae]=[]),Array.isArray(te.current[ae][Oe])||(te.current[ae][Oe]=[]),te.current[ae][Oe][ue]=ke},levelControlAriaLabel:typeof S=="function"?S(se):S,locale:s,firstDayOfWeek:o,weekdayFormat:i,weekendDays:l,getDayProps:a,excludeDate:c,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:h,hideWeekdays:p,getDayAriaLabel:g,__preventFocus:v,nextIcon:C,previousIcon:w,nextLabel:O,previousLabel:L,onNext:z,onPrevious:P,onLevelClick:$,nextDisabled:B,previousDisabled:H,hasNextLevel:G,classNames:X,styles:q,unstyled:U,__staticSelector:D||"MonthLevelGroup",size:J,static:de,withCellSpacing:k,highlightToday:M,withWeekNumbers:E,headerControlsOrder:K,attributes:Q},ae)});return m.jsx(en,{classNames:X,styles:q,__staticSelector:D||"MonthLevelGroup",ref:e,size:J,attributes:Q,...oe,children:pe})});yo.classes={...en.classes,...po.classes};yo.displayName="@mantine/dates/MonthLevelGroup";var _u={input:"m_6fa5e2aa"};const bo=x.factory((n,e)=>{const{inputProps:t,wrapperProps:r,placeholder:s,classNames:o,styles:i,unstyled:l,popoverProps:a,modalProps:c,dropdownType:u,children:d,formattedValue:f,dropdownHandlers:h,dropdownOpened:p,onClick:g,clearable:y,onClear:b,clearButtonProps:k,rightSection:M,shouldClear:E,readOnly:v,disabled:C,value:w,name:O,form:L,type:z,onDropdownClose:P,withTime:$,...B}=x.useInputProps("PickerInputBase",{size:"sm"},n),H=m.jsx(x.Input.ClearButton,{onClick:b,unstyled:l,...k}),G=()=>{z==="range"&&Array.isArray(w)&&w[0]&&!w[1]&&b(),h.close()};return m.jsxs(m.Fragment,{children:[u==="modal"&&!v&&m.jsx(x.Modal,{opened:p,onClose:G,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:l,...c,children:d}),m.jsx(x.Input.Wrapper,{...r,children:m.jsxs(x.Popover,{position:"bottom-start",opened:p,trapFocus:!0,returnFocus:!1,unstyled:l,onClose:P,...a,disabled:(a==null?void 0:a.disabled)||u==="modal"||v,onChange:K=>{var X;K||((X=a==null?void 0:a.onClose)==null||X.call(a),G())},children:[m.jsx(x.Popover.Target,{children:m.jsx(x.Input,{"data-dates-input":!0,"data-read-only":v||void 0,disabled:C,component:"button",type:"button",multiline:!0,onClick:K=>{g==null||g(K),h.toggle()},__clearSection:H,__clearable:y&&E&&!v&&!C,rightSection:M,...t,ref:e,classNames:{...o,input:pu(_u.input,o==null?void 0:o.input)},...B,children:f||m.jsx(x.Input.Placeholder,{error:t.error,unstyled:l,className:o==null?void 0:o.placeholder,style:i==null?void 0:i.placeholder,children:s})})}),m.jsx(x.Popover.Dropdown,{"data-dates-dropdown":!0,children:d})]})}),m.jsx(fl,{value:w,name:O,form:L,type:z,withTime:$})]})});bo.classes=_u;bo.displayName="@mantine/dates/PickerInputBase";const Da=n=>n==="range"?[null,null]:n==="multiple"?[]:null,Na=(n,e)=>{const t=e?Fn:He;return Array.isArray(n)?n.map(t):t(n)};function kr({type:n,value:e,defaultValue:t,onChange:r,withTime:s=!1}){const o=T.useRef(n),[i,l,a]=mu({value:Na(e,s),defaultValue:Na(t,s),finalValue:Da(n),onChange:r});let c=i;return o.current!==n&&(o.current=n,e===void 0&&(c=t!==void 0?t:Da(n),l(c))),[c,l,a]}function qo(n,e){return n?n==="month"?0:n==="year"?1:2:e||0}function im(n){return n===0?"month":n===1?"year":"decade"}function er(n,e,t){return im(ts(qo(n,0),qo(e,0),qo(t,2)))}const lm={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},Kn=x.factory((n,e)=>{const t=x.useProps("Calendar",lm,n),{vars:r,maxLevel:s,minLevel:o,defaultLevel:i,level:l,onLevelChange:a,date:c,defaultDate:u,onDateChange:d,numberOfColumns:f,columnsToScroll:h,ariaLabels:p,nextLabel:g,previousLabel:y,onYearSelect:b,onMonthSelect:k,onYearMouseEnter:M,onMonthMouseEnter:E,headerControlsOrder:v,__updateDateOnYearSelect:C,__updateDateOnMonthSelect:w,__setDateRef:O,__setLevelRef:L,firstDayOfWeek:z,weekdayFormat:P,weekendDays:$,getDayProps:B,excludeDate:H,renderDay:G,hideOutsideDates:K,hideWeekdays:X,getDayAriaLabel:q,monthLabelFormat:U,nextIcon:j,previousIcon:S,__onDayClick:A,__onDayMouseEnter:D,withCellSpacing:_,highlightToday:J,withWeekNumbers:de,monthsListFormat:N,getMonthControlProps:Q,yearLabelFormat:oe,yearsListFormat:te,getYearControlProps:pe,decadeLabelFormat:he,classNames:ae,styles:se,unstyled:Oe,minDate:ue,maxDate:ke,locale:ce,__staticSelector:Ee,size:Dn,__preventFocus:rn,__stopPropagation:sn,onNextDecade:on,onPreviousDecade:ln,onNextYear:an,onPreviousYear:Xe,onNextMonth:V,onPreviousMonth:Qe,static:Ze,enableKeyboardNavigation:cn,attributes:Nn,...Pr}=t,{resolvedClassNames:Gn,resolvedStyles:_o}=x.useResolvedStylesApi({classNames:ae,styles:se,props:t}),[It,ft]=mu({value:l?er(l,o,s):void 0,defaultValue:i?er(i,o,s):void 0,finalValue:er(void 0,o,s),onChange:a}),[Bo,ne]=kr({type:"default",value:He(c),defaultValue:He(u),onChange:d});T.useImperativeHandle(O,()=>ge=>{ne(ge)}),T.useImperativeHandle(L,()=>ge=>{ft(ge)});const xe={__staticSelector:Ee||"Calendar",styles:_o,classNames:Gn,unstyled:Oe,size:Dn,attributes:Nn},ot=h||f||1,jt=new Date,Ch=ue&&R(jt).isAfter(ue)?ue:R(jt).format("YYYY-MM-DD"),Ct=Bo||Ch,Mh=()=>{const ge=R(Ct).add(ot,"month").format("YYYY-MM-DD");V==null||V(ge),ne(ge)},wh=()=>{const ge=R(Ct).subtract(ot,"month").format("YYYY-MM-DD");Qe==null||Qe(ge),ne(ge)},Fo=()=>{const ge=R(Ct).add(ot,"year").format("YYYY-MM-DD");an==null||an(ge),ne(ge)},zo=()=>{const ge=R(Ct).subtract(ot,"year").format("YYYY-MM-DD");Xe==null||Xe(ge),ne(ge)},$o=()=>{const ge=R(Ct).add(10*ot,"year").format("YYYY-MM-DD");on==null||on(ge),ne(ge)},Vo=()=>{const ge=R(Ct).subtract(10*ot,"year").format("YYYY-MM-DD");ln==null||ln(ge),ne(ge)},ha=T.useRef(null);T.useEffect(()=>{if(!cn||Ze)return;const ge=qe=>{var ma;if(!((ma=ha.current)!=null&&ma.contains(document.activeElement)))return;const _r=qe.ctrlKey||qe.metaKey,pa=qe.shiftKey;switch(qe.key){case"ArrowUp":_r&&pa?(qe.preventDefault(),Vo()):_r&&(qe.preventDefault(),zo());break;case"ArrowDown":_r&&pa?(qe.preventDefault(),$o()):_r&&(qe.preventDefault(),Fo());break;case"y":case"Y":It==="month"&&(qe.preventDefault(),ft("year"));break}};return document.addEventListener("keydown",ge),()=>{document.removeEventListener("keydown",ge)}},[cn,Ze,It,Fo,zo,$o,Vo]);const Th=ge=>{ha.current=ge,typeof e=="function"?e(ge):e&&(e.current=ge)};return m.jsxs(x.Box,{ref:Th,size:Dn,"data-calendar":!0,...Pr,children:[It==="month"&&m.jsx(yo,{month:Ct,minDate:ue,maxDate:ke,firstDayOfWeek:z,weekdayFormat:P,weekendDays:$,getDayProps:B,excludeDate:H,renderDay:G,hideOutsideDates:K,hideWeekdays:X,getDayAriaLabel:q,onNext:Mh,onPrevious:wh,hasNextLevel:s!=="month",onLevelClick:()=>ft("year"),numberOfColumns:f,locale:ce,levelControlAriaLabel:p==null?void 0:p.monthLevelControl,nextLabel:(p==null?void 0:p.nextMonth)??g,nextIcon:j,previousLabel:(p==null?void 0:p.previousMonth)??y,previousIcon:S,monthLabelFormat:U,__onDayClick:A,__onDayMouseEnter:D,__preventFocus:rn,__stopPropagation:sn,static:Ze,withCellSpacing:_,highlightToday:J,withWeekNumbers:de,headerControlsOrder:v,...xe}),It==="year"&&m.jsx(go,{year:Ct,numberOfColumns:f,minDate:ue,maxDate:ke,monthsListFormat:N,getMonthControlProps:Q,locale:ce,onNext:Fo,onPrevious:zo,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>ft("decade"),levelControlAriaLabel:p==null?void 0:p.yearLevelControl,nextLabel:(p==null?void 0:p.nextYear)??g,nextIcon:j,previousLabel:(p==null?void 0:p.previousYear)??y,previousIcon:S,yearLabelFormat:oe,__onControlMouseEnter:E,__onControlClick:(ge,qe)=>{w&&ne(qe),ft(er("month",o,s)),k==null||k(qe)},__preventFocus:rn,__stopPropagation:sn,withCellSpacing:_,headerControlsOrder:v,...xe}),It==="decade"&&m.jsx(mo,{decade:Ct,minDate:ue,maxDate:ke,yearsListFormat:te,getYearControlProps:pe,locale:ce,onNext:$o,onPrevious:Vo,numberOfColumns:f,nextLabel:(p==null?void 0:p.nextDecade)??g,nextIcon:j,previousLabel:(p==null?void 0:p.previousDecade)??y,previousIcon:S,decadeLabelFormat:he,__onControlMouseEnter:M,__onControlClick:(ge,qe)=>{C&&ne(qe),ft(er("year",o,s)),b==null||b(qe)},__preventFocus:rn,__stopPropagation:sn,withCellSpacing:_,headerControlsOrder:v,...xe})]})});Kn.classes={...mo.classes,...go.classes,...yo.classes};Kn.displayName="@mantine/dates/Calendar";function kl(n){const{maxLevel:e,minLevel:t,defaultLevel:r,level:s,onLevelChange:o,nextIcon:i,previousIcon:l,date:a,defaultDate:c,onDateChange:u,numberOfColumns:d,columnsToScroll:f,ariaLabels:h,nextLabel:p,previousLabel:g,onYearSelect:y,onMonthSelect:b,onYearMouseEnter:k,onMonthMouseEnter:M,onNextMonth:E,onPreviousMonth:v,onNextYear:C,onPreviousYear:w,onNextDecade:O,onPreviousDecade:L,withCellSpacing:z,highlightToday:P,__updateDateOnYearSelect:$,__updateDateOnMonthSelect:B,__setDateRef:H,__setLevelRef:G,withWeekNumbers:K,headerControlsOrder:X,firstDayOfWeek:q,weekdayFormat:U,weekendDays:j,getDayProps:S,excludeDate:A,renderDay:D,hideOutsideDates:_,hideWeekdays:J,getDayAriaLabel:de,monthLabelFormat:N,monthsListFormat:Q,getMonthControlProps:oe,yearLabelFormat:te,yearsListFormat:pe,getYearControlProps:he,decadeLabelFormat:ae,allowSingleDateInRange:se,allowDeselect:Oe,minDate:ue,maxDate:ke,locale:ce,...Ee}=n;return{calendarProps:{maxLevel:e,minLevel:t,defaultLevel:r,level:s,onLevelChange:o,nextIcon:i,previousIcon:l,date:a,defaultDate:c,onDateChange:u,numberOfColumns:d,columnsToScroll:f,ariaLabels:h,nextLabel:p,previousLabel:g,onYearSelect:y,onMonthSelect:b,onYearMouseEnter:k,onMonthMouseEnter:M,onNextMonth:E,onPreviousMonth:v,onNextYear:C,onPreviousYear:w,onNextDecade:O,onPreviousDecade:L,withCellSpacing:z,highlightToday:P,__updateDateOnYearSelect:$,__updateDateOnMonthSelect:B,__setDateRef:H,withWeekNumbers:K,headerControlsOrder:X,firstDayOfWeek:q,weekdayFormat:U,weekendDays:j,getDayProps:S,excludeDate:A,renderDay:D,hideOutsideDates:_,hideWeekdays:J,getDayAriaLabel:de,monthLabelFormat:N,monthsListFormat:Q,getMonthControlProps:oe,yearLabelFormat:te,yearsListFormat:pe,getYearControlProps:he,decadeLabelFormat:ae,allowSingleDateInRange:se,allowDeselect:Oe,minDate:ue,maxDate:ke,locale:ce},others:Ee}}function Ra(n,e){const t=[...e].sort((r,s)=>R(r).isAfter(R(s))?1:-1);return R(t[0]).startOf("day").subtract(1,"ms").isBefore(n)&&R(t[1]).endOf("day").add(1,"ms").isAfter(n)}function am({type:n,level:e,value:t,defaultValue:r,onChange:s,allowSingleDateInRange:o,allowDeselect:i,onMouseLeave:l}){const[a,c]=kr({type:n,value:t,defaultValue:r,onChange:s}),[u,d]=T.useState(n==="range"&&a[0]&&!a[1]?a[0]:null),[f,h]=T.useState(null),p=v=>{if(n==="range"){if(u&&!a[1]){if(R(v).isSame(u,e)&&!o){d(null),h(null),c([null,null]);return}const C=[v,u];C.sort((w,O)=>R(w).isAfter(R(O))?1:-1),c(C),h(null),d(null);return}if(a[0]&&!a[1]&&R(v).isSame(a[0],e)&&!o){d(null),h(null),c([null,null]);return}c([v,null]),h(null),d(v);return}if(n==="multiple"){a.some(C=>R(C).isSame(v,e))?c(a.filter(C=>!R(C).isSame(v,e))):c([...a,v]);return}a&&i&&R(v).isSame(a,e)?c(null):c(v)},g=v=>u&&f?Ra(v,[f,u]):a[0]&&a[1]?Ra(v,a):!1,y=n==="range"?v=>{l==null||l(v),h(null)}:l,b=v=>a[0]&&R(v).isSame(a[0],e)?!(f&&R(f).isBefore(a[0])):!1,k=v=>a[1]?R(v).isSame(a[1],e):!a[0]||!f?!1:R(f).isBefore(a[0])&&R(v).isSame(a[0],e),M=v=>{if(n==="range")return{selected:a.some(w=>w&&R(w).isSame(v,e)),inRange:g(v),firstInRange:b(v),lastInRange:k(v),"data-autofocus":!!a[0]&&R(a[0]).isSame(v,e)||void 0};if(n==="multiple")return{selected:a.some(w=>w&&R(w).isSame(v,e)),"data-autofocus":!!a[0]&&R(a[0]).isSame(v,e)||void 0};const C=R(a).isSame(v,e);return{selected:C,"data-autofocus":C||void 0}},E=n==="range"&&u?h:()=>{};return T.useEffect(()=>{if(n==="range")if(a[0]&&!a[1])d(a[0]);else{const v=a[0]==null&&a[1]==null,C=a[0]!=null&&a[1]!=null;(v||C)&&(d(null),h(null))}},[a]),{onDateChange:p,onRootMouseLeave:y,onHoveredDateChange:E,getControlProps:M,_value:a,setValue:c}}var cm={datePickerRoot:"m_765a40cf",presetsList:"m_d6a681e1",presetButton:"m_acd30b22"};const um=x.createVarsResolver((n,{size:e})=>({datePickerRoot:{"--preset-font-size":x.getFontSize(e)}})),dm={type:"default",defaultLevel:"month",numberOfColumns:1,size:"sm"},ko=x.factory((n,e)=>{const t=x.useProps("DatePicker",dm,n),{allowDeselect:r,allowSingleDateInRange:s,value:o,defaultValue:i,onChange:l,onMouseLeave:a,classNames:c,styles:u,__staticSelector:d,__onDayClick:f,__onDayMouseEnter:h,__onPresetSelect:p,__stopPropagation:g,presets:y,className:b,style:k,unstyled:M,size:E,vars:v,attributes:C,...w}=t,{calendarProps:O,others:L}=kl(w),z=T.useRef(null),P=T.useRef(null),$=x.useStyles({name:d||"DatePicker",classes:cm,props:t,className:b,style:k,classNames:c,styles:u,unstyled:M,attributes:C,rootSelector:y?"datePickerRoot":void 0,varsResolver:um,vars:v}),{onDateChange:B,onRootMouseLeave:H,onHoveredDateChange:G,getControlProps:K,_value:X,setValue:q}=am({type:L.type,level:"day",allowDeselect:r,allowSingleDateInRange:s,value:o,defaultValue:i,onChange:l,onMouseLeave:a}),{resolvedClassNames:U,resolvedStyles:j}=x.useResolvedStylesApi({classNames:c,styles:u,props:t}),S=m.jsx(Kn,{ref:e,classNames:U,styles:j,__staticSelector:d||"DatePicker",onMouseLeave:H,size:E,...O,...y?{}:L,__stopPropagation:g,__setDateRef:z,__setLevelRef:P,minLevel:O.minLevel||"month",__onDayMouseEnter:(_,J)=>{G(J),h==null||h(_,J)},__onDayClick:(_,J)=>{B(J),f==null||f(_,J)},getDayProps:_=>{var J;return{...K(_),...(J=O.getDayProps)==null?void 0:J.call(O,_)}},getMonthControlProps:_=>{var J;return{selected:typeof X=="string"?io(_,X):!1,...(J=O.getMonthControlProps)==null?void 0:J.call(O,_)}},getYearControlProps:_=>{var J;return{selected:typeof X=="string"?R(_).isSame(X,"year"):!1,...(J=O.getYearControlProps)==null?void 0:J.call(O,_)}},hideOutsideDates:O.hideOutsideDates??O.numberOfColumns!==1,...y?{}:{className:b,style:k,attributes:C}});if(!y)return S;const A=_=>{var de,N;const J=Array.isArray(_)?_[0]:_;J!==void 0&&((de=z.current)==null||de.call(z,J),(N=P.current)==null||N.call(P,"month"),p?p(J):q(_))},D=y.map((_,J)=>m.jsx(x.UnstyledButton,{...$("presetButton"),onClick:()=>A(_.value),onMouseDown:de=>de.preventDefault(),"data-mantine-stop-propagation":g||void 0,children:_.label},J));return m.jsxs(x.Box,{...$("datePickerRoot"),size:E,...L,children:[m.jsx("div",{...$("presetsList"),children:D}),S]})});ko.classes=Kn.classes;ko.displayName="@mantine/dates/DatePicker";function fm(n){if(n===null)return null;const e=new Date(n);return Number.isNaN(e.getTime())||!n?null:R(e).format("YYYY-MM-DD")}function hm({date:n,maxDate:e,minDate:t}){return!(n==null||Number.isNaN(new Date(n).getTime())||e&&R(n).isAfter(e,"date")||t&&R(n).isBefore(t,"date"))}const pm={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},ms=x.factory((n,e)=>{const t=x.useInputProps("DateInput",pm,n),{inputProps:r,wrapperProps:s,value:o,defaultValue:i,onChange:l,clearable:a,clearButtonProps:c,popoverProps:u,getDayProps:d,locale:f,valueFormat:h,dateParser:p,minDate:g,maxDate:y,fixOnBlur:b,onFocus:k,onBlur:M,onClick:E,onKeyDown:v,readOnly:C,name:w,form:O,rightSection:L,unstyled:z,classNames:P,styles:$,allowDeselect:B,date:H,defaultDate:G,onDateChange:K,getMonthControlProps:X,getYearControlProps:q,disabled:U,...j}=t,S=T.useRef(null),A=T.useRef(null),[D,_]=T.useState(!1),{calendarProps:J,others:de}=kl(j),N=Rt(),oe=p||(V=>{const Qe=R(V,h,N.getLocale(f)).toDate();return Number.isNaN(Qe.getTime())?fm(V):R(Qe).format("YYYY-MM-DD")}),te=B!==void 0?B:a,pe=V=>V?R(V).locale(N.getLocale(f)).format(h):"",[he,ae,se]=kr({type:"default",value:o,defaultValue:i,onChange:l}),[Oe,ue]=kr({type:"default",value:H,defaultValue:i||G,onChange:K});T.useEffect(()=>{se&&o!==null&&ue(o)},[se,o]);const[ke,ce]=T.useState(pe(he));T.useEffect(()=>{ce(pe(he))},[N.getLocale(f)]);const Ee=V=>{const Qe=V.currentTarget.value;if(ce(Qe),_(!0),Qe.trim()===""&&(B||a))ae(null);else{const Ze=oe(Qe);Ze&&hm({date:Ze,minDate:g,maxDate:y})&&(ae(Ze),ue(Ze))}},Dn=V=>{M==null||M(V),_(!1),b&&ce(pe(he))},rn=V=>{k==null||k(V),_(!0)},sn=V=>{E==null||E(V),_(!0)},on=V=>{V.key==="Escape"&&_(!1),v==null||v(V)},ln=V=>({...d==null?void 0:d(V),selected:R(he).isSame(V,"day"),onClick:Qe=>{var cn,Nn;(Nn=d==null?void 0:(cn=d(V)).onClick)==null||Nn.call(cn,Qe);const Ze=te&&R(he).isSame(V,"day")?null:V;ae(Ze),!se&&Ze&&ce(pe(Ze)),_(!1)}}),an=m.jsx(x.Input.ClearButton,{onClick:()=>{ae(null),!se&&ce(""),_(!1)},unstyled:z,...c}),Xe=a&&!!he&&!C&&!U;return hs(()=>{he!==void 0&&!D&&ce(pe(he))},[he]),up(()=>_(!1),void 0,[S.current,A.current]),m.jsxs(m.Fragment,{children:[m.jsx(x.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:S,children:m.jsxs(x.Popover,{opened:D,trapFocus:!1,position:"bottom-start",disabled:C||U,withRoles:!1,unstyled:z,...u,children:[m.jsx(x.Popover.Target,{children:m.jsx(x.Input,{"data-dates-input":!0,"data-read-only":C||void 0,autoComplete:"off",ref:e,value:ke,onChange:Ee,onBlur:Dn,onFocus:rn,onClick:sn,onKeyDown:on,readOnly:C,rightSection:L,__clearSection:an,__clearable:Xe,...r,...de,disabled:U,__staticSelector:"DateInput"})}),m.jsx(x.Popover.Dropdown,{onMouseDown:V=>V.preventDefault(),"data-dates-dropdown":!0,ref:A,children:m.jsx(Kn,{__staticSelector:"DateInput",...J,classNames:P,styles:$,unstyled:z,__preventFocus:!0,minDate:g,maxDate:y,locale:f,getDayProps:ln,size:r.size,date:Oe,onDateChange:ue,getMonthControlProps:V=>({selected:typeof he=="string"?io(V,he):!1,...X==null?void 0:X(V)}),getYearControlProps:V=>({selected:typeof he=="string"?R(V).isSame(he,"year"):!1,...q==null?void 0:q(V)}),attributes:s.attributes})})]})}),m.jsx(fl,{name:w,form:O,value:he,type:"default"})]})});ms.classes={...x.Input.classes,...Kn.classes};ms.displayName="@mantine/dates/DateInput";function mm({minDate:n,value:e}){const t=n?R(n).format("HH:mm:ss"):null;return e&&n&&e===n?t??void 0:void 0}function gm({maxDate:n,value:e}){const t=n?R(n).format("HH:mm:ss"):null;return e&&n&&e===n?t??void 0:void 0}var Bu={timeWrapper:"m_208d2562",timeInput:"m_62ee059"};const ym={dropdownType:"popover",size:"sm"},gs=x.factory((n,e)=>{const t=x.useProps("DateTimePicker",ym,n),{value:r,defaultValue:s,onChange:o,valueFormat:i,locale:l,classNames:a,styles:c,unstyled:u,timePickerProps:d,submitButtonProps:f,withSeconds:h,level:p,defaultLevel:g,size:y,variant:b,dropdownType:k,vars:M,minDate:E,maxDate:v,defaultDate:C,defaultTimeValue:w,presets:O,attributes:L,onDropdownClose:z,...P}=t,$=x.useStyles({name:"DateTimePicker",classes:Bu,props:t,classNames:a,styles:c,unstyled:u,attributes:L,vars:M}),{resolvedClassNames:B,resolvedStyles:H}=x.useResolvedStylesApi({classNames:a,styles:c,props:t}),G=i||(h?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"),K=T.useRef(null),X=rr(K,d==null?void 0:d.hoursRef),{calendarProps:{allowSingleDateInRange:q,...U},others:j}=kl(P),S=Rt(),[A,D]=kr({type:"default",value:r,defaultValue:s,onChange:o,withTime:!0}),_=C||A,J=ce=>ce?R(ce).format(h?"HH:mm:ss":"HH:mm"):"",[de,N]=T.useState(w||J(A)),[Q,oe]=T.useState(p||g||"month"),[te,pe]=hl(!1),he=A?R(A).locale(S.getLocale(l)).format(G):"",ae=ce=>{var Ee;(Ee=d==null?void 0:d.onChange)==null||Ee.call(d,ce),N(ce),ce&&D(Ea(A,ce))},se=ce=>{var Ee;ce&&D(Ea(Wo(E,v,ce),de||w||"")),(Ee=K.current)==null||Ee.focus()},Oe=ce=>{ce.key==="Enter"&&(ce.preventDefault(),pe.close())};hs(()=>{te||N(J(A))},[A,te]),hs(()=>{te&&oe("month")},[te]);const ue=k==="popover",ke=()=>{const ce=Wo(E,v,A);A&&A!==ce&&D(Wo(E,v,A)),z==null||z()};return m.jsxs(bo,{formattedValue:he,dropdownOpened:P.disabled?!1:te,dropdownHandlers:pe,classNames:B,styles:H,unstyled:u,ref:e,onClear:()=>D(null),shouldClear:!!A,value:A,size:y,variant:b,dropdownType:k,...j,type:"default",__staticSelector:"DateTimePicker",onDropdownClose:ke,withTime:!0,attributes:L,children:[m.jsx(ko,{...U,maxDate:v,minDate:E,size:y,variant:b,type:"default",value:A,defaultDate:_||rp({maxDate:v,minDate:E}),onChange:se,locale:l,classNames:B,styles:H,unstyled:u,__staticSelector:"DateTimePicker",__stopPropagation:ue,level:p,defaultLevel:g,onLevelChange:ce=>{var Ee;oe(ce),(Ee=U.onLevelChange)==null||Ee.call(U,ce)},presets:O,__onPresetSelect:ce=>{D(ce),ce&&N(J(ce))},attributes:L}),Q==="month"&&m.jsxs("div",{...$("timeWrapper"),children:[m.jsx(gl,{value:de,withSeconds:h,unstyled:u,min:mm({minDate:E,value:A}),max:gm({maxDate:v,value:A}),...d,...$("timeInput",{className:d==null?void 0:d.className,style:d==null?void 0:d.style}),onChange:ae,onKeyDown:Oe,size:y,"data-mantine-stop-propagation":ue||void 0,hoursRef:X,attributes:L}),m.jsx(x.ActionIcon,{variant:"default",size:`input-${y||"sm"}`,...$("submitButton",{className:f==null?void 0:f.className,style:f==null?void 0:f.style}),unstyled:u,"data-mantine-stop-propagation":ue||void 0,children:m.jsx(x.CheckIcon,{size:"30%"}),...f,onClick:ce=>{var Ee;(Ee=f==null?void 0:f.onClick)==null||Ee.call(f,ce),pe.close(),ke()}})]})]})});gs.classes={...Bu,...bo.classes,...ko.classes};gs.displayName="@mantine/dates/DateTimePicker";function bm({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0,o=t.value?typeof t.value=="string"?new Date(t.value):t.value:null,i=l=>{const a=l?l.toISOString():null;t.onFieldChange(a)};return r||s?m.jsx(ms,{valueFormat:"YYYY-MMM-DD",value:o,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):m.jsx(ms,{valueFormat:"YYYY-MMM-DD",value:o,onChange:i,required:n.required,placeholder:n.placeholder,error:void 0})}function km({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0,o=t.value?typeof t.value=="string"?new Date(t.value):t.value:null,i=l=>{const a=l?l.toISOString():null;t.onFieldChange(a)};return r||s?m.jsx(gs,{valueFormat:"DD-MMM-YYYY hh:mm A",value:o,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):m.jsx(gs,{value:o,valueFormat:"DD-MMM-YYYY hh:mm A",onChange:i,required:n.required,placeholder:n.placeholder,error:void 0})}function xm({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?m.jsx(x.NumberInput,{value:t.value,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):m.jsx(x.NumberInput,{...t,onChange:o=>t.onFieldChange(Number(o)),required:n.required,placeholder:n.placeholder,error:void 0})}function vm({field:n,form:e,layout:t="vertical"}){var o;const r=n,s=al();return cl[t](m.jsx(m.Fragment,{children:(o=r.fields)==null?void 0:o.map(i=>m.jsx(oo,{field:i,layout:t,children:m.jsx(Po,{field:{...i,name:`${n.name}.${i.name}`},...s,form:e,layout:t})},`${n.name}.${i.name}`))}))}var Vr={exports:{}},Uo={};/**
22
+ <%s key={someKey} {...props} />`,_,N,Q,N),j[N+_]=!0)}if(N=null,D!==void 0&&(t(D),N=""+D),i(A)&&(t(A.key),N=""+A.key),"key"in A){D={};for(var oe in A)oe!=="key"&&(D[oe]=A[oe])}else D=A;return N&&l(D,typeof S=="function"?S.displayName||S.name||"Unknown":S),c(S,N,D,s(),J,de)}function d(S){f(S)?S._store&&(S._store.validated=1):typeof S=="object"&&S!==null&&S.$$typeof===L&&(S._payload.status==="fulfilled"?f(S._payload.value)&&S._payload.value._store&&(S._payload.value._store.validated=1):S._store&&(S._store.validated=1))}function f(S){return typeof S=="object"&&S!==null&&S.$$typeof===p}var h=T,p=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),E=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),P=Symbol.for("react.client.reference"),$=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=Object.prototype.hasOwnProperty,V=Array.isArray,G=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(S){return S()}};var K,X={},q=h.react_stack_bottom_frame.bind(h,o)(),U=G(r(o)),j={};Qn.Fragment=y,Qn.jsx=function(S,A,D){var _=1e4>$.recentlyCreatedOwnerStacks++;return u(S,A,D,!1,_?Error("react-stack-top-frame"):q,_?G(r(S)):U)},Qn.jsxs=function(S,A,D){var _=1e4>$.recentlyCreatedOwnerStacks++;return u(S,A,D,!0,_?Error("react-stack-top-frame"):q,_?G(r(S)):U)}})()),Qn}var ka;function Rh(){return ka||(ka=1,process.env.NODE_ENV==="production"?Br.exports=Dh():Br.exports=Nh()),Br.exports}var m=Rh();function Lh(n){if(!/^[0-9a-zA-Z-]+$/.test(n))throw new Error(`[@mantine/use-form] Form name "${n}" is invalid, it should contain only letters, numbers and dashes`)}const Ih=typeof window<"u"?T.useLayoutEffect:T.useEffect;function _e(n,e){Ih(()=>{if(n)return window.addEventListener(n,e),()=>window.removeEventListener(n,e)},[n])}function jh(n,e){n&&Lh(n),_e(`mantine-form:${n}:set-field-value`,t=>e.setFieldValue(t.detail.path,t.detail.value)),_e(`mantine-form:${n}:set-values`,t=>e.setValues(t.detail)),_e(`mantine-form:${n}:set-initial-values`,t=>e.setInitialValues(t.detail)),_e(`mantine-form:${n}:set-errors`,t=>e.setErrors(t.detail)),_e(`mantine-form:${n}:set-field-error`,t=>e.setFieldError(t.detail.path,t.detail.error)),_e(`mantine-form:${n}:clear-field-error`,t=>e.clearFieldError(t.detail)),_e(`mantine-form:${n}:clear-errors`,e.clearErrors),_e(`mantine-form:${n}:reset`,e.reset),_e(`mantine-form:${n}:validate`,e.validate),_e(`mantine-form:${n}:validate-field`,t=>e.validateField(t.detail)),_e(`mantine-form:${n}:reorder-list-item`,t=>e.reorderListItem(t.detail.path,t.detail.payload)),_e(`mantine-form:${n}:remove-list-item`,t=>e.removeListItem(t.detail.path,t.detail.index)),_e(`mantine-form:${n}:insert-list-item`,t=>e.insertListItem(t.detail.path,t.detail.item,t.detail.index)),_e(`mantine-form:${n}:set-dirty`,t=>e.setDirty(t.detail)),_e(`mantine-form:${n}:set-touched`,t=>e.setTouched(t.detail)),_e(`mantine-form:${n}:reset-dirty`,t=>e.resetDirty(t.detail)),_e(`mantine-form:${n}:reset-touched`,e.resetTouched)}function Ph(n){return e=>{if(!e)n(e);else if(typeof e=="function")n(e);else if(typeof e=="object"&&"nativeEvent"in e){const{currentTarget:t}=e;t instanceof HTMLInputElement?t.type==="checkbox"?n(t.checked):n(t.value):(t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)&&n(t.value)}else n(e)}}function wi(n){return n===null||typeof n!="object"?{}:Object.keys(n).reduce((e,t)=>{const r=n[t];return r!=null&&r!==!1&&(e[t]=r),e},{})}function _h(n){const[e,t]=T.useState(wi(n)),r=T.useRef(e),s=T.useCallback(a=>{t(c=>{const u=wi(typeof a=="function"?a(c):a);return r.current=u,u})},[]),o=T.useCallback(()=>s({}),[]),i=T.useCallback(a=>{r.current[a]!==void 0&&s(c=>{const u={...c};return delete u[a],u})},[e]),l=T.useCallback((a,c)=>{c==null||c===!1?i(a):r.current[a]!==c&&s(u=>({...u,[a]:c}))},[e]);return{errorsState:e,setErrors:s,clearErrors:o,setFieldError:l,clearFieldError:i}}function Ti(n,e){if(e===null||typeof e!="object")return{};const t={...e};return Object.keys(e).forEach(r=>{r.includes(`${String(n)}.`)&&delete t[r]}),t}function xa(n,e){const t=n.substring(e.length+1).split(".")[0];return parseInt(t,10)}function va(n,e,t,r){if(e===void 0)return t;const s=`${String(n)}`;let o=t;r===-1&&(o=Ti(`${s}.${e}`,o));const i={...o},l=new Set;return Object.entries(o).filter(([a])=>{if(!a.startsWith(`${s}.`))return!1;const c=xa(a,s);return Number.isNaN(c)?!1:c>=e}).forEach(([a,c])=>{const u=xa(a,s),d=a.replace(`${s}.${u}`,`${s}.${u+r}`);i[d]=c,l.add(d),l.has(a)||delete i[a]}),i}function Bh(n,{from:e,to:t},r){const s=`${n}.${e}`,o=`${n}.${t}`,i={...r},l=new Set;return Object.keys(r).forEach(a=>{if(l.has(a))return;let c,u;if(a.startsWith(s)?(c=a,u=a.replace(s,o)):a.startsWith(o)&&(c=a.replace(o,s),u=a),c&&u){const d=i[c],f=i[u];f===void 0?delete i[c]:i[c]=f,d===void 0?delete i[u]:i[u]=d,l.add(c),l.add(u)}}),i}function Sa(n,e,t){typeof t.value=="object"&&(t.value=Bn(t.value)),!t.enumerable||t.get||t.set||!t.configurable||!t.writable||e==="__proto__"?Object.defineProperty(n,e,t):n[e]=t.value}function Bn(n){if(typeof n!="object")return n;var e=0,t,r,s,o=Object.prototype.toString.call(n);if(o==="[object Object]"?s=Object.create(n.__proto__||null):o==="[object Array]"?s=Array(n.length):o==="[object Set]"?(s=new Set,n.forEach(function(i){s.add(Bn(i))})):o==="[object Map]"?(s=new Map,n.forEach(function(i,l){s.set(Bn(l),Bn(i))})):o==="[object Date]"?s=new Date(+n):o==="[object RegExp]"?s=new RegExp(n.source,n.flags):o==="[object DataView]"?s=new n.constructor(Bn(n.buffer)):o==="[object ArrayBuffer]"?s=n.slice(0):o.slice(-6)==="Array]"&&(s=new n.constructor(n)),s){for(r=Object.getOwnPropertySymbols(n);e<r.length;e++)Sa(s,r[e],Object.getOwnPropertyDescriptor(n,r[e]));for(e=0,r=Object.getOwnPropertyNames(n);e<r.length;e++)Object.hasOwnProperty.call(s,t=r[e])&&s[t]===n[t]||Sa(s,t,Object.getOwnPropertyDescriptor(n,t))}return s||n}function uu(n){return typeof n!="string"?[]:n.split(".")}function De(n,e){const t=uu(n);if(t.length===0||typeof e!="object"||e===null)return;let r=e[t[0]];for(let s=1;s<t.length&&r!=null;s+=1)r=r[t[s]];return r}function Nr(n,e,t){const r=uu(n);if(r.length===0)return t;const s=Bn(t);if(r.length===1)return s[r[0]]=e,s;let o=s[r[0]];for(let i=1;i<r.length-1;i+=1){if(o===void 0)return s;o=o[r[i]]}return o[r[r.length-1]]=e,s}function Fh(n,{from:e,to:t},r){const s=De(n,r);if(!Array.isArray(s))return r;const o=[...s],i=s[e];return o.splice(e,1),o.splice(t,0,i),Nr(n,o,r)}function zh(n,e,t,r){const s=De(n,r);if(!Array.isArray(s))return r;const o=[...s];return o.splice(typeof t=="number"?t:o.length,0,e),Nr(n,o,r)}function $h(n,e,t){const r=De(n,t);return Array.isArray(r)?Nr(n,r.filter((s,o)=>o!==e),t):t}function Vh(n,e,t,r){const s=De(n,r);if(!Array.isArray(s)||s.length<=t)return r;const o=[...s];return o[t]=e,Nr(n,o,r)}function Hh({$values:n,$errors:e,$status:t}){const r=T.useCallback((l,a)=>{t.clearFieldDirty(l),e.setErrors(c=>Bh(l,a,c)),n.setValues({values:Fh(l,a,n.refValues.current),updateState:!0})},[]),s=T.useCallback((l,a)=>{t.clearFieldDirty(l),e.setErrors(c=>va(l,a,c,-1)),n.setValues({values:$h(l,a,n.refValues.current),updateState:!0})},[]),o=T.useCallback((l,a,c)=>{t.clearFieldDirty(l),e.setErrors(u=>va(l,c,u,1)),n.setValues({values:zh(l,a,c,n.refValues.current),updateState:!0})},[]),i=T.useCallback((l,a,c)=>{t.clearFieldDirty(l),n.setValues({values:Vh(l,c,a,n.refValues.current),updateState:!0})},[]);return{reorderListItem:r,removeListItem:s,insertListItem:o,replaceListItem:i}}var Ho,Ca;function Wh(){return Ca||(Ca=1,Ho=function n(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,s,o;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!n(e[s],t[s]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=r;s--!==0;){var i=o[s];if(!n(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}),Ho}var Yh=Wh();const Fr=ll(Yh);function Zn(n,e){const t=Object.keys(n);if(typeof e=="string"){const r=t.filter(s=>s.startsWith(`${e}.`));return n[e]||r.some(s=>n[s])||!1}return t.some(r=>n[r])}function qh({initialDirty:n,initialTouched:e,mode:t,$values:r}){const[s,o]=T.useState(e),[i,l]=T.useState(n),a=T.useRef(e),c=T.useRef(n),u=T.useCallback(C=>{const w=typeof C=="function"?C(a.current):C;a.current=w,t==="controlled"&&o(w)},[]),d=T.useCallback((C,w=!1)=>{const O=typeof C=="function"?C(c.current):C;c.current=O,(t==="controlled"||w)&&l(O)},[]),f=T.useCallback(()=>u({}),[]),h=T.useCallback(C=>{const w=C?{...r.refValues.current,...C}:r.refValues.current;r.setValuesSnapshot(w),d({})},[]),p=T.useCallback((C,w)=>{u(O=>Zn(O,C)===w?O:{...O,[C]:w})},[]),g=T.useCallback((C,w,O)=>{d(L=>Zn(L,C)===w?L:{...L,[C]:w},O)},[]),y=T.useCallback((C,w)=>{const O=Zn(c.current,C),L=!Fr(De(C,r.getValuesSnapshot()),w),z=Ti(C,c.current);z[C]=L,d(z,O!==L)},[]),b=T.useCallback(C=>Zn(a.current,C),[]),k=T.useCallback(C=>d(w=>{if(typeof C!="string")return w;const O=Ti(C,w);return delete O[C],Fr(O,w)?w:O}),[]),M=T.useCallback(C=>{if(C){const O=De(C,c.current);if(typeof O=="boolean")return O;const L=De(C,r.refValues.current),z=De(C,r.valuesSnapshot.current);return!Fr(L,z)}return Object.keys(c.current).length>0?Zn(c.current):!Fr(r.refValues.current,r.valuesSnapshot.current)},[]),E=T.useCallback(()=>c.current,[]),v=T.useCallback(()=>a.current,[]);return{touchedState:s,dirtyState:i,touchedRef:a,dirtyRef:c,setTouched:u,setDirty:d,resetDirty:h,resetTouched:f,isTouched:b,setFieldTouched:p,setFieldDirty:g,setTouchedState:o,setDirtyState:l,clearFieldDirty:k,isDirty:M,getDirty:E,getTouched:v,setCalculatedFieldDirty:y}}function Uh({initialValues:n,onValuesChange:e,mode:t}){const r=T.useRef(!1),[s,o]=T.useState(n||{}),i=T.useRef(s),l=T.useRef(s),a=T.useCallback(({values:y,subscribers:b,updateState:k=!0,mergeWithPreviousValues:M=!0})=>{const E=i.current,v=y instanceof Function?y(i.current):y,C=M?{...E,...v}:v;i.current=C,k&&(o(C),t==="uncontrolled"&&(i.current=C)),e==null||e(C,E),b==null||b.filter(Boolean).forEach(w=>w({updatedValues:C,previousValues:E}))},[e]),c=T.useCallback(y=>{var M;const b=De(y.path,i.current),k=y.value instanceof Function?y.value(b):y.value;if(b!==k){const E=i.current,v=Nr(y.path,k,i.current);a({values:v,updateState:y.updateState}),(M=y.subscribers)==null||M.filter(Boolean).forEach(C=>C({path:y.path,updatedValues:v,previousValues:E}))}},[a]),u=T.useCallback(y=>{l.current=y},[]),d=T.useCallback((y,b)=>{r.current||(r.current=!0,a({values:y,updateState:t==="controlled"}),u(y),b())},[a]),f=T.useCallback(()=>{a({values:l.current,updateState:!0,mergeWithPreviousValues:!1})},[a]),h=T.useCallback(()=>i.current,[]),p=T.useCallback(()=>l.current,[]),g=T.useCallback((y,b)=>{const k=De(y,l.current);typeof k>"u"||c({path:y,value:k,updateState:t==="controlled",subscribers:b})},[c,t]);return{initialized:r,stateValues:s,refValues:i,valuesSnapshot:l,setValues:a,setFieldValue:c,resetValues:f,setValuesSnapshot:u,initialize:d,getValues:h,getValuesSnapshot:p,resetField:g}}function Kh({$status:n,cascadeUpdates:e}){const t=T.useRef({}),r=T.useCallback((o,i)=>{T.useEffect(()=>(t.current[o]=t.current[o]||[],t.current[o].push(i),()=>{t.current[o]=t.current[o].filter(l=>l!==i)}),[i])},[]),s=T.useCallback(o=>{var l;const i=((l=t.current[o])==null?void 0:l.map(a=>c=>a({previousValue:De(o,c.previousValues),value:De(o,c.updatedValues),touched:n.isTouched(o),dirty:n.isDirty(o)})))??[];if(e)for(const a in t.current)(a.startsWith(`${o}.`)||o.startsWith(`${a}.`))&&i.push(...t.current[a].map(c=>u=>c({previousValue:De(a,u.previousValues),value:De(a,u.updatedValues),touched:n.isTouched(a),dirty:n.isDirty(a)})));return i},[]);return{subscribers:t,watch:r,getFieldSubscribers:s}}function Ma(n,e){return n?`${n}-${e.toString()}`:e.toString()}const zr=Symbol("root-rule");function wa(n){const e=wi(n);return{hasErrors:Object.keys(e).length>0,errors:e}}function Ei(n,e,t="",r={}){return typeof n!="object"||n===null?r:Object.keys(n).reduce((s,o)=>{const i=n[o],l=`${t===""?"":`${t}.`}${o}`,a=De(l,e);let c=!1;return typeof i=="function"&&(s[l]=i(a,e,l)),typeof i=="object"&&Array.isArray(a)&&(c=!0,a.forEach((u,d)=>Ei(i,e,`${l}.${d}`,s)),zr in i&&(s[l]=i[zr](a,e,l))),typeof i=="object"&&typeof a=="object"&&a!==null&&(c||Ei(i,e,l,s),zr in i&&(s[l]=i[zr](a,e,l))),s},r)}function Ai(n,e){return wa(typeof n=="function"?n(e):Ei(n,e))}function $r(n,e,t){if(typeof n!="string")return{hasError:!1,error:null};const r=Ai(e,t),s=Object.keys(r.errors).find(o=>n.split(".").every((i,l)=>i===o.split(".")[l]));return{hasError:!!s,error:s?r.errors[s]:null}}const Jh="__MANTINE_FORM_INDEX__";function Ta(n,e){return e?typeof e=="boolean"?e:Array.isArray(e)?e.includes(n.replace(/[.][0-9]+/g,`.${Jh}`)):!1:!1}function Gh({name:n,mode:e="controlled",initialValues:t,initialErrors:r={},initialDirty:s={},initialTouched:o={},clearInputErrorOnChange:i=!0,validateInputOnChange:l=!1,validateInputOnBlur:a=!1,onValuesChange:c,transformValues:u=(y=>y),enhanceGetInputProps:d,validate:f,onSubmitPreventDefault:h="always",touchTrigger:p="change",cascadeUpdates:g=!1}={}){const y=_h(r),b=Uh({initialValues:t,onValuesChange:c,mode:e}),k=qh({initialDirty:s,initialTouched:o,$values:b,mode:e}),M=Hh({$values:b,$errors:y,$status:k}),E=Kh({$status:k,cascadeUpdates:g}),[v,C]=T.useState(0),[w,O]=T.useState({}),[L,z]=T.useState(!1),P=T.useCallback(()=>{b.resetValues(),y.clearErrors(),k.resetDirty(),k.resetTouched(),e==="uncontrolled"&&C(N=>N+1)},[]),$=T.useCallback(N=>{i&&y.clearErrors(),e==="uncontrolled"&&C(Q=>Q+1),Object.keys(E.subscribers.current).forEach(Q=>{const oe=De(Q,b.refValues.current),te=De(Q,N);oe!==te&&E.getFieldSubscribers(Q).forEach(pe=>pe({previousValues:N,updatedValues:b.refValues.current}))})},[i]),B=T.useCallback(N=>{const Q=b.refValues.current;b.initialize(N,()=>e==="uncontrolled"&&C(oe=>oe+1)),$(Q)},[$]),V=T.useCallback((N,Q,oe)=>{const te=Ta(N,l),pe=Q instanceof Function?Q(De(N,b.refValues.current)):Q;k.setCalculatedFieldDirty(N,pe),p==="change"&&k.setFieldTouched(N,!0),!te&&i&&y.clearFieldError(N),b.setFieldValue({path:N,value:Q,updateState:e==="controlled",subscribers:[...E.getFieldSubscribers(N),te?he=>{const ae=$r(N,f,he.updatedValues);ae.hasError?y.setFieldError(N,ae.error):y.clearFieldError(N)}:null,(oe==null?void 0:oe.forceUpdate)!==!1&&e!=="controlled"?()=>O(he=>({...he,[N]:(he[N]||0)+1})):null]})},[c,f]),G=T.useCallback(N=>{const Q=b.refValues.current;b.setValues({values:N,updateState:e==="controlled"}),$(Q)},[c,$]),K=T.useCallback(()=>{const N=Ai(f,b.refValues.current);return y.setErrors(N.errors),N},[f]),X=T.useCallback(N=>{const Q=$r(N,f,b.refValues.current);return Q.hasError?y.setFieldError(N,Q.error):y.clearFieldError(N),Q},[f]),q=(N,{type:Q="input",withError:oe=!0,withFocus:te=!0,...pe}={})=>{const ae={onChange:Ph(se=>V(N,se,{forceUpdate:!1})),"data-path":Ma(n,N)};return oe&&(ae.error=y.errorsState[N]),Q==="checkbox"?ae[e==="controlled"?"checked":"defaultChecked"]=De(N,b.refValues.current):ae[e==="controlled"?"value":"defaultValue"]=De(N,b.refValues.current),te&&(ae.onFocus=()=>k.setFieldTouched(N,!0),ae.onBlur=()=>{if(Ta(N,a)){const se=$r(N,f,b.refValues.current);se.hasError?y.setFieldError(N,se.error):y.clearFieldError(N)}}),Object.assign(ae,d==null?void 0:d({inputProps:ae,field:N,options:{type:Q,withError:oe,withFocus:te,...pe},form:de}))},U=(N,Q)=>oe=>{h==="always"&&(oe==null||oe.preventDefault());const te=K();if(te.hasErrors)h==="validation-failed"&&(oe==null||oe.preventDefault()),Q==null||Q(te.errors,b.refValues.current,oe);else{const pe=N==null?void 0:N(u(b.refValues.current),oe);pe instanceof Promise&&(z(!0),pe.finally(()=>z(!1)))}},j=N=>u(N||b.refValues.current),S=T.useCallback(N=>{N.preventDefault(),P()},[]),A=T.useCallback(N=>N?!$r(N,f,b.refValues.current).hasError:!Ai(f,b.refValues.current).hasErrors,[f]),D=N=>`${v}-${String(N)}-${w[String(N)]||0}`,_=T.useCallback(N=>document.querySelector(`[data-path="${Ma(n,N)}"]`),[]),J=T.useCallback(N=>{b.resetField(N,[e!=="controlled"?()=>O(Q=>({...Q,[N]:(Q[N]||0)+1})):null])},[b.resetField,e,O]),de={watch:E.watch,initialized:b.initialized.current,values:e==="uncontrolled"?b.refValues.current:b.stateValues,getValues:b.getValues,getInitialValues:b.getValuesSnapshot,setInitialValues:b.setValuesSnapshot,resetField:J,initialize:B,setValues:G,setFieldValue:V,submitting:L,setSubmitting:z,errors:y.errorsState,setErrors:y.setErrors,setFieldError:y.setFieldError,clearFieldError:y.clearFieldError,clearErrors:y.clearErrors,resetDirty:k.resetDirty,setTouched:k.setTouched,setDirty:k.setDirty,isTouched:k.isTouched,resetTouched:k.resetTouched,isDirty:k.isDirty,getTouched:k.getTouched,getDirty:k.getDirty,reorderListItem:M.reorderListItem,insertListItem:M.insertListItem,removeListItem:M.removeListItem,replaceListItem:M.replaceListItem,reset:P,validate:K,validateField:X,getInputProps:q,onSubmit:U,onReset:S,isValid:A,getTransformedValues:j,key:D,getInputNode:_};return jh(n,de),de}const du=T.createContext(null),Xh=({children:n,value:e})=>m.jsx(du.Provider,{value:e,children:n}),al=()=>{const n=T.useContext(du);if(!n)throw new Error("useRenderers must be used inside <RenderersProvider>");return n};function oo({field:n,layout:e,children:t}){if(e==="grid"){const r=n.column??6;return m.jsx(x.Grid.Col,{span:{base:12,md:r},children:t})}return e==="horizontal"?m.jsx(x.Box,{style:{display:"flex",alignItems:"center",gap:12},children:t}):m.jsx(x.Stack,{gap:"xs",children:t})}const cl={vertical:n=>m.jsx(x.Stack,{gap:"md",children:n}),horizontal:n=>m.jsx(x.Group,{wrap:"wrap",gap:"md",children:n}),grid:n=>m.jsx(x.Grid,{gutter:"md",children:n})},Oi=n=>{switch(n){case"number":return 0;case"array":return[];case"checkbox":return!1;case"object":return{};case"select":case"date":case"datetime":return null;default:return""}};function ul(n,e={}){const t={};for(const r of n)r.type==="object"&&r.fields?t[r.name]=ul(r.fields,e==null?void 0:e[r.name]):t[r.name]=(e==null?void 0:e[r.name])??r.initialValue??Oi(r.type);return t}function Di(n,e){const t={};for(const r of n){const s=(e==null?void 0:e[r.name])??Oi(r.type);if(r.required)if(r.type==="object"){Object.values(s).length||(t[r.name]=`${r.label||r.name} is required`);const o=Di(r.fields,s);for(const[i,l]of Object.entries(o))t[`${r.name}.${i}`]=l}else r.type==="array"?(s.length||(t[r.name]=`${r.label||r.name} is required`),s.forEach((o,i)=>{const l=Di(r.fields,o);for(const[a,c]of Object.entries(l))t[`${r.name}.${i}.${a}`]=c})):s===Oi(r.type)&&(t[r.name]=`${r.label||r.name} is required`)}return t}function Qh({field:n,form:e,layout:t="grid"}){const r=n,s=al(),o=e.getInputProps(r.name),i=o.value??[],l=r.readOnly===!0,a=r.disabled===!0;function c(){o.onFieldChange([...i,ul(r.fields)])}function u(d){o.onFieldChange(i.filter((f,h)=>h!==d))}return m.jsxs(x.Stack,{gap:"md",children:[i.map((d,f)=>{var h;return m.jsxs(x.Paper,{withBorder:!0,radius:"md",p:"md",shadow:"xs",children:[cl[t]((h=r.fields)==null?void 0:h.map(p=>m.jsx(oo,{field:p,layout:t,children:m.jsx(Po,{field:{...p,name:`${n.name}.${f}.${p.name}`,disabled:a||p.disabled,readOnly:l||p.readOnly},form:e,layout:t,...s})},`${n.name}.${f}.${p.name}`))),!l&&!a&&m.jsx(x.Group,{justify:"flex-end",mt:"xs",children:m.jsx(x.Button,{color:"red",variant:"light",onClick:()=>u(f),children:"Remove"})})]},`${r.name}.${f}`)}),!l&&!a&&m.jsxs(m.Fragment,{children:[i.length>0&&m.jsx(x.Divider,{my:"sm"}),m.jsx(x.Button,{onClick:c,variant:"default",children:"Add Row"})]})]})}function Zh({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?m.jsx(x.Checkbox,{value:t.value,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0,checked:t.value}):m.jsx(x.Checkbox,{...t,checked:t.value,onChange:o=>t.onFieldChange(o.target.checked),required:n.required,placeholder:n.placeholder,error:void 0})}function ep({direction:n,levelIndex:e,rowIndex:t,cellIndex:r,size:s}){switch(n){case"up":return e===0&&t===0?null:t===0?{levelIndex:e-1,rowIndex:r<=s[e-1][s[e-1].length-1]-1?s[e-1].length-1:s[e-1].length-2,cellIndex:r}:{levelIndex:e,rowIndex:t-1,cellIndex:r};case"down":return t===s[e].length-1?{levelIndex:e+1,rowIndex:0,cellIndex:r}:t===s[e].length-2&&r>=s[e][s[e].length-1]?{levelIndex:e+1,rowIndex:0,cellIndex:r}:{levelIndex:e,rowIndex:t+1,cellIndex:r};case"left":return e===0&&t===0&&r===0?null:t===0&&r===0?{levelIndex:e-1,rowIndex:s[e-1].length-1,cellIndex:s[e-1][s[e-1].length-1]-1}:r===0?{levelIndex:e,rowIndex:t-1,cellIndex:s[e][t-1]-1}:{levelIndex:e,rowIndex:t,cellIndex:r-1};case"right":return t===s[e].length-1&&r===s[e][t]-1?{levelIndex:e+1,rowIndex:0,cellIndex:0}:r===s[e][t]-1?{levelIndex:e,rowIndex:t+1,cellIndex:0}:{levelIndex:e,rowIndex:t,cellIndex:r+1};default:return{levelIndex:e,rowIndex:t,cellIndex:r}}}function fu({controlsRef:n,direction:e,levelIndex:t,rowIndex:r,cellIndex:s,size:o}){var a,c,u;const i=ep({direction:e,size:o,rowIndex:r,cellIndex:s,levelIndex:t});if(!i)return;const l=(u=(c=(a=n.current)==null?void 0:a[i.levelIndex])==null?void 0:c[i.rowIndex])==null?void 0:u[i.cellIndex];l&&(l.disabled||l.getAttribute("data-hidden")||l.getAttribute("data-outside")?fu({controlsRef:n,direction:e,levelIndex:i.levelIndex,cellIndex:i.cellIndex,rowIndex:i.rowIndex,size:o}):l.focus())}function tp(n){switch(n){case"ArrowDown":return"down";case"ArrowUp":return"up";case"ArrowRight":return"right";case"ArrowLeft":return"left";default:return null}}function np(n){var e;return(e=n.current)==null?void 0:e.map(t=>t.map(r=>r.length))}function dl({controlsRef:n,levelIndex:e,rowIndex:t,cellIndex:r,event:s}){const o=tp(s.key);if(o){s.preventDefault();const i=np(n);fu({controlsRef:n,direction:o,levelIndex:e,rowIndex:t,cellIndex:r,size:i})}}function Ea(n,e){let t=n?R(n):R();if(e==="")return t.format("YYYY-MM-DD HH:mm:ss");const[r,s,o=0]=e.split(":").map(Number);return t=t.set("hour",r),t=t.set("minute",s),t=t.set("second",o),t=t.set("millisecond",0),t.format("YYYY-MM-DD HH:mm:ss")}function He(n){return n==null||n===""?n:R(n).format("YYYY-MM-DD")}function Fn(n){return n==null||n===""?n:R(n).format("YYYY-MM-DD HH:mm:ss")}function rp({minDate:n,maxDate:e}){const t=R();return!n&&!e?He(t):n&&R(t).isBefore(n)?He(n):e&&R(t).isAfter(e)?He(e):He(t)}function Wo(n,e,t){return!n&&!e?Fn(t):n&&R(t).isBefore(n)?Fn(n):e&&R(t).isAfter(e)?Fn(e):Fn(t)}const sp={locale:"en",firstDayOfWeek:1,weekendDays:[0,6],labelSeparator:"–",consistentWeeks:!1},op=T.createContext(sp);function Rt(){const n=T.useContext(op),e=T.useCallback(o=>o||n.locale,[n.locale]),t=T.useCallback(o=>typeof o=="number"?o:n.firstDayOfWeek,[n.firstDayOfWeek]),r=T.useCallback(o=>Array.isArray(o)?o:n.weekendDays,[n.weekendDays]),s=T.useCallback(o=>typeof o=="string"?o:n.labelSeparator,[n.labelSeparator]);return{...n,getLocale:e,getFirstDayOfWeek:t,getWeekendDays:r,getLabelSeparator:s}}function ip({value:n,type:e,withTime:t}){const r=t?Fn:He;if(e==="range"&&Array.isArray(n)){const s=r(n[0]),o=r(n[1]);return s?o?`${s} – ${o}`:`${s} –`:""}return e==="multiple"&&Array.isArray(n)?n.filter(Boolean).join(", "):!Array.isArray(n)&&n?r(n):""}function fl({value:n,type:e,name:t,form:r,withTime:s=!1}){return m.jsx("input",{type:"hidden",value:ip({value:n,type:e,withTime:s}),name:t,form:r})}fl.displayName="@mantine/dates/HiddenDatesInput";function hu(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(e=0;e<s;e++)n[e]&&(t=hu(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function pu(){for(var n,e,t=0,r="",s=arguments.length;t<s;t++)(n=arguments[t])&&(e=hu(n))&&(r&&(r+=" "),r+=e);return r}var lp={input:"m_468e7eda"};const fs=x.factory((n,e)=>{const t=x.useProps("TimeInput",null,n),{classNames:r,styles:s,unstyled:o,vars:i,withSeconds:l,minTime:a,maxTime:c,value:u,onChange:d,step:f,...h}=t,{resolvedClassNames:p,resolvedStyles:g}=x.useResolvedStylesApi({classNames:r,styles:s,props:t}),y=k=>{if(a!==void 0||c!==void 0){const[M,E,v]=k.split(":").map(Number);if(a){const[C,w,O]=a.split(":").map(Number);if(M<C||M===C&&E<w||l&&M===C&&E===w&&v<O)return-1}if(c){const[C,w,O]=c.split(":").map(Number);if(M>C||M===C&&E>w||l&&M===C&&E===w&&v>O)return 1}}return 0},b=k=>{var M,E,v;if((M=t.onBlur)==null||M.call(t,k),a!==void 0||c!==void 0){const C=k.currentTarget.value;if(C){const w=y(C);w===1?(c&&(k.currentTarget.value=c),(E=t.onChange)==null||E.call(t,k)):w===-1&&(a&&(k.currentTarget.value=a),(v=t.onChange)==null||v.call(t,k))}}};return m.jsx(x.InputBase,{classNames:{...p,input:pu(lp.input,p==null?void 0:p.input)},styles:g,unstyled:o,ref:e,value:u,step:f??(l?1:60),...h,onChange:d,onBlur:b,type:"time",__staticSelector:"TimeInput"})});fs.classes=x.InputBase.classes;fs.displayName="@mantine/dates/TimeInput";function ts(n,e,t){return e===void 0&&t===void 0?n:e!==void 0&&t===void 0?Math.max(n,e):Math.min(e===void 0&&t!==void 0?n:Math.max(n,e),t)}function ap(n="mantine-"){return`${n}${Math.random().toString(36).slice(2,11)}`}const cp=["mousedown","touchstart"];function up(n,e,t){const r=T.useRef(null),s=cp;return T.useEffect(()=>{const o=i=>{const{target:l}=i??{};if(Array.isArray(t)){const a=!document.body.contains(l)&&(l==null?void 0:l.tagName)!=="HTML";t.every(u=>!!u&&!i.composedPath().includes(u))&&!a&&n(i)}else r.current&&!r.current.contains(l)&&n(i)};return s.forEach(i=>document.addEventListener(i,o)),()=>{s.forEach(i=>document.removeEventListener(i,o))}},[r,n,t]),r}const dp=typeof document<"u"?T.useLayoutEffect:T.useEffect;function hs(n,e){const t=T.useRef(!1);T.useEffect(()=>()=>{t.current=!1},[]),T.useEffect(()=>{if(t.current)return n();t.current=!0},e)}const fp=T.useId||(()=>{});function hp(){const n=fp();return n?`mantine-${n.replace(/:/g,"")}`:""}function pp(n){const e=hp(),[t,r]=T.useState(e);return dp(()=>{r(ap())},[]),typeof window>"u"?e:t}function mp(n,e,t){T.useEffect(()=>(window.addEventListener(n,e,t),()=>window.removeEventListener(n,e,t)),[n,e])}function Aa(n,e){if(typeof n=="function")return n(e);typeof n=="object"&&n!==null&&"current"in n&&(n.current=e)}function gp(...n){const e=new Map;return t=>{if(n.forEach(r=>{const s=Aa(r,t);s&&e.set(r,s)}),e.size>0)return()=>{n.forEach(r=>{const s=e.get(r);s&&typeof s=="function"?s():Aa(r,null)}),e.clear()}}}function rr(...n){return T.useCallback(gp(...n),n)}function mu({value:n,defaultValue:e,finalValue:t,onChange:r=()=>{}}){const[s,o]=T.useState(e!==void 0?e:t),i=(l,...a)=>{o(l),r==null||r(l,...a)};return n!==void 0?[n,r,!0]:[s,i,!1]}function yp(n){return e=>{if(!e)n(e);else if(typeof e=="function")n(e);else if(typeof e=="object"&&"nativeEvent"in e){const{currentTarget:t}=e;t.type==="checkbox"?n(t.checked):n(t.value)}else n(e)}}function bp(n){const[e,t]=T.useState(n);return[e,yp(t)]}function hl(n=!1,e={}){const[t,r]=T.useState(n),s=T.useCallback(()=>{r(l=>{var a;return l||((a=e.onOpen)==null||a.call(e),!0)})},[e.onOpen]),o=T.useCallback(()=>{r(l=>{var a;return l&&((a=e.onClose)==null||a.call(e),!1)})},[e.onClose]),i=T.useCallback(()=>{t?o():s()},[o,s,t]);return[t,{open:s,close:o,toggle:i}]}function Ve(n){return n<10?`0${n}`:`${n}`}const kp=n=>Number(n.toFixed(0)[0]),ns=T.forwardRef(({value:n,min:e,max:t,onChange:r,focusable:s,step:o,onNextInput:i,onPreviousInput:l,onFocus:a,readOnly:c,allowTemporaryZero:u=!1,placeholder:d="--",...f},h)=>{const p=kp(t),g=t+1-o,y=k=>{if(c)return;const M=k.replace(/\D/g,"");if(M!==""){const E=parseInt(M,10),v=u&&E===0&&e>0?0:ts(E,e,t);r(v),(v>p||k.startsWith("00"))&&(i==null||i())}},b=k=>{if(!c){if((k.key==="0"||k.key==="Num0")&&n===0&&(k.preventDefault(),i==null||i()),k.key==="Home"&&(k.preventDefault(),r(e)),k.key==="End"&&(k.preventDefault(),r(t)),(k.key==="Backspace"||k.key==="Delete")&&(k.preventDefault(),n!==null?r(null):l==null||l()),k.key==="ArrowRight"&&(k.preventDefault(),i==null||i()),k.key==="ArrowLeft"&&(k.preventDefault(),l==null||l()),k.key==="ArrowUp"){k.preventDefault();const M=n===null?e:ts(n+o,e,g);r(M)}if(k.key==="ArrowDown"){k.preventDefault();const M=n===null?g:ts(n-o,e,g);r(M)}}};return m.jsx("input",{ref:h,type:"text",role:"spinbutton","aria-valuemin":e,"aria-valuemax":t,"aria-valuenow":n===null?0:n,"data-empty":n===null||void 0,inputMode:"numeric",placeholder:d,value:n===null?"":Ve(n),onChange:k=>y(k.currentTarget.value),onKeyDown:b,onFocus:k=>{k.currentTarget.select(),a==null||a(k)},onClick:k=>{k.stopPropagation(),k.currentTarget.select()},onMouseDown:k=>k.stopPropagation(),...f})});ns.displayName="@mantine/dates/SpinInput";const[xp,Tn]=x.createSafeContext("TimeInput component was not found in the component tree"),gu=T.forwardRef(({labels:n,value:e,onChange:t,className:r,style:s,onPreviousInput:o,readOnly:i,onMouseDown:l,onTouchStart:a,inputType:c,...u},d)=>{const f=Tn(),h=p=>{i||(p.key==="Home"&&(p.preventDefault(),t(n.am)),p.key==="End"&&(p.preventDefault(),t(n.pm)),(p.key==="Backspace"||p.key==="Delete")&&(p.preventDefault(),e===null?o==null||o():t(null)),p.key==="ArrowLeft"&&(p.preventDefault(),o==null||o()),(p.key==="ArrowUp"||p.key==="ArrowDown")&&(p.preventDefault(),t(e===n.am?n.pm:n.am)),p.code==="KeyA"&&(p.preventDefault(),t(n.am)),p.code==="KeyP"&&(p.preventDefault(),t(n.pm)))};if(c==="input"){const p=e||"--",g=p.length+1;return m.jsx("input",{...f.getStyles("field",{className:r,style:s}),ref:d,value:p,size:g,onChange:y=>!i&&t(y.target.value||null),onClick:(y=>y.stopPropagation()),onKeyDown:h,onMouseDown:y=>{y.stopPropagation(),l==null||l(y)},"data-am-pm":!0,...u})}return m.jsxs("select",{...f.getStyles("field",{className:r,style:s}),ref:d,value:e||"",onChange:p=>!i&&t(p.target.value||null),onClick:p=>p.stopPropagation(),onKeyDown:h,onMouseDown:p=>{p.stopPropagation(),l==null||l(p)},"data-am-pm":!0,...u,children:[m.jsx("option",{value:"",children:"--"}),m.jsx("option",{value:n.am,children:n.am}),m.jsx("option",{value:n.pm,children:n.pm})]})});gu.displayName="@mantine/dates/AmPmInput";function pl({value:n,active:e,onSelect:t}){const r=Tn();return m.jsx(x.UnstyledButton,{mod:{active:e},onClick:()=>t(n),onMouseDown:s=>s.preventDefault(),"data-value":n,tabIndex:-1,...r.getStyles("control"),children:typeof n=="number"?Ve(n):n})}pl.displayName="@mantine/dates/TimeControl";function yu({labels:n,value:e,onSelect:t}){const r=Tn(),s=[n.am,n.pm].map(o=>m.jsx(pl,{value:o,active:e===o,onSelect:t},o));return m.jsx("div",{...r.getStyles("controlsList"),children:s})}yu.displayName="@mantine/dates/AmPmControlsList";function vp(n,e){if(!n||!e)return!1;const t=n.getBoundingClientRect(),r=e.getBoundingClientRect();return t.top>=r.top&&t.bottom<=r.bottom&&t.left>=r.left&&t.right<=r.right}function Sp(n,e,t){const r=[];for(let s=n;s<=e;s+=t)r.push(s);return r}function rs({min:n,max:e,step:t,value:r,onSelect:s,reversed:o}){const i=Tn(),l=T.useRef(null),a=Sp(n,e,t),c=(o?a.reverse():a).map(u=>m.jsx(pl,{value:u,active:r===u,onSelect:s},u));return T.useEffect(()=>{r!==null&&requestAnimationFrame(()=>{var f;const d=(f=l.current)==null?void 0:f.querySelector(`[data-value="${r}"]`);vp(d,l.current)||d==null||d.scrollIntoView({block:"nearest"})})},[r]),m.jsx(x.ScrollArea,{h:i.maxDropdownContentHeight,type:"never",viewportRef:l,...i.getStyles("scrollarea"),...i.scrollAreaProps,children:m.jsx("div",{...i.getStyles("controlsList"),children:c})})}rs.displayName="@mantine/dates/TimeControlsList";function ps(n){const[e=null,t=null,r=null]=n.split(":").map(Number);return{hours:e,minutes:t,seconds:r}}function bu({time:n,compare:e,withSeconds:t}){const r=ps(n),s=ps(e);return t?r.hours===s.hours&&r.minutes===s.minutes&&r.seconds===s.seconds:r.hours===s.hours&&r.minutes===s.minutes}function Cp(n,e){return`${n.getHours()}:${n.getMinutes()}${e?`:${n.getSeconds()}`:""}`}function Mp({value:n,format:e,amPmLabels:t,withSeconds:r}){const s=ps(typeof n=="string"?n:Cp(n,r));if(s.hours===null||s.minutes===null)return null;if(e==="24h")return`${Ve(s.hours)}:${Ve(s.minutes)}${r?`:${Ve(s.seconds||0)}`:""}`;const o=s.hours>=12;return`${s.hours%12===0?12:s.hours%12}:${Ve(s.minutes)}${r?`:${Ve(s.seconds||0)}`:""} ${o?t.pm:t.am}`}function ku({value:n,format:e="24h",amPmLabels:t={am:"AM",pm:"PM"},withSeconds:r=!1}){return m.jsx(m.Fragment,{children:Mp({value:n,format:e,amPmLabels:t,withSeconds:r})})}ku.displayName="@mantine/dates/TimeValue";function ml({value:n,active:e,onChange:t,format:r,amPmLabels:s,withSeconds:o}){const i=Tn();return m.jsx(x.UnstyledButton,{mod:{active:e},onClick:()=>t(n),...i.getStyles("presetControl"),children:m.jsx(ku,{withSeconds:o,value:n,format:r,amPmLabels:s})})}ml.displayName="@mantine/dates/TimePresetControl";function xu({value:n,data:e,onChange:t,format:r,amPmLabels:s,withSeconds:o}){const i=Tn(),l=e.values.map(a=>m.jsx(ml,{value:a,format:r,amPmLabels:s,withSeconds:o,active:bu({time:a,compare:n,withSeconds:o}),onChange:t},a));return m.jsxs("div",{...i.getStyles("presetsGroup"),children:[m.jsx("div",{...i.getStyles("presetsGroupLabel"),children:e.label}),m.jsx(x.SimpleGrid,{cols:o?2:3,spacing:4,children:l})]})}xu.displayName="@mantine/dates/TimePresetGroup";function vu({presets:n,format:e,amPmLabels:t,withSeconds:r,value:s,onChange:o}){const i=Tn();if(n.length===0)return null;if(typeof n[0]=="string"){const a=n.map(c=>m.jsx(ml,{value:c,format:e,amPmLabels:t,withSeconds:r,active:bu({time:c,compare:s,withSeconds:r}),onChange:o},c));return m.jsx(x.ScrollArea.Autosize,{mah:i.maxDropdownContentHeight,type:"never",...i.getStyles("scrollarea"),...i.scrollAreaProps,children:m.jsx("div",{...i.getStyles("presetsRoot"),children:m.jsx(x.SimpleGrid,{cols:r?2:3,spacing:4,children:a})})})}const l=n.map((a,c)=>m.jsx(xu,{data:a,value:s,format:e,amPmLabels:t,withSeconds:r,onChange:o},c));return m.jsx(x.ScrollArea.Autosize,{mah:i.maxDropdownContentHeight,type:"never",...i.getStyles("scrollarea"),...i.scrollAreaProps,children:m.jsx("div",{...i.getStyles("presetsRoot"),children:l})})}vu.displayName="@mantine/dates/TimePresets";function Yo(n){const[e=0,t=0,r=0]=n.split(":").map(Number);return e*3600+t*60+r}function wp(n){const e=Math.floor(n/3600),t=Math.floor(n%3600/60),r=n%60;return{timeString:`${Ve(e)}:${Ve(t)}:${Ve(r)}`,hours:e,minutes:t,seconds:r}}function Su(n,e,t){const r=Yo(n),s=e?Yo(e):-1/0,o=t?Yo(t):1/0,i=Math.max(s,Math.min(r,o));return wp(i)}function Tp({hours:n,minutes:e,seconds:t,amPmLabels:r}){if(n===null)return{hours:null,minutes:null,seconds:null,amPm:null};const s=n>=12?r.pm:r.am;return{hours:n%12===0?12:n%12,minutes:typeof e=="number"?e:null,seconds:typeof t=="number"?t:null,amPm:s}}function sr({time:n,format:e,amPmLabels:t}){if(n==="")return{hours:null,minutes:null,seconds:null,amPm:null};const{hours:r,minutes:s,seconds:o}=ps(n),i={hours:r,minutes:s,seconds:o};return e==="12h"?Tp({...i,amPmLabels:t}):{...i,amPm:null}}function Ep({hours:n,minutes:e,seconds:t,amPm:r,amPmLabels:s,withSeconds:o}){let i=n;return r===s.pm&&n!==12?i+=12:r===s.am&&n===12&&(i=0),`${Ve(i)}:${Ve(e)}${o?`:${Ve(t||0)}`:""}`}function ss({hours:n,minutes:e,seconds:t,format:r,withSeconds:s,amPm:o,amPmLabels:i}){return n===null||e===null?{valid:!1,value:""}:s&&t===null?{valid:!1,value:""}:r==="24h"?{valid:!0,value:`${Ve(n)}:${Ve(e)}${s?`:${Ve(t)}`:""}`}:o===null?{valid:!1,value:""}:{valid:!0,value:Ep({hours:n,minutes:e,seconds:t,amPm:o,amPmLabels:i,withSeconds:s})}}function Ap({value:n,defaultValue:e,onChange:t,format:r,amPmLabels:s,withSeconds:o=!1,min:i,max:l,clearable:a,readOnly:c,disabled:u,pasteSplit:d}){const f=sr({time:n||e||"",amPmLabels:s,format:r}),h=T.useRef(!0),[p,g]=T.useState(f.hours),[y,b]=T.useState(f.minutes),[k,M]=T.useState(f.seconds),[E,v]=T.useState(f.amPm),C=a&&!c&&!u&&(p!==null||y!==null||k!==null||E!==null),w=T.useRef(null),O=T.useRef(null),L=T.useRef(null),z=T.useRef(null),P=S=>{var A,D,_,J;S==="hours"&&((A=w.current)==null||A.focus()),S==="minutes"&&((D=O.current)==null||D.focus()),S==="seconds"&&((_=L.current)==null||_.focus()),S==="amPm"&&((J=z.current)==null||J.focus())},$=(S,A)=>{const D={hours:p,minutes:y,seconds:k,amPm:E,[S]:A},_=ss({...D,format:r,withSeconds:o,amPmLabels:s});_.valid?(h.current=!1,S==="hours"&&g(A),S==="minutes"&&b(A),S==="seconds"&&M(A),S==="amPm"&&v(A),t==null||t(_.value)):(h.current=!1,typeof n=="string"&&n!==""&&(t==null||t("")))},B=S=>{h.current=!1;const A=sr({time:S,amPmLabels:s,format:r});g(A.hours),b(A.minutes),M(A.seconds),v(A.amPm),t==null||t(S)},V=S=>{let A=S;r==="12h"&&typeof S=="number"&&S>12&&(A=(S-1)%12+1),g(A),$("hours",A),P("hours")},G=S=>{b(S),$("minutes",S),P("minutes")},K=S=>{M(S),$("seconds",S),P("seconds")},X=S=>{v(S),$("amPm",S),P("amPm")},q=()=>{h.current=!1,g(null),b(null),M(null),v(null),t==null||t(""),P("hours")},U=S=>{S.preventDefault();const A=S.clipboardData.getData("text"),D=(d||sr)({time:A,format:r,amPmLabels:s}),_=ss({...D,format:r,withSeconds:o,amPmLabels:s});if(_.valid){h.current=!1;const J=Su(_.value,i||"00:00:00",l||"23:59:59");t==null||t(J.timeString),g(D.hours),b(D.minutes),M(D.seconds),v(D.amPm)}},j=ss({hours:p,minutes:y,seconds:k,format:r,withSeconds:o,amPm:E,amPmLabels:s});return hs(()=>{if(n===""){h.current=!1,g(null),b(null),M(null),v(null),h.current=!0;return}if(h.current&&typeof n=="string"){const S=sr({time:n||"",amPmLabels:s,format:r});g(S.hours),b(S.minutes),M(S.seconds),v(S.amPm)}h.current=!0},[n]),{refs:{hours:w,minutes:O,seconds:L,amPm:z},values:{hours:p,minutes:y,seconds:k,amPm:E},setHours:V,setMinutes:G,setSeconds:K,setAmPm:X,focus:P,clear:q,onPaste:U,setTimeString:B,isClearable:C,hiddenInputValue:j.value}}var Cu={fieldsRoot:"m_7a8f1e6d",fieldsGroup:"m_d6bb0a54",controlsList:"m_b97ecb26",controlsListGroup:"m_31fe42f9",dropdown:"m_9c4817c3",control:"m_154c536b",presetControl:"m_7be09d0c",presetsGroup:"m_7d00001d",presetsGroupLabel:"m_d8d918d7",field:"m_6b43ba88"};const Op={hoursStep:1,minutesStep:1,secondsStep:1,format:"24h",amPmLabels:{am:"AM",pm:"PM"},pasteSplit:sr,maxDropdownContentHeight:200,hoursPlaceholder:"--",minutesPlaceholder:"--",secondsPlaceholder:"--"},Dp=x.createVarsResolver((n,{size:e})=>({dropdown:{"--control-font-size":x.getFontSize(e)}})),gl=x.factory((n,e)=>{const t=x.useProps("TimePicker",Op,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,onClick:c,format:u,value:d,defaultValue:f,onChange:h,hoursStep:p,minutesStep:g,secondsStep:y,withSeconds:b,hoursInputLabel:k,minutesInputLabel:M,secondsInputLabel:E,amPmInputLabel:v,amPmLabels:C,clearable:w,onMouseDown:O,onFocusCapture:L,onBlurCapture:z,min:P,max:$,popoverProps:B,withDropdown:V,rightSection:G,onFocus:K,onBlur:X,clearButtonProps:q,hoursInputProps:U,minutesInputProps:j,secondsInputProps:S,amPmSelectProps:A,readOnly:D,disabled:_,size:J,name:de,form:N,hiddenInputProps:Q,labelProps:oe,pasteSplit:te,hoursRef:pe,minutesRef:he,secondsRef:ae,amPmRef:se,presets:Oe,maxDropdownContentHeight:ue,scrollAreaProps:ke,attributes:ce,reverseTimeControlsList:Ee,hoursPlaceholder:Dn,minutesPlaceholder:rn,secondsPlaceholder:sn,...on}=t,{resolvedClassNames:ln,resolvedStyles:an}=x.useResolvedStylesApi({classNames:r,styles:i,props:t}),Xe=x.useStyles({name:"TimePicker",classes:Cu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:ce,vars:a,varsResolver:Dp}),H=Ap({value:d,defaultValue:f,onChange:h,format:u,amPmLabels:C,withSeconds:b,min:P,max:$,clearable:w,disabled:_,readOnly:D,pasteSplit:te}),Qe=rr(H.refs.hours,pe),Ze=rr(H.refs.minutes,he),cn=rr(H.refs.seconds,ae),Nn=rr(H.refs.amPm,se),Pr=pp(),Gn=T.useRef(!1),[_o,It]=T.useState(!1),ft=ne=>{Gn.current||(Gn.current=!0,K==null||K(ne))},Bo=ne=>{if(!ne.currentTarget.contains(ne.relatedTarget)){const xe=H.values,ot=ss({...xe,format:u,amPmLabels:C,withSeconds:!!b});if(ot.valid&&(P||$)){const jt=Su(ot.value,P,$);jt.timeString!==ot.value&&H.setTimeString(jt.timeString)}Gn.current=!1,X==null||X(ne)}};return m.jsx(xp,{value:{getStyles:Xe,scrollAreaProps:ke,maxDropdownContentHeight:ue},children:m.jsxs(x.Popover,{opened:_o,transitionProps:{duration:0},position:"bottom-start",withRoles:!1,disabled:_||D||!V,...B,children:[m.jsx(x.Popover.Target,{children:m.jsxs(x.InputBase,{component:"div",size:J,disabled:_,ref:e,onClick:ne=>{c==null||c(ne),H.focus("hours")},onMouseDown:ne=>{ne.preventDefault(),O==null||O(ne)},onFocusCapture:ne=>{It(!0),L==null||L(ne)},onBlurCapture:ne=>{It(!1),z==null||z(ne)},rightSection:G||H.isClearable&&m.jsx(x.CloseButton,{...q,size:J,onClick:ne=>{var xe;H.clear(),(xe=q==null?void 0:q.onClick)==null||xe.call(q,ne)},onMouseDown:ne=>{var xe;ne.preventDefault(),(xe=q==null?void 0:q.onMouseDown)==null||xe.call(q,ne)}}),labelProps:{htmlFor:Pr,...oe},style:o,className:s,classNames:ln,styles:an,__staticSelector:"TimePicker",...on,children:[m.jsx("div",{...Xe("fieldsRoot"),dir:"ltr",children:m.jsxs("div",{...Xe("fieldsGroup"),onBlur:Bo,children:[m.jsx(ns,{id:Pr,...U,...Xe("field",{className:U==null?void 0:U.className,style:U==null?void 0:U.style}),value:H.values.hours,onChange:H.setHours,onNextInput:()=>H.focus("minutes"),min:u==="12h"?1:0,max:u==="12h"?12:23,allowTemporaryZero:u==="12h",focusable:!0,step:p,ref:Qe,"aria-label":k,readOnly:D,disabled:_,onPaste:H.onPaste,onFocus:ne=>{var xe;ft(ne),(xe=U==null?void 0:U.onFocus)==null||xe.call(U,ne)},onBlur:ne=>{var jt;const xe=ne.currentTarget.value,ot=xe?parseInt(xe,10):null;u==="12h"&&ot===0&&H.setHours(12),(jt=U==null?void 0:U.onBlur)==null||jt.call(U,ne)},placeholder:Dn}),m.jsx("span",{children:":"}),m.jsx(ns,{...j,...Xe("field",{className:j==null?void 0:j.className,style:j==null?void 0:j.style}),value:H.values.minutes,onChange:H.setMinutes,min:0,max:59,focusable:!0,step:g,ref:Ze,onPreviousInput:()=>H.focus("hours"),onNextInput:()=>b?H.focus("seconds"):H.focus("amPm"),"aria-label":M,tabIndex:-1,readOnly:D,disabled:_,onPaste:H.onPaste,onFocus:ne=>{var xe;ft(ne),(xe=j==null?void 0:j.onFocus)==null||xe.call(j,ne)},placeholder:rn}),b&&m.jsxs(m.Fragment,{children:[m.jsx("span",{children:":"}),m.jsx(ns,{...S,...Xe("field",{className:S==null?void 0:S.className,style:S==null?void 0:S.style}),value:H.values.seconds,onChange:H.setSeconds,min:0,max:59,focusable:!0,step:y,ref:cn,onPreviousInput:()=>H.focus("minutes"),onNextInput:()=>H.focus("amPm"),"aria-label":E,tabIndex:-1,readOnly:D,disabled:_,onPaste:H.onPaste,onFocus:ne=>{var xe;ft(ne),(xe=S==null?void 0:S.onFocus)==null||xe.call(S,ne)},placeholder:sn})]}),u==="12h"&&m.jsx(gu,{...A,inputType:V?"input":"select",labels:C,value:H.values.amPm,onChange:H.setAmPm,ref:Nn,"aria-label":v,onPreviousInput:()=>b?H.focus("seconds"):H.focus("minutes"),readOnly:D,disabled:_,tabIndex:-1,onPaste:H.onPaste,onFocus:ne=>{var xe;ft(ne),(xe=A==null?void 0:A.onFocus)==null||xe.call(A,ne)}})]})}),m.jsx("input",{type:"hidden",name:de,form:N,value:H.hiddenInputValue,...Q})]})}),m.jsx(x.Popover.Dropdown,{...Xe("dropdown"),onMouseDown:ne=>ne.preventDefault(),children:Oe?m.jsx(vu,{value:H.hiddenInputValue,onChange:H.setTimeString,format:u,presets:Oe,amPmLabels:C,withSeconds:b||!1}):m.jsxs("div",{...Xe("controlsListGroup"),children:[m.jsx(rs,{min:u==="12h"?1:0,max:u==="12h"?12:23,step:p,value:H.values.hours,onSelect:H.setHours,reversed:Ee}),m.jsx(rs,{min:0,max:59,step:g,value:H.values.minutes,onSelect:H.setMinutes,reversed:Ee}),b&&m.jsx(rs,{min:0,max:59,step:y,value:H.values.seconds,onSelect:H.setSeconds,reversed:Ee}),u==="12h"&&m.jsx(yu,{labels:C,value:H.values.amPm,onSelect:H.setAmPm})]})})]})})});gl.displayName="@mantine/dates/TimePicker";gl.classes=Cu;var Mu={day:"m_396ce5cb"};const Np=x.createVarsResolver((n,{size:e})=>({day:{"--day-size":x.getSize(e,"day-size")}})),yl=x.factory((n,e)=>{const t=x.useProps("Day",null,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,date:c,disabled:u,__staticSelector:d,weekend:f,outside:h,selected:p,renderDay:g,inRange:y,firstInRange:b,lastInRange:k,hidden:M,static:E,highlightToday:v,attributes:C,...w}=t,O=x.useStyles({name:d||"Day",classes:Mu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:C,vars:a,varsResolver:Np,rootSelector:"day"});return m.jsx(x.UnstyledButton,{...O("day",{style:M?{display:"none"}:void 0}),component:E?"div":"button",ref:e,disabled:u,"data-today":R(c).isSame(new Date,"day")||void 0,"data-hidden":M||void 0,"data-highlight-today":v||void 0,"data-disabled":u||void 0,"data-weekend":!u&&!h&&f||void 0,"data-outside":!u&&h||void 0,"data-selected":!u&&p||void 0,"data-in-range":y&&!u||void 0,"data-first-in-range":b&&!u||void 0,"data-last-in-range":k&&!u||void 0,"data-static":E||void 0,unstyled:l,...w,children:(g==null?void 0:g(c))||R(c).date()})});yl.classes=Mu;yl.displayName="@mantine/dates/Day";function Rp({locale:n,format:e="dd",firstDayOfWeek:t=1}){const r=R().day(t),s=[];for(let o=0;o<7;o+=1)typeof e=="string"?s.push(R(r).add(o,"days").locale(n).format(e)):s.push(e(R(r).add(o,"days").format("YYYY-MM-DD")));return s}var wu={weekday:"m_18a3eca"};const Lp=x.createVarsResolver((n,{size:e})=>({weekdaysRow:{"--wr-fz":x.getFontSize(e),"--wr-spacing":x.getSpacing(e)}})),bl=x.factory((n,e)=>{const t=x.useProps("WeekdaysRow",null,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,locale:c,firstDayOfWeek:u,weekdayFormat:d,cellComponent:f="th",__staticSelector:h,withWeekNumbers:p,attributes:g,...y}=t,b=x.useStyles({name:h||"WeekdaysRow",classes:wu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:g,vars:a,varsResolver:Lp,rootSelector:"weekdaysRow"}),k=Rt(),M=Rp({locale:k.getLocale(c),format:d,firstDayOfWeek:k.getFirstDayOfWeek(u)}).map((E,v)=>m.jsx(f,{...b("weekday"),children:E},v));return m.jsxs(x.Box,{component:"tr",ref:e,...b("weekdaysRow"),...y,children:[p&&m.jsx(f,{...b("weekday"),children:"#"}),M]})});bl.classes=wu;bl.displayName="@mantine/dates/WeekdaysRow";function Ip(n,e=1){let t=R(n);if(!t.isValid())return t;const r=e===0?6:e-1;for(;t.day()!==r;)t=t.add(1,"day");return t.format("YYYY-MM-DD")}function jp(n,e=1){let t=R(n);for(;t.day()!==e;)t=t.subtract(1,"day");return t.format("YYYY-MM-DD")}function Pp({month:n,firstDayOfWeek:e=1,consistentWeeks:t}){const r=R(n).subtract(R(n).date()-1,"day"),s=R(r.format("YYYY-M-D")),o=s.format("YYYY-MM-DD"),i=s.add(+s.daysInMonth()-1,"day").format("YYYY-MM-DD"),l=Ip(i,e),a=[];let c=R(jp(o,e));for(;R(c).isBefore(l,"day");){const u=[];for(let d=0;d<7;d+=1)u.push(c.format("YYYY-MM-DD")),c=c.add(1,"day");a.push(u)}if(t&&a.length<6){const u=a[a.length-1],d=u[u.length-1];let f=R(d).add(1,"day");for(;a.length<6;){const h=[];for(let p=0;p<7;p+=1)h.push(f.format("YYYY-MM-DD")),f=f.add(1,"day");a.push(h)}}return a}function io(n,e){return R(n).format("YYYY-MM")===R(e).format("YYYY-MM")}function Tu(n,e){return e?R(n).isAfter(R(e).subtract(1,"day"),"day"):!0}function Eu(n,e){return e?R(n).isBefore(R(e).add(1,"day"),"day"):!0}function _p({dates:n,minDate:e,maxDate:t,getDayProps:r,excludeDate:s,hideOutsideDates:o,month:i}){const l=n.flat().filter(u=>{var d;return Eu(u,t)&&Tu(u,e)&&!(s!=null&&s(u))&&!((d=r==null?void 0:r(u))!=null&&d.disabled)&&(!o||io(u,i))}),a=l.find(u=>{var d;return(d=r==null?void 0:r(u))==null?void 0:d.selected});if(a)return a;const c=l.find(u=>R().isSame(u,"date"));return c||l[0]}var is={exports:{}},Bp=is.exports,Oa;function Fp(){return Oa||(Oa=1,(function(n,e){(function(t,r){n.exports=r()})(Bp,(function(){var t="day";return function(r,s,o){var i=function(c){return c.add(4-c.isoWeekday(),t)},l=s.prototype;l.isoWeekYear=function(){return i(this).year()},l.isoWeek=function(c){if(!this.$utils().u(c))return this.add(7*(c-this.isoWeek()),t);var u,d,f,h,p=i(this),g=(u=this.isoWeekYear(),d=this.$u,f=(d?o.utc:o)().year(u).startOf("year"),h=4-f.isoWeekday(),f.isoWeekday()>4&&(h+=7),f.add(h,t));return p.diff(g,"week")+1},l.isoWeekday=function(c){return this.$utils().u(c)?this.day()||7:this.day(this.day()%7?c:c-7)};var a=l.startOf;l.startOf=function(c,u){var d=this.$utils(),f=!!d.u(u)||u;return d.p(c)==="isoweek"?f?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):a.bind(this)(c,u)}}}))})(is)),is.exports}var zp=Fp();const $p=ll(zp);R.extend($p);function Vp(n){const e=n.find(t=>R(t).day()===1);return R(e).isoWeek()}var Au={month:"m_cc9820d3",monthCell:"m_8f457cd5",weekNumber:"m_6cff9dea"};const Hp={withCellSpacing:!0},Wp=x.createVarsResolver((n,{size:e})=>({weekNumber:{"--wn-fz":x.getFontSize(e),"--wn-size":x.getSize(e,"wn-size")}})),lo=x.factory((n,e)=>{const t=x.useProps("Month",Hp,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,__staticSelector:c,locale:u,firstDayOfWeek:d,weekdayFormat:f,month:h,weekendDays:p,getDayProps:g,excludeDate:y,minDate:b,maxDate:k,renderDay:M,hideOutsideDates:E,hideWeekdays:v,getDayAriaLabel:C,static:w,__getDayRef:O,__onDayKeyDown:L,__onDayClick:z,__onDayMouseEnter:P,__preventFocus:$,__stopPropagation:B,withCellSpacing:V,size:G,highlightToday:K,withWeekNumbers:X,attributes:q,...U}=t,j=x.useStyles({name:c||"Month",classes:Au,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:q,vars:a,varsResolver:Wp,rootSelector:"month"}),S=Rt(),A=Pp({month:h,firstDayOfWeek:S.getFirstDayOfWeek(d),consistentWeeks:S.consistentWeeks}),D=_p({dates:A,minDate:He(b),maxDate:He(k),getDayProps:g,excludeDate:y,hideOutsideDates:E,month:h}),{resolvedClassNames:_,resolvedStyles:J}=x.useResolvedStylesApi({classNames:r,styles:i,props:t}),de=A.map((N,Q)=>{const oe=N.map((te,pe)=>{const he=!io(te,h),ae=(C==null?void 0:C(te))||R(te).locale(u||S.locale).format("D MMMM YYYY"),se=g==null?void 0:g(te),Oe=R(te).isSame(D,"date");return m.jsx("td",{...j("monthCell"),"data-with-spacing":V||void 0,children:m.jsx(yl,{__staticSelector:c||"Month",classNames:_,styles:J,unstyled:l,"data-mantine-stop-propagation":B||void 0,highlightToday:K,renderDay:M,date:te,size:G,weekend:S.getWeekendDays(p).includes(R(te).get("day")),outside:he,hidden:E?he:!1,"aria-label":ae,static:w,disabled:(y==null?void 0:y(te))||!Eu(te,He(k))||!Tu(te,He(b)),ref:ue=>{ue&&(O==null||O(Q,pe,ue))},...se,onKeyDown:ue=>{var ke;(ke=se==null?void 0:se.onKeyDown)==null||ke.call(se,ue),L==null||L(ue,{rowIndex:Q,cellIndex:pe,date:te})},onMouseEnter:ue=>{var ke;(ke=se==null?void 0:se.onMouseEnter)==null||ke.call(se,ue),P==null||P(ue,te)},onClick:ue=>{var ke;(ke=se==null?void 0:se.onClick)==null||ke.call(se,ue),z==null||z(ue,te)},onMouseDown:ue=>{var ke;(ke=se==null?void 0:se.onMouseDown)==null||ke.call(se,ue),$&&ue.preventDefault()},tabIndex:$||!Oe?-1:0})},te.toString())});return m.jsxs("tr",{...j("monthRow"),children:[X&&m.jsx("td",{...j("weekNumber"),children:Vp(N)}),oe]},Q)});return m.jsxs(x.Box,{component:"table",...j("month"),size:G,ref:e,...U,children:[!v&&m.jsx("thead",{...j("monthThead"),children:m.jsx(bl,{__staticSelector:c||"Month",locale:u,firstDayOfWeek:d,weekdayFormat:f,size:G,classNames:_,styles:J,unstyled:l,withWeekNumbers:X})}),m.jsx("tbody",{...j("monthTbody"),children:de})]})});lo.classes=Au;lo.displayName="@mantine/dates/Month";var Ou={pickerControl:"m_dc6a3c71"};const Yp=x.createVarsResolver((n,{size:e})=>({pickerControl:{"--dpc-fz":x.getFontSize(e),"--dpc-size":x.getSize(e,"dpc-size")}})),ao=x.factory((n,e)=>{const t=x.useProps("PickerControl",null,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,firstInRange:c,lastInRange:u,inRange:d,__staticSelector:f,selected:h,disabled:p,attributes:g,...y}=t,b=x.useStyles({name:f||"PickerControl",classes:Ou,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:g,vars:a,varsResolver:Yp,rootSelector:"pickerControl"});return m.jsx(x.UnstyledButton,{...b("pickerControl"),ref:e,unstyled:l,"data-picker-control":!0,"data-selected":h&&!p||void 0,"data-disabled":p||void 0,"data-in-range":d&&!p&&!h||void 0,"data-first-in-range":c&&!p||void 0,"data-last-in-range":u&&!p||void 0,disabled:p,...y})});ao.classes=Ou;ao.displayName="@mantine/dates/PickerControl";function Du({year:n,minDate:e,maxDate:t}){return!e&&!t?!1:!!(e&&R(n).isBefore(e,"year")||t&&R(n).isAfter(t,"year"))}function qp({years:n,minDate:e,maxDate:t,getYearControlProps:r}){const s=n.flat().filter(l=>{var a;return!Du({year:l,minDate:e,maxDate:t})&&!((a=r==null?void 0:r(l))!=null&&a.disabled)}),o=s.find(l=>{var a;return(a=r==null?void 0:r(l))==null?void 0:a.selected});if(o)return o;const i=s.find(l=>R().isSame(l,"year"));return i||s[0]}function Nu(n){const e=R(n).year(),t=e-e%10;let r=0;const s=[[],[],[],[]];for(let o=0;o<4;o+=1){const i=o===3?1:3;for(let l=0;l<i;l+=1)s[o].push(R(new Date(t+r,0)).format("YYYY-MM-DD")),r+=1}return s}var Ru={yearsList:"m_9206547b",yearsListCell:"m_c5a19c7d"};const Up={yearsListFormat:"YYYY",withCellSpacing:!0},co=x.factory((n,e)=>{const t=x.useProps("YearsList",Up,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,decade:c,yearsListFormat:u,locale:d,minDate:f,maxDate:h,getYearControlProps:p,__staticSelector:g,__getControlRef:y,__onControlKeyDown:b,__onControlClick:k,__onControlMouseEnter:M,__preventFocus:E,__stopPropagation:v,withCellSpacing:C,size:w,attributes:O,...L}=t,z=x.useStyles({name:g||"YearsList",classes:Ru,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:O,vars:a,rootSelector:"yearsList"}),P=Rt(),$=Nu(c),B=qp({years:$,minDate:f,maxDate:h,getYearControlProps:p}),V=$.map((G,K)=>{const X=G.map((q,U)=>{const j=p==null?void 0:p(q),S=R(q).isSame(B,"year");return m.jsx("td",{...z("yearsListCell"),"data-with-spacing":C||void 0,children:m.jsx(ao,{...z("yearsListControl"),size:w,unstyled:l,"data-mantine-stop-propagation":v||void 0,disabled:Du({year:q,minDate:f,maxDate:h}),ref:A=>{A&&(y==null||y(K,U,A))},...j,onKeyDown:A=>{var D;(D=j==null?void 0:j.onKeyDown)==null||D.call(j,A),b==null||b(A,{rowIndex:K,cellIndex:U,date:q})},onClick:A=>{var D;(D=j==null?void 0:j.onClick)==null||D.call(j,A),k==null||k(A,q)},onMouseEnter:A=>{var D;(D=j==null?void 0:j.onMouseEnter)==null||D.call(j,A),M==null||M(A,q)},onMouseDown:A=>{var D;(D=j==null?void 0:j.onMouseDown)==null||D.call(j,A),E&&A.preventDefault()},tabIndex:E||!S?-1:0,children:R(q).locale(P.getLocale(d)).format(u)})},U)});return m.jsx("tr",{...z("yearsListRow"),children:X},K)});return m.jsx(x.Box,{component:"table",ref:e,size:w,...z("yearsList"),...L,children:m.jsx("tbody",{children:V})})});co.classes=Ru;co.displayName="@mantine/dates/YearsList";function Lu({month:n,minDate:e,maxDate:t}){return!e&&!t?!1:!!(e&&R(n).isBefore(e,"month")||t&&R(n).isAfter(t,"month"))}function Kp({months:n,minDate:e,maxDate:t,getMonthControlProps:r}){const s=n.flat().filter(l=>{var a;return!Lu({month:l,minDate:e,maxDate:t})&&!((a=r==null?void 0:r(l))!=null&&a.disabled)}),o=s.find(l=>{var a;return(a=r==null?void 0:r(l))==null?void 0:a.selected});if(o)return o;const i=s.find(l=>R().isSame(l,"month"));return i||s[0]}function Jp(n){const e=R(n).startOf("year").toDate(),t=[[],[],[],[]];let r=0;for(let s=0;s<4;s+=1)for(let o=0;o<3;o+=1)t[s].push(R(e).add(r,"months").format("YYYY-MM-DD")),r+=1;return t}var Iu={monthsList:"m_2a6c32d",monthsListCell:"m_fe27622f"};const Gp={monthsListFormat:"MMM",withCellSpacing:!0},uo=x.factory((n,e)=>{const t=x.useProps("MonthsList",Gp,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,__staticSelector:c,year:u,monthsListFormat:d,locale:f,minDate:h,maxDate:p,getMonthControlProps:g,__getControlRef:y,__onControlKeyDown:b,__onControlClick:k,__onControlMouseEnter:M,__preventFocus:E,__stopPropagation:v,withCellSpacing:C,size:w,attributes:O,...L}=t,z=x.useStyles({name:c||"MonthsList",classes:Iu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:O,vars:a,rootSelector:"monthsList"}),P=Rt(),$=Jp(u),B=Kp({months:$,minDate:He(h),maxDate:He(p),getMonthControlProps:g}),V=$.map((G,K)=>{const X=G.map((q,U)=>{const j=g==null?void 0:g(q),S=R(q).isSame(B,"month");return m.jsx("td",{...z("monthsListCell"),"data-with-spacing":C||void 0,children:m.jsx(ao,{...z("monthsListControl"),size:w,unstyled:l,__staticSelector:c||"MonthsList","data-mantine-stop-propagation":v||void 0,disabled:Lu({month:q,minDate:He(h),maxDate:He(p)}),ref:A=>{A&&(y==null||y(K,U,A))},...j,onKeyDown:A=>{var D;(D=j==null?void 0:j.onKeyDown)==null||D.call(j,A),b==null||b(A,{rowIndex:K,cellIndex:U,date:q})},onClick:A=>{var D;(D=j==null?void 0:j.onClick)==null||D.call(j,A),k==null||k(A,q)},onMouseEnter:A=>{var D;(D=j==null?void 0:j.onMouseEnter)==null||D.call(j,A),M==null||M(A,q)},onMouseDown:A=>{var D;(D=j==null?void 0:j.onMouseDown)==null||D.call(j,A),E&&A.preventDefault()},tabIndex:E||!S?-1:0,children:R(q).locale(P.getLocale(f)).format(d)})},U)});return m.jsx("tr",{...z("monthsListRow"),children:X},K)});return m.jsx(x.Box,{component:"table",ref:e,size:w,...z("monthsList"),...L,children:m.jsx("tbody",{children:V})})});uo.classes=Iu;uo.displayName="@mantine/dates/MonthsList";var ju={calendarHeader:"m_730a79ed",calendarHeaderLevel:"m_f6645d97",calendarHeaderControl:"m_2351eeb0",calendarHeaderControlIcon:"m_367dc749"};const Xp={hasNextLevel:!0,withNext:!0,withPrevious:!0,headerControlsOrder:["previous","level","next"]},Qp=x.createVarsResolver((n,{size:e})=>({calendarHeader:{"--dch-control-size":x.getSize(e,"dch-control-size"),"--dch-fz":x.getFontSize(e)}})),Zt=x.factory((n,e)=>{const t=x.useProps("CalendarHeader",Xp,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,nextIcon:c,previousIcon:u,nextLabel:d,previousLabel:f,onNext:h,onPrevious:p,onLevelClick:g,label:y,nextDisabled:b,previousDisabled:k,hasNextLevel:M,levelControlAriaLabel:E,withNext:v,withPrevious:C,headerControlsOrder:w,__staticSelector:O,__preventFocus:L,__stopPropagation:z,attributes:P,...$}=t,B=x.useStyles({name:O||"CalendarHeader",classes:ju,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:P,vars:a,varsResolver:Qp,rootSelector:"calendarHeader"}),V=L?U=>U.preventDefault():void 0,G=C&&T.createElement(x.UnstyledButton,{...B("calendarHeaderControl"),key:"previous","data-direction":"previous","aria-label":f,onClick:p,unstyled:l,onMouseDown:V,disabled:k,"data-disabled":k||void 0,tabIndex:L||k?-1:0,"data-mantine-stop-propagation":z||void 0},u||m.jsx(x.AccordionChevron,{...B("calendarHeaderControlIcon"),"data-direction":"previous",size:"45%"})),K=T.createElement(x.UnstyledButton,{component:M?"button":"div",...B("calendarHeaderLevel"),key:"level",onClick:M?g:void 0,unstyled:l,onMouseDown:M?V:void 0,disabled:!M,"data-static":!M||void 0,"aria-label":E,tabIndex:L||!M?-1:0,"data-mantine-stop-propagation":z||void 0},y),X=v&&T.createElement(x.UnstyledButton,{...B("calendarHeaderControl"),key:"next","data-direction":"next","aria-label":d,onClick:h,unstyled:l,onMouseDown:V,disabled:b,"data-disabled":b||void 0,tabIndex:L||b?-1:0,"data-mantine-stop-propagation":z||void 0},c||m.jsx(x.AccordionChevron,{...B("calendarHeaderControlIcon"),"data-direction":"next",size:"45%"})),q=w.map(U=>U==="previous"?G:U==="level"?K:U==="next"?X:null);return m.jsx(x.Box,{...B("calendarHeader"),ref:e,...$,children:q})});Zt.classes=ju;Zt.displayName="@mantine/dates/CalendarHeader";function Zp(n){const e=Nu(n);return[e[0][0],e[3][0]]}const em={decadeLabelFormat:"YYYY"},fo=x.factory((n,e)=>{const t=x.useProps("DecadeLevel",em,n),{decade:r,locale:s,minDate:o,maxDate:i,yearsListFormat:l,getYearControlProps:a,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,withCellSpacing:h,__preventFocus:p,nextIcon:g,previousIcon:y,nextLabel:b,previousLabel:k,onNext:M,onPrevious:E,nextDisabled:v,previousDisabled:C,levelControlAriaLabel:w,withNext:O,withPrevious:L,headerControlsOrder:z,decadeLabelFormat:P,classNames:$,styles:B,unstyled:V,__staticSelector:G,__stopPropagation:K,size:X,attributes:q,...U}=t,j=Rt(),[S,A]=Zp(r),D={__staticSelector:G||"DecadeLevel",classNames:$,styles:B,unstyled:V,size:X,attributes:q},_=typeof v=="boolean"?v:i?!R(A).endOf("year").isBefore(i):!1,J=typeof C=="boolean"?C:o?!R(S).startOf("year").isAfter(o):!1,de=(N,Q)=>R(N).locale(s||j.locale).format(Q);return m.jsxs(x.Box,{"data-decade-level":!0,size:X,ref:e,...U,children:[m.jsx(Zt,{label:typeof P=="function"?P(S,A):`${de(S,P)} – ${de(A,P)}`,__preventFocus:p,__stopPropagation:K,nextIcon:g,previousIcon:y,nextLabel:b,previousLabel:k,onNext:M,onPrevious:E,nextDisabled:_,previousDisabled:J,hasNextLevel:!1,levelControlAriaLabel:w,withNext:O,withPrevious:L,headerControlsOrder:z,...D}),m.jsx(co,{decade:r,locale:s,minDate:o,maxDate:i,yearsListFormat:l,getYearControlProps:a,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,__preventFocus:p,__stopPropagation:K,withCellSpacing:h,...D})]})});fo.classes={...co.classes,...Zt.classes};fo.displayName="@mantine/dates/DecadeLevel";const tm={yearLabelFormat:"YYYY"},ho=x.factory((n,e)=>{const t=x.useProps("YearLevel",tm,n),{year:r,locale:s,minDate:o,maxDate:i,monthsListFormat:l,getMonthControlProps:a,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,withCellSpacing:h,__preventFocus:p,nextIcon:g,previousIcon:y,nextLabel:b,previousLabel:k,onNext:M,onPrevious:E,onLevelClick:v,nextDisabled:C,previousDisabled:w,hasNextLevel:O,levelControlAriaLabel:L,withNext:z,withPrevious:P,headerControlsOrder:$,yearLabelFormat:B,__staticSelector:V,__stopPropagation:G,size:K,classNames:X,styles:q,unstyled:U,attributes:j,...S}=t,A=Rt(),D={__staticSelector:V||"YearLevel",classNames:X,styles:q,unstyled:U,size:K,attributes:j},_=typeof C=="boolean"?C:i?!R(r).endOf("year").isBefore(i):!1,J=typeof w=="boolean"?w:o?!R(r).startOf("year").isAfter(o):!1;return m.jsxs(x.Box,{"data-year-level":!0,size:K,ref:e,...S,children:[m.jsx(Zt,{label:typeof B=="function"?B(r):R(r).locale(s||A.locale).format(B),__preventFocus:p,__stopPropagation:G,nextIcon:g,previousIcon:y,nextLabel:b,previousLabel:k,onNext:M,onPrevious:E,onLevelClick:v,nextDisabled:_,previousDisabled:J,hasNextLevel:O,levelControlAriaLabel:L,withNext:z,withPrevious:P,headerControlsOrder:$,...D}),m.jsx(uo,{year:r,locale:s,minDate:o,maxDate:i,monthsListFormat:l,getMonthControlProps:a,__getControlRef:c,__onControlKeyDown:u,__onControlClick:d,__onControlMouseEnter:f,__preventFocus:p,__stopPropagation:G,withCellSpacing:h,...D})]})});ho.classes={...Zt.classes,...uo.classes};ho.displayName="@mantine/dates/YearLevel";const nm={monthLabelFormat:"MMMM YYYY"},po=x.factory((n,e)=>{const t=x.useProps("MonthLevel",nm,n),{month:r,locale:s,firstDayOfWeek:o,weekdayFormat:i,weekendDays:l,getDayProps:a,excludeDate:c,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:h,hideWeekdays:p,getDayAriaLabel:g,__getDayRef:y,__onDayKeyDown:b,__onDayClick:k,__onDayMouseEnter:M,withCellSpacing:E,highlightToday:v,withWeekNumbers:C,__preventFocus:w,__stopPropagation:O,nextIcon:L,previousIcon:z,nextLabel:P,previousLabel:$,onNext:B,onPrevious:V,onLevelClick:G,nextDisabled:K,previousDisabled:X,hasNextLevel:q,levelControlAriaLabel:U,withNext:j,withPrevious:S,headerControlsOrder:A,monthLabelFormat:D,classNames:_,styles:J,unstyled:de,__staticSelector:N,size:Q,static:oe,attributes:te,...pe}=t,he=Rt(),ae={__staticSelector:N||"MonthLevel",classNames:_,styles:J,unstyled:de,size:Q,attributes:te},se=typeof K=="boolean"?K:d?!R(r).endOf("month").isBefore(d):!1,Oe=typeof X=="boolean"?X:u?!R(r).startOf("month").isAfter(u):!1;return m.jsxs(x.Box,{"data-month-level":!0,size:Q,ref:e,...pe,children:[m.jsx(Zt,{label:typeof D=="function"?D(r):R(r).locale(s||he.locale).format(D),__preventFocus:w,__stopPropagation:O,nextIcon:L,previousIcon:z,nextLabel:P,previousLabel:$,onNext:B,onPrevious:V,onLevelClick:G,nextDisabled:se,previousDisabled:Oe,hasNextLevel:q,levelControlAriaLabel:U,withNext:j,withPrevious:S,headerControlsOrder:A,...ae}),m.jsx(lo,{month:r,locale:s,firstDayOfWeek:o,weekdayFormat:i,weekendDays:l,getDayProps:a,excludeDate:c,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:h,hideWeekdays:p,getDayAriaLabel:g,__getDayRef:y,__onDayKeyDown:b,__onDayClick:k,__onDayMouseEnter:M,__preventFocus:w,__stopPropagation:O,static:oe,withCellSpacing:E,highlightToday:v,withWeekNumbers:C,...ae})]})});po.classes={...lo.classes,...Zt.classes};po.displayName="@mantine/dates/MonthLevel";var Pu={levelsGroup:"m_30b26e33"};const en=x.factory((n,e)=>{const t=x.useProps("LevelsGroup",null,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,__staticSelector:c,attributes:u,...d}=t,f=x.useStyles({name:c||"LevelsGroup",classes:Pu,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:u,vars:a,rootSelector:"levelsGroup"});return m.jsx(x.Box,{ref:e,...f("levelsGroup"),...d})});en.classes=Pu;en.displayName="@mantine/dates/LevelsGroup";const rm={numberOfColumns:1},mo=x.factory((n,e)=>{const t=x.useProps("DecadeLevelGroup",rm,n),{decade:r,locale:s,minDate:o,maxDate:i,yearsListFormat:l,getYearControlProps:a,__onControlClick:c,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:f,nextIcon:h,previousIcon:p,nextLabel:g,previousLabel:y,onNext:b,onPrevious:k,nextDisabled:M,previousDisabled:E,headerControlsOrder:v,classNames:C,styles:w,unstyled:O,__staticSelector:L,__stopPropagation:z,numberOfColumns:P,levelControlAriaLabel:$,decadeLabelFormat:B,size:V,vars:G,attributes:K,...X}=t,q=T.useRef([]),U=Array(P).fill(0).map((j,S)=>{const A=R(r).add(S*10,"years").format("YYYY-MM-DD");return m.jsx(fo,{size:V,yearsListFormat:l,decade:A,withNext:S===P-1,withPrevious:S===0,decadeLabelFormat:B,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(D,_)=>dl({levelIndex:S,rowIndex:_.rowIndex,cellIndex:_.cellIndex,event:D,controlsRef:q}),__getControlRef:(D,_,J)=>{Array.isArray(q.current[S])||(q.current[S]=[]),Array.isArray(q.current[S][D])||(q.current[S][D]=[]),q.current[S][D][_]=J},levelControlAriaLabel:typeof $=="function"?$(A):$,locale:s,minDate:o,maxDate:i,__preventFocus:f,__stopPropagation:z,nextIcon:h,previousIcon:p,nextLabel:g,previousLabel:y,onNext:b,onPrevious:k,nextDisabled:M,previousDisabled:E,getYearControlProps:a,__staticSelector:L||"DecadeLevelGroup",classNames:C,styles:w,unstyled:O,withCellSpacing:d,headerControlsOrder:v,attributes:K},S)});return m.jsx(en,{classNames:C,styles:w,__staticSelector:L||"DecadeLevelGroup",ref:e,size:V,unstyled:O,attributes:K,...X,children:U})});mo.classes={...en.classes,...fo.classes};mo.displayName="@mantine/dates/DecadeLevelGroup";const sm={numberOfColumns:1},go=x.factory((n,e)=>{const t=x.useProps("YearLevelGroup",sm,n),{year:r,locale:s,minDate:o,maxDate:i,monthsListFormat:l,getMonthControlProps:a,__onControlClick:c,__onControlMouseEnter:u,withCellSpacing:d,__preventFocus:f,nextIcon:h,previousIcon:p,nextLabel:g,previousLabel:y,onNext:b,onPrevious:k,onLevelClick:M,nextDisabled:E,previousDisabled:v,hasNextLevel:C,headerControlsOrder:w,classNames:O,styles:L,unstyled:z,__staticSelector:P,__stopPropagation:$,numberOfColumns:B,levelControlAriaLabel:V,yearLabelFormat:G,size:K,vars:X,attributes:q,...U}=t,j=T.useRef([]),S=Array(B).fill(0).map((A,D)=>{const _=R(r).add(D,"years").format("YYYY-MM-DD");return m.jsx(ho,{size:K,monthsListFormat:l,year:_,withNext:D===B-1,withPrevious:D===0,yearLabelFormat:G,__stopPropagation:$,__onControlClick:c,__onControlMouseEnter:u,__onControlKeyDown:(J,de)=>dl({levelIndex:D,rowIndex:de.rowIndex,cellIndex:de.cellIndex,event:J,controlsRef:j}),__getControlRef:(J,de,N)=>{Array.isArray(j.current[D])||(j.current[D]=[]),Array.isArray(j.current[D][J])||(j.current[D][J]=[]),j.current[D][J][de]=N},levelControlAriaLabel:typeof V=="function"?V(_):V,locale:s,minDate:o,maxDate:i,__preventFocus:f,nextIcon:h,previousIcon:p,nextLabel:g,previousLabel:y,onNext:b,onPrevious:k,onLevelClick:M,nextDisabled:E,previousDisabled:v,hasNextLevel:C,getMonthControlProps:a,classNames:O,styles:L,unstyled:z,__staticSelector:P||"YearLevelGroup",withCellSpacing:d,headerControlsOrder:w,attributes:q},D)});return m.jsx(en,{classNames:O,styles:L,__staticSelector:P||"YearLevelGroup",ref:e,size:K,unstyled:z,attributes:q,...U,children:S})});go.classes={...ho.classes,...en.classes};go.displayName="@mantine/dates/YearLevelGroup";const om={numberOfColumns:1},yo=x.factory((n,e)=>{const t=x.useProps("MonthLevelGroup",om,n),{month:r,locale:s,firstDayOfWeek:o,weekdayFormat:i,weekendDays:l,getDayProps:a,excludeDate:c,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:h,hideWeekdays:p,getDayAriaLabel:g,__onDayClick:y,__onDayMouseEnter:b,withCellSpacing:k,highlightToday:M,withWeekNumbers:E,__preventFocus:v,nextIcon:C,previousIcon:w,nextLabel:O,previousLabel:L,onNext:z,onPrevious:P,onLevelClick:$,nextDisabled:B,previousDisabled:V,hasNextLevel:G,headerControlsOrder:K,classNames:X,styles:q,unstyled:U,numberOfColumns:j,levelControlAriaLabel:S,monthLabelFormat:A,__staticSelector:D,__stopPropagation:_,size:J,static:de,vars:N,attributes:Q,...oe}=t,te=T.useRef([]),pe=Array(j).fill(0).map((he,ae)=>{const se=R(r).add(ae,"months").format("YYYY-MM-DD");return m.jsx(po,{month:se,withNext:ae===j-1,withPrevious:ae===0,monthLabelFormat:A,__stopPropagation:_,__onDayClick:y,__onDayMouseEnter:b,__onDayKeyDown:(Oe,ue)=>dl({levelIndex:ae,rowIndex:ue.rowIndex,cellIndex:ue.cellIndex,event:Oe,controlsRef:te}),__getDayRef:(Oe,ue,ke)=>{Array.isArray(te.current[ae])||(te.current[ae]=[]),Array.isArray(te.current[ae][Oe])||(te.current[ae][Oe]=[]),te.current[ae][Oe][ue]=ke},levelControlAriaLabel:typeof S=="function"?S(se):S,locale:s,firstDayOfWeek:o,weekdayFormat:i,weekendDays:l,getDayProps:a,excludeDate:c,minDate:u,maxDate:d,renderDay:f,hideOutsideDates:h,hideWeekdays:p,getDayAriaLabel:g,__preventFocus:v,nextIcon:C,previousIcon:w,nextLabel:O,previousLabel:L,onNext:z,onPrevious:P,onLevelClick:$,nextDisabled:B,previousDisabled:V,hasNextLevel:G,classNames:X,styles:q,unstyled:U,__staticSelector:D||"MonthLevelGroup",size:J,static:de,withCellSpacing:k,highlightToday:M,withWeekNumbers:E,headerControlsOrder:K,attributes:Q},ae)});return m.jsx(en,{classNames:X,styles:q,__staticSelector:D||"MonthLevelGroup",ref:e,size:J,attributes:Q,...oe,children:pe})});yo.classes={...en.classes,...po.classes};yo.displayName="@mantine/dates/MonthLevelGroup";var _u={input:"m_6fa5e2aa"};const bo=x.factory((n,e)=>{const{inputProps:t,wrapperProps:r,placeholder:s,classNames:o,styles:i,unstyled:l,popoverProps:a,modalProps:c,dropdownType:u,children:d,formattedValue:f,dropdownHandlers:h,dropdownOpened:p,onClick:g,clearable:y,onClear:b,clearButtonProps:k,rightSection:M,shouldClear:E,readOnly:v,disabled:C,value:w,name:O,form:L,type:z,onDropdownClose:P,withTime:$,...B}=x.useInputProps("PickerInputBase",{size:"sm"},n),V=m.jsx(x.Input.ClearButton,{onClick:b,unstyled:l,...k}),G=()=>{z==="range"&&Array.isArray(w)&&w[0]&&!w[1]&&b(),h.close()};return m.jsxs(m.Fragment,{children:[u==="modal"&&!v&&m.jsx(x.Modal,{opened:p,onClose:G,withCloseButton:!1,size:"auto","data-dates-modal":!0,unstyled:l,...c,children:d}),m.jsx(x.Input.Wrapper,{...r,children:m.jsxs(x.Popover,{position:"bottom-start",opened:p,trapFocus:!0,returnFocus:!1,unstyled:l,onClose:P,...a,disabled:(a==null?void 0:a.disabled)||u==="modal"||v,onChange:K=>{var X;K||((X=a==null?void 0:a.onClose)==null||X.call(a),G())},children:[m.jsx(x.Popover.Target,{children:m.jsx(x.Input,{"data-dates-input":!0,"data-read-only":v||void 0,disabled:C,component:"button",type:"button",multiline:!0,onClick:K=>{g==null||g(K),h.toggle()},__clearSection:V,__clearable:y&&E&&!v&&!C,rightSection:M,...t,ref:e,classNames:{...o,input:pu(_u.input,o==null?void 0:o.input)},...B,children:f||m.jsx(x.Input.Placeholder,{error:t.error,unstyled:l,className:o==null?void 0:o.placeholder,style:i==null?void 0:i.placeholder,children:s})})}),m.jsx(x.Popover.Dropdown,{"data-dates-dropdown":!0,children:d})]})}),m.jsx(fl,{value:w,name:O,form:L,type:z,withTime:$})]})});bo.classes=_u;bo.displayName="@mantine/dates/PickerInputBase";const Da=n=>n==="range"?[null,null]:n==="multiple"?[]:null,Na=(n,e)=>{const t=e?Fn:He;return Array.isArray(n)?n.map(t):t(n)};function kr({type:n,value:e,defaultValue:t,onChange:r,withTime:s=!1}){const o=T.useRef(n),[i,l,a]=mu({value:Na(e,s),defaultValue:Na(t,s),finalValue:Da(n),onChange:r});let c=i;return o.current!==n&&(o.current=n,e===void 0&&(c=t!==void 0?t:Da(n),l(c))),[c,l,a]}function qo(n,e){return n?n==="month"?0:n==="year"?1:2:e||0}function im(n){return n===0?"month":n===1?"year":"decade"}function er(n,e,t){return im(ts(qo(n,0),qo(e,0),qo(t,2)))}const lm={maxLevel:"decade",minLevel:"month",__updateDateOnYearSelect:!0,__updateDateOnMonthSelect:!0,enableKeyboardNavigation:!0},Kn=x.factory((n,e)=>{const t=x.useProps("Calendar",lm,n),{vars:r,maxLevel:s,minLevel:o,defaultLevel:i,level:l,onLevelChange:a,date:c,defaultDate:u,onDateChange:d,numberOfColumns:f,columnsToScroll:h,ariaLabels:p,nextLabel:g,previousLabel:y,onYearSelect:b,onMonthSelect:k,onYearMouseEnter:M,onMonthMouseEnter:E,headerControlsOrder:v,__updateDateOnYearSelect:C,__updateDateOnMonthSelect:w,__setDateRef:O,__setLevelRef:L,firstDayOfWeek:z,weekdayFormat:P,weekendDays:$,getDayProps:B,excludeDate:V,renderDay:G,hideOutsideDates:K,hideWeekdays:X,getDayAriaLabel:q,monthLabelFormat:U,nextIcon:j,previousIcon:S,__onDayClick:A,__onDayMouseEnter:D,withCellSpacing:_,highlightToday:J,withWeekNumbers:de,monthsListFormat:N,getMonthControlProps:Q,yearLabelFormat:oe,yearsListFormat:te,getYearControlProps:pe,decadeLabelFormat:he,classNames:ae,styles:se,unstyled:Oe,minDate:ue,maxDate:ke,locale:ce,__staticSelector:Ee,size:Dn,__preventFocus:rn,__stopPropagation:sn,onNextDecade:on,onPreviousDecade:ln,onNextYear:an,onPreviousYear:Xe,onNextMonth:H,onPreviousMonth:Qe,static:Ze,enableKeyboardNavigation:cn,attributes:Nn,...Pr}=t,{resolvedClassNames:Gn,resolvedStyles:_o}=x.useResolvedStylesApi({classNames:ae,styles:se,props:t}),[It,ft]=mu({value:l?er(l,o,s):void 0,defaultValue:i?er(i,o,s):void 0,finalValue:er(void 0,o,s),onChange:a}),[Bo,ne]=kr({type:"default",value:He(c),defaultValue:He(u),onChange:d});T.useImperativeHandle(O,()=>ge=>{ne(ge)}),T.useImperativeHandle(L,()=>ge=>{ft(ge)});const xe={__staticSelector:Ee||"Calendar",styles:_o,classNames:Gn,unstyled:Oe,size:Dn,attributes:Nn},ot=h||f||1,jt=new Date,Ch=ue&&R(jt).isAfter(ue)?ue:R(jt).format("YYYY-MM-DD"),Ct=Bo||Ch,Mh=()=>{const ge=R(Ct).add(ot,"month").format("YYYY-MM-DD");H==null||H(ge),ne(ge)},wh=()=>{const ge=R(Ct).subtract(ot,"month").format("YYYY-MM-DD");Qe==null||Qe(ge),ne(ge)},Fo=()=>{const ge=R(Ct).add(ot,"year").format("YYYY-MM-DD");an==null||an(ge),ne(ge)},zo=()=>{const ge=R(Ct).subtract(ot,"year").format("YYYY-MM-DD");Xe==null||Xe(ge),ne(ge)},$o=()=>{const ge=R(Ct).add(10*ot,"year").format("YYYY-MM-DD");on==null||on(ge),ne(ge)},Vo=()=>{const ge=R(Ct).subtract(10*ot,"year").format("YYYY-MM-DD");ln==null||ln(ge),ne(ge)},ha=T.useRef(null);T.useEffect(()=>{if(!cn||Ze)return;const ge=qe=>{var ma;if(!((ma=ha.current)!=null&&ma.contains(document.activeElement)))return;const _r=qe.ctrlKey||qe.metaKey,pa=qe.shiftKey;switch(qe.key){case"ArrowUp":_r&&pa?(qe.preventDefault(),Vo()):_r&&(qe.preventDefault(),zo());break;case"ArrowDown":_r&&pa?(qe.preventDefault(),$o()):_r&&(qe.preventDefault(),Fo());break;case"y":case"Y":It==="month"&&(qe.preventDefault(),ft("year"));break}};return document.addEventListener("keydown",ge),()=>{document.removeEventListener("keydown",ge)}},[cn,Ze,It,Fo,zo,$o,Vo]);const Th=ge=>{ha.current=ge,typeof e=="function"?e(ge):e&&(e.current=ge)};return m.jsxs(x.Box,{ref:Th,size:Dn,"data-calendar":!0,...Pr,children:[It==="month"&&m.jsx(yo,{month:Ct,minDate:ue,maxDate:ke,firstDayOfWeek:z,weekdayFormat:P,weekendDays:$,getDayProps:B,excludeDate:V,renderDay:G,hideOutsideDates:K,hideWeekdays:X,getDayAriaLabel:q,onNext:Mh,onPrevious:wh,hasNextLevel:s!=="month",onLevelClick:()=>ft("year"),numberOfColumns:f,locale:ce,levelControlAriaLabel:p==null?void 0:p.monthLevelControl,nextLabel:(p==null?void 0:p.nextMonth)??g,nextIcon:j,previousLabel:(p==null?void 0:p.previousMonth)??y,previousIcon:S,monthLabelFormat:U,__onDayClick:A,__onDayMouseEnter:D,__preventFocus:rn,__stopPropagation:sn,static:Ze,withCellSpacing:_,highlightToday:J,withWeekNumbers:de,headerControlsOrder:v,...xe}),It==="year"&&m.jsx(go,{year:Ct,numberOfColumns:f,minDate:ue,maxDate:ke,monthsListFormat:N,getMonthControlProps:Q,locale:ce,onNext:Fo,onPrevious:zo,hasNextLevel:s!=="month"&&s!=="year",onLevelClick:()=>ft("decade"),levelControlAriaLabel:p==null?void 0:p.yearLevelControl,nextLabel:(p==null?void 0:p.nextYear)??g,nextIcon:j,previousLabel:(p==null?void 0:p.previousYear)??y,previousIcon:S,yearLabelFormat:oe,__onControlMouseEnter:E,__onControlClick:(ge,qe)=>{w&&ne(qe),ft(er("month",o,s)),k==null||k(qe)},__preventFocus:rn,__stopPropagation:sn,withCellSpacing:_,headerControlsOrder:v,...xe}),It==="decade"&&m.jsx(mo,{decade:Ct,minDate:ue,maxDate:ke,yearsListFormat:te,getYearControlProps:pe,locale:ce,onNext:$o,onPrevious:Vo,numberOfColumns:f,nextLabel:(p==null?void 0:p.nextDecade)??g,nextIcon:j,previousLabel:(p==null?void 0:p.previousDecade)??y,previousIcon:S,decadeLabelFormat:he,__onControlMouseEnter:M,__onControlClick:(ge,qe)=>{C&&ne(qe),ft(er("year",o,s)),b==null||b(qe)},__preventFocus:rn,__stopPropagation:sn,withCellSpacing:_,headerControlsOrder:v,...xe})]})});Kn.classes={...mo.classes,...go.classes,...yo.classes};Kn.displayName="@mantine/dates/Calendar";function kl(n){const{maxLevel:e,minLevel:t,defaultLevel:r,level:s,onLevelChange:o,nextIcon:i,previousIcon:l,date:a,defaultDate:c,onDateChange:u,numberOfColumns:d,columnsToScroll:f,ariaLabels:h,nextLabel:p,previousLabel:g,onYearSelect:y,onMonthSelect:b,onYearMouseEnter:k,onMonthMouseEnter:M,onNextMonth:E,onPreviousMonth:v,onNextYear:C,onPreviousYear:w,onNextDecade:O,onPreviousDecade:L,withCellSpacing:z,highlightToday:P,__updateDateOnYearSelect:$,__updateDateOnMonthSelect:B,__setDateRef:V,__setLevelRef:G,withWeekNumbers:K,headerControlsOrder:X,firstDayOfWeek:q,weekdayFormat:U,weekendDays:j,getDayProps:S,excludeDate:A,renderDay:D,hideOutsideDates:_,hideWeekdays:J,getDayAriaLabel:de,monthLabelFormat:N,monthsListFormat:Q,getMonthControlProps:oe,yearLabelFormat:te,yearsListFormat:pe,getYearControlProps:he,decadeLabelFormat:ae,allowSingleDateInRange:se,allowDeselect:Oe,minDate:ue,maxDate:ke,locale:ce,...Ee}=n;return{calendarProps:{maxLevel:e,minLevel:t,defaultLevel:r,level:s,onLevelChange:o,nextIcon:i,previousIcon:l,date:a,defaultDate:c,onDateChange:u,numberOfColumns:d,columnsToScroll:f,ariaLabels:h,nextLabel:p,previousLabel:g,onYearSelect:y,onMonthSelect:b,onYearMouseEnter:k,onMonthMouseEnter:M,onNextMonth:E,onPreviousMonth:v,onNextYear:C,onPreviousYear:w,onNextDecade:O,onPreviousDecade:L,withCellSpacing:z,highlightToday:P,__updateDateOnYearSelect:$,__updateDateOnMonthSelect:B,__setDateRef:V,withWeekNumbers:K,headerControlsOrder:X,firstDayOfWeek:q,weekdayFormat:U,weekendDays:j,getDayProps:S,excludeDate:A,renderDay:D,hideOutsideDates:_,hideWeekdays:J,getDayAriaLabel:de,monthLabelFormat:N,monthsListFormat:Q,getMonthControlProps:oe,yearLabelFormat:te,yearsListFormat:pe,getYearControlProps:he,decadeLabelFormat:ae,allowSingleDateInRange:se,allowDeselect:Oe,minDate:ue,maxDate:ke,locale:ce},others:Ee}}function Ra(n,e){const t=[...e].sort((r,s)=>R(r).isAfter(R(s))?1:-1);return R(t[0]).startOf("day").subtract(1,"ms").isBefore(n)&&R(t[1]).endOf("day").add(1,"ms").isAfter(n)}function am({type:n,level:e,value:t,defaultValue:r,onChange:s,allowSingleDateInRange:o,allowDeselect:i,onMouseLeave:l}){const[a,c]=kr({type:n,value:t,defaultValue:r,onChange:s}),[u,d]=T.useState(n==="range"&&a[0]&&!a[1]?a[0]:null),[f,h]=T.useState(null),p=v=>{if(n==="range"){if(u&&!a[1]){if(R(v).isSame(u,e)&&!o){d(null),h(null),c([null,null]);return}const C=[v,u];C.sort((w,O)=>R(w).isAfter(R(O))?1:-1),c(C),h(null),d(null);return}if(a[0]&&!a[1]&&R(v).isSame(a[0],e)&&!o){d(null),h(null),c([null,null]);return}c([v,null]),h(null),d(v);return}if(n==="multiple"){a.some(C=>R(C).isSame(v,e))?c(a.filter(C=>!R(C).isSame(v,e))):c([...a,v]);return}a&&i&&R(v).isSame(a,e)?c(null):c(v)},g=v=>u&&f?Ra(v,[f,u]):a[0]&&a[1]?Ra(v,a):!1,y=n==="range"?v=>{l==null||l(v),h(null)}:l,b=v=>a[0]&&R(v).isSame(a[0],e)?!(f&&R(f).isBefore(a[0])):!1,k=v=>a[1]?R(v).isSame(a[1],e):!a[0]||!f?!1:R(f).isBefore(a[0])&&R(v).isSame(a[0],e),M=v=>{if(n==="range")return{selected:a.some(w=>w&&R(w).isSame(v,e)),inRange:g(v),firstInRange:b(v),lastInRange:k(v),"data-autofocus":!!a[0]&&R(a[0]).isSame(v,e)||void 0};if(n==="multiple")return{selected:a.some(w=>w&&R(w).isSame(v,e)),"data-autofocus":!!a[0]&&R(a[0]).isSame(v,e)||void 0};const C=R(a).isSame(v,e);return{selected:C,"data-autofocus":C||void 0}},E=n==="range"&&u?h:()=>{};return T.useEffect(()=>{if(n==="range")if(a[0]&&!a[1])d(a[0]);else{const v=a[0]==null&&a[1]==null,C=a[0]!=null&&a[1]!=null;(v||C)&&(d(null),h(null))}},[a]),{onDateChange:p,onRootMouseLeave:y,onHoveredDateChange:E,getControlProps:M,_value:a,setValue:c}}var cm={datePickerRoot:"m_765a40cf",presetsList:"m_d6a681e1",presetButton:"m_acd30b22"};const um=x.createVarsResolver((n,{size:e})=>({datePickerRoot:{"--preset-font-size":x.getFontSize(e)}})),dm={type:"default",defaultLevel:"month",numberOfColumns:1,size:"sm"},ko=x.factory((n,e)=>{const t=x.useProps("DatePicker",dm,n),{allowDeselect:r,allowSingleDateInRange:s,value:o,defaultValue:i,onChange:l,onMouseLeave:a,classNames:c,styles:u,__staticSelector:d,__onDayClick:f,__onDayMouseEnter:h,__onPresetSelect:p,__stopPropagation:g,presets:y,className:b,style:k,unstyled:M,size:E,vars:v,attributes:C,...w}=t,{calendarProps:O,others:L}=kl(w),z=T.useRef(null),P=T.useRef(null),$=x.useStyles({name:d||"DatePicker",classes:cm,props:t,className:b,style:k,classNames:c,styles:u,unstyled:M,attributes:C,rootSelector:y?"datePickerRoot":void 0,varsResolver:um,vars:v}),{onDateChange:B,onRootMouseLeave:V,onHoveredDateChange:G,getControlProps:K,_value:X,setValue:q}=am({type:L.type,level:"day",allowDeselect:r,allowSingleDateInRange:s,value:o,defaultValue:i,onChange:l,onMouseLeave:a}),{resolvedClassNames:U,resolvedStyles:j}=x.useResolvedStylesApi({classNames:c,styles:u,props:t}),S=m.jsx(Kn,{ref:e,classNames:U,styles:j,__staticSelector:d||"DatePicker",onMouseLeave:V,size:E,...O,...y?{}:L,__stopPropagation:g,__setDateRef:z,__setLevelRef:P,minLevel:O.minLevel||"month",__onDayMouseEnter:(_,J)=>{G(J),h==null||h(_,J)},__onDayClick:(_,J)=>{B(J),f==null||f(_,J)},getDayProps:_=>{var J;return{...K(_),...(J=O.getDayProps)==null?void 0:J.call(O,_)}},getMonthControlProps:_=>{var J;return{selected:typeof X=="string"?io(_,X):!1,...(J=O.getMonthControlProps)==null?void 0:J.call(O,_)}},getYearControlProps:_=>{var J;return{selected:typeof X=="string"?R(_).isSame(X,"year"):!1,...(J=O.getYearControlProps)==null?void 0:J.call(O,_)}},hideOutsideDates:O.hideOutsideDates??O.numberOfColumns!==1,...y?{}:{className:b,style:k,attributes:C}});if(!y)return S;const A=_=>{var de,N;const J=Array.isArray(_)?_[0]:_;J!==void 0&&((de=z.current)==null||de.call(z,J),(N=P.current)==null||N.call(P,"month"),p?p(J):q(_))},D=y.map((_,J)=>m.jsx(x.UnstyledButton,{...$("presetButton"),onClick:()=>A(_.value),onMouseDown:de=>de.preventDefault(),"data-mantine-stop-propagation":g||void 0,children:_.label},J));return m.jsxs(x.Box,{...$("datePickerRoot"),size:E,...L,children:[m.jsx("div",{...$("presetsList"),children:D}),S]})});ko.classes=Kn.classes;ko.displayName="@mantine/dates/DatePicker";function fm(n){if(n===null)return null;const e=new Date(n);return Number.isNaN(e.getTime())||!n?null:R(e).format("YYYY-MM-DD")}function hm({date:n,maxDate:e,minDate:t}){return!(n==null||Number.isNaN(new Date(n).getTime())||e&&R(n).isAfter(e,"date")||t&&R(n).isBefore(t,"date"))}const pm={valueFormat:"MMMM D, YYYY",fixOnBlur:!0,size:"sm"},ms=x.factory((n,e)=>{const t=x.useInputProps("DateInput",pm,n),{inputProps:r,wrapperProps:s,value:o,defaultValue:i,onChange:l,clearable:a,clearButtonProps:c,popoverProps:u,getDayProps:d,locale:f,valueFormat:h,dateParser:p,minDate:g,maxDate:y,fixOnBlur:b,onFocus:k,onBlur:M,onClick:E,onKeyDown:v,readOnly:C,name:w,form:O,rightSection:L,unstyled:z,classNames:P,styles:$,allowDeselect:B,date:V,defaultDate:G,onDateChange:K,getMonthControlProps:X,getYearControlProps:q,disabled:U,...j}=t,S=T.useRef(null),A=T.useRef(null),[D,_]=T.useState(!1),{calendarProps:J,others:de}=kl(j),N=Rt(),oe=p||(H=>{const Qe=R(H,h,N.getLocale(f)).toDate();return Number.isNaN(Qe.getTime())?fm(H):R(Qe).format("YYYY-MM-DD")}),te=B!==void 0?B:a,pe=H=>H?R(H).locale(N.getLocale(f)).format(h):"",[he,ae,se]=kr({type:"default",value:o,defaultValue:i,onChange:l}),[Oe,ue]=kr({type:"default",value:V,defaultValue:i||G,onChange:K});T.useEffect(()=>{se&&o!==null&&ue(o)},[se,o]);const[ke,ce]=T.useState(pe(he));T.useEffect(()=>{ce(pe(he))},[N.getLocale(f)]);const Ee=H=>{const Qe=H.currentTarget.value;if(ce(Qe),_(!0),Qe.trim()===""&&(B||a))ae(null);else{const Ze=oe(Qe);Ze&&hm({date:Ze,minDate:g,maxDate:y})&&(ae(Ze),ue(Ze))}},Dn=H=>{M==null||M(H),_(!1),b&&ce(pe(he))},rn=H=>{k==null||k(H),_(!0)},sn=H=>{E==null||E(H),_(!0)},on=H=>{H.key==="Escape"&&_(!1),v==null||v(H)},ln=H=>({...d==null?void 0:d(H),selected:R(he).isSame(H,"day"),onClick:Qe=>{var cn,Nn;(Nn=d==null?void 0:(cn=d(H)).onClick)==null||Nn.call(cn,Qe);const Ze=te&&R(he).isSame(H,"day")?null:H;ae(Ze),!se&&Ze&&ce(pe(Ze)),_(!1)}}),an=m.jsx(x.Input.ClearButton,{onClick:()=>{ae(null),!se&&ce(""),_(!1)},unstyled:z,...c}),Xe=a&&!!he&&!C&&!U;return hs(()=>{he!==void 0&&!D&&ce(pe(he))},[he]),up(()=>_(!1),void 0,[S.current,A.current]),m.jsxs(m.Fragment,{children:[m.jsx(x.Input.Wrapper,{...s,__staticSelector:"DateInput",ref:S,children:m.jsxs(x.Popover,{opened:D,trapFocus:!1,position:"bottom-start",disabled:C||U,withRoles:!1,unstyled:z,...u,children:[m.jsx(x.Popover.Target,{children:m.jsx(x.Input,{"data-dates-input":!0,"data-read-only":C||void 0,autoComplete:"off",ref:e,value:ke,onChange:Ee,onBlur:Dn,onFocus:rn,onClick:sn,onKeyDown:on,readOnly:C,rightSection:L,__clearSection:an,__clearable:Xe,...r,...de,disabled:U,__staticSelector:"DateInput"})}),m.jsx(x.Popover.Dropdown,{onMouseDown:H=>H.preventDefault(),"data-dates-dropdown":!0,ref:A,children:m.jsx(Kn,{__staticSelector:"DateInput",...J,classNames:P,styles:$,unstyled:z,__preventFocus:!0,minDate:g,maxDate:y,locale:f,getDayProps:ln,size:r.size,date:Oe,onDateChange:ue,getMonthControlProps:H=>({selected:typeof he=="string"?io(H,he):!1,...X==null?void 0:X(H)}),getYearControlProps:H=>({selected:typeof he=="string"?R(H).isSame(he,"year"):!1,...q==null?void 0:q(H)}),attributes:s.attributes})})]})}),m.jsx(fl,{name:w,form:O,value:he,type:"default"})]})});ms.classes={...x.Input.classes,...Kn.classes};ms.displayName="@mantine/dates/DateInput";function mm({minDate:n,value:e}){const t=n?R(n).format("HH:mm:ss"):null;return e&&n&&e===n?t??void 0:void 0}function gm({maxDate:n,value:e}){const t=n?R(n).format("HH:mm:ss"):null;return e&&n&&e===n?t??void 0:void 0}var Bu={timeWrapper:"m_208d2562",timeInput:"m_62ee059"};const ym={dropdownType:"popover",size:"sm"},gs=x.factory((n,e)=>{const t=x.useProps("DateTimePicker",ym,n),{value:r,defaultValue:s,onChange:o,valueFormat:i,locale:l,classNames:a,styles:c,unstyled:u,timePickerProps:d,submitButtonProps:f,withSeconds:h,level:p,defaultLevel:g,size:y,variant:b,dropdownType:k,vars:M,minDate:E,maxDate:v,defaultDate:C,defaultTimeValue:w,presets:O,attributes:L,onDropdownClose:z,...P}=t,$=x.useStyles({name:"DateTimePicker",classes:Bu,props:t,classNames:a,styles:c,unstyled:u,attributes:L,vars:M}),{resolvedClassNames:B,resolvedStyles:V}=x.useResolvedStylesApi({classNames:a,styles:c,props:t}),G=i||(h?"DD/MM/YYYY HH:mm:ss":"DD/MM/YYYY HH:mm"),K=T.useRef(null),X=rr(K,d==null?void 0:d.hoursRef),{calendarProps:{allowSingleDateInRange:q,...U},others:j}=kl(P),S=Rt(),[A,D]=kr({type:"default",value:r,defaultValue:s,onChange:o,withTime:!0}),_=C||A,J=ce=>ce?R(ce).format(h?"HH:mm:ss":"HH:mm"):"",[de,N]=T.useState(w||J(A)),[Q,oe]=T.useState(p||g||"month"),[te,pe]=hl(!1),he=A?R(A).locale(S.getLocale(l)).format(G):"",ae=ce=>{var Ee;(Ee=d==null?void 0:d.onChange)==null||Ee.call(d,ce),N(ce),ce&&D(Ea(A,ce))},se=ce=>{var Ee;ce&&D(Ea(Wo(E,v,ce),de||w||"")),(Ee=K.current)==null||Ee.focus()},Oe=ce=>{ce.key==="Enter"&&(ce.preventDefault(),pe.close())};hs(()=>{te||N(J(A))},[A,te]),hs(()=>{te&&oe("month")},[te]);const ue=k==="popover",ke=()=>{const ce=Wo(E,v,A);A&&A!==ce&&D(Wo(E,v,A)),z==null||z()};return m.jsxs(bo,{formattedValue:he,dropdownOpened:P.disabled?!1:te,dropdownHandlers:pe,classNames:B,styles:V,unstyled:u,ref:e,onClear:()=>D(null),shouldClear:!!A,value:A,size:y,variant:b,dropdownType:k,...j,type:"default",__staticSelector:"DateTimePicker",onDropdownClose:ke,withTime:!0,attributes:L,children:[m.jsx(ko,{...U,maxDate:v,minDate:E,size:y,variant:b,type:"default",value:A,defaultDate:_||rp({maxDate:v,minDate:E}),onChange:se,locale:l,classNames:B,styles:V,unstyled:u,__staticSelector:"DateTimePicker",__stopPropagation:ue,level:p,defaultLevel:g,onLevelChange:ce=>{var Ee;oe(ce),(Ee=U.onLevelChange)==null||Ee.call(U,ce)},presets:O,__onPresetSelect:ce=>{D(ce),ce&&N(J(ce))},attributes:L}),Q==="month"&&m.jsxs("div",{...$("timeWrapper"),children:[m.jsx(gl,{value:de,withSeconds:h,unstyled:u,min:mm({minDate:E,value:A}),max:gm({maxDate:v,value:A}),...d,...$("timeInput",{className:d==null?void 0:d.className,style:d==null?void 0:d.style}),onChange:ae,onKeyDown:Oe,size:y,"data-mantine-stop-propagation":ue||void 0,hoursRef:X,attributes:L}),m.jsx(x.ActionIcon,{variant:"default",size:`input-${y||"sm"}`,...$("submitButton",{className:f==null?void 0:f.className,style:f==null?void 0:f.style}),unstyled:u,"data-mantine-stop-propagation":ue||void 0,children:m.jsx(x.CheckIcon,{size:"30%"}),...f,onClick:ce=>{var Ee;(Ee=f==null?void 0:f.onClick)==null||Ee.call(f,ce),pe.close(),ke()}})]})]})});gs.classes={...Bu,...bo.classes,...ko.classes};gs.displayName="@mantine/dates/DateTimePicker";function bm({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0,o=t.value?typeof t.value=="string"?new Date(t.value):t.value:null,i=l=>{const a=l?l.toISOString():null;t.onFieldChange(a)};return r||s?m.jsx(ms,{valueFormat:"YYYY-MMM-DD",value:o,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):m.jsx(ms,{valueFormat:"YYYY-MMM-DD",value:o,onChange:i,required:n.required,placeholder:n.placeholder,error:void 0})}function km({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0,o=t.value?typeof t.value=="string"?new Date(t.value):t.value:null,i=l=>{const a=l?l.toISOString():null;t.onFieldChange(a)};return r||s?m.jsx(gs,{valueFormat:"DD-MMM-YYYY hh:mm A",value:o,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):m.jsx(gs,{value:o,valueFormat:"DD-MMM-YYYY hh:mm A",onChange:i,required:n.required,placeholder:n.placeholder,error:void 0})}function xm({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?m.jsx(x.NumberInput,{value:t.value,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):m.jsx(x.NumberInput,{...t,onChange:o=>t.onFieldChange(Number(o)),required:n.required,placeholder:n.placeholder,error:void 0})}function vm({field:n,form:e,layout:t="vertical"}){var o;const r=n,s=al();return cl[t](m.jsx(m.Fragment,{children:(o=r.fields)==null?void 0:o.map(i=>m.jsx(oo,{field:i,layout:t,children:m.jsx(Po,{field:{...i,name:`${n.name}.${i.name}`},...s,form:e,layout:t})},`${n.name}.${i.name}`))}))}var Vr={exports:{}},Uo={};/**
23
23
  * @license React
24
24
  * use-sync-external-store-shim.production.js
25
25
  *
@@ -119,7 +119,7 @@ img.ProseMirror-separator {
119
119
  display: block;
120
120
  }`;function fk(n,e,t){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute("data-tiptap-style",""),s.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(s),s}var hk=class extends Zb{constructor(n={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:s,moved:o})=>this.options.onDrop(r,s,o)),this.on("paste",({event:r,slice:s})=>this.options.onPaste(r,s)),this.on("delete",this.options.onDelete);const e=this.createDoc(),t=yf(e,this.options.autofocus);this.editorState=zn.create({doc:e,schema:this.schema,selection:t||void 0}),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const n=this.editorView.dom;n!=null&&n.editor&&delete n.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(n){console.warn("Failed to remove CSS element:",n)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=fk(dk,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.dispatchTransaction(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in n)return Reflect.get(n,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,e){const t=Sf(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}unregisterPlugin(n){if(this.isDestroyed)return;const e=this.state.plugins;let t=e;if([].concat(n).forEach(s=>{const o=typeof s=="string"?`${s}$`:s.key;t=t.filter(i=>!i.key.startsWith(o))}),e.length===t.length)return;const r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}createExtensionManager(){var n,e;const r=[...this.options.enableCoreExtensions?[_f,Lf.configure({blockSeparator:(e=(n=this.options.coreExtensionOptions)==null?void 0:n.clipboardTextSerializer)==null?void 0:e.blockSeparator}),If,Ff,zf,Vf,Pf,$f,jf].filter(s=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[s.name]!==!1:!0):[],...this.options.extensions].filter(s=>["extension","node","mark"].includes(s==null?void 0:s.type));this.extensionManager=new Lo(r,this)}createCommandManager(){this.commandManager=new Ao({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=qi(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>t.name!=="collaboration"),this.createExtensionManager()}}),n=qi(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return n}createView(n){var e;this.editorView=new ff(n,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.prependClass(),this.injectCSS();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});return}const{state:e,transactions:t}=this.state.applyTransaction(n),r=!this.state.selection.eq(e.selection),s=t.includes(n),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),!s)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:t.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:n});const i=t.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=i==null?void 0:i.getMeta("focus"),a=i==null?void 0:i.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:i}),a&&this.emit("blur",{editor:this,event:a.event,transaction:i}),!(n.getMeta("preventUpdate")||!t.some(c=>c.docChanged)||o.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:t.slice(1)})}getAttributes(n){return Ef(this.state,n)}isActive(n,e){const t=typeof n=="string"?n:null,r=typeof n=="string"?e:n;return Nb(this.state,t,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Wl(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:e=`
121
121
 
122
- `,textSerializers:t={}}=n||{};return wb(this.state.doc,{blockSeparator:e,textSerializers:{...Tf(this.schema),...t}})}get isEmpty(){return No(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var n,e;return(e=(n=this.editorView)==null?void 0:n.isDestroyed)!=null?e:!0}$node(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelectorAll(n,e))||null}$pos(n){const e=this.state.doc.resolve(n);return new uk(e,this)}get $doc(){return this.$pos(0)}};function wn(n){return new Ro({find:n.find,handler:({state:e,range:t,match:r})=>{const s=ye(n.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:o}=e,i=r[r.length-1],l=r[0];if(i){const a=l.search(/\S/),c=t.from+l.indexOf(i),u=c+i.length;if(ql(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>c).length)return null;u<t.to&&o.delete(u,t.to),c>t.from&&o.delete(t.from+a,c);const f=t.from+a+i.length;o.addMark(t.from+a,f,n.type.create(s||{})),o.removeStoredMark(n.type)}},undoable:n.undoable})}function pk(n){return new Ro({find:n.find,handler:({state:e,range:t,match:r})=>{const s=ye(n.getAttributes,void 0,r)||{},{tr:o}=e,i=t.from;let l=t.to;const a=n.type.create(s);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=i+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];o.insertText(d,i+r[0].length-1),o.replaceWith(u,l,a)}else if(r[0]){const c=n.type.isInline?i:i-1;o.insert(c,n.type.create(s)).delete(o.mapping.map(i),o.mapping.map(l))}o.scrollIntoView()},undoable:n.undoable})}function Ki(n){return new Ro({find:n.find,handler:({state:e,range:t,match:r})=>{const s=e.doc.resolve(t.from),o=ye(n.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)},undoable:n.undoable})}function Un(n){return new Ro({find:n.find,handler:({state:e,range:t,match:r,chain:s})=>{const o=ye(n.getAttributes,void 0,r)||{},i=e.tr.delete(t.from,t.to),a=i.doc.resolve(t.from).blockRange(),c=a&&Cl(a,n.type,o);if(!c)return null;if(i.wrap(a,c),n.keepMarks&&n.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:h}=n.editor.extensionManager,p=f||d.$to.parentOffset&&d.$from.marks();if(p){const g=p.filter(y=>h.includes(y.type.name));i.ensureMarks(g)}}if(n.keepAttributes){const d=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(d,o).run()}const u=i.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&tn(i.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&i.join(t.from-1)},undoable:n.undoable})}function mk(n,e){const{selection:t}=n,{$from:r}=t;if(t instanceof ee){const o=r.index();return r.parent.canReplaceWith(o,o+1,e)}let s=r.depth;for(;s>=0;){const o=r.index(s);if(r.node(s).contentMatchAt(o).matchType(e))return!0;s-=1}return!1}var gk={};Fl(gk,{createAtomBlockMarkdownSpec:()=>yk,createBlockMarkdownSpec:()=>bk,createInlineMarkdownSpec:()=>vk,parseAttributes:()=>Kl,parseIndentedBlocks:()=>Ji,renderNestedMarkdownContent:()=>Gl,serializeAttributes:()=>Jl});function Kl(n){if(!(n!=null&&n.trim()))return{};const e={},t=[],r=n.replace(/["']([^"']*)["']/g,c=>(t.push(c),`__QUOTED_${t.length-1}__`)),s=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const c=s.map(u=>u.trim().slice(1));e.class=c.join(" ")}const o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(e.id=o[1]);const i=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(i)).forEach(([,c,u])=>{var d;const f=parseInt(((d=u.match(/__QUOTED_(\d+)__/))==null?void 0:d[1])||"0",10),h=t[f];h&&(e[c]=h.slice(1,-1))});const a=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function Jl(n){if(!n||Object.keys(n).length===0)return"";const e=[];return n.class&&String(n.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),n.id&&e.push(`#${n.id}`),Object.entries(n).forEach(([t,r])=>{t==="class"||t==="id"||(r===!0?e.push(t):r!==!1&&r!=null&&e.push(`${t}="${String(r)}"`))}),e.join(" ")}function yk(n){const{nodeName:e,name:t,parseAttributes:r=Kl,serializeAttributes:s=Jl,defaultAttributes:o={},requiredAttributes:i=[],allowedAttributes:l}=n,a=t||e,c=u=>{if(!l)return u;const d={};return l.forEach(f=>{f in u&&(d[f]=u[f])}),d};return{parseMarkdown:(u,d)=>{const f={...o,...u.attributes};return d.createNode(e,f,[])},markdownTokenizer:{name:e,level:"block",start(u){var d;const f=new RegExp(`^:::${a}(?:\\s|$)`,"m"),h=(d=u.match(f))==null?void 0:d.index;return h!==void 0?h:-1},tokenize(u,d,f){const h=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=u.match(h);if(!p)return;const g=p[1]||"",y=r(g);if(!i.find(k=>!(k in y)))return{type:e,raw:p[0],attributes:y}}},renderMarkdown:u=>{const d=c(u.attrs||{}),f=s(d),h=f?` {${f}}`:"";return`:::${a}${h} :::`}}}function bk(n){const{nodeName:e,name:t,getContent:r,parseAttributes:s=Kl,serializeAttributes:o=Jl,defaultAttributes:i={},content:l="block",allowedAttributes:a}=n,c=t||e,u=d=>{if(!a)return d;const f={};return a.forEach(h=>{h in d&&(f[h]=d[h])}),f};return{parseMarkdown:(d,f)=>{let h;if(r){const g=r(d);h=typeof g=="string"?[{type:"text",text:g}]:g}else l==="block"?h=f.parseChildren(d.tokens||[]):h=f.parseInline(d.tokens||[]);const p={...i,...d.attributes};return f.createNode(e,p,h)},markdownTokenizer:{name:e,level:"block",start(d){var f;const h=new RegExp(`^:::${c}`,"m"),p=(f=d.match(h))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(d,f,h){var p;const g=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),y=d.match(g);if(!y)return;const[b,k=""]=y,M=s(k);let E=1;const v=b.length;let C="";const w=/^:::([\w-]*)(\s.*)?/gm,O=d.slice(v);for(w.lastIndex=0;;){const L=w.exec(O);if(L===null)break;const z=L.index,P=L[1];if(!((p=L[2])!=null&&p.endsWith(":::"))){if(P)E+=1;else if(E-=1,E===0){const $=O.slice(0,z);C=$.trim();const B=d.slice(0,v+z+L[0].length);let H=[];if(C)if(l==="block")for(H=h.blockTokens($),H.forEach(G=>{G.text&&(!G.tokens||G.tokens.length===0)&&(G.tokens=h.inlineTokens(G.text))});H.length>0;){const G=H[H.length-1];if(G.type==="paragraph"&&(!G.text||G.text.trim()===""))H.pop();else break}else H=h.inlineTokens(C);return{type:e,raw:B,attributes:M,content:C,tokens:H}}}}}},renderMarkdown:(d,f)=>{const h=u(d.attrs||{}),p=o(h),g=p?` {${p}}`:"",y=f.renderChildren(d.content||[],`
122
+ `,textSerializers:t={}}=n||{};return wb(this.state.doc,{blockSeparator:e,textSerializers:{...Tf(this.schema),...t}})}get isEmpty(){return No(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var n,e;return(e=(n=this.editorView)==null?void 0:n.isDestroyed)!=null?e:!0}$node(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelectorAll(n,e))||null}$pos(n){const e=this.state.doc.resolve(n);return new uk(e,this)}get $doc(){return this.$pos(0)}};function wn(n){return new Ro({find:n.find,handler:({state:e,range:t,match:r})=>{const s=ye(n.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:o}=e,i=r[r.length-1],l=r[0];if(i){const a=l.search(/\S/),c=t.from+l.indexOf(i),u=c+i.length;if(ql(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(g=>g===n.type&&g!==h.mark.type)).filter(h=>h.to>c).length)return null;u<t.to&&o.delete(u,t.to),c>t.from&&o.delete(t.from+a,c);const f=t.from+a+i.length;o.addMark(t.from+a,f,n.type.create(s||{})),o.removeStoredMark(n.type)}},undoable:n.undoable})}function pk(n){return new Ro({find:n.find,handler:({state:e,range:t,match:r})=>{const s=ye(n.getAttributes,void 0,r)||{},{tr:o}=e,i=t.from;let l=t.to;const a=n.type.create(s);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=i+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];o.insertText(d,i+r[0].length-1),o.replaceWith(u,l,a)}else if(r[0]){const c=n.type.isInline?i:i-1;o.insert(c,n.type.create(s)).delete(o.mapping.map(i),o.mapping.map(l))}o.scrollIntoView()},undoable:n.undoable})}function Ki(n){return new Ro({find:n.find,handler:({state:e,range:t,match:r})=>{const s=e.doc.resolve(t.from),o=ye(n.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)},undoable:n.undoable})}function Un(n){return new Ro({find:n.find,handler:({state:e,range:t,match:r,chain:s})=>{const o=ye(n.getAttributes,void 0,r)||{},i=e.tr.delete(t.from,t.to),a=i.doc.resolve(t.from).blockRange(),c=a&&Cl(a,n.type,o);if(!c)return null;if(i.wrap(a,c),n.keepMarks&&n.editor){const{selection:d,storedMarks:f}=e,{splittableMarks:h}=n.editor.extensionManager,p=f||d.$to.parentOffset&&d.$from.marks();if(p){const g=p.filter(y=>h.includes(y.type.name));i.ensureMarks(g)}}if(n.keepAttributes){const d=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(d,o).run()}const u=i.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&tn(i.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&i.join(t.from-1)},undoable:n.undoable})}function mk(n,e){const{selection:t}=n,{$from:r}=t;if(t instanceof ee){const o=r.index();return r.parent.canReplaceWith(o,o+1,e)}let s=r.depth;for(;s>=0;){const o=r.index(s);if(r.node(s).contentMatchAt(o).matchType(e))return!0;s-=1}return!1}var gk={};Fl(gk,{createAtomBlockMarkdownSpec:()=>yk,createBlockMarkdownSpec:()=>bk,createInlineMarkdownSpec:()=>vk,parseAttributes:()=>Kl,parseIndentedBlocks:()=>Ji,renderNestedMarkdownContent:()=>Gl,serializeAttributes:()=>Jl});function Kl(n){if(!(n!=null&&n.trim()))return{};const e={},t=[],r=n.replace(/["']([^"']*)["']/g,c=>(t.push(c),`__QUOTED_${t.length-1}__`)),s=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const c=s.map(u=>u.trim().slice(1));e.class=c.join(" ")}const o=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);o&&(e.id=o[1]);const i=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(i)).forEach(([,c,u])=>{var d;const f=parseInt(((d=u.match(/__QUOTED_(\d+)__/))==null?void 0:d[1])||"0",10),h=t[f];h&&(e[c]=h.slice(1,-1))});const a=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function Jl(n){if(!n||Object.keys(n).length===0)return"";const e=[];return n.class&&String(n.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),n.id&&e.push(`#${n.id}`),Object.entries(n).forEach(([t,r])=>{t==="class"||t==="id"||(r===!0?e.push(t):r!==!1&&r!=null&&e.push(`${t}="${String(r)}"`))}),e.join(" ")}function yk(n){const{nodeName:e,name:t,parseAttributes:r=Kl,serializeAttributes:s=Jl,defaultAttributes:o={},requiredAttributes:i=[],allowedAttributes:l}=n,a=t||e,c=u=>{if(!l)return u;const d={};return l.forEach(f=>{f in u&&(d[f]=u[f])}),d};return{parseMarkdown:(u,d)=>{const f={...o,...u.attributes};return d.createNode(e,f,[])},markdownTokenizer:{name:e,level:"block",start(u){var d;const f=new RegExp(`^:::${a}(?:\\s|$)`,"m"),h=(d=u.match(f))==null?void 0:d.index;return h!==void 0?h:-1},tokenize(u,d,f){const h=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=u.match(h);if(!p)return;const g=p[1]||"",y=r(g);if(!i.find(k=>!(k in y)))return{type:e,raw:p[0],attributes:y}}},renderMarkdown:u=>{const d=c(u.attrs||{}),f=s(d),h=f?` {${f}}`:"";return`:::${a}${h} :::`}}}function bk(n){const{nodeName:e,name:t,getContent:r,parseAttributes:s=Kl,serializeAttributes:o=Jl,defaultAttributes:i={},content:l="block",allowedAttributes:a}=n,c=t||e,u=d=>{if(!a)return d;const f={};return a.forEach(h=>{h in d&&(f[h]=d[h])}),f};return{parseMarkdown:(d,f)=>{let h;if(r){const g=r(d);h=typeof g=="string"?[{type:"text",text:g}]:g}else l==="block"?h=f.parseChildren(d.tokens||[]):h=f.parseInline(d.tokens||[]);const p={...i,...d.attributes};return f.createNode(e,p,h)},markdownTokenizer:{name:e,level:"block",start(d){var f;const h=new RegExp(`^:::${c}`,"m"),p=(f=d.match(h))==null?void 0:f.index;return p!==void 0?p:-1},tokenize(d,f,h){var p;const g=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),y=d.match(g);if(!y)return;const[b,k=""]=y,M=s(k);let E=1;const v=b.length;let C="";const w=/^:::([\w-]*)(\s.*)?/gm,O=d.slice(v);for(w.lastIndex=0;;){const L=w.exec(O);if(L===null)break;const z=L.index,P=L[1];if(!((p=L[2])!=null&&p.endsWith(":::"))){if(P)E+=1;else if(E-=1,E===0){const $=O.slice(0,z);C=$.trim();const B=d.slice(0,v+z+L[0].length);let V=[];if(C)if(l==="block")for(V=h.blockTokens($),V.forEach(G=>{G.text&&(!G.tokens||G.tokens.length===0)&&(G.tokens=h.inlineTokens(G.text))});V.length>0;){const G=V[V.length-1];if(G.type==="paragraph"&&(!G.text||G.text.trim()===""))V.pop();else break}else V=h.inlineTokens(C);return{type:e,raw:B,attributes:M,content:C,tokens:V}}}}}},renderMarkdown:(d,f)=>{const h=u(d.attrs||{}),p=o(h),g=p?` {${p}}`:"",y=f.renderChildren(d.content||[],`
123
123
 
124
124
  `);return`:::${c}${g}
125
125
 
@@ -175,7 +175,7 @@ ${t}
175
175
  `):""}),sx=st.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",Ce(this.options.HTMLAttributes,n)]},renderText(){return`
176
176
  `},renderMarkdown:()=>`
177
177
  `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:s,storedMarks:o}=t;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:l}=r.extensionManager,a=o||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&i){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ox=st.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Ce(this.options.HTMLAttributes,e),0]},parseMarkdown:(n,e)=>e.createNode("heading",{level:n.depth||1},e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>{var t;const r=(t=n.attrs)!=null&&t.level?parseInt(n.attrs.level,10):1,s="#".repeat(r);return n.content?`${s} ${e.renderChildren(n.content)}`:""},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>Ki({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),ix=st.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Ce(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!mk(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:r}=t,s=n();return Of(t)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:o,tr:i,dispatch:l})=>{if(l){const{$to:a}=i.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?i.setSelection(re.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection(ee.create(i.doc,a.pos)):i.setSelection(re.create(i.doc,a.pos));else{const u=o.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,d=u==null?void 0:u.create();d&&(i.insert(c,d),i.setSelection(re.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[pk({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),lx=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,ax=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,cx=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,ux=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,dx=vt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Ce(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(n,e)=>e.applyMark("italic",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`*${e.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[wn({find:lx,type:this.type}),wn({find:cx,type:this.type})]},addPasteRules(){return[Qt({find:ax,type:this.type}),Qt({find:ux,type:this.type})]}});const fx="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",hx="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Xi="numeric",Qi="ascii",Zi="alpha",hr="asciinumeric",ar="alphanumeric",el="domain",Yf="emoji",px="scheme",mx="slashscheme",yi="whitespace";function gx(n,e){return n in e||(e[n]=[]),e[n]}function mn(n,e,t){e[Xi]&&(e[hr]=!0,e[ar]=!0),e[Qi]&&(e[hr]=!0,e[Zi]=!0),e[hr]&&(e[ar]=!0),e[Zi]&&(e[ar]=!0),e[ar]&&(e[el]=!0),e[Yf]&&(e[el]=!0);for(const r in e){const s=gx(r,t);s.indexOf(n)<0&&s.push(n)}}function yx(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function et(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}et.groups={};et.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const s=e.jr[r][0],o=e.jr[r][1];if(o&&s.test(n))return o}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let s=0;s<n.length;s++)this.tt(n[s],e,t,r)},tr(n,e,t,r){r=r||et.groups;let s;return e&&e.j?s=e:(s=new et(e),t&&r&&mn(e,t,r)),this.jr.push([n,s]),s},ts(n,e,t,r){let s=this;const o=n.length;if(!o)return s;for(let i=0;i<o-1;i++)s=s.tt(n[i]);return s.tt(n[o-1],e,t,r)},tt(n,e,t,r){r=r||et.groups;const s=this;if(e&&e.j)return s.j[n]=e,e;const o=e;let i,l=s.go(n);if(l?(i=new et,Object.assign(i.j,l.j),i.jr.push.apply(i.jr,l.jr),i.jd=l.jd,i.t=l.t):i=new et,o){if(r)if(i.t&&typeof i.t=="string"){const a=Object.assign(yx(i.t,r),t);mn(o,a,r)}else t&&mn(o,t,r);i.t=o}return s.j[n]=i,i}};const ie=(n,e,t,r,s)=>n.ta(e,t,r,s),Me=(n,e,t,r,s)=>n.tr(e,t,r,s),Jc=(n,e,t,r,s)=>n.ts(e,t,r,s),F=(n,e,t,r,s)=>n.tt(e,t,r,s),Et="WORD",tl="UWORD",qf="ASCIINUMERICAL",Uf="ALPHANUMERICAL",Or="LOCALHOST",nl="TLD",rl="UTLD",us="SCHEME",_n="SLASH_SCHEME",Xl="NUM",sl="WS",Ql="NL",pr="OPENBRACE",mr="CLOSEBRACE",Ns="OPENBRACKET",Rs="CLOSEBRACKET",Ls="OPENPAREN",Is="CLOSEPAREN",js="OPENANGLEBRACKET",Ps="CLOSEANGLEBRACKET",_s="FULLWIDTHLEFTPAREN",Bs="FULLWIDTHRIGHTPAREN",Fs="LEFTCORNERBRACKET",zs="RIGHTCORNERBRACKET",$s="LEFTWHITECORNERBRACKET",Vs="RIGHTWHITECORNERBRACKET",Hs="FULLWIDTHLESSTHAN",Ws="FULLWIDTHGREATERTHAN",Ys="AMPERSAND",qs="APOSTROPHE",Us="ASTERISK",Ft="AT",Ks="BACKSLASH",Js="BACKTICK",Gs="CARET",Vt="COLON",Zl="COMMA",Xs="DOLLAR",gt="DOT",Qs="EQUALS",ea="EXCLAMATION",lt="HYPHEN",gr="PERCENT",Zs="PIPE",eo="PLUS",to="POUND",yr="QUERY",ta="QUOTE",Kf="FULLWIDTHMIDDLEDOT",na="SEMI",yt="SLASH",br="TILDE",no="UNDERSCORE",Jf="EMOJI",ro="SYM";var Gf=Object.freeze({__proto__:null,ALPHANUMERICAL:Uf,AMPERSAND:Ys,APOSTROPHE:qs,ASCIINUMERICAL:qf,ASTERISK:Us,AT:Ft,BACKSLASH:Ks,BACKTICK:Js,CARET:Gs,CLOSEANGLEBRACKET:Ps,CLOSEBRACE:mr,CLOSEBRACKET:Rs,CLOSEPAREN:Is,COLON:Vt,COMMA:Zl,DOLLAR:Xs,DOT:gt,EMOJI:Jf,EQUALS:Qs,EXCLAMATION:ea,FULLWIDTHGREATERTHAN:Ws,FULLWIDTHLEFTPAREN:_s,FULLWIDTHLESSTHAN:Hs,FULLWIDTHMIDDLEDOT:Kf,FULLWIDTHRIGHTPAREN:Bs,HYPHEN:lt,LEFTCORNERBRACKET:Fs,LEFTWHITECORNERBRACKET:$s,LOCALHOST:Or,NL:Ql,NUM:Xl,OPENANGLEBRACKET:js,OPENBRACE:pr,OPENBRACKET:Ns,OPENPAREN:Ls,PERCENT:gr,PIPE:Zs,PLUS:eo,POUND:to,QUERY:yr,QUOTE:ta,RIGHTCORNERBRACKET:zs,RIGHTWHITECORNERBRACKET:Vs,SCHEME:us,SEMI:na,SLASH:yt,SLASH_SCHEME:_n,SYM:ro,TILDE:br,TLD:nl,UNDERSCORE:no,UTLD:rl,UWORD:tl,WORD:Et,WS:sl});const wt=/[a-z]/,nr=new RegExp("\\p{L}","u"),bi=new RegExp("\\p{Emoji}","u"),Tt=/\d/,ki=/\s/,Gc="\r",xi=`
178
- `,bx="️",kx="‍",vi="";let Xr=null,Qr=null;function xx(n=[]){const e={};et.groups=e;const t=new et;Xr==null&&(Xr=Xc(fx)),Qr==null&&(Qr=Xc(hx)),F(t,"'",qs),F(t,"{",pr),F(t,"}",mr),F(t,"[",Ns),F(t,"]",Rs),F(t,"(",Ls),F(t,")",Is),F(t,"<",js),F(t,">",Ps),F(t,"(",_s),F(t,")",Bs),F(t,"「",Fs),F(t,"」",zs),F(t,"『",$s),F(t,"』",Vs),F(t,"<",Hs),F(t,">",Ws),F(t,"&",Ys),F(t,"*",Us),F(t,"@",Ft),F(t,"`",Js),F(t,"^",Gs),F(t,":",Vt),F(t,",",Zl),F(t,"$",Xs),F(t,".",gt),F(t,"=",Qs),F(t,"!",ea),F(t,"-",lt),F(t,"%",gr),F(t,"|",Zs),F(t,"+",eo),F(t,"#",to),F(t,"?",yr),F(t,'"',ta),F(t,"/",yt),F(t,";",na),F(t,"~",br),F(t,"_",no),F(t,"\\",Ks),F(t,"・",Kf);const r=Me(t,Tt,Xl,{[Xi]:!0});Me(r,Tt,r);const s=Me(r,wt,qf,{[hr]:!0}),o=Me(r,nr,Uf,{[ar]:!0}),i=Me(t,wt,Et,{[Qi]:!0});Me(i,Tt,s),Me(i,wt,i),Me(s,Tt,s),Me(s,wt,s);const l=Me(t,nr,tl,{[Zi]:!0});Me(l,wt),Me(l,Tt,o),Me(l,nr,l),Me(o,Tt,o),Me(o,wt),Me(o,nr,o);const a=F(t,xi,Ql,{[yi]:!0}),c=F(t,Gc,sl,{[yi]:!0}),u=Me(t,ki,sl,{[yi]:!0});F(t,vi,u),F(c,xi,a),F(c,vi,u),Me(c,ki,u),F(u,Gc),F(u,xi),Me(u,ki,u),F(u,vi,u);const d=Me(t,bi,Jf,{[Yf]:!0});F(d,"#"),Me(d,bi,d),F(d,bx,d);const f=F(d,kx);F(f,"#"),Me(f,bi,d);const h=[[wt,i],[Tt,s]],p=[[wt,null],[nr,l],[Tt,o]];for(let g=0;g<Xr.length;g++)Pt(t,Xr[g],nl,Et,h);for(let g=0;g<Qr.length;g++)Pt(t,Qr[g],rl,tl,p);mn(nl,{tld:!0,ascii:!0},e),mn(rl,{utld:!0,alpha:!0},e),Pt(t,"file",us,Et,h),Pt(t,"mailto",us,Et,h),Pt(t,"http",_n,Et,h),Pt(t,"https",_n,Et,h),Pt(t,"ftp",_n,Et,h),Pt(t,"ftps",_n,Et,h),mn(us,{scheme:!0,ascii:!0},e),mn(_n,{slashscheme:!0,ascii:!0},e),n=n.sort((g,y)=>g[0]>y[0]?1:-1);for(let g=0;g<n.length;g++){const y=n[g][0],k=n[g][1]?{[px]:!0}:{[mx]:!0};y.indexOf("-")>=0?k[el]=!0:wt.test(y)?Tt.test(y)?k[hr]=!0:k[Qi]=!0:k[Xi]=!0,Jc(t,y,y,k)}return Jc(t,"localhost",Or,{ascii:!0}),t.jd=new et(ro),{start:t,tokens:Object.assign({groups:e},Gf)}}function Xf(n,e){const t=vx(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,s=[];let o=0,i=0;for(;i<r;){let l=n,a=null,c=0,u=null,d=-1,f=-1;for(;i<r&&(a=l.go(t[i]));)l=a,l.accepts()?(d=0,f=0,u=l):d>=0&&(d+=t[i].length,f++),c+=t[i].length,o+=t[i].length,i++;o-=d,i-=f,c-=d,s.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return s}function vx(n){const e=[],t=n.length;let r=0;for(;r<t;){let s=n.charCodeAt(r),o,i=s<55296||s>56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(i),r+=i.length}return e}function Pt(n,e,t,r,s){let o;const i=e.length;for(let l=0;l<i-1;l++){const a=e[l];n.j[a]?o=n.j[a]:(o=new et(r),o.jr=s.slice(),n.j[a]=o),n=o}return o=new et(t),o.jr=s.slice(),n.j[e[i-1]]=o,o}function Xc(n){const e=[],t=[];let r=0,s="0123456789";for(;r<n.length;){let o=0;for(;s.indexOf(n[r+o])>=0;)o++;if(o>0){e.push(t.join(""));for(let i=parseInt(n.substring(r,r+o),10);i>0;i--)t.pop();r+=o}else t.push(n[r]),r++}return e}const Dr={defaultProtocol:"http",events:null,format:Qc,formatHref:Qc,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ra(n,e=null){let t=Object.assign({},Dr);n&&(t=Object.assign(t,n instanceof ra?n.o:n));const r=t.ignoreTags,s=[];for(let o=0;o<r.length;o++)s.push(r[o].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=s}ra.prototype={o:Dr,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let s=this.o[n];return s&&(typeof s=="object"?(s=t.t in s?s[t.t]:Dr[n],typeof s=="function"&&r&&(s=s(e,t))):typeof s=="function"&&r&&(s=s(e,t.t,t)),s)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function Qc(n){return n}function Qf(n,e){this.t="token",this.v=n,this.tk=e}Qf.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Dr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),s=n.get("tagName",t,e),o=this.toFormattedString(n),i={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return i.href=r,l&&(i.class=l),a&&(i.target=a),c&&(i.rel=c),u&&Object.assign(i,u),{tagName:s,attributes:i,content:o,eventListeners:d}}};function Io(n,e){class t extends Qf{constructor(s,o){super(s,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const Zc=Io("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),eu=Io("text"),Sx=Io("nl"),Zr=Io("url",{isLink:!0,toHref(n=Dr.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Or&&n[1].t===Vt}}),it=n=>new et(n);function Cx({groups:n}){const e=n.domain.concat([Ys,Us,Ft,Ks,Js,Gs,Xs,Qs,lt,Xl,gr,Zs,eo,to,yt,ro,br,no]),t=[qs,Vt,Zl,gt,ea,gr,yr,ta,na,js,Ps,pr,mr,Rs,Ns,Ls,Is,_s,Bs,Fs,zs,$s,Vs,Hs,Ws],r=[Ys,qs,Us,Ks,Js,Gs,Xs,Qs,lt,pr,mr,gr,Zs,eo,to,yr,yt,ro,br,no],s=it(),o=F(s,br);ie(o,r,o),ie(o,n.domain,o);const i=it(),l=it(),a=it();ie(s,n.domain,i),ie(s,n.scheme,l),ie(s,n.slashscheme,a),ie(i,r,o),ie(i,n.domain,i);const c=F(i,Ft);F(o,Ft,c),F(l,Ft,c),F(a,Ft,c);const u=F(o,gt);ie(u,r,o),ie(u,n.domain,o);const d=it();ie(c,n.domain,d),ie(d,n.domain,d);const f=F(d,gt);ie(f,n.domain,d);const h=it(Zc);ie(f,n.tld,h),ie(f,n.utld,h),F(c,Or,h);const p=F(d,lt);F(p,lt,p),ie(p,n.domain,d),ie(h,n.domain,d),F(h,gt,f),F(h,lt,p);const g=F(h,Vt);ie(g,n.numeric,Zc);const y=F(i,lt),b=F(i,gt);F(y,lt,y),ie(y,n.domain,i),ie(b,r,o),ie(b,n.domain,i);const k=it(Zr);ie(b,n.tld,k),ie(b,n.utld,k),ie(k,n.domain,i),ie(k,r,o),F(k,gt,b),F(k,lt,y),F(k,Ft,c);const M=F(k,Vt),E=it(Zr);ie(M,n.numeric,E);const v=it(Zr),C=it();ie(v,e,v),ie(v,t,C),ie(C,e,v),ie(C,t,C),F(k,yt,v),F(E,yt,v);const w=F(l,Vt),O=F(a,Vt),L=F(O,yt),z=F(L,yt);ie(l,n.domain,i),F(l,gt,b),F(l,lt,y),ie(a,n.domain,i),F(a,gt,b),F(a,lt,y),ie(w,n.domain,v),F(w,yt,v),F(w,yr,v),ie(z,n.domain,v),ie(z,e,v),F(z,yt,v);const P=[[pr,mr],[Ns,Rs],[Ls,Is],[js,Ps],[_s,Bs],[Fs,zs],[$s,Vs],[Hs,Ws]];for(let $=0;$<P.length;$++){const[B,H]=P[$],G=F(v,B);F(C,B,G),F(G,H,v);const K=it(Zr);ie(G,e,K);const X=it();ie(G,t),ie(K,e,K),ie(K,t,X),ie(X,e,K),ie(X,t,X),F(K,H,v),F(X,H,v)}return F(s,Or,k),F(s,Ql,Sx),{start:s,tokens:Gf}}function Mx(n,e,t){let r=t.length,s=0,o=[],i=[];for(;s<r;){let l=n,a=null,c=null,u=0,d=null,f=-1;for(;s<r&&!(a=l.go(t[s].t));)i.push(t[s++]);for(;s<r&&(c=a||l.go(t[s].t));)a=null,l=c,l.accepts()?(f=0,d=l):f>=0&&f++,s++,u++;if(f<0)s-=u,s<r&&(i.push(t[s]),s++);else{i.length>0&&(o.push(Si(eu,e,i)),i=[]),s-=f,u-=f;const h=d.t,p=t.slice(s-u,s);o.push(Si(h,e,p))}}return i.length>0&&o.push(Si(eu,e,i)),o}function Si(n,e,t){const r=t[0].s,s=t[t.length-1].e,o=e.slice(r,s);return new n(o,t)}const wx=typeof console<"u"&&console&&console.warn||(()=>{}),Tx="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ve={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Ex(){return et.groups={},ve.scanner=null,ve.parser=null,ve.tokenQueue=[],ve.pluginQueue=[],ve.customSchemes=[],ve.initialized=!1,ve}function tu(n,e=!1){if(ve.initialized&&wx(`linkifyjs: already initialized - will not register custom scheme "${n}" ${Tx}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
178
+ `,bx="️",kx="‍",vi="";let Xr=null,Qr=null;function xx(n=[]){const e={};et.groups=e;const t=new et;Xr==null&&(Xr=Xc(fx)),Qr==null&&(Qr=Xc(hx)),F(t,"'",qs),F(t,"{",pr),F(t,"}",mr),F(t,"[",Ns),F(t,"]",Rs),F(t,"(",Ls),F(t,")",Is),F(t,"<",js),F(t,">",Ps),F(t,"(",_s),F(t,")",Bs),F(t,"「",Fs),F(t,"」",zs),F(t,"『",$s),F(t,"』",Vs),F(t,"<",Hs),F(t,">",Ws),F(t,"&",Ys),F(t,"*",Us),F(t,"@",Ft),F(t,"`",Js),F(t,"^",Gs),F(t,":",Vt),F(t,",",Zl),F(t,"$",Xs),F(t,".",gt),F(t,"=",Qs),F(t,"!",ea),F(t,"-",lt),F(t,"%",gr),F(t,"|",Zs),F(t,"+",eo),F(t,"#",to),F(t,"?",yr),F(t,'"',ta),F(t,"/",yt),F(t,";",na),F(t,"~",br),F(t,"_",no),F(t,"\\",Ks),F(t,"・",Kf);const r=Me(t,Tt,Xl,{[Xi]:!0});Me(r,Tt,r);const s=Me(r,wt,qf,{[hr]:!0}),o=Me(r,nr,Uf,{[ar]:!0}),i=Me(t,wt,Et,{[Qi]:!0});Me(i,Tt,s),Me(i,wt,i),Me(s,Tt,s),Me(s,wt,s);const l=Me(t,nr,tl,{[Zi]:!0});Me(l,wt),Me(l,Tt,o),Me(l,nr,l),Me(o,Tt,o),Me(o,wt),Me(o,nr,o);const a=F(t,xi,Ql,{[yi]:!0}),c=F(t,Gc,sl,{[yi]:!0}),u=Me(t,ki,sl,{[yi]:!0});F(t,vi,u),F(c,xi,a),F(c,vi,u),Me(c,ki,u),F(u,Gc),F(u,xi),Me(u,ki,u),F(u,vi,u);const d=Me(t,bi,Jf,{[Yf]:!0});F(d,"#"),Me(d,bi,d),F(d,bx,d);const f=F(d,kx);F(f,"#"),Me(f,bi,d);const h=[[wt,i],[Tt,s]],p=[[wt,null],[nr,l],[Tt,o]];for(let g=0;g<Xr.length;g++)Pt(t,Xr[g],nl,Et,h);for(let g=0;g<Qr.length;g++)Pt(t,Qr[g],rl,tl,p);mn(nl,{tld:!0,ascii:!0},e),mn(rl,{utld:!0,alpha:!0},e),Pt(t,"file",us,Et,h),Pt(t,"mailto",us,Et,h),Pt(t,"http",_n,Et,h),Pt(t,"https",_n,Et,h),Pt(t,"ftp",_n,Et,h),Pt(t,"ftps",_n,Et,h),mn(us,{scheme:!0,ascii:!0},e),mn(_n,{slashscheme:!0,ascii:!0},e),n=n.sort((g,y)=>g[0]>y[0]?1:-1);for(let g=0;g<n.length;g++){const y=n[g][0],k=n[g][1]?{[px]:!0}:{[mx]:!0};y.indexOf("-")>=0?k[el]=!0:wt.test(y)?Tt.test(y)?k[hr]=!0:k[Qi]=!0:k[Xi]=!0,Jc(t,y,y,k)}return Jc(t,"localhost",Or,{ascii:!0}),t.jd=new et(ro),{start:t,tokens:Object.assign({groups:e},Gf)}}function Xf(n,e){const t=vx(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,s=[];let o=0,i=0;for(;i<r;){let l=n,a=null,c=0,u=null,d=-1,f=-1;for(;i<r&&(a=l.go(t[i]));)l=a,l.accepts()?(d=0,f=0,u=l):d>=0&&(d+=t[i].length,f++),c+=t[i].length,o+=t[i].length,i++;o-=d,i-=f,c-=d,s.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return s}function vx(n){const e=[],t=n.length;let r=0;for(;r<t;){let s=n.charCodeAt(r),o,i=s<55296||s>56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(i),r+=i.length}return e}function Pt(n,e,t,r,s){let o;const i=e.length;for(let l=0;l<i-1;l++){const a=e[l];n.j[a]?o=n.j[a]:(o=new et(r),o.jr=s.slice(),n.j[a]=o),n=o}return o=new et(t),o.jr=s.slice(),n.j[e[i-1]]=o,o}function Xc(n){const e=[],t=[];let r=0,s="0123456789";for(;r<n.length;){let o=0;for(;s.indexOf(n[r+o])>=0;)o++;if(o>0){e.push(t.join(""));for(let i=parseInt(n.substring(r,r+o),10);i>0;i--)t.pop();r+=o}else t.push(n[r]),r++}return e}const Dr={defaultProtocol:"http",events:null,format:Qc,formatHref:Qc,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ra(n,e=null){let t=Object.assign({},Dr);n&&(t=Object.assign(t,n instanceof ra?n.o:n));const r=t.ignoreTags,s=[];for(let o=0;o<r.length;o++)s.push(r[o].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=s}ra.prototype={o:Dr,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let s=this.o[n];return s&&(typeof s=="object"?(s=t.t in s?s[t.t]:Dr[n],typeof s=="function"&&r&&(s=s(e,t))):typeof s=="function"&&r&&(s=s(e,t.t,t)),s)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function Qc(n){return n}function Qf(n,e){this.t="token",this.v=n,this.tk=e}Qf.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Dr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),s=n.get("tagName",t,e),o=this.toFormattedString(n),i={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return i.href=r,l&&(i.class=l),a&&(i.target=a),c&&(i.rel=c),u&&Object.assign(i,u),{tagName:s,attributes:i,content:o,eventListeners:d}}};function Io(n,e){class t extends Qf{constructor(s,o){super(s,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const Zc=Io("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),eu=Io("text"),Sx=Io("nl"),Zr=Io("url",{isLink:!0,toHref(n=Dr.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Or&&n[1].t===Vt}}),it=n=>new et(n);function Cx({groups:n}){const e=n.domain.concat([Ys,Us,Ft,Ks,Js,Gs,Xs,Qs,lt,Xl,gr,Zs,eo,to,yt,ro,br,no]),t=[qs,Vt,Zl,gt,ea,gr,yr,ta,na,js,Ps,pr,mr,Rs,Ns,Ls,Is,_s,Bs,Fs,zs,$s,Vs,Hs,Ws],r=[Ys,qs,Us,Ks,Js,Gs,Xs,Qs,lt,pr,mr,gr,Zs,eo,to,yr,yt,ro,br,no],s=it(),o=F(s,br);ie(o,r,o),ie(o,n.domain,o);const i=it(),l=it(),a=it();ie(s,n.domain,i),ie(s,n.scheme,l),ie(s,n.slashscheme,a),ie(i,r,o),ie(i,n.domain,i);const c=F(i,Ft);F(o,Ft,c),F(l,Ft,c),F(a,Ft,c);const u=F(o,gt);ie(u,r,o),ie(u,n.domain,o);const d=it();ie(c,n.domain,d),ie(d,n.domain,d);const f=F(d,gt);ie(f,n.domain,d);const h=it(Zc);ie(f,n.tld,h),ie(f,n.utld,h),F(c,Or,h);const p=F(d,lt);F(p,lt,p),ie(p,n.domain,d),ie(h,n.domain,d),F(h,gt,f),F(h,lt,p);const g=F(h,Vt);ie(g,n.numeric,Zc);const y=F(i,lt),b=F(i,gt);F(y,lt,y),ie(y,n.domain,i),ie(b,r,o),ie(b,n.domain,i);const k=it(Zr);ie(b,n.tld,k),ie(b,n.utld,k),ie(k,n.domain,i),ie(k,r,o),F(k,gt,b),F(k,lt,y),F(k,Ft,c);const M=F(k,Vt),E=it(Zr);ie(M,n.numeric,E);const v=it(Zr),C=it();ie(v,e,v),ie(v,t,C),ie(C,e,v),ie(C,t,C),F(k,yt,v),F(E,yt,v);const w=F(l,Vt),O=F(a,Vt),L=F(O,yt),z=F(L,yt);ie(l,n.domain,i),F(l,gt,b),F(l,lt,y),ie(a,n.domain,i),F(a,gt,b),F(a,lt,y),ie(w,n.domain,v),F(w,yt,v),F(w,yr,v),ie(z,n.domain,v),ie(z,e,v),F(z,yt,v);const P=[[pr,mr],[Ns,Rs],[Ls,Is],[js,Ps],[_s,Bs],[Fs,zs],[$s,Vs],[Hs,Ws]];for(let $=0;$<P.length;$++){const[B,V]=P[$],G=F(v,B);F(C,B,G),F(G,V,v);const K=it(Zr);ie(G,e,K);const X=it();ie(G,t),ie(K,e,K),ie(K,t,X),ie(X,e,K),ie(X,t,X),F(K,V,v),F(X,V,v)}return F(s,Or,k),F(s,Ql,Sx),{start:s,tokens:Gf}}function Mx(n,e,t){let r=t.length,s=0,o=[],i=[];for(;s<r;){let l=n,a=null,c=null,u=0,d=null,f=-1;for(;s<r&&!(a=l.go(t[s].t));)i.push(t[s++]);for(;s<r&&(c=a||l.go(t[s].t));)a=null,l=c,l.accepts()?(f=0,d=l):f>=0&&f++,s++,u++;if(f<0)s-=u,s<r&&(i.push(t[s]),s++);else{i.length>0&&(o.push(Si(eu,e,i)),i=[]),s-=f,u-=f;const h=d.t,p=t.slice(s-u,s);o.push(Si(h,e,p))}}return i.length>0&&o.push(Si(eu,e,i)),o}function Si(n,e,t){const r=t[0].s,s=t[t.length-1].e,o=e.slice(r,s);return new n(o,t)}const wx=typeof console<"u"&&console&&console.warn||(()=>{}),Tx="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ve={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Ex(){return et.groups={},ve.scanner=null,ve.parser=null,ve.tokenQueue=[],ve.pluginQueue=[],ve.customSchemes=[],ve.initialized=!1,ve}function tu(n,e=!1){if(ve.initialized&&wx(`linkifyjs: already initialized - will not register custom scheme "${n}" ${Tx}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
179
179
  1. Must only contain digits, lowercase ASCII letters or "-"
180
180
  2. Cannot start or end with "-"
181
181
  3. "-" cannot repeat`);ve.customSchemes.push([n,e])}function Ax(){ve.scanner=xx(ve.customSchemes);for(let n=0;n<ve.tokenQueue.length;n++)ve.tokenQueue[n][1]({scanner:ve.scanner});ve.parser=Cx(ve.scanner.tokens);for(let n=0;n<ve.pluginQueue.length;n++)ve.pluginQueue[n][1]({scanner:ve.scanner,parser:ve.parser});return ve.initialized=!0,ve}function sa(n){return ve.initialized||Ax(),Mx(ve.parser.start,n,Xf(ve.scanner.start,n))}sa.scan=Xf;function Zf(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new ra(t),s=sa(n),o=[];for(let i=0;i<s.length;i++){const l=s[i];l.isLink&&(!e||l.t===e)&&r.check(l)&&o.push(l.toFormattedObject(r))}return o}var oa="[\0-   ᠎ -\u2029  ]",Ox=new RegExp(oa),Dx=new RegExp(`${oa}$`),Nx=new RegExp(oa,"g");function Rx(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function Lx(n){return new Te({key:new Pe("autolink"),appendTransaction:(e,t,r)=>{const s=e.some(c=>c.docChanged)&&!t.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!s||o)return;const{tr:i}=r,l=vf(t.doc,[...e]);if(Af(l).forEach(({newRange:c})=>{const u=kb(r.doc,c,h=>h.isTextblock);let d,f;if(u.length>1)d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(u.length){const h=r.doc.textBetween(c.from,c.to," "," ");if(!Dx.test(h))return;d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")}if(d&&f){const h=f.split(Ox).filter(Boolean);if(h.length<=0)return!1;const p=h[h.length-1],g=d.pos+f.lastIndexOf(p);if(!p)return!1;const y=sa(p).map(b=>b.toObject(n.defaultProtocol));if(!Rx(y))return!1;y.filter(b=>b.isLink).map(b=>({...b,from:g+b.start+1,to:g+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>n.validate(b.value)).filter(b=>n.shouldAutoLink(b.value)).forEach(b=>{ql(b.from,b.to,r.doc).some(k=>k.mark.type===n.type)||i.addMark(b.from,b.to,n.type.create({href:b.href}))})}}),!!i.steps.length)return i}})}function Ix(n){return new Te({key:new Pe("handleClickLink"),props:{handleClick:(e,t,r)=>{var s,o;if(r.button!==0||!e.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let u=r.target;const d=[];for(;u.nodeName!=="DIV";)d.push(u),u=u.parentNode;i=d.find(f=>f.nodeName==="A")}if(!i)return!1;const l=Ef(e.state,n.type.name),a=(s=i==null?void 0:i.href)!=null?s:l.href,c=(o=i==null?void 0:i.target)!=null?o:l.target;return n.enableClickSelection&&n.editor.commands.extendMarkRange(n.type.name),i&&a?(window.open(a,c),!0):!1}}})}function jx(n){return new Te({key:new Pe("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{shouldAutoLink:s}=n,{state:o}=e,{selection:i}=o,{empty:l}=i;if(l)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const c=Zf(a,{defaultProtocol:n.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!c||s!==void 0&&!s(c.href)?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}function un(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&t.push(s)}),!n||n.replace(Nx,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var eh=vt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){tu(n);return}tu(n.scheme,n.optionalSlashes)})},onDestroy(){Ex()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!un(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!un(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!un(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Ce(this.options.HTMLAttributes,n),0]:["a",Ce(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,e)=>e.applyMark("link",e.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,e)=>{var t;const r=((t=n.attrs)==null?void 0:t.href)||"";return`[${e.renderChildren(n)}](${r})`},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!un(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:r=>!!un(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Qt({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,s=Zf(n).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:i=>!!un(i,t),protocols:t,defaultProtocol:r}));s.length&&s.forEach(o=>{this.options.shouldAutoLink(o.value)&&e.push({text:o.value,data:{href:o.href},index:o.start})})}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(Lx({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!un(s,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(Ix({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(jx({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),Px=eh,_x=Object.defineProperty,Bx=(n,e)=>{for(var t in e)_x(n,t,{get:e[t],enumerable:!0})},Fx="listItem",nu="textStyle",ru=/^\s*([-+*])\s$/,th=st.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",Ce(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?e.parseChildren(n.items):[]},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
@@ -191,4 +191,4 @@ ${h.slice(c+2)}`,d+=1;else break}e.push({indent:c,number:parseInt(l,10),content:
191
191
  `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Yx,this.editor.getAttributes(ou)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=Un({find:iu,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Un({find:iu,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(ou)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),qx=/^\s*(\[([( |x])?\])\s$/,Ux=st.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",Ce(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const r=e.parseChildren(n.nestedTokens);t.push(...r)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const s=`- [${(t=n.attrs)!=null&&t.checked?"x":" "}] `;return Gl(n,e,s)},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const s=document.createElement("li"),o=document.createElement("label"),i=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=u=>{var d,f;l.ariaLabel=((f=(d=this.options.a11y)==null?void 0:d.checkboxLabel)==null?void 0:f.call(d,u,l.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};return c(n),o.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:d}=u.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const h=t();if(typeof h!="number")return!1;const p=f.doc.nodeAt(h);return f.setNodeMarkup(h,void 0,{...p==null?void 0:p.attrs,checked:d}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,d)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,d])=>{s.setAttribute(u,d)}),s.dataset.checked=n.attrs.checked,l.checked=n.attrs.checked,o.append(l,i),s.append(o,a),Object.entries(e).forEach(([u,d])=>{s.setAttribute(u,d)}),{dom:s,contentDOM:a,update:u=>u.type!==this.type?!1:(s.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,c(u),!0)}}},addInputRules(){return[Un({find:qx,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),Kx=st.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",Ce(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
192
192
  `):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=o=>{const i=Ji(o,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:t.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},t);return i?[{type:"taskList",raw:i.raw,items:i.items}]:t.blockTokens(o)},s=Ji(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,i)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:t.inlineTokens(o.mainContent),nestedTokens:i}),customNestedParser:r},t);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Ae.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(th.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(nh.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(ah.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(uh.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(Ux.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(Kx.configure(this.options.taskList)),n}});var Jx=st.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ce(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];return t.length===1&&t[0].type==="image"?e.parseChildren([t[0]]):e.createNode("paragraph",void 0,e.parseInline(t))},renderMarkdown:(n,e)=>!n||!Array.isArray(n.content)?"":e.renderChildren(n.content),addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Gx=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Xx=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Qx=vt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Ce(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[wn({find:Gx,type:this.type})]},addPasteRules(){return[Qt({find:Xx,type:this.type})]}}),Zx=st.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),dh=vt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",Ce(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!s)return;const o=s[2].trim();return{type:"underline",raw:s[0],text:o,tokens:t.inlineTokens(o)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),e1=dh;function t1(n={}){return new Te({view(e){return new n1(e,n)}})}class n1{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let o=i=>{this[s](i)};return e.dom.addEventListener(s,o),{name:s,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,s=this.editorView.dom,o=s.getBoundingClientRect(),i=o.width/s.offsetWidth,l=o.height/s.offsetHeight;if(t){let d=e.nodeBefore,f=e.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let p=h.getBoundingClientRect(),g=d?p.bottom:p.top;d&&f&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let y=this.width/2*l;r={left:p.left,right:p.right,top:g-y,bottom:g+y}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*i;r={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=a.getBoundingClientRect(),f=d.width/a.offsetWidth,h=d.height/a.offsetHeight;c=d.left-a.scrollLeft*f,u=d.top-a.scrollTop*h}this.element.style.left=(r.left-c)/i+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/i+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),s=r&&r.type.spec.disableDropCursor,o=typeof s=="function"?s(this.editorView,t,e):s;if(t&&!o){let i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=fd(this.editorView.state.doc,i,this.editorView.dragging.slice);l!=null&&(i=l)}this.setCursor(i),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class we extends le{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return we.valid(r)?new we(r):le.near(r)}content(){return Y.empty}eq(e){return e instanceof we&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new we(e.resolve(t.pos))}getBookmark(){return new la(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!r1(e)||!s1(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let s=t.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&we.valid(e))return e;let s=e.pos,o=null;for(let i=e.depth;;i--){let l=e.node(i);if(t>0?e.indexAfter(i)<l.childCount:e.index(i)>0){o=l.child(t>0?e.indexAfter(i):e.index(i)-1);break}else if(i==0)return null;s+=t;let a=e.doc.resolve(s);if(we.valid(a))return a}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!ee.isSelectable(o)){e=e.doc.resolve(s+o.nodeSize*t),r=!1;continue e}break}o=i,s+=t;let l=e.doc.resolve(s);if(we.valid(l))return l}return null}}}we.prototype.visible=!1;we.findFrom=we.findGapCursorFrom;le.jsonID("gapcursor",we);class la{constructor(e){this.pos=e}map(e){return new la(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return we.valid(t)?new we(t):le.near(t)}}function fh(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function r1(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||fh(s.type))return!0;if(s.inlineContent)return!1}}return!0}function s1(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||fh(s.type))return!0;if(s.inlineContent)return!1}}return!0}function o1(){return new Te({props:{decorations:c1,createSelectionBetween(n,e,t){return e.pos==t.pos&&we.valid(t)?new we(t):null},handleClick:l1,handleKeyDown:i1,handleDOMEvents:{beforeinput:a1}}})}const i1=hf({ArrowLeft:es("horiz",-1),ArrowRight:es("horiz",1),ArrowUp:es("vert",-1),ArrowDown:es("vert",1)});function es(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,o){let i=r.selection,l=e>0?i.$to:i.$from,a=i.empty;if(i instanceof re){if(!o.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=we.findGapCursorFrom(l,e,a);return c?(s&&s(r.tr.setSelection(new we(c))),!0):!1}}function l1(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!we.valid(r))return!1;let s=n.posAtCoords({left:t.clientX,top:t.clientY});return s&&s.inside>-1&&ee.isSelectable(n.state.doc.nodeAt(s.inside))?!1:(n.dispatch(n.state.tr.setSelection(new we(r))),!0)}function a1(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof we))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let s=I.empty;for(let i=r.length-1;i>=0;i--)s=I.from(r[i].createAndFill(null,s));let o=n.state.tr.replace(t.pos,t.pos,new Y(s,0,0));return o.setSelection(re.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function c1(n){if(!(n.selection instanceof we))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Se.create(n.doc,[Ue.widget(n.selection.head,e,{key:"gapcursor"})])}var so=200,je=function(){};je.prototype.append=function(e){return e.length?(e=je.from(e),!this.length&&e||e.length<so&&this.leafAppend(e)||this.length<so&&e.leafPrepend(this)||this.appendInner(e)):this};je.prototype.prepend=function(e){return e.length?je.from(e).append(this):this};je.prototype.appendInner=function(e){return new u1(this,e)};je.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?je.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};je.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};je.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};je.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(o,i){return s.push(e(o,i))},t,r),s};je.from=function(e){return e instanceof je?e:e&&e.length?new hh(e):je.empty};var hh=(function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,o){return s==0&&o==this.length?this:new e(this.values.slice(s,o))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,o,i,l){for(var a=o;a<i;a++)if(s(this.values[a],l+a)===!1)return!1},e.prototype.forEachInvertedInner=function(s,o,i,l){for(var a=o-1;a>=i;a--)if(s(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=so)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=so)return new e(s.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(je);je.empty=new hh([]);var u1=(function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,s,o,i){var l=this.left.length;if(s<l&&this.left.forEachInner(r,s,Math.min(o,l),i)===!1||o>l&&this.right.forEachInner(r,Math.max(s-l,0),Math.min(this.length,o)-l,i+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,o,i){var l=this.left.length;if(s>l&&this.right.forEachInvertedInner(r,s-l,Math.max(o,l)-l,i+l)===!1||o<l&&this.left.forEachInvertedInner(r,Math.min(s,l),o,i)===!1)return!1},e.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var o=this.left.length;return s<=o?this.left.slice(r,s):r>=o?this.right.slice(r-o,s-o):this.left.slice(r,o).append(this.right.slice(0,s-o))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e})(je);const d1=500;class ht{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,o;t&&(s=this.remapping(r,this.items.length),o=s.maps.length);let i=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){s||(s=this.remapping(r,f+1),o=s.maps.length),o--,u.push(d);return}if(s){u.push(new bt(d.map));let h=d.step.map(s.slice(o)),p;h&&i.maybeStep(h).doc&&(p=i.mapping.maps[i.mapping.maps.length-1],c.push(new bt(p,void 0,void 0,c.length+u.length))),o--,p&&s.appendMap(p,o)}else i.maybeStep(d.step);if(d.selection)return l=s?d.selection.map(s.slice(o)):d.selection,a=new ht(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:i,selection:l}}addTransform(e,t,r,s){let o=[],i=this.eventCount,l=this.items,a=!s&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),f=new bt(e.mapping.maps[u],d,t),h;(h=a&&a.merge(f))&&(f=h,u?o.pop():l=l.slice(0,l.length-1)),o.push(f),t&&(i++,t=void 0),s||(a=f)}let c=i-r.depth;return c>h1&&(l=f1(l,c),i-=c),new ht(l.append(o),i)}remapping(e,t){let r=new Sr;return this.items.forEach((s,o)=>{let i=s.mirrorOffset!=null&&o-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,i)},e,t),r}addMaps(e){return this.eventCount==0?this:new ht(this.items.append(e.map(t=>new bt(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},s);let a=t;this.items.forEach(f=>{let h=o.getMirror(--a);if(h==null)return;i=Math.min(i,h);let p=o.maps[h];if(f.step){let g=e.steps[h].invert(e.docs[h]),y=f.selection&&f.selection.map(o.slice(a+1,h));y&&l++,r.push(new bt(p,g,y))}else r.push(new bt(p))},s);let c=[];for(let f=t;f<i;f++)c.push(new bt(o.maps[f]));let u=this.items.slice(0,s).append(c).append(r),d=new ht(u,l);return d.emptyItemCount()>d1&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,s=[],o=0;return this.items.forEach((i,l)=>{if(l>=e)s.push(i),i.selection&&o++;else if(i.step){let a=i.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=i.selection&&i.selection.map(t.slice(r));u&&o++;let d=new bt(c.invert(),a,u),f,h=s.length-1;(f=s.length&&s[h].merge(d))?s[h]=f:s.push(d)}}else i.map&&r--},this.items.length,0),new ht(je.from(s.reverse()),o)}}ht.empty=new ht(je.empty,0);function f1(n,e){let t;return n.forEach((r,s)=>{if(r.selection&&e--==0)return t=s,!1}),n.slice(t)}class bt{constructor(e,t,r,s){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new bt(t.getMap().invert(),t,this.selection)}}}class zt{constructor(e,t,r,s,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=s,this.prevComposition=o}}const h1=20;function p1(n,e,t,r){let s=t.getMeta(xn),o;if(s)return s.historyState;t.getMeta(y1)&&(n=new zt(n.done,n.undone,null,0,-1));let i=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(i&&i.getMeta(xn))return i.getMeta(xn).redo?new zt(n.done.addTransform(t,void 0,r,ds(e)),n.undone,lu(t.mapping.maps),n.prevTime,n.prevComposition):new zt(n.done,n.undone.addTransform(t,void 0,r,ds(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(i&&i.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!i&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!m1(t,n.prevRanges)),c=i?Ci(n.prevRanges,t.mapping):lu(t.mapping.maps);return new zt(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,ds(e)),ht.empty,c,t.time,l??n.prevComposition)}else return(o=t.getMeta("rebased"))?new zt(n.done.rebased(t,o),n.undone.rebased(t,o),Ci(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new zt(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Ci(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function m1(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,s)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&s>=e[o]&&(t=!0)}),t}function lu(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,s,o,i)=>e.push(o,i));return e}function Ci(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let s=e.map(n[r],1),o=e.map(n[r+1],-1);s<=o&&t.push(s,o)}return t}function g1(n,e,t){let r=ds(e),s=xn.get(e).spec.config,o=(t?n.undone:n.done).popEvent(e,r);if(!o)return null;let i=o.selection.resolve(o.transform.doc),l=(t?n.done:n.undone).addTransform(o.transform,e.selection.getBookmark(),s,r),a=new zt(t?l:o.remaining,t?o.remaining:l,null,0,-1);return o.transform.setSelection(i).setMeta(xn,{redo:t,historyState:a})}let Mi=!1,au=null;function ds(n){let e=n.plugins;if(au!=e){Mi=!1,au=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Mi=!0;break}}return Mi}const xn=new Pe("history"),y1=new Pe("closeHistory");function b1(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Te({key:xn,state:{init(){return new zt(ht.empty,ht.empty,null,0,-1)},apply(e,t,r){return p1(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,s=r=="historyUndo"?mh:r=="historyRedo"?gh:null;return!s||!e.editable?!1:(t.preventDefault(),s(e.state,e.dispatch))}}}})}function ph(n,e){return(t,r)=>{let s=xn.getState(t);if(!s||(n?s.undone:s.done).eventCount==0)return!1;if(r){let o=g1(s,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const mh=ph(!1,!0),gh=ph(!0,!0);Ae.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc;if(((n==null?void 0:n.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new Te({key:new Pe("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const s=this.options.limit;if(s==null||s===0){n=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const i=o-s,l=0,a=i;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(l,a);return n=!0,c}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=r||s>r&&o>r&&o<=s)return!0;if(s>r&&o>r&&o>s||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,a=o-r,c=l-a,u=l;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}});var k1=Ae.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[t1(this.options)]}});Ae.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Te({key:new Pe("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:s}=e,o=[];if(!t||!r)return Se.create(n,[]);let i=0;this.options.mode==="deepest"&&n.descendants((a,c)=>{if(a.isText)return;if(!(s>=c&&s<=c+a.nodeSize-1))return!1;i+=1});let l=0;return n.descendants((a,c)=>{if(a.isText||!(s>=c&&s<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&i-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(Ue.node(c,c+a.nodeSize,{class:this.options.className}))}),Se.create(n,o)}}})]}});var x1=Ae.create({name:"gapCursor",addProseMirrorPlugins(){return[o1()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=ye(Z(n,"allowGapCursor",t)))!=null?e:null}}});Ae.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Te({key:new Pe("placeholder"),props:{decorations:({doc:n,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,s=[];if(!t)return null;const o=this.editor.isEmpty;return n.descendants((i,l)=>{const a=r>=l&&r<=l+i.nodeSize,c=!i.isLeaf&&No(i);if((a||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];o&&u.push(this.options.emptyEditorClass);const d=Ue.node(l,l+i.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:i,pos:l,hasAnchor:a}):this.options.placeholder});s.push(d)}return this.options.includeChildren}),Se.create(n,s)}}})]}});Ae.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new Te({key:new Pe("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||Of(t.selection)||n.view.dragging?null:Se.create(t.doc,[Ue.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function cu({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||(e==null?void 0:e.type)===n}var v1=Ae.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new Pe(this.name),t=((n=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:n.name)||this.options.node||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(t).includes(s.name));return[new Te({key:e,appendTransaction:(s,o,i)=>{const{doc:l,tr:a,schema:c}=i,u=e.getState(i),d=l.content.size,f=c.nodes[t];if(u)return a.insert(d,f.create())},state:{init:(s,o)=>{const i=o.tr.doc.lastChild;return!cu({node:i,types:r})},apply:(s,o)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return o;const i=s.doc.lastChild;return!cu({node:i,types:r})}}})]}}),S1=Ae.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>mh(n,e),redo:()=>({state:n,dispatch:e})=>gh(n,e)}},addProseMirrorPlugins(){return[b1(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),C1=Ae.create({name:"starterKit",addExtensions(){var n,e,t,r;const s=[];return this.options.bold!==!1&&s.push(Gk.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(Yk.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(th.configure(this.options.bulletList)),this.options.code!==!1&&s.push(Zk.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(nx.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(rx.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(k1.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(x1.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(sx.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(ox.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(S1.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(ix.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(dx.configure(this.options.italic)),this.options.listItem!==!1&&s.push(nh.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(ah.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&s.push(eh.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(uh.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(Jx.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(Qx.configure(this.options.strike)),this.options.text!==!1&&s.push(Zx.configure(this.options.text)),this.options.underline!==!1&&s.push(dh.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&s.push(v1.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),M1=C1,w1=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,T1=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,E1=vt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",Ce(this.options.HTMLAttributes,n),0]},renderMarkdown:(n,e)=>`==${e.renderChildren(n)}==`,parseMarkdown:(n,e)=>e.applyMark("highlight",e.parseInline(n.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:n=>n.indexOf("=="),tokenize(n,e,t){const s=/^(==)([^=]+)(==)/.exec(n);if(s){const o=s[2].trim(),i=t.inlineTokens(o);return{type:"highlight",raw:s[0],text:o,tokens:i}}}},addCommands(){return{setHighlight:n=>({commands:e})=>e.setMark(this.name,n),toggleHighlight:n=>({commands:e})=>e.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[wn({find:w1,type:this.type})]},addPasteRules(){return[Qt({find:T1,type:this.type})]}}),A1=E1,O1=Ae.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>{const e=n.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:n=>n.textAlign?{style:`text-align: ${n.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:n})).every(t=>t):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.map(e=>n.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:n=>({editor:e,commands:t})=>this.options.alignments.includes(n)?e.isActive({textAlign:n})?t.unsetTextAlign():t.setTextAlign(n):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),D1=O1,N1=vt.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(n){return n!=="super"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sup",Ce(this.options.HTMLAttributes,n),0]},addCommands(){return{setSuperscript:()=>({commands:n})=>n.setMark(this.name),toggleSuperscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSuperscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),R1=N1,L1=vt.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(n){return n!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sub",Ce(this.options.HTMLAttributes,n),0]},addCommands(){return{setSubscript:()=>({commands:n})=>n.setMark(this.name),toggleSubscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSubscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),I1=L1,An={root:"m_dd3f7539",Typography:"m_f2016866",content:"m_c2204cc2",linkEditorDropdown:"m_8a991b4f",control:"m_c2207da6",controlIcon:"m_9cdfeb3f",controlsGroup:"m_2ab47ef2",linkEditor:"m_b67b711e",linkEditorInput:"m_296cf94c",linkEditorExternalControl:"m_cfef614",linkEditorSave:"m_3b28e7bb",toolbar:"m_4574a3c4",taskList:"m_8b44009a"};const j1={linkControlLabel:"Link",colorPickerControlLabel:"Text color",highlightControlLabel:"Highlight text",colorControlLabel:n=>`Set text color ${n}`,boldControlLabel:"Bold",italicControlLabel:"Italic",underlineControlLabel:"Underline",strikeControlLabel:"Strikethrough",clearFormattingControlLabel:"Clear formatting",unlinkControlLabel:"Remove link",bulletListControlLabel:"Bullet list",orderedListControlLabel:"Ordered list",sourceCodeControlLabel:"Switch between text/source code",h1ControlLabel:"Heading 1",h2ControlLabel:"Heading 2",h3ControlLabel:"Heading 3",h4ControlLabel:"Heading 4",h5ControlLabel:"Heading 5",h6ControlLabel:"Heading 6",blockquoteControlLabel:"Blockquote",alignLeftControlLabel:"Align text: left",alignCenterControlLabel:"Align text: center",alignRightControlLabel:"Align text: right",alignJustifyControlLabel:"Align text: justify",codeControlLabel:"Code",codeBlockControlLabel:"Code block",subscriptControlLabel:"Subscript",superscriptControlLabel:"Superscript",unsetColorControlLabel:"Unset color",hrControlLabel:"Horizontal line",undoControlLabel:"Undo",redoControlLabel:"Redo",tasksControlLabel:"Task list",tasksSinkLabel:"Decrease task level",tasksLiftLabel:"Increase task level",linkEditorInputLabel:"Enter URL",linkEditorInputPlaceholder:"https://example.com/",linkEditorExternalLink:"Open link in a new tab",linkEditorInternalLink:"Open link in the same tab",linkEditorSave:"Save",colorPickerCancel:"Cancel",colorPickerClear:"Clear color",colorPickerColorPicker:"Color picker",colorPickerPalette:"Color palette",colorPickerSave:"Save",colorPickerColorLabel:n=>`Set text color ${n}`},[P1,St]=x.createSafeContext("RichTextEditor component was not found in tree"),aa=x.factory((n,e)=>{const t=x.useProps("RichTextEditorContent",null,n),{classNames:r,className:s,style:o,styles:i,vars:l,...a}=t,c=St();return c.withTypographyStyles?m.jsx(x.Typography,{...c.getStyles("Typography",{className:s,style:o,styles:i,classNames:r}),unstyled:c.unstyled,ref:e,children:m.jsx(x.Box,{component:Uc,editor:c.editor,...c.getStyles("content",{classNames:r,styles:i}),...a})}):m.jsx(x.Box,{component:Uc,editor:c.editor,...c.getStyles("content",{classNames:r,styles:i,className:s,style:o}),...a})});aa.classes=An;aa.displayName="@mantine/tiptap/RichTextEditorContent";function fe(n){return m.jsx("svg",{...n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})}function _1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M7 5h6a3.5 3.5 0 0 1 0 7h-6z"}),m.jsx("path",{d:"M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7"})]})}function B1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M11 5l6 0"}),m.jsx("path",{d:"M7 19l6 0"}),m.jsx("path",{d:"M14 5l-4 14"})]})}function F1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M7 5v5a5 5 0 0 0 10 0v-5"}),m.jsx("path",{d:"M5 19h14"})]})}function z1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 12l14 0"}),m.jsx("path",{d:"M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5"})]})}function $1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M17 15l4 4m0 -4l-4 4"}),m.jsx("path",{d:"M7 6v-1h11v1"}),m.jsx("path",{d:"M7 19l4 0"}),m.jsx("path",{d:"M13 5l-4 14"})]})}function V1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M19 18v-8l-2 2"}),m.jsx("path",{d:"M4 6v12"}),m.jsx("path",{d:"M12 6v12"}),m.jsx("path",{d:"M11 18h2"}),m.jsx("path",{d:"M3 18h2"}),m.jsx("path",{d:"M4 12h8"}),m.jsx("path",{d:"M3 6h2"}),m.jsx("path",{d:"M11 6h2"})]})}function H1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 0"}),m.jsx("path",{d:"M4 6v12"}),m.jsx("path",{d:"M12 6v12"}),m.jsx("path",{d:"M11 18h2"}),m.jsx("path",{d:"M3 18h2"}),m.jsx("path",{d:"M4 12h8"}),m.jsx("path",{d:"M3 6h2"}),m.jsx("path",{d:"M11 6h2"})]})}function W1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M19 14a2 2 0 1 0 -2 -2"}),m.jsx("path",{d:"M17 16a2 2 0 1 0 2 -2"}),m.jsx("path",{d:"M4 6v12"}),m.jsx("path",{d:"M12 6v12"}),m.jsx("path",{d:"M11 18h2"}),m.jsx("path",{d:"M3 18h2"}),m.jsx("path",{d:"M4 12h8"}),m.jsx("path",{d:"M3 6h2"}),m.jsx("path",{d:"M11 6h2"})]})}function Y1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M20 18v-8l-4 6h5"}),m.jsx("path",{d:"M4 6v12"}),m.jsx("path",{d:"M12 6v12"}),m.jsx("path",{d:"M11 18h2"}),m.jsx("path",{d:"M3 18h2"}),m.jsx("path",{d:"M4 12h8"}),m.jsx("path",{d:"M3 6h2"}),m.jsx("path",{d:"M11 6h2"})]})}function q1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M17 18h2a2 2 0 1 0 0 -4h-2v-4h4"}),m.jsx("path",{d:"M4 6v12"}),m.jsx("path",{d:"M12 6v12"}),m.jsx("path",{d:"M11 18h2"}),m.jsx("path",{d:"M3 18h2"}),m.jsx("path",{d:"M4 12h8"}),m.jsx("path",{d:"M3 6h2"}),m.jsx("path",{d:"M11 6h2"})]})}function U1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M19 14a2 2 0 1 0 0 4a2 2 0 0 0 0 -4z"}),m.jsx("path",{d:"M21 12a2 2 0 1 0 -4 0v4"}),m.jsx("path",{d:"M4 6v12"}),m.jsx("path",{d:"M12 6v12"}),m.jsx("path",{d:"M11 18h2"}),m.jsx("path",{d:"M3 18h2"}),m.jsx("path",{d:"M4 12h8"}),m.jsx("path",{d:"M3 6h2"}),m.jsx("path",{d:"M11 6h2"})]})}function K1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M9 6l11 0"}),m.jsx("path",{d:"M9 12l11 0"}),m.jsx("path",{d:"M9 18l11 0"}),m.jsx("path",{d:"M5 6l0 .01"}),m.jsx("path",{d:"M5 12l0 .01"}),m.jsx("path",{d:"M5 18l0 .01"})]})}function J1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M11 6h9"}),m.jsx("path",{d:"M11 12h9"}),m.jsx("path",{d:"M12 18h8"}),m.jsx("path",{d:"M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4"}),m.jsx("path",{d:"M6 10v-6l-2 2"})]})}function G1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M17 22v-2"}),m.jsx("path",{d:"M9 15l6 -6"}),m.jsx("path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"}),m.jsx("path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"}),m.jsx("path",{d:"M20 17h2"}),m.jsx("path",{d:"M2 7h2"}),m.jsx("path",{d:"M7 2v2"})]})}function X1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M6 15h15"}),m.jsx("path",{d:"M21 19h-15"}),m.jsx("path",{d:"M15 11h6"}),m.jsx("path",{d:"M21 7h-6"}),m.jsx("path",{d:"M9 9h1a1 1 0 1 1 -1 1v-2.5a2 2 0 0 1 2 -2"}),m.jsx("path",{d:"M3 9h1a1 1 0 1 1 -1 1v-2.5a2 2 0 0 1 2 -2"})]})}function Q1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 6l16 0"}),m.jsx("path",{d:"M4 12l10 0"}),m.jsx("path",{d:"M4 18l14 0"})]})}function Z1(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 6l16 0"}),m.jsx("path",{d:"M10 12l10 0"}),m.jsx("path",{d:"M6 18l14 0"})]})}function ev(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 6l16 0"}),m.jsx("path",{d:"M8 12l8 0"}),m.jsx("path",{d:"M6 18l12 0"})]})}function tv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M4 6l16 0"}),m.jsx("path",{d:"M4 12l16 0"}),m.jsx("path",{d:"M4 18l12 0"})]})}function nv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 7l8 10m-8 0l8 -10"}),m.jsx("path",{d:"M21 20h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2"})]})}function rv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 7l8 10m-8 0l8 -10"}),m.jsx("path",{d:"M21 11h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2"})]})}function yh(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M7 8l-4 4l4 4"}),m.jsx("path",{d:"M17 8l4 4l-4 4"}),m.jsx("path",{d:"M14 4l-4 16"})]})}function sv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3 19h4l10.5 -10.5a2.828 2.828 0 1 0 -4 -4l-10.5 10.5v4"}),m.jsx("path",{d:"M12.5 5.5l4 4"}),m.jsx("path",{d:"M4.5 13.5l4 4"}),m.jsx("path",{d:"M21 15v4h-8l4 -4z"})]})}function ov(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 12h2"}),m.jsx("path",{d:"M17 12h2"}),m.jsx("path",{d:"M11 12h2"})]})}function bh(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M20.042 16.045a9 9 0 0 0 -12.087 -12.087m-2.318 1.677a9 9 0 1 0 12.725 12.73"}),m.jsx("path",{d:"M3 3l18 18"})]})}function iv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M11 7l6 6"}),m.jsx("path",{d:"M4 16l11.7 -11.7a1 1 0 0 1 1.4 0l2.6 2.6a1 1 0 0 1 0 1.4l-11.7 11.7h-4v-4z"})]})}function lv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M18 6l-12 12"}),m.jsx("path",{d:"M6 6l12 12"})]})}function av(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25"}),m.jsx("path",{d:"M8.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),m.jsx("path",{d:"M12.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"}),m.jsx("path",{d:"M16.5 10.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"})]})}function cv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M5 12l5 5l10 -10"})]})}function uv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M9 15l6 -6"}),m.jsx("path",{d:"M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464"}),m.jsx("path",{d:"M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463"})]})}function dv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6"}),m.jsx("path",{d:"M11 13l9 -9"}),m.jsx("path",{d:"M15 4h5v5"})]})}function fv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M9 14l-4 -4l4 -4"}),m.jsx("path",{d:"M5 10h11a4 4 0 1 1 0 8h-1"})]})}function hv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M15 14l4 -4l-4 -4"}),m.jsx("path",{d:"M19 10h-11a4 4 0 1 0 0 8h1"})]})}function pv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M3.5 5.5l1.5 1.5l2.5 -2.5"}),m.jsx("path",{d:"M3.5 11.5l1.5 1.5l2.5 -2.5"}),m.jsx("path",{d:"M3.5 17.5l1.5 1.5l2.5 -2.5"}),m.jsx("path",{d:"M11 6l9 0"}),m.jsx("path",{d:"M11 12l9 0"}),m.jsx("path",{d:"M11 18l9 0"})]})}function mv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M20 6l-11 0"}),m.jsx("path",{d:"M20 12l-7 0"}),m.jsx("path",{d:"M20 18l-11 0"}),m.jsx("path",{d:"M4 8l4 4l-4 4"})]})}function gv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:"M20 6l-7 0"}),m.jsx("path",{d:"M20 12l-9 0"}),m.jsx("path",{d:"M20 18l-7 0"}),m.jsx("path",{d:"M8 8l-4 4l4 4"})]})}function yv(n){return m.jsxs(fe,{...n,children:[m.jsx("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),m.jsx("path",{d:`M19 3v16a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V7.914
193
193
  a1 1 0 0 1 .293-.707l3.914-3.914A1 1 0 0 1 9.914 3H18
194
- a1 1 0 0 1 1 1Z`}),m.jsx("path",{d:"M10 11l-2 2 2 2"}),m.jsx("path",{d:"M14 11l2 2-2 2"})]})}const bv={interactive:!0},On=x.factory((n,e)=>{const t=x.useProps("RichTextEditorControl",bv,n),{classNames:r,className:s,style:o,styles:i,vars:l,interactive:a,active:c,onMouseDown:u,disabled:d,...f}=t,h=St();return m.jsx(x.UnstyledButton,{...f,...h.getStyles("control",{className:s,style:o,classNames:r,styles:i}),disabled:d,"data-rich-text-editor-control":!0,tabIndex:a?0:-1,"data-interactive":a||void 0,"data-disabled":d||void 0,"data-active":c||void 0,"aria-pressed":c&&a||void 0,"aria-hidden":!a||void 0,ref:e,unstyled:h.unstyled,variant:h.variant||"default",onMouseDown:p=>{p.preventDefault(),u==null||u(p)}})});On.classes=An;On.displayName="@mantine/tiptap/RichTextEditorControl";const ca=T.forwardRef(({className:n,icon:e,...t},r)=>{const s=St();return m.jsx(On,{ref:r,...t,children:m.jsx(e,{...s.getStyles("controlIcon")})})});ca.displayName="@mantine/tiptap/RichTextEditorControlBase";function me({label:n,isActive:e,operation:t,icon:r,isDisabled:s}){const o=T.forwardRef((i,l)=>{const{editor:a,labels:c}=St(),u=c[n];return m.jsx(ca,{"aria-label":u,title:u,active:e!=null&&e.name?a==null?void 0:a.isActive(e.name,e.attributes):!1,ref:l,icon:i.icon||r,disabled:(s==null?void 0:s(a))||!1,...i,onClick:()=>a==null?void 0:a.chain().focus()[t.name](t.attributes).run()})});return o.displayName=`@mantine/tiptap/${n}`,o}const kv=me({label:"boldControlLabel",icon:n=>m.jsx(_1,{...n}),isActive:{name:"bold"},operation:{name:"toggleBold"}}),xv=me({label:"italicControlLabel",icon:n=>m.jsx(B1,{...n}),isActive:{name:"italic"},operation:{name:"toggleItalic"}}),vv=me({label:"underlineControlLabel",icon:n=>m.jsx(F1,{...n}),isActive:{name:"underline"},operation:{name:"toggleUnderline"}}),Sv=me({label:"strikeControlLabel",icon:n=>m.jsx(z1,{...n}),isActive:{name:"strike"},operation:{name:"toggleStrike"}}),Cv=me({label:"clearFormattingControlLabel",icon:n=>m.jsx($1,{...n}),operation:{name:"unsetAllMarks"}}),Mv=me({label:"unlinkControlLabel",icon:n=>m.jsx(G1,{...n}),operation:{name:"unsetLink"}}),wv=me({label:"bulletListControlLabel",icon:n=>m.jsx(K1,{...n}),isActive:{name:"bulletList"},operation:{name:"toggleBulletList"}}),Tv=me({label:"orderedListControlLabel",icon:n=>m.jsx(J1,{...n}),isActive:{name:"orderedList"},operation:{name:"toggleOrderedList"}}),Ev=me({label:"h1ControlLabel",icon:n=>m.jsx(V1,{...n}),isActive:{name:"heading",attributes:{level:1}},operation:{name:"toggleHeading",attributes:{level:1}}}),Av=me({label:"h2ControlLabel",icon:n=>m.jsx(H1,{...n}),isActive:{name:"heading",attributes:{level:2}},operation:{name:"toggleHeading",attributes:{level:2}}}),Ov=me({label:"h3ControlLabel",icon:n=>m.jsx(W1,{...n}),isActive:{name:"heading",attributes:{level:3}},operation:{name:"toggleHeading",attributes:{level:3}}}),Dv=me({label:"h4ControlLabel",icon:n=>m.jsx(Y1,{...n}),isActive:{name:"heading",attributes:{level:4}},operation:{name:"toggleHeading",attributes:{level:4}}}),Nv=me({label:"h5ControlLabel",icon:n=>m.jsx(q1,{...n}),isActive:{name:"heading",attributes:{level:5}},operation:{name:"toggleHeading",attributes:{level:5}}}),Rv=me({label:"h6ControlLabel",icon:n=>m.jsx(U1,{...n}),isActive:{name:"heading",attributes:{level:6}},operation:{name:"toggleHeading",attributes:{level:6}}}),Lv=me({label:"blockquoteControlLabel",icon:n=>m.jsx(X1,{...n}),isActive:{name:"blockquote"},operation:{name:"toggleBlockquote"}}),Iv=me({label:"alignLeftControlLabel",icon:n=>m.jsx(Q1,{...n}),operation:{name:"setTextAlign",attributes:"left"}}),jv=me({label:"alignRightControlLabel",icon:n=>m.jsx(Z1,{...n}),operation:{name:"setTextAlign",attributes:"right"}}),Pv=me({label:"alignCenterControlLabel",icon:n=>m.jsx(ev,{...n}),operation:{name:"setTextAlign",attributes:"center"}}),_v=me({label:"alignJustifyControlLabel",icon:n=>m.jsx(tv,{...n}),operation:{name:"setTextAlign",attributes:"justify"}}),Bv=me({label:"subscriptControlLabel",icon:n=>m.jsx(nv,{...n}),isActive:{name:"subscript"},operation:{name:"toggleSubscript"}}),Fv=me({label:"superscriptControlLabel",icon:n=>m.jsx(rv,{...n}),isActive:{name:"superscript"},operation:{name:"toggleSuperscript"}}),zv=me({label:"codeControlLabel",icon:n=>m.jsx(yh,{...n}),isActive:{name:"code"},operation:{name:"toggleCode"}}),$v=me({label:"codeBlockControlLabel",icon:n=>m.jsx(yh,{...n}),isActive:{name:"codeBlock"},operation:{name:"toggleCodeBlock"}}),Vv=me({label:"highlightControlLabel",icon:n=>m.jsx(sv,{...n}),isActive:{name:"highlight"},operation:{name:"toggleHighlight"}}),Hv=me({label:"hrControlLabel",icon:n=>m.jsx(ov,{...n}),operation:{name:"setHorizontalRule"}}),Wv=me({label:"unsetColorControlLabel",icon:n=>m.jsx(bh,{...n}),operation:{name:"unsetColor"}}),Yv=me({label:"undoControlLabel",icon:n=>m.jsx(fv,{...n}),isDisabled:n=>!(n!=null&&n.can().undo()),operation:{name:"undo"}}),qv=me({label:"redoControlLabel",icon:n=>m.jsx(hv,{...n}),isDisabled:n=>!(n!=null&&n.can().redo()),operation:{name:"redo"}}),Uv=me({label:"tasksControlLabel",icon:n=>m.jsx(pv,{...n}),isActive:{name:"taskList"},operation:{name:"toggleTaskList"}}),Kv=me({label:"tasksSinkLabel",icon:n=>m.jsx(mv,{...n}),operation:{name:"sinkListItem",attributes:"taskItem"},isDisabled:n=>!(n!=null&&n.can().sinkListItem("taskItem"))}),Jv=me({label:"tasksLiftLabel",icon:n=>m.jsx(gv,{...n}),operation:{name:"liftListItem",attributes:"taskItem"},isDisabled:n=>!(n!=null&&n.can().liftListItem("taskItem"))}),Gv=n=>m.jsx(uv,{...n}),ua=x.factory((n,e)=>{var $;const t=x.useProps("RichTextEditorLinkControl",null,n),{classNames:r,className:s,style:o,styles:i,vars:l,icon:a,popoverProps:c,disableTooltips:u,initialExternal:d,...f}=t,h=St(),p={classNames:r,styles:i},[g,y]=bp(""),[b,k]=T.useState(d),[M,{open:E,close:v}]=hl(!1),C=()=>{var H;E();const B=(H=h.editor)==null?void 0:H.getAttributes("link");y((B==null?void 0:B.href)||""),k(B!=null&&B.href?(B==null?void 0:B.target)==="_blank":d)},w=()=>{v(),y(""),k(d)},O=()=>{var B,H;w(),g===""?(B=h.editor)==null||B.chain().focus().extendMarkRange("link").unsetLink().run():(H=h.editor)==null||H.chain().focus().extendMarkRange("link").setLink({href:g,target:b?"_blank":null}).run()},L=B=>{B.key==="Enter"&&(B.preventDefault(),O())};mp("edit-link",C,!1);const{resolvedClassNames:z,resolvedStyles:P}=x.useResolvedStylesApi({classNames:r,styles:i,props:t});return m.jsxs(x.Popover,{trapFocus:!0,shadow:"md",withinPortal:!0,opened:M,onChange:B=>!B&&w(),offset:-44,zIndex:1e4,...c,children:[m.jsx(x.Popover.Target,{children:m.jsx(ca,{icon:a||Gv,...f,"aria-label":h.labels.linkControlLabel,title:h.labels.linkControlLabel,onClick:C,active:($=h.editor)==null?void 0:$.isActive("link"),ref:e,classNames:z,styles:P,className:s,style:o,variant:h.variant})}),m.jsx(x.Popover.Dropdown,{...h.getStyles("linkEditorDropdown",p),children:m.jsxs("div",{...h.getStyles("linkEditor",p),children:[m.jsx(x.TextInput,{placeholder:h.labels.linkEditorInputPlaceholder,"aria-label":h.labels.linkEditorInputLabel,type:"url",value:g,onChange:y,classNames:{input:h.getStyles("linkEditorInput",p).className},onKeyDown:L,rightSection:m.jsx(x.Tooltip,{label:b?h.labels.linkEditorExternalLink:h.labels.linkEditorInternalLink,events:{hover:!0,focus:!0,touch:!0},withinPortal:!0,withArrow:!0,disabled:u,zIndex:1e4,children:m.jsx(x.UnstyledButton,{onClick:()=>k(B=>!B),"data-active":b||void 0,...h.getStyles("linkEditorExternalControl",p),children:m.jsx(dv,{style:{width:x.rem(14),height:x.rem(14)}})})})}),m.jsx(x.Button,{variant:"default",onClick:O,...h.getStyles("linkEditorSave",p),children:h.labels.linkEditorSave})]})})]})});ua.classes=An;ua.displayName="@mantine/tiptap/RichTextEditorLinkControl";const kh=T.forwardRef((n,e)=>{const{popoverProps:t,colors:r,colorPickerProps:s,...o}=x.useProps("RichTextEditorColorPickerControl",null,n),{editor:i,labels:l,getStyles:a,variant:c}=St(),[u,{toggle:d,close:f}]=hl(!1),[h,p]=T.useState("palette"),g=(i==null?void 0:i.getAttributes("textStyle").color)||"var(--mantine-color-text)",y=(M,E=!0)=>{(i==null?void 0:i.chain()).focus().setColor(M).run(),E&&f()},b=()=>{(i==null?void 0:i.chain()).focus().unsetColor().run(),f()},k=r.map((M,E)=>m.jsx(x.ColorSwatch,{component:"button",color:M,onClick:()=>y(M),size:26,radius:"xs",style:{cursor:"pointer"},title:l.colorPickerColorLabel(M),"aria-label":l.colorPickerColorLabel(M)},E));return m.jsxs(x.Popover,{opened:u,withinPortal:!0,trapFocus:!0,onChange:M=>!M&&f(),...t,children:[m.jsx(x.Popover.Target,{children:m.jsx(On,{...o,variant:c,"aria-label":l.colorPickerControlLabel,title:l.colorPickerControlLabel,ref:e,onClick:d,children:m.jsx(x.ColorSwatch,{color:g,size:14})})}),m.jsxs(x.Popover.Dropdown,{...a("linkEditorDropdown"),children:[h==="palette"&&m.jsx(x.SimpleGrid,{cols:7,spacing:2,children:k}),h==="colorPicker"&&m.jsx(x.ColorPicker,{defaultValue:g,onChange:M=>y(M,!1),...s}),m.jsx(x.Tooltip.Group,{closeDelay:200,children:m.jsxs(x.Group,{justify:"flex-end",gap:"xs",mt:"sm",children:[h==="palette"&&m.jsx(x.ActionIcon,{variant:"default",onClick:f,title:l.colorPickerCancel,"aria-label":l.colorPickerCancel,children:m.jsx(lv,{style:{width:x.rem(16),height:x.rem(16)}})}),m.jsx(x.ActionIcon,{variant:"default",onClick:b,title:l.colorPickerClear,"aria-label":l.colorPickerClear,children:m.jsx(bh,{style:{width:x.rem(16),height:x.rem(16)}})}),h==="palette"?m.jsx(x.ActionIcon,{variant:"default",onClick:()=>p("colorPicker"),title:l.colorPickerColorPicker,"aria-label":l.colorPickerColorPicker,children:m.jsx(iv,{style:{width:x.rem(16),height:x.rem(16)}})}):m.jsx(x.ActionIcon,{variant:"default",onClick:()=>p("palette"),"aria-label":l.colorPickerPalette,title:l.colorPickerPalette,children:m.jsx(av,{style:{width:x.rem(16),height:x.rem(16)}})}),h==="colorPicker"&&m.jsx(x.ActionIcon,{variant:"default",onClick:f,title:l.colorPickerSave,"aria-label":l.colorPickerSave,children:m.jsx(cv,{style:{width:x.rem(16),height:x.rem(16)}})})]})})]})]})});kh.displayName="@mantine/tiptap/ColorPickerControl";const xh=T.forwardRef((n,e)=>{const{color:t,...r}=x.useProps("RichTextEditorColorControl",null,n),{editor:s,labels:o,variant:i}=St(),l=(s==null?void 0:s.getAttributes("textStyle").color)||null,a=o.colorControlLabel(t);return m.jsx(On,{...r,variant:i,active:l===t,"aria-label":a,title:a,onClick:()=>(s==null?void 0:s.chain()).focus().setColor(t).run(),ref:e,children:m.jsx(x.ColorSwatch,{color:t,size:14})})});xh.displayName="@mantine/tiptap/RichTextEditorColorControl";const Xv={},vh=T.forwardRef((n,e)=>{const{...t}=x.useProps("RichTextEditorSourceCodeControl",Xv,n),{editor:r,labels:s,variant:o,onSourceCodeTextSwitch:i}=St(),[l,a]=T.useState(!1),c=()=>{l?r==null||r.commands.setContent(r.getText(),{emitUpdate:!0}):r==null||r.commands.setContent(`<textarea>${r.getHTML()}</textarea>`);const u=!l;a(u),i==null||i(u)};return m.jsx(On,{...t,variant:o,active:l,"aria-label":s.sourceCodeControlLabel,title:s.sourceCodeControlLabel,onClick:()=>c(),ref:e,children:m.jsx(yv,{style:{width:x.rem(16),height:x.rem(16)}})})});vh.displayName="@mantine/tiptap/RichTextEditorSourceCodeControl";const da=x.factory((n,e)=>{const t=x.useProps("RichTextEditorControlsGroup",null,n),{classNames:r,className:s,style:o,styles:i,vars:l,variant:a,...c}=t,u=St();return m.jsx(x.Box,{ref:e,variant:a||u.variant,...u.getStyles("controlsGroup",{className:s,style:o,styles:i,classNames:r}),...c})});da.classes=An;da.displayName="@mantine/tiptap/RichTextEditorControlsGroup";const fa=x.factory((n,e)=>{const t=x.useProps("RichTextEditorToolbar",null,n),{classNames:r,className:s,style:o,styles:i,vars:l,sticky:a,stickyOffset:c,mod:u,variant:d,...f}=t,h=St();return m.jsx(x.Box,{ref:e,mod:[{sticky:a},u],variant:d||h.variant,...h.getStyles("toolbar",{className:s,style:o,styles:i,classNames:r}),...f,__vars:{"--rte-sticky-offset":x.rem(c)}})});fa.classes=An;fa.displayName="@mantine/tiptap/RichTextEditorToolbar";const Qv={withCodeHighlightStyles:!0,withTypographyStyles:!0,variant:"default"},W=x.factory((n,e)=>{const t=x.useProps("RichTextEditor",Qv,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,editor:c,withCodeHighlightStyles:u,withTypographyStyles:d,onSourceCodeTextSwitch:f,labels:h,children:p,variant:g,attributes:y,...b}=t,k=x.useStyles({name:"RichTextEditor",classes:An,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:y,vars:a}),M=T.useMemo(()=>({...j1,...h}),[h]);return m.jsx(P1,{value:{editor:c,getStyles:k,labels:M,withCodeHighlightStyles:u,withTypographyStyles:d,onSourceCodeTextSwitch:f,unstyled:l,variant:g},children:m.jsx(x.Box,{...k("root"),...b,ref:e,children:p})})});W.classes=An;W.displayName="@mantine/tiptap/RichTextEditor";W.Content=aa;W.Control=On;W.Toolbar=fa;W.ControlsGroup=da;W.Bold=kv;W.Italic=xv;W.Strikethrough=Sv;W.Underline=vv;W.ClearFormatting=Cv;W.H1=Ev;W.H2=Av;W.H3=Ov;W.H4=Dv;W.H5=Nv;W.H6=Rv;W.BulletList=wv;W.OrderedList=Tv;W.Link=ua;W.Unlink=Mv;W.Blockquote=Lv;W.AlignLeft=Iv;W.AlignRight=jv;W.AlignCenter=Pv;W.AlignJustify=_v;W.Superscript=Fv;W.Subscript=Bv;W.Code=zv;W.CodeBlock=$v;W.ColorPicker=kh;W.Color=xh;W.Highlight=Vv;W.Hr=Hv;W.UnsetColor=Wv;W.Undo=Yv;W.Redo=qv;W.TaskList=Uv;W.TaskListSink=Kv;W.TaskListLift=Jv;W.SourceCode=vh;function Zv({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0,o=zk({editable:!r&&!s,extensions:[M1,e1,Px,R1,I1,A1,D1.configure({types:["heading","paragraph"]})],content:t.value||"",onUpdate:({editor:i})=>{t.onChange(i.getHTML())}});return m.jsxs(W,{editor:o,h:400,children:[m.jsxs(W.Toolbar,{sticky:!0,stickyOffset:60,children:[m.jsxs(W.ControlsGroup,{children:[m.jsx(W.Bold,{}),m.jsx(W.Italic,{}),m.jsx(W.Underline,{}),m.jsx(W.Strikethrough,{}),m.jsx(W.ClearFormatting,{}),m.jsx(W.Highlight,{}),m.jsx(W.Code,{})]}),m.jsxs(W.ControlsGroup,{children:[m.jsx(W.H1,{}),m.jsx(W.H2,{}),m.jsx(W.H3,{}),m.jsx(W.H4,{})]}),m.jsxs(W.ControlsGroup,{children:[m.jsx(W.Blockquote,{}),m.jsx(W.Hr,{}),m.jsx(W.BulletList,{}),m.jsx(W.OrderedList,{}),m.jsx(W.Subscript,{}),m.jsx(W.Superscript,{})]}),m.jsxs(W.ControlsGroup,{children:[m.jsx(W.Link,{}),m.jsx(W.Unlink,{})]}),m.jsxs(W.ControlsGroup,{children:[m.jsx(W.AlignLeft,{}),m.jsx(W.AlignCenter,{}),m.jsx(W.AlignJustify,{}),m.jsx(W.AlignRight,{})]}),m.jsxs(W.ControlsGroup,{children:[m.jsx(W.Undo,{}),m.jsx(W.Redo,{})]})]}),m.jsx(W.Content,{})]})}function eS({field:n,form:e}){const t=n,r=e.getInputProps(t.name),s=t.readOnly===!0,o=t.disabled===!0;return s||o?m.jsx(x.Select,{data:t.data,value:r.value,disabled:o||s,readOnly:s,placeholder:t.placeholder,required:t.required,variant:s?"filled":"default",error:void 0}):m.jsx(x.Select,{data:t.data,...r,placeholder:t.placeholder,error:void 0,onChange:i=>r.onFieldChange(i)})}function tS({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?m.jsx(x.Switch,{value:t.value,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0,checked:t.value}):m.jsx(x.Switch,{...t,checked:t.value,onChange:o=>t.onFieldChange(o.target.checked),required:n.required,placeholder:n.placeholder,error:void 0})}function nS({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?m.jsx(x.TagsInput,{value:t.value||[],readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):m.jsx(x.TagsInput,{value:t.value||[],onChange:o=>t.onChange(o),required:n.required,placeholder:n.placeholder,error:void 0})}function rS({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?m.jsx(x.TextInput,{value:t.value,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):m.jsx(x.TextInput,{...t,onChange:o=>t.onFieldChange(o.target.value),required:n.required,placeholder:n.placeholder,error:void 0})}function sS({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0,o=typeof t.value=="string"?t.value:"",i=T.useRef(null),l=m.jsx(x.ActionIcon,{variant:"subtle",color:"gray",onClick:()=>{var a;return(a=i.current)==null?void 0:a.showPicker()},children:"⏰"});return r||s?m.jsx(fs,{value:o,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):m.jsx(fs,{value:o,onChange:a=>t.onChange(a.currentTarget.value),required:n.required,placeholder:n.placeholder,error:void 0,ref:i,rightSection:l})}function Sh({field:n,form:e,children:t}){const{error:r}=e.getInputProps(n.name);return m.jsxs(x.Stack,{gap:4,children:[n.label&&m.jsxs(x.Text,{fw:500,size:"sm",mb:2,component:"label",htmlFor:n.name,style:{display:"block"},children:[n.label," ",n.required&&m.jsx(x.Text,{component:"span",c:"red",fz:"sm",children:"*"})]}),m.jsx(x.Box,{children:t}),n.description&&m.jsx(x.Text,{size:"xs",c:"dimmed",mt:2,style:{lineHeight:1.4},children:n.description}),r&&m.jsx(x.Text,{size:"xs",c:"red",mt:2,style:{fontWeight:500},children:r})]})}function oS(n){const{layout:e,field:{required:t,...r},form:s}=n;let o=null;switch(r.type){case"text":o=m.jsx(rS,{field:r,form:n.form});break;case"select":o=m.jsx(eS,{field:r,form:n.form});break;case"object":o=m.jsx(vm,{field:r,form:s,layout:e});break;case"array":o=m.jsx(Qh,{field:r,form:s,layout:e});break;case"checkbox":o=m.jsx(Zh,{field:r,form:s});break;case"number":o=m.jsx(xm,{field:r,form:s});break;case"date":o=m.jsx(bm,{field:r,form:s});break;case"datetime":o=m.jsx(km,{field:r,form:s});break;case"switch":o=m.jsx(tS,{field:r,form:s});break;case"texteditor":o=m.jsx(Zv,{field:r,form:s});break;case"time":o=m.jsx(sS,{field:r,form:s});break;case"tags":o=m.jsx(nS,{field:r,form:s});break;default:o=m.jsxs("div",{children:["Unsupported field type: ",r.type]});break}return m.jsx(Sh,{field:r,form:s,children:o})}class jo{constructor(){ga(this,"next")}setNext(e){return this.next=e,e}handle(e,t){var r;return this.canHandle(e)?this.render(e,t):((r=this.next)==null?void 0:r.handle(e,t))??null}}class iS extends jo{constructor(e){super(),this.layout=e}canHandle(){return!0}render(e,t){return m.jsx(oS,{field:e,form:t,layout:this.layout})}}class lS extends jo{constructor(e){super(),this.customFieldTypes=e}canHandle(e){return!!this.customFieldTypes[e.type]}render(e,t){return this.customFieldTypes[e.type](e,t)}}class aS extends jo{constructor(e){super(),this.fieldRenderers=e}canHandle(e){return!!this.fieldRenderers[e.name]}render(e,t){return this.fieldRenderers[e.name](e,t)}}class cS extends jo{constructor(e){super(),this.typeRenderers=e}canHandle(e){return!!this.typeRenderers[e.type]}render(e,t){return this.typeRenderers[e.type](e,t)}}const Po=n=>{const{field:e,form:t,customFieldRenderers:r,customTypeRenderers:s,customFieldTypes:o,layout:i="grid"}=n,l=new aS(r??{}),a=new cS(s??{}),c=new iS(i),u=new lS(o??{});return l.setNext(a).setNext(u).setNext(c),l.handle(e,t)},uS=T.forwardRef(function({schema:e,currentValues:t,initialValues:r,layout:s="vertical",readOnly:o,validate:i,onSubmit:l,onFieldChange:a,updateFieldSchema:c,preFill:u=M=>M,preSubmit:d=M=>M,postSubmit:f=()=>{},submitButton:h=!0,customFieldRenderers:p,customFieldTypes:g,customTypeRenderers:y,loading:b},k){const[M,E]=T.useState(!1),v=Gh({validate:i,enhanceGetInputProps(P){return{onFieldChange:async $=>{var B;P.inputProps.onChange($),await((B=a==null?void 0:a[P.field.replace(/\.\d+\./g,".")])==null?void 0:B.call(a,P.field,$,v))}}}}),C=cl[s],w=(P,$,B)=>P.map(H=>{if(H.type==="object"||H.type==="array"){const K=B==null?void 0:B[H.name];return{...H,fields:w(H.fields,$||{},K)}}const G=B==null?void 0:B[H.name];return G?G(H,$):H}),O=T.useMemo(()=>{if(!c)return e;const P=v.getValues();return w(e,P,c)},[e,v.values,c]),L=v.onSubmit(async P=>{const $=Di(e,P);if(Object.keys($).length){v.setErrors($);return}const B=await d(P);await l(B),f(B)});T.useImperativeHandle(k,()=>({submit:()=>L(),reset:P=>z(P),validate:()=>{const P=v.validate();return Object.keys(P.errors).length===0},getValues:()=>v.getValues(),setValues:P=>v.setValues(P),getFieldValue:P=>v.getInputProps(P).value,setFieldValue:(P,$)=>v.setFieldValue(P,$),isValid:()=>Object.keys(v.validate().errors).length===0,isDirty:()=>v.isDirty(),isLoading:()=>M}));async function z(P){if(P){E(!0);try{const $=typeof P=="function"?await P():P,B=await u(ul(e,$));v.setValues(B),v.setDirty(B)}finally{E(!1)}}}return T.useEffect(()=>{z(r||{})},[]),T.useEffect(()=>{z(t)},[t]),m.jsx(Xh,{value:{customFieldRenderers:p,customTypeRenderers:y,customFieldTypes:g},children:m.jsxs("form",{onSubmit:L,style:{position:"relative"},children:[m.jsx(x.LoadingOverlay,{visible:M||b}),C(m.jsx(m.Fragment,{children:O.map(P=>{const $={...P,readOnly:P.readOnly||o};return $.visible===!1?null:m.jsx(oo,{field:$,layout:s,children:m.jsx(Po,{field:$,form:v,customFieldRenderers:p,customTypeRenderers:y,customFieldTypes:g,layout:s})},$.name)})})),!M&&m.jsx(m.Fragment,{children:typeof h=="boolean"?h?m.jsx(x.Group,{justify:"flex-end",mt:"md",children:m.jsx(x.Button,{type:"submit",loading:b,children:"Submit"})}):null:h})]})})});exports.AutoForm=uS;exports.DefaultFieldRender=Sh;exports.FieldLayoutWrapper=oo;exports.FieldRendererResolver=Po;exports.useRenderers=al;
194
+ a1 1 0 0 1 1 1Z`}),m.jsx("path",{d:"M10 11l-2 2 2 2"}),m.jsx("path",{d:"M14 11l2 2-2 2"})]})}const bv={interactive:!0},On=x.factory((n,e)=>{const t=x.useProps("RichTextEditorControl",bv,n),{classNames:r,className:s,style:o,styles:i,vars:l,interactive:a,active:c,onMouseDown:u,disabled:d,...f}=t,h=St();return m.jsx(x.UnstyledButton,{...f,...h.getStyles("control",{className:s,style:o,classNames:r,styles:i}),disabled:d,"data-rich-text-editor-control":!0,tabIndex:a?0:-1,"data-interactive":a||void 0,"data-disabled":d||void 0,"data-active":c||void 0,"aria-pressed":c&&a||void 0,"aria-hidden":!a||void 0,ref:e,unstyled:h.unstyled,variant:h.variant||"default",onMouseDown:p=>{p.preventDefault(),u==null||u(p)}})});On.classes=An;On.displayName="@mantine/tiptap/RichTextEditorControl";const ca=T.forwardRef(({className:n,icon:e,...t},r)=>{const s=St();return m.jsx(On,{ref:r,...t,children:m.jsx(e,{...s.getStyles("controlIcon")})})});ca.displayName="@mantine/tiptap/RichTextEditorControlBase";function me({label:n,isActive:e,operation:t,icon:r,isDisabled:s}){const o=T.forwardRef((i,l)=>{const{editor:a,labels:c}=St(),u=c[n];return m.jsx(ca,{"aria-label":u,title:u,active:e!=null&&e.name?a==null?void 0:a.isActive(e.name,e.attributes):!1,ref:l,icon:i.icon||r,disabled:(s==null?void 0:s(a))||!1,...i,onClick:()=>a==null?void 0:a.chain().focus()[t.name](t.attributes).run()})});return o.displayName=`@mantine/tiptap/${n}`,o}const kv=me({label:"boldControlLabel",icon:n=>m.jsx(_1,{...n}),isActive:{name:"bold"},operation:{name:"toggleBold"}}),xv=me({label:"italicControlLabel",icon:n=>m.jsx(B1,{...n}),isActive:{name:"italic"},operation:{name:"toggleItalic"}}),vv=me({label:"underlineControlLabel",icon:n=>m.jsx(F1,{...n}),isActive:{name:"underline"},operation:{name:"toggleUnderline"}}),Sv=me({label:"strikeControlLabel",icon:n=>m.jsx(z1,{...n}),isActive:{name:"strike"},operation:{name:"toggleStrike"}}),Cv=me({label:"clearFormattingControlLabel",icon:n=>m.jsx($1,{...n}),operation:{name:"unsetAllMarks"}}),Mv=me({label:"unlinkControlLabel",icon:n=>m.jsx(G1,{...n}),operation:{name:"unsetLink"}}),wv=me({label:"bulletListControlLabel",icon:n=>m.jsx(K1,{...n}),isActive:{name:"bulletList"},operation:{name:"toggleBulletList"}}),Tv=me({label:"orderedListControlLabel",icon:n=>m.jsx(J1,{...n}),isActive:{name:"orderedList"},operation:{name:"toggleOrderedList"}}),Ev=me({label:"h1ControlLabel",icon:n=>m.jsx(V1,{...n}),isActive:{name:"heading",attributes:{level:1}},operation:{name:"toggleHeading",attributes:{level:1}}}),Av=me({label:"h2ControlLabel",icon:n=>m.jsx(H1,{...n}),isActive:{name:"heading",attributes:{level:2}},operation:{name:"toggleHeading",attributes:{level:2}}}),Ov=me({label:"h3ControlLabel",icon:n=>m.jsx(W1,{...n}),isActive:{name:"heading",attributes:{level:3}},operation:{name:"toggleHeading",attributes:{level:3}}}),Dv=me({label:"h4ControlLabel",icon:n=>m.jsx(Y1,{...n}),isActive:{name:"heading",attributes:{level:4}},operation:{name:"toggleHeading",attributes:{level:4}}}),Nv=me({label:"h5ControlLabel",icon:n=>m.jsx(q1,{...n}),isActive:{name:"heading",attributes:{level:5}},operation:{name:"toggleHeading",attributes:{level:5}}}),Rv=me({label:"h6ControlLabel",icon:n=>m.jsx(U1,{...n}),isActive:{name:"heading",attributes:{level:6}},operation:{name:"toggleHeading",attributes:{level:6}}}),Lv=me({label:"blockquoteControlLabel",icon:n=>m.jsx(X1,{...n}),isActive:{name:"blockquote"},operation:{name:"toggleBlockquote"}}),Iv=me({label:"alignLeftControlLabel",icon:n=>m.jsx(Q1,{...n}),operation:{name:"setTextAlign",attributes:"left"}}),jv=me({label:"alignRightControlLabel",icon:n=>m.jsx(Z1,{...n}),operation:{name:"setTextAlign",attributes:"right"}}),Pv=me({label:"alignCenterControlLabel",icon:n=>m.jsx(ev,{...n}),operation:{name:"setTextAlign",attributes:"center"}}),_v=me({label:"alignJustifyControlLabel",icon:n=>m.jsx(tv,{...n}),operation:{name:"setTextAlign",attributes:"justify"}}),Bv=me({label:"subscriptControlLabel",icon:n=>m.jsx(nv,{...n}),isActive:{name:"subscript"},operation:{name:"toggleSubscript"}}),Fv=me({label:"superscriptControlLabel",icon:n=>m.jsx(rv,{...n}),isActive:{name:"superscript"},operation:{name:"toggleSuperscript"}}),zv=me({label:"codeControlLabel",icon:n=>m.jsx(yh,{...n}),isActive:{name:"code"},operation:{name:"toggleCode"}}),$v=me({label:"codeBlockControlLabel",icon:n=>m.jsx(yh,{...n}),isActive:{name:"codeBlock"},operation:{name:"toggleCodeBlock"}}),Vv=me({label:"highlightControlLabel",icon:n=>m.jsx(sv,{...n}),isActive:{name:"highlight"},operation:{name:"toggleHighlight"}}),Hv=me({label:"hrControlLabel",icon:n=>m.jsx(ov,{...n}),operation:{name:"setHorizontalRule"}}),Wv=me({label:"unsetColorControlLabel",icon:n=>m.jsx(bh,{...n}),operation:{name:"unsetColor"}}),Yv=me({label:"undoControlLabel",icon:n=>m.jsx(fv,{...n}),isDisabled:n=>!(n!=null&&n.can().undo()),operation:{name:"undo"}}),qv=me({label:"redoControlLabel",icon:n=>m.jsx(hv,{...n}),isDisabled:n=>!(n!=null&&n.can().redo()),operation:{name:"redo"}}),Uv=me({label:"tasksControlLabel",icon:n=>m.jsx(pv,{...n}),isActive:{name:"taskList"},operation:{name:"toggleTaskList"}}),Kv=me({label:"tasksSinkLabel",icon:n=>m.jsx(mv,{...n}),operation:{name:"sinkListItem",attributes:"taskItem"},isDisabled:n=>!(n!=null&&n.can().sinkListItem("taskItem"))}),Jv=me({label:"tasksLiftLabel",icon:n=>m.jsx(gv,{...n}),operation:{name:"liftListItem",attributes:"taskItem"},isDisabled:n=>!(n!=null&&n.can().liftListItem("taskItem"))}),Gv=n=>m.jsx(uv,{...n}),ua=x.factory((n,e)=>{var $;const t=x.useProps("RichTextEditorLinkControl",null,n),{classNames:r,className:s,style:o,styles:i,vars:l,icon:a,popoverProps:c,disableTooltips:u,initialExternal:d,...f}=t,h=St(),p={classNames:r,styles:i},[g,y]=bp(""),[b,k]=T.useState(d),[M,{open:E,close:v}]=hl(!1),C=()=>{var V;E();const B=(V=h.editor)==null?void 0:V.getAttributes("link");y((B==null?void 0:B.href)||""),k(B!=null&&B.href?(B==null?void 0:B.target)==="_blank":d)},w=()=>{v(),y(""),k(d)},O=()=>{var B,V;w(),g===""?(B=h.editor)==null||B.chain().focus().extendMarkRange("link").unsetLink().run():(V=h.editor)==null||V.chain().focus().extendMarkRange("link").setLink({href:g,target:b?"_blank":null}).run()},L=B=>{B.key==="Enter"&&(B.preventDefault(),O())};mp("edit-link",C,!1);const{resolvedClassNames:z,resolvedStyles:P}=x.useResolvedStylesApi({classNames:r,styles:i,props:t});return m.jsxs(x.Popover,{trapFocus:!0,shadow:"md",withinPortal:!0,opened:M,onChange:B=>!B&&w(),offset:-44,zIndex:1e4,...c,children:[m.jsx(x.Popover.Target,{children:m.jsx(ca,{icon:a||Gv,...f,"aria-label":h.labels.linkControlLabel,title:h.labels.linkControlLabel,onClick:C,active:($=h.editor)==null?void 0:$.isActive("link"),ref:e,classNames:z,styles:P,className:s,style:o,variant:h.variant})}),m.jsx(x.Popover.Dropdown,{...h.getStyles("linkEditorDropdown",p),children:m.jsxs("div",{...h.getStyles("linkEditor",p),children:[m.jsx(x.TextInput,{placeholder:h.labels.linkEditorInputPlaceholder,"aria-label":h.labels.linkEditorInputLabel,type:"url",value:g,onChange:y,classNames:{input:h.getStyles("linkEditorInput",p).className},onKeyDown:L,rightSection:m.jsx(x.Tooltip,{label:b?h.labels.linkEditorExternalLink:h.labels.linkEditorInternalLink,events:{hover:!0,focus:!0,touch:!0},withinPortal:!0,withArrow:!0,disabled:u,zIndex:1e4,children:m.jsx(x.UnstyledButton,{onClick:()=>k(B=>!B),"data-active":b||void 0,...h.getStyles("linkEditorExternalControl",p),children:m.jsx(dv,{style:{width:x.rem(14),height:x.rem(14)}})})})}),m.jsx(x.Button,{variant:"default",onClick:O,...h.getStyles("linkEditorSave",p),children:h.labels.linkEditorSave})]})})]})});ua.classes=An;ua.displayName="@mantine/tiptap/RichTextEditorLinkControl";const kh=T.forwardRef((n,e)=>{const{popoverProps:t,colors:r,colorPickerProps:s,...o}=x.useProps("RichTextEditorColorPickerControl",null,n),{editor:i,labels:l,getStyles:a,variant:c}=St(),[u,{toggle:d,close:f}]=hl(!1),[h,p]=T.useState("palette"),g=(i==null?void 0:i.getAttributes("textStyle").color)||"var(--mantine-color-text)",y=(M,E=!0)=>{(i==null?void 0:i.chain()).focus().setColor(M).run(),E&&f()},b=()=>{(i==null?void 0:i.chain()).focus().unsetColor().run(),f()},k=r.map((M,E)=>m.jsx(x.ColorSwatch,{component:"button",color:M,onClick:()=>y(M),size:26,radius:"xs",style:{cursor:"pointer"},title:l.colorPickerColorLabel(M),"aria-label":l.colorPickerColorLabel(M)},E));return m.jsxs(x.Popover,{opened:u,withinPortal:!0,trapFocus:!0,onChange:M=>!M&&f(),...t,children:[m.jsx(x.Popover.Target,{children:m.jsx(On,{...o,variant:c,"aria-label":l.colorPickerControlLabel,title:l.colorPickerControlLabel,ref:e,onClick:d,children:m.jsx(x.ColorSwatch,{color:g,size:14})})}),m.jsxs(x.Popover.Dropdown,{...a("linkEditorDropdown"),children:[h==="palette"&&m.jsx(x.SimpleGrid,{cols:7,spacing:2,children:k}),h==="colorPicker"&&m.jsx(x.ColorPicker,{defaultValue:g,onChange:M=>y(M,!1),...s}),m.jsx(x.Tooltip.Group,{closeDelay:200,children:m.jsxs(x.Group,{justify:"flex-end",gap:"xs",mt:"sm",children:[h==="palette"&&m.jsx(x.ActionIcon,{variant:"default",onClick:f,title:l.colorPickerCancel,"aria-label":l.colorPickerCancel,children:m.jsx(lv,{style:{width:x.rem(16),height:x.rem(16)}})}),m.jsx(x.ActionIcon,{variant:"default",onClick:b,title:l.colorPickerClear,"aria-label":l.colorPickerClear,children:m.jsx(bh,{style:{width:x.rem(16),height:x.rem(16)}})}),h==="palette"?m.jsx(x.ActionIcon,{variant:"default",onClick:()=>p("colorPicker"),title:l.colorPickerColorPicker,"aria-label":l.colorPickerColorPicker,children:m.jsx(iv,{style:{width:x.rem(16),height:x.rem(16)}})}):m.jsx(x.ActionIcon,{variant:"default",onClick:()=>p("palette"),"aria-label":l.colorPickerPalette,title:l.colorPickerPalette,children:m.jsx(av,{style:{width:x.rem(16),height:x.rem(16)}})}),h==="colorPicker"&&m.jsx(x.ActionIcon,{variant:"default",onClick:f,title:l.colorPickerSave,"aria-label":l.colorPickerSave,children:m.jsx(cv,{style:{width:x.rem(16),height:x.rem(16)}})})]})})]})]})});kh.displayName="@mantine/tiptap/ColorPickerControl";const xh=T.forwardRef((n,e)=>{const{color:t,...r}=x.useProps("RichTextEditorColorControl",null,n),{editor:s,labels:o,variant:i}=St(),l=(s==null?void 0:s.getAttributes("textStyle").color)||null,a=o.colorControlLabel(t);return m.jsx(On,{...r,variant:i,active:l===t,"aria-label":a,title:a,onClick:()=>(s==null?void 0:s.chain()).focus().setColor(t).run(),ref:e,children:m.jsx(x.ColorSwatch,{color:t,size:14})})});xh.displayName="@mantine/tiptap/RichTextEditorColorControl";const Xv={},vh=T.forwardRef((n,e)=>{const{...t}=x.useProps("RichTextEditorSourceCodeControl",Xv,n),{editor:r,labels:s,variant:o,onSourceCodeTextSwitch:i}=St(),[l,a]=T.useState(!1),c=()=>{l?r==null||r.commands.setContent(r.getText(),{emitUpdate:!0}):r==null||r.commands.setContent(`<textarea>${r.getHTML()}</textarea>`);const u=!l;a(u),i==null||i(u)};return m.jsx(On,{...t,variant:o,active:l,"aria-label":s.sourceCodeControlLabel,title:s.sourceCodeControlLabel,onClick:()=>c(),ref:e,children:m.jsx(yv,{style:{width:x.rem(16),height:x.rem(16)}})})});vh.displayName="@mantine/tiptap/RichTextEditorSourceCodeControl";const da=x.factory((n,e)=>{const t=x.useProps("RichTextEditorControlsGroup",null,n),{classNames:r,className:s,style:o,styles:i,vars:l,variant:a,...c}=t,u=St();return m.jsx(x.Box,{ref:e,variant:a||u.variant,...u.getStyles("controlsGroup",{className:s,style:o,styles:i,classNames:r}),...c})});da.classes=An;da.displayName="@mantine/tiptap/RichTextEditorControlsGroup";const fa=x.factory((n,e)=>{const t=x.useProps("RichTextEditorToolbar",null,n),{classNames:r,className:s,style:o,styles:i,vars:l,sticky:a,stickyOffset:c,mod:u,variant:d,...f}=t,h=St();return m.jsx(x.Box,{ref:e,mod:[{sticky:a},u],variant:d||h.variant,...h.getStyles("toolbar",{className:s,style:o,styles:i,classNames:r}),...f,__vars:{"--rte-sticky-offset":x.rem(c)}})});fa.classes=An;fa.displayName="@mantine/tiptap/RichTextEditorToolbar";const Qv={withCodeHighlightStyles:!0,withTypographyStyles:!0,variant:"default"},W=x.factory((n,e)=>{const t=x.useProps("RichTextEditor",Qv,n),{classNames:r,className:s,style:o,styles:i,unstyled:l,vars:a,editor:c,withCodeHighlightStyles:u,withTypographyStyles:d,onSourceCodeTextSwitch:f,labels:h,children:p,variant:g,attributes:y,...b}=t,k=x.useStyles({name:"RichTextEditor",classes:An,props:t,className:s,style:o,classNames:r,styles:i,unstyled:l,attributes:y,vars:a}),M=T.useMemo(()=>({...j1,...h}),[h]);return m.jsx(P1,{value:{editor:c,getStyles:k,labels:M,withCodeHighlightStyles:u,withTypographyStyles:d,onSourceCodeTextSwitch:f,unstyled:l,variant:g},children:m.jsx(x.Box,{...k("root"),...b,ref:e,children:p})})});W.classes=An;W.displayName="@mantine/tiptap/RichTextEditor";W.Content=aa;W.Control=On;W.Toolbar=fa;W.ControlsGroup=da;W.Bold=kv;W.Italic=xv;W.Strikethrough=Sv;W.Underline=vv;W.ClearFormatting=Cv;W.H1=Ev;W.H2=Av;W.H3=Ov;W.H4=Dv;W.H5=Nv;W.H6=Rv;W.BulletList=wv;W.OrderedList=Tv;W.Link=ua;W.Unlink=Mv;W.Blockquote=Lv;W.AlignLeft=Iv;W.AlignRight=jv;W.AlignCenter=Pv;W.AlignJustify=_v;W.Superscript=Fv;W.Subscript=Bv;W.Code=zv;W.CodeBlock=$v;W.ColorPicker=kh;W.Color=xh;W.Highlight=Vv;W.Hr=Hv;W.UnsetColor=Wv;W.Undo=Yv;W.Redo=qv;W.TaskList=Uv;W.TaskListSink=Kv;W.TaskListLift=Jv;W.SourceCode=vh;function Zv({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0,o=zk({editable:!r&&!s,extensions:[M1,e1,Px,R1,I1,A1,D1.configure({types:["heading","paragraph"]})],content:t.value||"",onUpdate:({editor:i})=>{t.onChange(i.getHTML())}});return m.jsxs(W,{editor:o,h:400,children:[m.jsxs(W.Toolbar,{sticky:!0,stickyOffset:60,children:[m.jsxs(W.ControlsGroup,{children:[m.jsx(W.Bold,{}),m.jsx(W.Italic,{}),m.jsx(W.Underline,{}),m.jsx(W.Strikethrough,{}),m.jsx(W.ClearFormatting,{}),m.jsx(W.Highlight,{}),m.jsx(W.Code,{})]}),m.jsxs(W.ControlsGroup,{children:[m.jsx(W.H1,{}),m.jsx(W.H2,{}),m.jsx(W.H3,{}),m.jsx(W.H4,{})]}),m.jsxs(W.ControlsGroup,{children:[m.jsx(W.Blockquote,{}),m.jsx(W.Hr,{}),m.jsx(W.BulletList,{}),m.jsx(W.OrderedList,{}),m.jsx(W.Subscript,{}),m.jsx(W.Superscript,{})]}),m.jsxs(W.ControlsGroup,{children:[m.jsx(W.Link,{}),m.jsx(W.Unlink,{})]}),m.jsxs(W.ControlsGroup,{children:[m.jsx(W.AlignLeft,{}),m.jsx(W.AlignCenter,{}),m.jsx(W.AlignJustify,{}),m.jsx(W.AlignRight,{})]}),m.jsxs(W.ControlsGroup,{children:[m.jsx(W.Undo,{}),m.jsx(W.Redo,{})]})]}),m.jsx(W.Content,{})]})}function eS({field:n,form:e}){const t=n,r=e.getInputProps(t.name),s=t.readOnly===!0,o=t.disabled===!0;return s||o?m.jsx(x.Select,{data:t.data,value:r.value,disabled:o||s,readOnly:s,placeholder:t.placeholder,required:t.required,variant:s?"filled":"default",error:void 0}):m.jsx(x.Select,{data:t.data,...r,placeholder:t.placeholder,error:void 0,onChange:i=>r.onFieldChange(i)})}function tS({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?m.jsx(x.Switch,{value:t.value,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0,checked:t.value}):m.jsx(x.Switch,{...t,checked:t.value,onChange:o=>t.onFieldChange(o.target.checked),required:n.required,placeholder:n.placeholder,error:void 0})}function nS({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?m.jsx(x.TagsInput,{value:t.value||[],readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):m.jsx(x.TagsInput,{value:t.value||[],onChange:o=>t.onChange(o),required:n.required,placeholder:n.placeholder,error:void 0})}function rS({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0;return r||s?m.jsx(x.TextInput,{value:t.value,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):m.jsx(x.TextInput,{...t,onChange:o=>t.onFieldChange(o.target.value),required:n.required,placeholder:n.placeholder,error:void 0})}function sS({field:n,form:e}){const t=e.getInputProps(n.name),r=n.readOnly===!0,s=n.disabled===!0,o=typeof t.value=="string"?t.value:"",i=T.useRef(null),l=m.jsx(x.ActionIcon,{variant:"subtle",color:"gray",onClick:()=>{var a;return(a=i.current)==null?void 0:a.showPicker()},children:"⏰"});return r||s?m.jsx(fs,{value:o,readOnly:r,disabled:s,required:n.required,placeholder:n.placeholder,variant:r?"filled":"default",error:void 0}):m.jsx(fs,{value:o,onChange:a=>t.onChange(a.currentTarget.value),required:n.required,placeholder:n.placeholder,error:void 0,ref:i,rightSection:l})}function Sh({field:n,form:e,children:t}){const{error:r}=e.getInputProps(n.name);return m.jsxs(x.Stack,{gap:4,children:[n.label&&m.jsxs(x.Text,{fw:500,size:"sm",mb:2,component:"label",htmlFor:n.name,style:{display:"block"},children:[n.label," ",n.required&&m.jsx(x.Text,{component:"span",c:"red",fz:"sm",children:"*"})]}),m.jsx(x.Box,{children:t}),n.description&&m.jsx(x.Text,{size:"xs",c:"dimmed",mt:2,style:{lineHeight:1.4},children:n.description}),r&&m.jsx(x.Text,{size:"xs",c:"red",mt:2,style:{fontWeight:500},children:r})]})}function oS(n){const{layout:e,field:{required:t,...r},form:s}=n;let o=null;switch(r.type){case"text":o=m.jsx(rS,{field:r,form:n.form});break;case"select":o=m.jsx(eS,{field:r,form:n.form});break;case"object":o=m.jsx(vm,{field:r,form:s,layout:e});break;case"array":o=m.jsx(Qh,{field:r,form:s,layout:e});break;case"checkbox":o=m.jsx(Zh,{field:r,form:s});break;case"number":o=m.jsx(xm,{field:r,form:s});break;case"date":o=m.jsx(bm,{field:r,form:s});break;case"datetime":o=m.jsx(km,{field:r,form:s});break;case"switch":o=m.jsx(tS,{field:r,form:s});break;case"texteditor":o=m.jsx(Zv,{field:r,form:s});break;case"time":o=m.jsx(sS,{field:r,form:s});break;case"tags":o=m.jsx(nS,{field:r,form:s});break;default:o=m.jsxs("div",{children:["Unsupported field type: ",r.type]});break}return m.jsx(Sh,{field:r,form:s,children:o})}class jo{constructor(){ga(this,"next")}setNext(e){return this.next=e,e}handle(e,t){var r;return this.canHandle(e)?this.render(e,t):((r=this.next)==null?void 0:r.handle(e,t))??null}}class iS extends jo{constructor(e){super(),this.layout=e}canHandle(){return!0}render(e,t){return m.jsx(oS,{field:e,form:t,layout:this.layout})}}class lS extends jo{constructor(e){super(),this.customFieldTypes=e}canHandle(e){return!!this.customFieldTypes[e.type]}render(e,t){return this.customFieldTypes[e.type](e,t)}}class aS extends jo{constructor(e){super(),this.fieldRenderers=e}canHandle(e){return!!this.fieldRenderers[e.name]}render(e,t){return this.fieldRenderers[e.name](e,t)}}class cS extends jo{constructor(e){super(),this.typeRenderers=e}canHandle(e){return!!this.typeRenderers[e.type]}render(e,t){return this.typeRenderers[e.type](e,t)}}const Po=n=>{const{field:e,form:t,customFieldRenderers:r,customTypeRenderers:s,customFieldTypes:o,layout:i="grid"}=n,l=new aS(r??{}),a=new cS(s??{}),c=new iS(i),u=new lS(o??{});return l.setNext(a).setNext(u).setNext(c),l.handle(e,t)},uS=T.forwardRef(function({schema:e,currentValues:t,initialValues:r,layout:s="vertical",readOnly:o,validate:i,onSubmit:l,onFieldChange:a,updateFieldSchema:c,preFill:u=M=>M,preSubmit:d=M=>M,postSubmit:f=()=>{},submitButton:h=!0,customFieldRenderers:p,customFieldTypes:g,customTypeRenderers:y,loading:b},k){const[M,E]=T.useState(!1),v=Gh({validate:i,enhanceGetInputProps(P){return{onFieldChange:async $=>{var B;P.inputProps.onChange($),await((B=a==null?void 0:a[P.field.replace(/\.\d+\./g,".")])==null?void 0:B.call(a,P.field,$,v))}}}}),C=cl[s],w=(P,$,B)=>P.map(V=>{if(V.type==="object"||V.type==="array"){const K=B==null?void 0:B[V.name];return{...V,fields:w(V.fields,$||{},K)}}const G=B==null?void 0:B[V.name];return G?G(V,$):V}),O=T.useMemo(()=>{if(!c)return e;const P=v.getValues();return w(e,P,c)},[e,v.values,c]),L=v.onSubmit(async P=>{const $=Di(e,P);if(Object.keys($).length){v.setErrors($);return}const B=await d(P);await l(B),f(B)});T.useImperativeHandle(k,()=>({submit:()=>L(),reset:P=>z(P),validate:()=>{const P=v.validate();return Object.keys(P.errors).length===0},getValues:()=>v.getValues(),setValues:P=>v.setValues(P),getFieldValue:P=>v.getInputProps(P).value,setFieldValue:(P,$)=>v.setFieldValue(P,$),isValid:()=>Object.keys(v.validate().errors).length===0,isDirty:()=>v.isDirty(),isLoading:()=>M}));async function z(P){if(P){E(!0);try{const $=typeof P=="function"?await P():P;console.log("test",$);const B=await u($),V=ul(e,B);v.setValues(V),v.setDirty(V)}finally{E(!1)}}}return T.useEffect(()=>{z(r||{})},[]),T.useEffect(()=>{z(t)},[t]),m.jsx(Xh,{value:{customFieldRenderers:p,customTypeRenderers:y,customFieldTypes:g},children:m.jsxs("form",{onSubmit:L,style:{position:"relative"},children:[m.jsx(x.LoadingOverlay,{visible:M||b}),C(m.jsx(m.Fragment,{children:O.map(P=>{const $={...P,readOnly:P.readOnly||o};return $.visible===!1?null:m.jsx(oo,{field:$,layout:s,children:m.jsx(Po,{field:$,form:v,customFieldRenderers:p,customTypeRenderers:y,customFieldTypes:g,layout:s})},$.name)})})),!M&&m.jsx(m.Fragment,{children:typeof h=="boolean"?h?m.jsx(x.Group,{justify:"flex-end",mt:"md",children:m.jsx(x.Button,{type:"submit",loading:b,children:"Submit"})}):null:h})]})})});exports.AutoForm=uS;exports.DefaultFieldRender=Sh;exports.FieldLayoutWrapper=oo;exports.FieldRendererResolver=Po;exports.useRenderers=al;